Skip to content

fix(extension_manager): set TCP_USER_TIMEOUT on streamable HTTP clients - #9207

Merged
DOsinga merged 1 commit into
aaif-goose:mainfrom
clouatre:fix/tcp-user-timeout-9022
May 18, 2026
Merged

fix(extension_manager): set TCP_USER_TIMEOUT on streamable HTTP clients#9207
DOsinga merged 1 commit into
aaif-goose:mainfrom
clouatre:fix/tcp-user-timeout-9022

Conversation

@clouatre

@clouatre clouatre commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary

TCP_USER_TIMEOUT is a Linux-only kernel socket option. reqwest 0.13.2 defaults it to 30s on Linux, killing established Streamable HTTP MCP connections after ~30s regardless of the configured extension timeout.

PR #9101 used .connect_timeout(), which only bounds the TCP handshake and has no effect on established connections. The correct fix is .tcp_user_timeout().

Changes

Add .tcp_user_timeout(Some(timeout_duration)) to both reqwest::Client builders in create_streamable_http_client() (primary and OAuth fallback), gated on #[cfg(target_os = "linux")]. macOS and Windows do not have this socket option and are unaffected by the bug.

timeout_duration is moved before the first builder so both can use it. A mut builder with a cfg-gated reassignment avoids duplicating the chain; #[allow(unused_mut)] suppresses the clippy false positive on non-Linux targets.

.timeout() is omitted -- it caps total request duration and breaks SSE streams.

Test plan

  • cargo build -p goose passes
  • cargo clippy --all-targets -- -D warnings clean
  • cargo fmt applied

Closes #9022

@clouatre
clouatre force-pushed the fix/tcp-user-timeout-9022 branch 3 times, most recently from 652aa05 to 769a851 Compare May 14, 2026 11:31

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

Copy link
Copy Markdown

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: 769a8510dc

ℹ️ 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".

Comment thread crates/goose/src/agents/extension_manager.rs
Signed-off-by: Hugues Clouâtre <hugues@linux.com>
@DOsinga
DOsinga added this pull request to the merge queue May 18, 2026
Merged via the queue into aaif-goose:main with commit c3b4f78 May 18, 2026
22 checks passed
michaelneale added a commit that referenced this pull request May 19, 2026
* origin/main: (160 commits)
  Add Linux musl CLI builds (#9240)
  feat(acp): paginate session list (#9199)
  docs: reorganize (#9310)
  Structured per-provider config block, non-destructive provider switching (#8977)
  feat(cli): add `goose review` local code review command (#9114)
  feat(tui): diff viewer (#9260)
  fix(otel): emit trace_output as span attribute instead of event (#9255)
  docs: add guide for connecting goose Desktop to a remote goosed server (#9275)
  fix(config): check file fallback when keyring has no entry (#9279)
  fix(desktop): ScheduleModal error message styling (#9278)
  fix(ui): align sidebar hamburger in macOS fullscreen (#9257)
  Add documentation for new provider SaladCloud AI Gateway (#9253)
  fix: use current_exe() instead of PATH lookup when spawning goose (#9236)
  fix(extension_manager): set TCP_USER_TIMEOUT on streamable HTTP clients (#9207)
  fix: activate custom provider after adding via configure (#9213)
  Flush OTLP traces reliably on exit with configurable timeout (#9228)
  fix: reduce excessive MISSING_TRANSLATION warnings for fallback locales (#9294)
  feat(acp): pass session cwd param to acp providers (#9229)
  fix(desktop): eliminate cross-window deep link contamination (#9273)
  fix: improve Telegram gateway error reporting and connection reliability (#9223)
  ...

Signed-off-by: Michael Neale <michael.neale@gmail.com>

# Conflicts:
#	crates/goose/src/agents/agent.rs
#	crates/goose/tests/agent.rs
shafqatevo pushed a commit to shafqatevo/goose that referenced this pull request Aug 7, 2026
…ts (aaif-goose#9207)

Signed-off-by: Hugues Clouâtre <hugues@linux.com>
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.

Streamable HTTP MCP calls on Linux may reset after ~30s despite larger extension timeout

2 participants