mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
Fix/claude code plugin schema (#22271)
* 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 * test: add regression test for LiteLLM_ClaudeCodePluginTable schema * fix: address greptile review - add @updatedAt, clean up test imports
This commit is contained in:
parent
03720ec08c
commit
64c85dbc9f
3 changed files with 50 additions and 2 deletions
|
|
@ -1096,4 +1096,19 @@ model LiteLLM_AccessGroupTable {
|
|||
created_by String?
|
||||
updated_at DateTime @default(now()) @updatedAt
|
||||
updated_by String?
|
||||
}
|
||||
}
|
||||
// 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()) @updatedAt
|
||||
created_by String?
|
||||
|
||||
@@map("LiteLLM_ClaudeCodePluginTable")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1095,4 +1095,19 @@ model LiteLLM_AccessGroupTable {
|
|||
created_by String?
|
||||
updated_at DateTime @default(now()) @updatedAt
|
||||
updated_by String?
|
||||
}
|
||||
}
|
||||
// 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()) @updatedAt
|
||||
created_by String?
|
||||
|
||||
@@map("LiteLLM_ClaudeCodePluginTable")
|
||||
}
|
||||
|
|
|
|||
18
tests/litellm/proxy/test_claude_code_marketplace.py
Normal file
18
tests/litellm/proxy/test_claude_code_marketplace.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_claude_code_plugin_table_schema_exists():
|
||||
|
||||
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"
|
||||
)
|
||||
Loading…
Add table
Reference in a new issue