Repository navigation
Conversation
Patches the read, write, and edit tool schemas to accept file_path, old_string, and new_string aliases. This ensures strict schema validation passes before the existing normalization logic runs.
Contributor
|
Contributor
|
Re-implemented in main without merging this PR: added schema aliases for file_path/old_string/new_string, kept runtime required guards, and added regression tests + changelog. Closing since the fix landed on main in 2563040. |
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
PR #768 introduced runtime normalization for Claude-style parameters (e.g., converting
file_path->path). However, it did not update the JSON Schema definitions for these tools.As a result, strict schema validation (used by Gemini/Claude) rejects requests containing
file_pathbefore the runtime normalization logic is ever executed.This PR fixes that by:
read,write, andeditto acceptfile_path,old_string, andnew_stringas valid (optional) parameters.pathetc. in the schema, since the alias is sufficient.This "unlocks" the logic from PR #768, allowing it to function as intended.
Changes
patchToolSchemaForClaudeCompatibilityinsrc/agents/pi-tools.ts.read,write, andedittools.Verification
readtool calls withfile_pathnow pass schema validation.Gemini Verification update (2026-01-12)
Confirmed effective against
INVALID_ARGUMENTerrors ongemini-3-pro-low.readtool schema was confirmed to includefile_pathand have an emptyrequiredlist in the actual payload sent to Gemini.readusingfile_pathwithout triggering a 400 error.