hotfix: Qwen URL+model from codec_config (was hardcoded wrong dashboard port)#32
Merged
hotfix: Qwen URL+model from codec_config (was hardcoded wrong dashboard port)#32
Conversation
… port) Phase 3 was failing on first real plan-draft attempt with: Plan failed: Qwen-3.6 unavailable: qwen3.6 returned 405 Root cause: codec_agent_plan, codec_agent_runner, codec_dashboard all hardcoded: QWEN_URL = "http://127.0.0.1:8090/v1/chat/completions" QWEN_MODEL = "qwen3.6" Both were wrong. Reality: llm_base_url = "http://localhost:8083/v1" (port 8083, not 8090) llm_model = "mlx-community/Qwen3.6-35B-A3B-4bit" Port 8090 is codec-dashboard itself, so requests were hitting the dashboard's FastAPI router which returns 405 for POST /v1/chat/completions (no such route). Fix: read both values from codec_config (which reads ~/.codec/config.json), falling back to sensible defaults. Resolved at call time so config.json edits don't require a process restart. Files: - codec_agent_plan.py — _qwen_url() + _qwen_model() helpers; _qwen_chat uses them at call time - codec_agent_runner.py — same helpers, _qwen_chat uses them - codec_dashboard.py — _qwen_chat_classify (Step 10 auto-escalation) now imports QWEN_BASE_URL + QWEN_MODEL from codec_config Module-level QWEN_URL and QWEN_MODEL constants kept for backward compatibility (tests reference them). Test plan: - 122 Phase 3 + 3.5 tests pass (no regression) - After deploy + Project mode plan attempt, the 405 is gone — Qwen drafts the plan successfully This unblocks the anchor example run (Step 12 / property bot test).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 3 was failing on first real plan-draft attempt:
Root cause
When I wrote
codec_agent_plan.py,codec_agent_runner.py, and the Step 10 classifier incodec_dashboard.py, I hardcoded:Both wrong. Reality (from
~/.codec/config.json):{ "llm_base_url": "http://localhost:8083/v1", "llm_model": "mlx-community/Qwen3.6-35B-A3B-4bit" }Port 8090 is
codec-dashboarditself.POST /v1/chat/completionsto the dashboard returns 405 because no such route exists. So Phase 3 was talking to itself instead of Qwen.Fix
Read both values from
codec_config.QWEN_BASE_URL+codec_config.QWEN_MODEL(which both read~/.codec/config.json). Fall back to sensible defaults. Resolved at call time so config edits pick up without process restart.Files
codec_agent_plan.py_qwen_url()+_qwen_model();_qwen_chatuses them at call timecodec_agent_runner.pycodec_dashboard.py_qwen_chat_classify(auto-escalation) imports from codec_configModule-level
QWEN_URL+QWEN_MODELconstants kept for backward compat (tests reference them, default to live values from config).Test plan
pm2 restart codec-dashboard codec-agent-runner, drop a project in/chatProject mode → plan drafts successfully (no 405)This unblocks Step 12 (the anchor example run).
🤖 Generated with Claude Code