Repository navigation
feat(mcpx): wire identity failover into the daemon call path (#8017) - #11236
Conversation
Pool.Call now runs failover-configured servers through Rotator.Do: an error tools/call result (or call error) carrying a GitHub soft block is translated to mcpauth.APIError (new mcpauth/toolresult.go), the identity rotates, the instance serving the key is respawned on the rotated credential (ReleaseKey + resolveAuth on the persisted rotation state), and the call is retried so the session never sees the soft block. Hard blocks and every non-block outcome settle byte-for-byte as before via a sentinel the rotator treats as hard. resolveAuth and Call share one failover construction site (failoverRotator). fakemcp scripts gain isError results and an ifEnv/else conditional so a fake answer can depend on the credential it was spawned with. Oracle tests: mcpauth translation (soft rotates / hard does not / success never translates) and pool end-to-end (soft block rotates+respawns+retries to served-by-second; hard block surfaces unchanged with no rotation). doc/fleet/mcp.md updated.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 33 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Implements piece 1 of #8017 (daemon call-path wiring; follow-on to #7948, queue task 20062):
mcpauth/toolresult.go(new): translates an errortools/callresult — or a call error's text — into an*mcpauth.APIErrorClassify can read (status extraction, soft markers, Retry-After). Successful results never translate, however rate-limit-shaped their content.pool/failover.go(new):Pool.Callruns failover-configured servers throughRotator.Do. A soft block rotates the identity, the instance serving the key is respawned on the rotated credential (ReleaseKey; the fresh spawn'sresolveAuthreads the persisted rotation state), and the call is retried — the calling session never sees the soft block. Hard blocks and all non-block outcomes settle byte-for-byte as before (sentinel the rotator treats as hard).resolveAuthandCallshare one construction site (failoverRotator); rotations log through the pool lifecycle log naming both identities.pool.go: existingCallbody becomescallOnce; unusednet/httpimport dropped.testsupport/fakemcp: script responses gainisErrorresults and anifEnv/elseconditional, so a fake's answer can depend on the credential it was spawned with.doc/fleet/mcp.md: failover paragraph now describes the call path.Oracle tests (all pass on the laptop, post-rebase):
TestFailoverCallSoftBlockRotatesRespawnsAndRetries): fake spawned with identity "first" soft-blocks; the caller sees onlyserved-by-secondand the persisted rotation state names "second".TestFailoverCallHardBlockSurfacesUnchanged: hard block returns unchanged, no rotation.go build ./...,go vet, mcpauth + fakemcp suites pass. Full pool suite: one flaky failure inTestDefaultConfigStdioRunsSupervised(supervised-child reap timing under suite load) — passes standalone in this worktree and on clean main; unrelated to this change.Not in this PR — piece 2 (live activation) is split to a follow-on queue task with the evidence: the github server is absent from both the live
~/.config/mcpx/config.jsonand the repo.mcpx.json, and no source checked (issue #8017, doc/fleet/mcp.md, #7948) names the three GitHub App identities / App IDs / installation IDs / secret-store names to enroll, so there is nothing well-defined to activate yet.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.