mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-16 23:41:43 +00:00
fix(mcp): propagate draft deletion failures
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
0cc7951488
commit
243a0615f1
5 changed files with 23 additions and 23 deletions
|
|
@ -18,13 +18,13 @@
|
|||
"limit": 59
|
||||
},
|
||||
"reportDeprecated": {
|
||||
"limit": 326
|
||||
"limit": 323
|
||||
},
|
||||
"reportDuplicateImport": {
|
||||
"limit": 42
|
||||
},
|
||||
"reportExplicitAny": {
|
||||
"limit": 10397
|
||||
"limit": 10395
|
||||
},
|
||||
"reportFunctionMemberAccess": {
|
||||
"limit": 11
|
||||
|
|
@ -111,7 +111,7 @@
|
|||
"limit": 20418
|
||||
},
|
||||
"reportUnknownVariableType": {
|
||||
"limit": 32151
|
||||
"limit": 32150
|
||||
},
|
||||
"reportUnnecessaryCast": {
|
||||
"limit": 177
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
"limit": 7
|
||||
},
|
||||
"reportUnnecessaryIsInstance": {
|
||||
"limit": 1212
|
||||
"limit": 1211
|
||||
},
|
||||
"reportUntypedBaseClass": {
|
||||
"limit": 165
|
||||
|
|
|
|||
|
|
@ -694,15 +694,12 @@ async def _delete_draft_mcp_server(
|
|||
prisma_client: PrismaClient,
|
||||
server_id: str,
|
||||
) -> None:
|
||||
try:
|
||||
await MCPServerRepository(prisma_client).table.delete_many(
|
||||
where={
|
||||
"server_id": server_id,
|
||||
"approval_status": MCPApprovalStatus.draft,
|
||||
}
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
await MCPServerRepository(prisma_client).table.delete_many(
|
||||
where={
|
||||
"server_id": server_id,
|
||||
"approval_status": MCPApprovalStatus.draft,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
async def delete_expired_draft_mcp_servers(
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@
|
|||
"limit": 4
|
||||
},
|
||||
"BLE001": {
|
||||
"limit": 2903
|
||||
"limit": 2898
|
||||
},
|
||||
"C401": {
|
||||
"limit": 11
|
||||
|
|
@ -90,7 +90,7 @@
|
|||
"limit": 5
|
||||
},
|
||||
"DTZ003": {
|
||||
"limit": 33
|
||||
"limit": 30
|
||||
},
|
||||
"DTZ005": {
|
||||
"limit": 244
|
||||
|
|
@ -225,7 +225,7 @@
|
|||
"limit": 721
|
||||
},
|
||||
"RUF010": {
|
||||
"limit": 874
|
||||
"limit": 869
|
||||
},
|
||||
"RUF012": {
|
||||
"limit": 168
|
||||
|
|
@ -324,7 +324,7 @@
|
|||
"limit": 883
|
||||
},
|
||||
"UP006": {
|
||||
"limit": 12869
|
||||
"limit": 12866
|
||||
},
|
||||
"UP007": {
|
||||
"limit": 2570
|
||||
|
|
@ -363,6 +363,6 @@
|
|||
"limit": 105
|
||||
},
|
||||
"UP045": {
|
||||
"limit": 18517
|
||||
"limit": 18516
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -255,13 +255,16 @@ class TestDeleteDraftMcpServer:
|
|||
assert where["approval_status"] == MCPApprovalStatus.draft
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_swallows_exceptions(self):
|
||||
async def test_propagates_delete_errors(self):
|
||||
repo_instance, mock_table = _mock_repo()
|
||||
mock_table.delete_many = AsyncMock(side_effect=Exception("db error"))
|
||||
prisma = MagicMock()
|
||||
|
||||
with patch(
|
||||
"litellm.proxy._experimental.mcp_server.db.MCPServerRepository",
|
||||
return_value=repo_instance,
|
||||
with (
|
||||
patch(
|
||||
"litellm.proxy._experimental.mcp_server.db.MCPServerRepository",
|
||||
return_value=repo_instance,
|
||||
),
|
||||
pytest.raises(Exception, match="db error"),
|
||||
):
|
||||
await _delete_draft_mcp_server(prisma, "target-id")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"LIT001": {
|
||||
"limit": 23452
|
||||
"limit": 23449
|
||||
},
|
||||
"LIT002": {
|
||||
"limit": 27522
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue