-
-
Notifications
You must be signed in to change notification settings - Fork 925
feat: add configurable request timeout for extended thinking models #860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @Klaudioz, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request implements a crucial enhancement by introducing a configurable request timeout for all HTTP-based executors. This addresses a common issue where long-running AI model requests, particularly those involving 'extended thinking' like Claude Opus, would prematurely time out. By allowing users to define a 'request-timeout' in the configuration, or by defaulting to a generous 10-minute period, the system can now reliably handle requests that require more processing time, preventing 'context deadline exceeded' errors and improving the stability of interactions with various upstream providers. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a configurable request-timeout to address issues with long-running model requests, which is a great addition. The implementation is solid, adding the configuration option and a helper function to resolve the timeout, which is then consistently applied across all relevant HTTP executors. My feedback is minor, focusing on improving the clarity of comments in the configuration file and the config struct to make the new option easier for users and developers to understand.
config.example.yaml
Outdated
| # Maximum wait time in seconds for a cooled-down credential before triggering a retry. | ||
| max-retry-interval: 30 | ||
|
|
||
| # Maximum duration in seconds for upstream provider requests. Set to 0 to use the default (10 minutes). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is a bit ambiguous. It says to use 0 for the default, but the example value 600 is the same as the default (10 minutes). This might be confusing for users. Let's rephrase it to be more explicit about the default value and how to use it.
# Maximum duration in seconds for upstream provider requests. Defaults to 600s (10 minutes) if omitted or set to 0.Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
+1 |
|
Any change to get it reviewed @luispater ? |
…auto-update, request timeout, multi-candidate, auth persistence Applied features from upstream PRs: - PR router-for-me#878: Usage statistics persistence (SetPersistPath, LoadStatistics, SaveStatistics) - PR router-for-me#877: Codex plan type credential filename handling - PR router-for-me#868: Claude request cloaking utilities (obfuscation, fake user IDs) - PR router-for-me#715: Auto-update command for self-updating binary - PR router-for-me#860: Configurable request timeout with RequestTimeout config - PR router-for-me#879: Gemini multi-candidate support (n param -> candidateCount) - PR router-for-me#869: Auth token persistence for non-Google OAuth providers Fixed build issues: - Added applyPayloadConfig wrapper function - Added originalTranslated computation in claude/antigravity/codex executors - Fixed model registry hook methods - Removed duplicate SanitizeFunctionName - Fixed gemini_schema placeholder logic for nested object properties Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Summary
request-timeoutconfiguration option (in seconds)Problem
When using Claude Opus 4.5 with extended thinking (
thinking.budget_tokens: 32000+), requests can fail with:Extended thinking requests can take 2-10+ minutes to complete. Several executors passed
0as the timeout tonewProxyAwareHTTPClient(), which meant upstream requests relied solely on context cancellation and could terminate before the response completed.Solution
request-timeoutfield toConfigUsage
Testing
go test ./...Related