Skip to content

fix(mcpx): report 'waiting for OAuth sign-in' instead of a generic discover timeout - #271

Merged
dezren39 merged 1 commit into
mainfrom
creator/270-oauth-wait
Oct 18, 2026
Merged

dezren39 merged 1 commit into
mainfrom
creator/270-oauth-wait

Conversation

@dezren39

@dezren39 dezren39 commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Fixes #270. Port of dezren39/nix PR #383 (dezren39/darwin-nix#370) — the same defect in this repo's pkgs/mcpx copy, whose internal/pool/pool.go differed from nix's post-fix copy at exactly the wrapped return.

  • internal/pool/oauthwait.go (new): detects an unfinished mcp-remote OAuth sign-in on disk (~/.mcp-auth/mcp-remote-*/<md5(url)> with client_info.json + code_verifier, no tokens.json).
  • Pool.startLane wraps its start failure with oauthWaitError: on a pending sign-in the error names the state, the URL, the state dir, and the exact mcp-remote <url> command that finishes it. Finished / never-started / non-mcp-remote / HTTP cases keep the original error untouched.
  • oauthwait_test.go ported: 5 tests (pending detected, finished not waiting, never-started not waiting, other servers ignored, wrap message).

Verified locally:

  • go test ./internal/pool/ — full suite green; new OAuth tests 5/5.
  • Ablation: removing oauthwait.go makes the new tests fail to build/pass; restored, they pass.
  • go build ./..., go vet ./internal/pool/, gofmt clean.

Summary by CodeRabbit

  • Bug Fixes
    • When a server fails to start because an mcp-remote sign-in is unfinished, the error message now identifies the server and sign-in URL, shows where sign-in progress is saved, and provides a command to resume sign-in. The original startup error is also included for troubleshooting. Other startup errors continue to be reported as before.

…scover timeout

Port of dezren39/nix PR #383 (its #370) to this repo's pkgs/mcpx copy:
mcp-remote parks an unfinished OAuth sign-in on disk
(~/.mcp-auth/mcp-remote-*/<md5(url)> with client_info.json +
code_verifier, no tokens.json), and while that state holds every start
blocks in the browser flow, so mcpx surfaced only a discover timeout.

- new internal/pool/oauthwait.go detects the pending state
- Pool.startLane wraps the start failure: on a pending sign-in the
  error names the state, URL, state dir and the exact
  'mcp-remote <url>' command that finishes it; finished/never-started/
  non-mcp-remote/HTTP cases keep the original error
- oauthwait_test.go ported (5 detector/wrap tests)

Fixes #270
@dezren39
dezren39 requested a review from a team as a code owner October 18, 2026 10:25
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-18T10:25:59.701403Z ed53575 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Oct 18, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1ccdbd0a-4129-4820-ba31-b6a6d6be5655
📥 Commits

Reviewing files that changed from the base of the PR and between a9d14e2 and ed53575.

📒 Files selected for processing: 3
  • pkgs/mcpx/internal/pool/oauthwait.go
  • pkgs/mcpx/internal/pool/oauthwait_test.go
  • pkgs/mcpx/internal/pool/pool.go
+---------------------------------------------------------+
| Finding bugs faster than a kid with a magnifying glass. |
+---------------------------------------------------------+
  \
   \     /)/)
        ( '')
        /  |
      o(___)
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@dezren39
dezren39 merged commit a29abd3 into main Oct 18, 2026
15 of 16 checks passed
@dezren39
dezren39 deleted the creator/270-oauth-wait branch October 18, 2026 10:29
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.

mcpx: report 'waiting for OAuth sign-in' instead of a generic discover timeout (mcp-remote pending state not detected)

1 participant