Add durable profile and proxy MCP contract parity - #140
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9c3e730. Configure here.
masnwilliams
left a comment
There was a problem hiding this comment.
The production behavior is correct and worth landing: exact profile resolution, ID-bound setup sessions, rename parity, and stable API error codes all close real gaps. I'm requesting changes for the test architecture, which introduces global/import-order coupling and does not exercise the MCP contract it claims to cover. Once the tests use an isolated client dependency and validate the real MCP boundary, this should be good to merge. As a smaller follow-up while touching this code, please also consider centralizing the repeated profile_name/profile_id XOR validation used by get, rename, and delete.
Use exact profile-name lookup for setup, expose profile and proxy rename operations, and retain stable Kernel API error codes in tool output so agents can act on durable API contracts.
5e61a10 to
056ed44
Compare
|
Also completed the optional cleanup from the review summary in c7fa9aa: |
masnwilliams
left a comment
There was a problem hiding this comment.
Rechecked c7fa9aa. Both requested structural changes are addressed: profile/proxy registrations now receive an isolated Kernel client dependency, and rename behavior is covered through a real MCP server/client boundary including discovery, validation, authentication propagation, SDK calls, and serialization. The repeated profile selector validation is also centralized. Local verification passes: 109 tests, TypeScript, changed-file Prettier, and diff checks. Approved.

Summary
Why
Durable MCP operations should resolve stable identities and surface actionable API failures. Search-style profile matching and name reuse could otherwise select the wrong durable profile.
Implementation
Profile setup filters by exact name, rejects duplicate exact matches with an executable recovery path, and uses the resolved ID when opening the setup browser. Rename guidance warns before invocation about active profile sessions. Rename responses retain their direct SDK resource shape.
Verification
bun test(95 tests)bunx tsc --noEmitgit diff --checkNote
Medium Risk
Changes how durable profiles are resolved during setup (ID binding and ambiguity handling), which could alter agent behavior if duplicate names existed; production wiring stays on default dependencies.
Overview
Introduces
McpDependenciesso MCP registration and tools can injectcreateKernelClient(defaults unchanged in production), enabling contract tests without hitting the real API.Profile setup now lists by exact
name, fails on duplicate exact matches with recovery guidance, rejectsupdate_existingwhen the profile is missing, and opens the setup browser withprofile.idinstead of name.manage_profilesgains arenameaction (by name or ID) with shared identifier validation; tool docs warn against renaming while a browser session is attached.manage_proxiesgainsrenameviaproxies.update. MCPthrowToolErrormessages append[code: …]when the Kernel SDK returns a string API error code.Adds
durable-contracts.test.tsand extendsresponses.test.tsfor coded errors and rename/schema behavior at the MCP boundary.Reviewed by Cursor Bugbot for commit c7fa9aa. Bugbot is set up for automated code reviews on this repo. Configure here.