Repository navigation
Validate vault fill inputs and pass API errors through - #247
Merged
Merged
Conversation
- Reject fill inputs that do not match the API request shape before any request is sent, naming unknown keys and the expected shape. - Pass vault API errors through as returned; only a request with no response at all gets a note, with no retry advice. - Reject unknown manage_browsers keys instead of silently dropping them, pointing "vault" at "vaults". - Correct the 1password flow order in the manage_vaults description: access requests need no browser.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
hiroTamada
approved these changes
Oct 12, 2026
hiroTamada
left a comment
Contributor
There was a problem hiding this comment.
reviewed — no blocking issues found. full test suite passes (936 tests), and the TypeScript check passes.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default 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 9a0712d. Configure here.
hiroTamada
approved these changes
Oct 13, 2026
hiroTamada
left a comment
Contributor
There was a problem hiding this comment.
reviewed — no blocking issues found. full test suite passes (941 tests), and the TypeScript check passes.
Resolve vault-responses.ts: keep the Kernel-provider error helpers from main, and keep the pass-through throwVaultError. Update the preflight redaction test so its fill call supplies valid inputs, since fill inputs are now validated before any request.
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.

Summary
Four changes to the vault and browser tools, all aimed at the same problem: misshaped input was either passed through to the API verbatim or silently dropped, and the tool then layered its own guidance on top of the API's answer.
1. Strict
fillinputs (manage_vault_items)inputsforoperation: "fill"was spread into the request body unvalidated. It is now parsed against a strict zod schema mirroring the API'sFillVaultItemOperationRequestbefore any request is sent:browser_idnon-empty;page_urlan http(s) URL;fields1–32 strict objects;formatonlyMM/YY/MM/YYYY(the API's card-expiration option);timeout_ms1–30000.unknown key "bindings" in fill inputs. expected { browser_id, page_url?, fields: [{ field, selector, format? }], timeout_ms? }.inputsdescription now states the fill shape literally.2. API errors pass through unchanged (
throwVaultError)Every vault API error previously had a fixed sentence appended, including "fill may have written some fields … so it is safe to retry", which is wrong for a request the API rejected without doing anything. Status, code, and message now pass through exactly as returned. The only added text is for a request that got no response at all (connection error, timeout, abort):
no response was received from the api[ after the operation was submitted].No retry advice.3. Strict
manage_browsersargumentsThe input schema was a plain
z.object, so unknown keys were dropped silently; passingvaultinstead ofvaultscreated a browser with no vault attached. The schema is now strict and names the key:unknown key "vault": did you mean "vaults" (array of { id } or { name })?. This applies to every action that shares the schema; all known keys are unchanged, soupdate,list,get,get_telemetry, anddeletebehave as before.The schema also declares an optional
contextstring. PostHog's MCP instrumentation adds a requiredcontextargument to every tool it wraps and rejects the call if the schema doesn't accept it. Declaring it here makes PostHog skip its injection for this tool. PostHog's own intent capture only readscontextfor tools whosecontextit owns, so intent formanage_browsersis recorded from the declared field through theintentFallbackoption inanalytics.ts($mcp_intent_sourceisinferred). The value is never sent to the API: the config builders pick named fields, socontextis not forwarded.Note: prettier reindents the schema block when the object gains a second argument.
git diff -wshows the real change (a helper, thecontextdeclaration, and two lines).4.
manage_vaultsdescriptionThe 1password sentence said to create a browser and then request access in it. Access requests need no browser. It now matches
manage_vault_items: connect the account, create the credential, request access with1pw_create_access_request, and create a browser with the vault attached only when ready for1pw_fill.Tests
bun test: 1013 pass, 0 fail (new tests for unknown fill keys, malformed fill inputs, the full fill request shape, and unknownmanage_browserskeys includingvault).browser-vaults.test.ts: a call withcontextset parses and succeeds for create and update, and the API request body has nocontextproperty.bun x tsc --noEmit: clean.bun x prettier --check "src/**/*.ts": clean.bun run format:checkfails only onAGENTS.md, which is pre-existing on main.bun run lintfails on main already (next lintwas removed in Next 16).