Repository navigation
fix(app): match invalid_mcp_token in cloud MCP auth-failure codes - #2776
Merged
Merged
Conversation
The Den rejects an expired/missing first-party bearer with code invalid_mcp_token (alias openwork_cloud_token_expired). The remint-retry gate used substring checks that the _mcp_ infix defeated, so the retry built for exactly this failure could never fire — in the field a desktop token sat expired for ~7 days. Adds exact matches for invalid_mcp_token/ missing_mcp_token and an aliases-aware helper used at the retry site.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
This was referenced Jul 15, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Field incident (Jul 14): a desktop's 7-day first-party MCP token expired and the reconciler's remint-retry never fired — cloud tools 401'd, then vanished from sessions.
Root cause: the Den rejects an expired/missing opaque bearer with code
invalid_mcp_token(health prober maps the direct tools/list 401 to this code with aliasopenwork_cloud_token_expired—apps/server/src/cloud-mcp-health.ts:1434).isCloudMcpAuthTokenFailureCoderelied on.includes("invalid_token"), which the_mcp_infix defeats, and the call site checked.codeonly, neveraliases.invalid_mcp_token/missing_mcp_tokenisCloudMcpAuthTokenFailure(failure)that also consultsaliasesand use it at the retry site (repairCloudMcp)Testing
bun test tests/cloud-mcp-health.test.tsinapps/app— 9 pass / 0 fail (2 new tests: expired-token code regression incl. exclusions; alias-driven remint drives the reconciler to a second mint and usable health)pnpm typecheckinapps/app— cleanfraimz: skipped — unit-tested renderer logic, no visual surface change. Part 1/3 of the token-death-spiral fixes (gate fix and maintenance watchdog ship separately).