fix: raise default LLM idle timeout to 240 seconds to reduce false timeouts on slow providers#1170
Conversation
…meouts on slow providers
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f747abc439
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const providerKey = primary.slice(0, slashIndex); | ||
| const models = (config.models || {}) as Record<string, unknown>; | ||
| const providers = (models.providers || {}) as Record<string, unknown>; | ||
| const changed = ensureBuiltInProviderIdleTimeoutOverlay(providers, providerKey); |
There was a problem hiding this comment.
Preserve explicit default provider registrations
When the saved default model uses a provider that must be explicitly registered (for example custom-*, ollama, or OpenAI browser-OAuth), this startup path now passes that provider key into ensureBuiltInProviderIdleTimeoutOverlay. That helper treats any entry with baseUrl, api, or models as stale and replaces it with only { timeoutSeconds: 240 }, so the next launch drops the required base URL/API/model/auth fields and the provider can no longer route requests. The timeout-only overlay should only be created for built-in providers with no explicit registration, not for existing custom/override entries.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 30e51a2a8b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (nextProvider.timeoutSeconds === undefined) { | ||
| nextProvider.timeoutSeconds = DEFAULT_PROVIDER_TIMEOUT_SECONDS; | ||
| } |
There was a problem hiding this comment.
Propagate idle timeout into per-agent model registries
This default is only applied to the openclaw.json provider entry. The same runtime provider config is also written to each agent's models.json via updateAgentModelProvider/syncAgentModelsToRuntime, and that per-agent writer still has no timeoutSeconds field even though the repo documents it as the model registry used by pi-ai directly. When a custom/OAuth provider is selected through an agent-specific model, OpenClaw can therefore read the per-agent entry and keep using the 120s idle default, so the slow-provider false timeout remains for that flow; please pass DEFAULT_PROVIDER_TIMEOUT_SECONDS through the per-agent models.json path too.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 04787f46fd
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const slashIndex = primary.indexOf('/'); | ||
| if (slashIndex <= 0 || slashIndex >= primary.length - 1) return false; | ||
|
|
||
| const providerKey = primary.slice(0, slashIndex); |
There was a problem hiding this comment.
Seed timeouts for fallback model providers
When the default account has fallback refs pointing at another built-in provider (for example agents.defaults.model.fallbacks: ["google/gemini-..."]), this backfill derives an overlay only from model.primary. setOpenClawDefaultModel still writes those fallback refs, but a built-in fallback provider with no explicit models.providers entry will not get timeoutSeconds: 240, so failover to a slow fallback still uses OpenClaw's 120s idle watchdog and can hit the same false timeout this change is trying to avoid. Please also collect provider keys from the fallback refs before writing the timeout overlays.
Useful? React with 👍 / 👎.
No description provided.