mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-03-16 18:33:08 +00:00
When users configured GLM/Ollama/Kimi via the Settings UI, agents still used Claude because conflicting env vars leaked through subprocess env. Root cause: get_effective_sdk_env() set ANTHROPIC_AUTH_TOKEN for GLM but didn't clear ANTHROPIC_API_KEY, which leaked from os.environ. The CLI prioritized the wrong credential. Changes: - registry.py: Clear conflicting auth vars (API_KEY vs AUTH_TOKEN) and Vertex AI vars when building env for alternative providers - client.py: Replace manual os.getenv() loop with get_effective_sdk_env() so agent SDK reads provider settings from the database - autonomous_agent_demo.py: Apply UI-configured provider settings to process env so CLI-launched agents also respect Settings UI config - start.py: Pass --model from settings when launching agent subprocess - server/schemas.py: Allow non-Claude model names when an alternative provider is configured (prevents 422 errors for glm-4.7, etc.) - .env.example: Document env vars for GLM, Ollama, and Kimi providers Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>