Skip to content

fix(tools): harden Grep format_output for local-model searches JSON#549

Closed
JessicaMulein wants to merge 1 commit into
cecli-dev:mainfrom
Digital-Defiance:pr/grep-searches-coerce
Closed

fix(tools): harden Grep format_output for local-model searches JSON#549
JessicaMulein wants to merge 1 commit into
cecli-dev:mainfrom
Digital-Defiance:pr/grep-searches-coerce

Conversation

@JessicaMulein

Copy link
Copy Markdown

Summary

Harden Grep format_output and execute when local models emit double-encoded or malformed searches JSON (truncated inner JSON, string instead of list).

  • Add _coerce_searches() and route through parse_tool_arguments
  • Regression test in tests/tools/test_tool_arguments.py

Context

Reopened from Digital-Defiance/cecli#12 (rebased on cecli-dev/main).

Test plan

  • pytest tests/tools/test_tool_arguments.py -k grep — 3 passed (local run)
  • BrightVision dogfood: Grep tool no longer crashes on qwen-style searches JSON

Coerce double-encoded or malformed searches strings via parse_tool_arguments
so format_output no longer crashes when qwen emits truncated inner JSON.

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