Repository navigation
fix(app): cloud MCP user state gates provisioning, not token maintenance - #2777
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Rebased onto the structured-maintenance rewrite (#2779). A stale disabled/removed intent (including the legacy raw-string format migrated from old builds) permanently skipped ALL cloud MCP token maintenance, so the 7-day first-party token expired with nothing to remint it and the engine dropped the MCP at connect (field incident). Recorded intent now only blocks provisioning: when an enabled openwork-cloud entry exists in the engine, the maintenance loop and the reconciler keep its token fresh regardless of recorded intent. Absent or explicitly disabled entries honor intent as before.
benjaminshafii
force-pushed
the
fix/cloud-mcp-maintenance-gate
branch
from
July 15, 2026 05:51
2d06da2 to
a9b7826
Compare
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 machine had the legacy raw-string
openwork.den.mcp.cloudControlUserState = "removed"left over from a manual connection toggle. Two gates treated ANY recorded intent as a veto on all maintenance:syncCloudControlMcpInBackgroundreturnedskippedbefore even listing the engine's MCPsshouldSkipForPrerequisitein the reconciler skipped onreadCloudMcpUserState(scope) !== nullResult: the 7-day first-party token expired with nothing to remint it → engine dropped the MCP at connect (SSE 401) →
search_capabilities/execute_capabilityvanished from sessions.Invariant implemented
Recorded user intent (disabled/removed) gates provisioning only — never token freshness. If the engine has a configured
openwork-cloudentry withenabled !== false, maintenance and repair run regardless of recorded intent. Absent or explicitly disabled entries honor intent exactly as before.use-session-mcp-maintenance.ts: list the engine MCPs first; apply the intent gate only when no enabled entry exists; pass effective enablement to the reconcilercloud-mcp-reconciler.tsshouldSkipForPrerequisite: consult user state only whenconfiguredEnabled !== trueTesting
bun test tests/cloud-mcp-maintenance-gate.test.ts tests/cloud-mcp-health.test.ts tests/cloud-mcp-user-state.test.tsinapps/app— 21 pass / 0 fail (new file with 4 tests: the exact field repro with the legacy raw string + enabled entry + expired-token health → remint happens; provisioning still gated when the entry is absent; explicit disable still skips; reconciler-level yield/block matrix)pnpm typecheckinapps/app— cleanfraimz: skipped — unit-tested renderer logic, no visual surface change. Part 2/3 of the token-death-spiral fixes (#2776 is part 1; maintenance watchdog ships separately).