Skip to content

fix(mcp): separate OAuth login and handshake deadlines - #1624

Merged
jhrozek merged 1 commit into
mainfrom
worktree-debug+mcp-dcr-login-timeout
Sep 17, 2026
Merged

jhrozek merged 1 commit into
mainfrom
worktree-debug+mcp-dcr-login-timeout

Conversation

@jhrozek

@jhrozek jhrozek commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • separate the explicit OAuth browser/callback wait from bounded pre- and post-authorization MCP exchanges
  • raise the direct OAuth resource response-header timeout to 30 seconds while retaining the 30-second request and five-second dial/TLS limits
  • emit redacted diagnostics for transport and DCR grant failures, and route login diagnostics to command stderr
  • add offline coverage for timeout separation, timer races, reconnect bounds, delayed headers, and diagnostic redaction

Verification

  • go test -race ./internal/adapter/mcp ./cmd/mecated
  • task docs
  • task api:check
  • go run ./cmd/mecademo

task lint exceeded its 600-second timeout without a finding. task test has unrelated environment-sensitive failures in mecatui credential/embedded-socket and credential-store suites; changed MCP/app/mecated packages passed.

Fixes #1623

@jhrozek
jhrozek force-pushed the worktree-debug+mcp-dcr-login-timeout branch from 4aedf4b to 289cd8a Compare September 16, 2026 09:41
Keep the interactive browser callback governed by caller cancellation while
bounding pre- and post-authorization MCP exchanges independently. Raise the
direct resource header timeout and surface redacted transport and DCR grant
failures so a generic SDK timeout does not hide the actionable cause.

Co-authored-by: mecatl <[email protected]>
@jhrozek
jhrozek force-pushed the worktree-debug+mcp-dcr-login-timeout branch from 289cd8a to f932e4d Compare September 17, 2026 09:33
@jhrozek
jhrozek merged commit fbefea1 into main Sep 17, 2026
35 checks passed
@jhrozek
jhrozek deleted the worktree-debug+mcp-dcr-login-timeout branch September 17, 2026 09:44
jhrozek added a commit that referenced this pull request Sep 18, 2026
runMCPAdd's internal runMCPLogin call never passed stderr through, so
any diagnostics logged during add's login/verification step were
silently discarded via runMCPLogin's own io.Discard default — the
exact same "no logs" gap #1624 fixed for mcp login directly, just not
propagated to the newer add command that wraps it.

Ref: #1613

Co-Authored-By: mecatl <[email protected]>
@toolhive-release-app toolhive-release-app Bot mentioned this pull request Sep 21, 2026
2 tasks
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.

fix(mcp): separate OAuth browser login from bounded handshake timeouts

1 participant