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:
mateo 2026-07-10 04:31:14 +00:00
parent 0cc7951488
commit 243a0615f1
5 changed files with 23 additions and 23 deletions

View file

@ -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

View file

@ -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(

View file

@ -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
}
}

View file

@ -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")

View file

@ -1,6 +1,6 @@
{
"LIT001": {
"limit": 23452
"limit": 23449
},
"LIT002": {
"limit": 27522