mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
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:
parent
fe0607c16c
commit
c6c61c8ddd
1 changed files with 1 additions and 0 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue