Skip to content

fix(tools): normalize LIST_PARAMS when TRACK_INVOCATIONS is off#559

Closed
JessicaMulein wants to merge 1 commit into
cecli-dev:mainfrom
Digital-Defiance:pr/edit-text-list-params
Closed

fix(tools): normalize LIST_PARAMS when TRACK_INVOCATIONS is off#559
JessicaMulein wants to merge 1 commit into
cecli-dev:mainfrom
Digital-Defiance:pr/edit-text-list-params

Conversation

@JessicaMulein

@JessicaMulein JessicaMulein commented Jun 6, 2026

Copy link
Copy Markdown

Summary

  • Run normalize_json_array for LIST_PARAMS before invocation tracking, not only inside the TRACK_INVOCATIONS block — fixes EditText and ReadRange when local models double-encode array args as JSON strings.
  • Harden EditText.format_output to coerce string edits (same pattern as Grep / UpdateTodoList) so UI formatting no longer crashes with AttributeError: 'str' object has no attribute 'get'.
  • Catch ToolError in BaseTool.process_response without Python tracebacks for expected tool guard failures (e.g. ReadRange-before-EditText).

Motivation

BrightVision dogfood on Qwen 3.6 27B hit EditText with edits passed as a JSON string. Execute returned "edits parameter must be an array" and format_output crashed with a Python traceback in the activity log.

Test plan

  • pytest tests/tools/test_edit_text.py

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant