fix(schema): align file_write mode default with Python implementation#91
Open
shaun0927 wants to merge 1 commit intolsdefine:mainfrom
Open
fix(schema): align file_write mode default with Python implementation#91shaun0927 wants to merge 1 commit intolsdefine:mainfrom
shaun0927 wants to merge 1 commit intolsdefine:mainfrom
Conversation
assets/tools_schema.json declares file_write.mode default as 'append',
but assets/tools_schema_cn.json and ga.py both default to 'overwrite':
# ga.py:369
mode = args.get("mode", "overwrite")
Since the i18n switch in 7cadbd7 loads the English schema for en_*
locales, an LLM that trusts the schema default and omits the mode
parameter will silently overwrite instead of append. Align the English
schema with the Chinese schema and the Python handler so all three
agree on 'overwrite'.
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.
Problem
assets/tools_schema.json(used for English-locale agents since the i18nauto-detect in 7cadbd7) declares
file_write.modewith a default of\"append\":But
assets/tools_schema_cn.jsonand the Python handler both default to\"overwrite\":When the LLM trusts the English schema's documented default and omits
mode, the Python handler silently overwrites the file. Same call,opposite behavior depending on which locale loaded the schema.
Fix
Change the EN schema default to
\"overwrite\"so all three sources oftruth — EN schema, CN schema, Python handler — agree:
The reverse direction (changing CN + ga.py to
\"append\") was rejectedbecause:
overwritesince the introduction ofthe parameter, so
overwriteis the de-facto behavior callers depend on.file_writein CONTRIBUTING-style usage (huge edits with the<file_content>block before the call) targets a fresh write, not anappend; flipping the default to
appendwould silently change semanticsfor every existing skill that omits
mode.Verification
Net line count: 0.