mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-01-30 06:12:06 +00:00
fix: use ANTHROPIC_DEFAULT_OPUS_MODEL env var for model selection
The model was hardcoded to "claude-opus-4-5-20251101" in chat session services, ignoring the ANTHROPIC_DEFAULT_OPUS_MODEL environment variable. This caused issues when using alternative API providers (e.g., GLM via z.ai) that don't support Claude model names. Fixes #51 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -169,10 +169,14 @@ class SpecChatSession:
|
||||
# Build environment overrides for API configuration
|
||||
sdk_env = {var: os.getenv(var) for var in API_ENV_VARS if os.getenv(var)}
|
||||
|
||||
# Determine model from environment or use default
|
||||
# This allows using alternative APIs (e.g., GLM via z.ai) that may not support Claude model names
|
||||
model = os.getenv("ANTHROPIC_DEFAULT_OPUS_MODEL", "claude-opus-4-5-20251101")
|
||||
|
||||
try:
|
||||
self.client = ClaudeSDKClient(
|
||||
options=ClaudeAgentOptions(
|
||||
model="claude-opus-4-5-20251101",
|
||||
model=model,
|
||||
cli_path=system_cli,
|
||||
# System prompt loaded from CLAUDE.md via setting_sources
|
||||
# This avoids Windows command line length limit (~8191 chars)
|
||||
|
||||
Reference in New Issue
Block a user