mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-03-17 02:43:09 +00:00
fix: address PR #163 review findings
- Fix model selection regression: _get_settings_defaults() now checks api_model (set by new provider UI) before falling back to legacy model setting, ensuring Claude model selection works end-to-end - Add input validation for provider settings: api_base_url must start with http:// or https:// (max 500 chars), api_auth_token max 500 chars, api_model max 200 chars - Fix terminal.py misleading import alias: replace is_valid_project_name aliased as validate_project_name with direct is_valid_project_name import across all 5 call sites Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -436,9 +436,18 @@ class SettingsUpdate(BaseModel):
|
||||
playwright_headless: bool | None = None
|
||||
batch_size: int | None = None # Features per agent batch (1-3)
|
||||
api_provider: str | None = None
|
||||
api_base_url: str | None = None
|
||||
api_auth_token: str | None = None # Write-only, never returned
|
||||
api_model: str | None = None
|
||||
api_base_url: str | None = Field(None, max_length=500)
|
||||
api_auth_token: str | None = Field(None, max_length=500) # Write-only, never returned
|
||||
api_model: str | None = Field(None, max_length=200)
|
||||
|
||||
@field_validator('api_base_url')
|
||||
@classmethod
|
||||
def validate_api_base_url(cls, v: str | None) -> str | None:
|
||||
if v is not None and v.strip():
|
||||
v = v.strip()
|
||||
if not v.startswith(("http://", "https://")):
|
||||
raise ValueError("api_base_url must start with http:// or https://")
|
||||
return v
|
||||
|
||||
@field_validator('model')
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user