Skip to content

fix: report malformed tool input JSON#2397

Open
he-yufeng wants to merge 1 commit into
strands-agents:mainfrom
he-yufeng:fix/malformed-tool-input-error
Open

fix: report malformed tool input JSON#2397
he-yufeng wants to merge 1 commit into
strands-agents:mainfrom
he-yufeng:fix/malformed-tool-input-error

Conversation

@he-yufeng
Copy link
Copy Markdown
Contributor

Summary

  • mark malformed streamed tool input JSON instead of replacing it with {}
  • turn that parse marker into an error tool result before tool execution
  • keep missing-input tool uses on the existing {} path

Fixes #2051.

To verify

  • python -m pytest tests/strands/event_loop/test_streaming.py tests/strands/tools/test_validator.py -q
  • python -m ruff check src/strands/event_loop/streaming.py src/strands/tools/_validator.py tests/strands/event_loop/test_streaming.py tests/strands/tools/test_validator.py
  • python -m ruff format --check src/strands/event_loop/streaming.py src/strands/tools/_validator.py tests/strands/event_loop/test_streaming.py tests/strands/tools/test_validator.py
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Malformed tool input JSON silently replaced with empty dict, no logging

1 participant