Repository navigation
Fail the tests when an agent tool's inputs drift from its checks - #20
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Each tool's inputs are written twice: the valibot schema that parseInput checks, and the JSON Schema the agent reads. Nothing kept them in step, and the two hex patterns were already spelled differently. A test now converts each valibot schema with @valibot/to-json-schema and compares it with what the tool shows an agent, ignoring descriptions. The converter is a dev dependency, so the page ships nothing new. The hex pattern is now spelled the same way on both sides, and without the i flag, which JSON Schema can't carry.
ericchernuka
force-pushed
the
ec/agent-tool-schemas
branch
from
November 10, 2026 04:23
aff151f to
5819799
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.
Summary
Each agent tool's inputs are written twice: the valibot schema that
parseInputchecks, and the JSON Schema the agent reads. This keeps both copies, and a test now fails when they disagree.The fake agent gains
agent.inputs(name), so the test reads the schema the way an agent does.Evidence
maximum: 99intools.ts:× when an agent reads choose_colour, then its inputs match what the tool checks. I changedpicklist(FORMATS.slice(1))inrequests.ts:× when an agent reads choose_format, ….After: with both files restored,
pnpm checkpasses: 134 tests, types, lint, format, fallow and build.Merge Danger
Door: two-way
Blast Radius: tests
Agents see the same inputs as before. The only change they can see is how the hex pattern is spelled, and it matches the same strings.