From 50d889fcb58d13177b7a4e136ddb86a10c9daa57 Mon Sep 17 00:00:00 2001 From: rahul dhanawade Date: Fri, 27 Feb 2026 13:35:32 +0530 Subject: [PATCH 1/3] fix: add missing LiteLLM_ClaudeCodePluginTable to schema.prisma - Claude Code Plugin Marketplace endpoints (/claude-code/marketplace.json, /claude-code/plugins) were returning 500 errors because LiteLLM_ClaudeCodePluginTable model was missing from both schema.prisma files - Prisma client was generated without this table causing AttributeError: 'Prisma' object has no attribute 'litellm_claudecodeplugintable' - Added missing model definition to root schema.prisma and litellm/proxy/schema.prisma Fixes #21310 --- litellm/proxy/schema.prisma | 17 ++++++++++++++++- schema.prisma | 17 ++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/litellm/proxy/schema.prisma b/litellm/proxy/schema.prisma index 34308b29ebf..3f7ffd814c5 100644 --- a/litellm/proxy/schema.prisma +++ b/litellm/proxy/schema.prisma @@ -1095,4 +1095,19 @@ model LiteLLM_AccessGroupTable { created_by String? updated_at DateTime @default(now()) @updatedAt updated_by String? -} \ No newline at end of file +} +// Claude Code Plugin Marketplace table +model LiteLLM_ClaudeCodePluginTable { + id String @id @default(uuid()) + name String @unique + version String? + description String? + manifest_json String? + files_json String? @default("{}") + enabled Boolean @default(true) + created_at DateTime? @default(now()) + updated_at DateTime? @default(now()) + created_by String? + + @@map("LiteLLM_ClaudeCodePluginTable") +} diff --git a/schema.prisma b/schema.prisma index 34308b29ebf..3f7ffd814c5 100644 --- a/schema.prisma +++ b/schema.prisma @@ -1095,4 +1095,19 @@ model LiteLLM_AccessGroupTable { created_by String? updated_at DateTime @default(now()) @updatedAt updated_by String? -} \ No newline at end of file +} +// Claude Code Plugin Marketplace table +model LiteLLM_ClaudeCodePluginTable { + id String @id @default(uuid()) + name String @unique + version String? + description String? + manifest_json String? + files_json String? @default("{}") + enabled Boolean @default(true) + created_at DateTime? @default(now()) + updated_at DateTime? @default(now()) + created_by String? + + @@map("LiteLLM_ClaudeCodePluginTable") +} From ed3d1620c0df0cca894f45421fdc8c1c287e8004 Mon Sep 17 00:00:00 2001 From: rahul dhanawade Date: Fri, 27 Feb 2026 13:43:36 +0530 Subject: [PATCH 2/3] test: add regression test for LiteLLM_ClaudeCodePluginTable schema --- .../proxy/test_claude_code_marketplace.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/litellm/proxy/test_claude_code_marketplace.py diff --git a/tests/litellm/proxy/test_claude_code_marketplace.py b/tests/litellm/proxy/test_claude_code_marketplace.py new file mode 100644 index 00000000000..c18e970f285 --- /dev/null +++ b/tests/litellm/proxy/test_claude_code_marketplace.py @@ -0,0 +1,22 @@ +import pytest +from unittest.mock import AsyncMock, MagicMock, patch + + +@pytest.mark.asyncio +async def test_claude_code_plugin_table_schema_exists(): + """ + Test that LiteLLM_ClaudeCodePluginTable is defined in schema.prisma. + Regression test for https://github.com/BerriAI/litellm/issues/21310 + """ + with open("schema.prisma", "r") as f: + schema = f.read() + assert "LiteLLM_ClaudeCodePluginTable" in schema, ( + "LiteLLM_ClaudeCodePluginTable model missing from schema.prisma - " + "this causes AttributeError on all /claude-code/plugins endpoints" + ) + + with open("litellm/proxy/schema.prisma", "r") as f: + proxy_schema = f.read() + assert "LiteLLM_ClaudeCodePluginTable" in proxy_schema, ( + "LiteLLM_ClaudeCodePluginTable model missing from litellm/proxy/schema.prisma" + ) \ No newline at end of file From 2dd4b82ad0c7fc98edf9a03019ddd21e231bf793 Mon Sep 17 00:00:00 2001 From: rahul dhanawade Date: Fri, 27 Feb 2026 14:39:29 +0530 Subject: [PATCH 3/3] fix: address greptile review - add @updatedAt, clean up test imports --- litellm/proxy/schema.prisma | 2 +- schema.prisma | 2 +- tests/litellm/proxy/test_claude_code_marketplace.py | 8 ++------ 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/litellm/proxy/schema.prisma b/litellm/proxy/schema.prisma index 3f7ffd814c5..bc32a8cce32 100644 --- a/litellm/proxy/schema.prisma +++ b/litellm/proxy/schema.prisma @@ -1106,7 +1106,7 @@ model LiteLLM_ClaudeCodePluginTable { files_json String? @default("{}") enabled Boolean @default(true) created_at DateTime? @default(now()) - updated_at DateTime? @default(now()) + updated_at DateTime? @default(now()) @updatedAt created_by String? @@map("LiteLLM_ClaudeCodePluginTable") diff --git a/schema.prisma b/schema.prisma index 3f7ffd814c5..bc32a8cce32 100644 --- a/schema.prisma +++ b/schema.prisma @@ -1106,7 +1106,7 @@ model LiteLLM_ClaudeCodePluginTable { files_json String? @default("{}") enabled Boolean @default(true) created_at DateTime? @default(now()) - updated_at DateTime? @default(now()) + updated_at DateTime? @default(now()) @updatedAt created_by String? @@map("LiteLLM_ClaudeCodePluginTable") diff --git a/tests/litellm/proxy/test_claude_code_marketplace.py b/tests/litellm/proxy/test_claude_code_marketplace.py index c18e970f285..5376e81012b 100644 --- a/tests/litellm/proxy/test_claude_code_marketplace.py +++ b/tests/litellm/proxy/test_claude_code_marketplace.py @@ -1,13 +1,9 @@ import pytest -from unittest.mock import AsyncMock, MagicMock, patch @pytest.mark.asyncio async def test_claude_code_plugin_table_schema_exists(): - """ - Test that LiteLLM_ClaudeCodePluginTable is defined in schema.prisma. - Regression test for https://github.com/BerriAI/litellm/issues/21310 - """ + with open("schema.prisma", "r") as f: schema = f.read() assert "LiteLLM_ClaudeCodePluginTable" in schema, ( @@ -19,4 +15,4 @@ async def test_claude_code_plugin_table_schema_exists(): proxy_schema = f.read() assert "LiteLLM_ClaudeCodePluginTable" in proxy_schema, ( "LiteLLM_ClaudeCodePluginTable model missing from litellm/proxy/schema.prisma" - ) \ No newline at end of file + )