Skip to content

fix: raise default LLM idle timeout to 240 seconds to reduce false timeouts on slow providers#1170

Merged
su8su merged 3 commits into
mainfrom
feat/add_default_timeout
Jul 15, 2026
Merged

fix: raise default LLM idle timeout to 240 seconds to reduce false timeouts on slow providers#1170
su8su merged 3 commits into
mainfrom
feat/add_default_timeout

Conversation

@su8su

@su8su su8su commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +2047 to +2049
if (nextProvider.timeoutSeconds === undefined) {
nextProvider.timeoutSeconds = DEFAULT_PROVIDER_TIMEOUT_SECONDS;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@su8su
su8su merged commit 502d9d5 into main Jul 15, 2026
6 checks passed
@su8su
su8su deleted the feat/add_default_timeout branch July 15, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant