test(tools): cover non-object JSON in concatenated arguments

Codecov flagged the `not isinstance(obj, dict)` guard in
`_split_complete_json_objects` as the one uncovered line in the patch.
`{"a": 1}[1, 2]` decodes cleanly but yields a list, which must not be
salvaged as tool arguments.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
deepak7lal 2026-09-11 01:06:17 +05:30
parent fe0607c16c
commit c6c61c8ddd

View file

@ -315,6 +315,7 @@ def test_parse_tool_call_arguments_concatenated_is_not_dropped_silently():
'{"a": 1}{"b":', # truncated tail
'{"a": 1} garbage', # trailing garbage
'{"a": 1}{"b": 2} x', # complete objects followed by junk
'{"a": 1}[1, 2]', # valid JSON, but not an object
],
)
def test_parse_tool_call_arguments_rejects_incomplete_concatenation(raw):