mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
test(responses): cover namespace tools whose member list fails to parse in guardrail merge
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
a5d58a7b8b
commit
585e780db2
3 changed files with 19 additions and 4 deletions
|
|
@ -123,7 +123,7 @@
|
|||
"limit": 5
|
||||
},
|
||||
"reportUnnecessaryIsInstance": {
|
||||
"limit": 823
|
||||
"limit": 822
|
||||
},
|
||||
"reportUntypedBaseClass": {
|
||||
"limit": 0
|
||||
|
|
|
|||
|
|
@ -1406,6 +1406,21 @@ class TestOpenAIResponsesHandlerNamespaceTools:
|
|||
|
||||
assert result["tools"] == tools
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_namespace_with_unparseable_members_is_kept_once_and_unchanged(self):
|
||||
handler = OpenAIResponsesHandler()
|
||||
namespace_tool = {"type": "namespace", "name": "mcp__odd", "tools": ["confluence_get_page"]}
|
||||
data = {
|
||||
"input": [{"role": "user", "content": "fetch page 1", "type": "message"}],
|
||||
"tools": [dict(namespace_tool)],
|
||||
"model": "gpt-5.3-codex",
|
||||
}
|
||||
|
||||
result = await handler.process_input_messages(data, ToolAppendingGuardrail(guardrail_name="test"))
|
||||
|
||||
assert result["tools"][0] == namespace_tool
|
||||
assert [t["name"] for t in result["tools"]] == ["mcp__odd", "injected_tool"]
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_guardrail_can_still_drop_a_single_namespace_member(self):
|
||||
handler = OpenAIResponsesHandler()
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"LIT001": {
|
||||
"limit": 22352
|
||||
"limit": 22346
|
||||
},
|
||||
"LIT002": {
|
||||
"limit": 26774
|
||||
"limit": 26773
|
||||
},
|
||||
"LIT003": {
|
||||
"limit": 269
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
"limit": 0
|
||||
},
|
||||
"LIT010": {
|
||||
"limit": 16504
|
||||
"limit": 16503
|
||||
},
|
||||
"LIT011": {
|
||||
"limit": 5535
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue