fix(tools): normalize LIST_PARAMS when TRACK_INVOCATIONS is off#559
Closed
JessicaMulein wants to merge 1 commit into
Closed
fix(tools): normalize LIST_PARAMS when TRACK_INVOCATIONS is off#559JessicaMulein wants to merge 1 commit into
JessicaMulein wants to merge 1 commit into
Conversation
Local models often double-encode EditText `edits` as a JSON string. That normalization only ran inside the invocation-tracking block, so tools with TRACK_INVOCATIONS=False (EditText, ReadRange) still saw raw strings and failed with "edits parameter must be an array". Also harden EditText format_output to coerce string edits (same pattern as Grep/UpdateTodoList) and stop emitting Python tracebacks for expected ToolError responses from process_response. Co-authored-by: Cursor <cursoragent@cursor.com>
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
normalize_json_arrayforLIST_PARAMSbefore invocation tracking, not only inside theTRACK_INVOCATIONSblock — fixes EditText and ReadRange when local models double-encode array args as JSON strings.EditText.format_outputto coerce stringedits(same pattern as Grep / UpdateTodoList) so UI formatting no longer crashes withAttributeError: 'str' object has no attribute 'get'.ToolErrorinBaseTool.process_responsewithout Python tracebacks for expected tool guard failures (e.g. ReadRange-before-EditText).Motivation
BrightVision dogfood on Qwen 3.6 27B hit EditText with
editspassed as a JSON string. Execute returned "edits parameter must be an array" andformat_outputcrashed with a Python traceback in the activity log.Test plan
pytest tests/tools/test_edit_text.py