Commit ae5bac2b authored by Admin's avatar Admin

fix: relax adapter_type validation pattern to accept all frontend adapter types

parent cbac55dc
......@@ -12,7 +12,7 @@ class AgentBase(BaseModel):
company_id: str
name: str = Field(..., min_length=1, max_length=255)
role: str = Field(..., min_length=1, max_length=255)
adapter_type: str = Field(..., pattern="^(claude|codex|openclaw|custom)$")
adapter_type: str = Field(..., pattern=r"^[a-z][a-z0-9_]*$")
adapter_config: Dict[str, Any] = Field(default_factory=dict)
runtime_config: Dict[str, Any] = Field(default_factory=dict)
budget_monthly_cents: int = Field(0, ge=0)
......@@ -34,7 +34,7 @@ class AgentUpdate(BaseModel):
name: Optional[str] = Field(None, min_length=1, max_length=255)
role: Optional[str] = Field(None, min_length=1, max_length=255)
adapter_type: Optional[str] = Field(None, pattern="^(claude|codex|openclaw|custom)$")
adapter_type: Optional[str] = Field(None, pattern=r"^[a-z][a-z0-9_]*$")
adapter_config: Optional[Dict[str, Any]] = None
runtime_config: Optional[Dict[str, Any]] = None
budget_monthly_cents: Optional[int] = Field(None, ge=0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment