Skip to content

hotfix: Qwen URL+model from codec_config (was hardcoded wrong dashboard port)#32

Merged
AVADSA25 merged 1 commit intomainfrom
hotfix/qwen-url-and-model
May 3, 2026
Merged

hotfix: Qwen URL+model from codec_config (was hardcoded wrong dashboard port)#32
AVADSA25 merged 1 commit intomainfrom
hotfix/qwen-url-and-model

Conversation

@AVADSA25
Copy link
Copy Markdown
Owner

@AVADSA25 AVADSA25 commented May 3, 2026

Summary

Phase 3 was failing on first real plan-draft attempt:

Plan failed: Qwen-3.6 unavailable: qwen3.6 returned 405

Root cause

When I wrote codec_agent_plan.py, codec_agent_runner.py, and the Step 10 classifier in codec_dashboard.py, I hardcoded:

QWEN_URL = "http://127.0.0.1:8090/v1/chat/completions"
QWEN_MODEL = "qwen3.6"

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-dashboard itself. POST /v1/chat/completions to 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

File Change
codec_agent_plan.py New helpers _qwen_url() + _qwen_model(); _qwen_chat uses them at call time
codec_agent_runner.py Same pattern
codec_dashboard.py _qwen_chat_classify (auto-escalation) imports from codec_config

Module-level QWEN_URL + QWEN_MODEL constants kept for backward compat (tests reference them, default to live values from config).

Test plan

  • 🧪 122 Phase 3 + 3.5 tests pass (test_agent_plan + test_agent_runner + test_agent_messaging + test_chat_escalation + test_proactive) — no regression
  • After merge + pm2 restart codec-dashboard codec-agent-runner, drop a project in /chat Project mode → plan drafts successfully (no 405)

This unblocks Step 12 (the anchor example run).

🤖 Generated with Claude Code

… 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).
@AVADSA25 AVADSA25 merged commit bf6ccea into main May 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants