fix(mcp): stop a cleared enrollment reporting as a failed persist - #1444
fix(mcp): stop a cleared enrollment reporting as a failed persist#1444khaliqgant wants to merge 1 commit into
Conversation
Reusing `persistenceWarning` for the cleared-enrollment message meant `set_workspace_key` took the failure branch on success, answering with "the workspace is active for this process" — i.e. telling the caller the key had NOT persisted — when it had, and when the only thing that happened was the enrolled node being dropped. The tool's own description promised the opposite. The two outcomes are now tracked separately: a failed write still reports the active-not-persisted wording, and a successful write that cleared an enrollment reports the persisted wording followed by the clearing notice. Test asserts both halves, including that the failure wording is absent. Refs #1432 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe ChangesWorkspace persistence reporting
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Follow-up to #1439, which merged at
f8c644838while this last review finding was still being fixed. Everything else from that PR is inmain; this is the one commit that missed the merge.The bug
#1439 made MCP
set_workspace_keyreport a cleared fleet-node enrollment through thewarningstring it already used for persistence failures. Reusing one variable for two outcomes made the success case take the failure branch:A cleared enrollment means
persistWorkspaceSessionsucceeded. SelectingactiveMessageanswered "Workspace key set." — the wording that exists specifically to say the key did not persist — while the key had in fact persisted and the only thing that happened was the enrolled node being dropped.The tool's own description, updated in the same PR, promised the opposite: that the message states whether the key was persisted.
Caught by CodeRabbit on #1439 (comment); the finding is correct and the bug was mine.
The fix
The two outcomes are tracked separately:
Test bar
reports an enrolled fleet node dropped by joining another workspacenow asserts both halves, including the absence of the failure wording. Mutation-checked by restoring the conflated single-variable form:The 2 remaining are pre-existing on
main(telemetry machine-id), unrelated and present before this branch.Gates
npm run typecheck— exit 0npx vitest run— 1760 passed, 16 skipped, 5 failednpm run format:check— cleanThe 5 failures are the same pre-existing
mainfailures documented on #1439:telemetry/client.test.ts(2),agent-relay-mcp.startup.test.ts(2),packages/cloud/src/auth.test.ts(1).Refs #1432
🤖 Generated with Claude Code