feat: form-mode cost confirmation via MCP elicitations - #367
Draft
barryroodt wants to merge 22 commits into
Draft
Conversation
commit: |
barryroodt
marked this pull request as draft
August 19, 2026 10:00
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.
Stacked on #358. Please review that one first. This diff is against
barryroodt/ai-1044-dual-era-servingat851f01e. Merging this PR only opens a release PR. It does not ship the package.What changed
This adds Human Confirmation for
create_projectandcreate_branchthrough MCP form elicitations, replacing the bypassableconfirm_costpath on capable clients (AI-886).mcp-utilsowns the policy seam, signed Continuation State, replay protection, 120-second expiry, and handler plumbing. State keys must contain at least 32 bytes.--disable-elicitationsoption from AI-1045. The platform PR handlesdisable_elicitations.formDeliveryAvailabledistinguishes BASE legacy clients, form-capable legacy clients, and generic clients without changing the optionalTool.formatResultcontract.The cost payload includes the live rate, a continuous-run projection, and its assumption. The prose remains PLACEHOLDER-COPY behind Design/PM sign-off, so tests pin the facts rather than the wording.
The branch is 20 commits atop #358. Earlier amended intermediates mean old review-thread SHAs may be superseded.
Behavior contracts
Clients without form support plus opted-out connections keep the existing
confirm_costbehavior. The complete BASEtools/listresponse contains 29 tools and hashes to SHA-2567327d077b6bdacccfa9f5853d489be6a81f2b2763ca0cc344e0bb4e8fd47371d. Exact legacy text assertions also preserveexecute_sqlas{result:string}and its untrusted-data boundary.On form-capable connections,
confirm_costis hidden from discovery but remains callable with migration guidance. Decline and cancel are structured terminal variants. Expiry returns recovery guidance. Tampered state, including an edited readableexp, remains an SDK-owned-32602.humanConfirmationEnabled === falsefails protected paid tools closed while ordinary tools continue working. The gate runs before replay consumption, so an in-flight confirmation can resume with the same state inside its TTL. Generic gate telemetry usesreason: gate; serving-path telemetry preserves the capability-specific reason.Legacy-era sessions take capabilities from the initialize handshake. Legacy-wire results project through the contextual output schema.
Verification
Final tree
c5660c99c301922139a045e0c44ef49ec4223f60:format:check: clean across 100 filesbuild: all three packages typecheck and buildmcp-utils: 69/69mcp-server-supabase: 279/279 non-environmental tests, including stdio integration 21/21, Supabase elicitations 26/26, cost policies 15/15, and the legacy server suite 123/123@supabase/mcp-server-postgrest: the same pre-existing 7/7 localhost:54321failures at BASE and headFive Anthropic-key e2e tests were excluded locally because
ANTHROPIC_API_KEYwas missing. The real-Claude prompt-injection e2e passed 1/1 earlier in this branch's review, before the final local review. This verification does not claim a fresh pass at the current head.A five-lane review covered correctness/contracts, security, tests, spec compliance, and structural simplification. The initial verdict was NOT_READY; all nine synthesized findings and one post-fix telemetry issue were fixed. The final verdict is READY with no critical or important findings.
Notes for reviewers
The runtime owns minting and verification because SDK v1's
createRequestStateCodechard-readsDate.now()and does not expose typed failure causes. The implementation remains byte-compatible, with codec parity and replay boundaries covered independently. Request-state parsing, replay, codecs, and handlers now have separate responsibilities, and SDK input usesInputResponseView.A fresh
pnpm installbreaks under Corepack's floating pnpm 11.16. The repo uses pnpm 10.33.2 through mise; moving the build-script policy for pnpm 11 remains a follow-up.Please leave
release.ymland the release PR out of this change. Thepublish-previewlabel records the pkg.pr.new URL for the platform stack.Part of AI-1091