Skip to content

feat: configurable extension timeouts via ACP _meta and global default#8295

Open
baxen wants to merge 1 commit intomainfrom
baxen-stagedtimeouts
Open

feat: configurable extension timeouts via ACP _meta and global default#8295
baxen wants to merge 1 commit intomainfrom
baxen-stagedtimeouts

Conversation

@baxen
Copy link
Copy Markdown
Collaborator

@baxen baxen commented Apr 3, 2026

Adds support for configuring per-extension timeouts through two mechanisms:

  • ACP _meta.timeout: Extensions can specify a timeout (in seconds) via the _meta field on Stdio and HTTP MCP server configs, which is extracted and passed through to ExtensionConfig.
  • Global default: A new GOOSE_DEFAULT_EXTENSION_TIMEOUT config value (defaulting to 300s) allows overriding the hardcoded default timeout for all extensions.

The timeout resolution order is: per-extension _meta.timeoutGOOSE_DEFAULT_EXTENSION_TIMEOUT config → hardcoded 300s default.

Changes

  • goose-acp/src/server.rs: Extract timeout from _meta when converting McpServer to ExtensionConfig
  • goose/src/agents/extension_manager.rs: Centralize timeout resolution in resolve_timeout() helper, checking config before falling back to the constant
  • goose/src/config/base.rs: Add GOOSE_DEFAULT_EXTENSION_TIMEOUT config value

Add two ways to control extension timeouts:

1. Per-extension: read an optional 'timeout' value from the ACP _meta
   field on McpServer configurations. Both Stdio and Http variants of
   mcp_server_to_extension_config pass this through to ExtensionConfig.

2. Global default: add GOOSE_DEFAULT_EXTENSION_TIMEOUT config value
   (settable in config.yaml or as an environment variable).

All three extension client creation paths (child_process_client,
create_streamable_http_client, and builtin extensions) now use a
resolve_timeout() helper that checks:
  1. Per-extension timeout (from config or ACP _meta) - highest priority
  2. GOOSE_DEFAULT_EXTENSION_TIMEOUT global config value
  3. Hardcoded DEFAULT_EXTENSION_TIMEOUT constant (300s) - fallback

Signed-off-by: Bradley Axen <baxen@squareup.com>
Copy link
Copy Markdown

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

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: fdbde22a58

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

config_value!(CLAUDE_THINKING_TYPE, String);
config_value!(CLAUDE_THINKING_EFFORT, String);
config_value!(CLAUDE_THINKING_BUDGET, i32);
config_value!(GOOSE_DEFAULT_EXTENSION_TIMEOUT, String, "300");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Parse default extension timeout as numeric config

GOOSE_DEFAULT_EXTENSION_TIMEOUT is registered as String (config_value!(..., String, "300")), but users will naturally set this as a numeric YAML/env value (e.g. 600). In Config::get_param, numeric env/YAML values are deserialized as numbers, which cannot deserialize into the generated string wrapper, so get_goose_default_extension_timeout() errors and resolve_timeout() silently falls back to DEFAULT_EXTENSION_TIMEOUT (300). This makes the new global timeout override ineffective for common configurations unless the value is quoted as a string.

Useful? React with 👍 / 👎.

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