Metadata
| Status | done |
|---|---|
| Assigned | agent-954 |
| Agent identity | 3184716484e6f0ea08bb13539daf07686ee79d440505f1fdf2de0357707034c3 |
| Model | claude:opus |
| Created | 2026-04-28T21:23:33.076743389+00:00 |
| Started | 2026-04-28T21:51:41.583465222+00:00 |
| Completed | 2026-04-28T22:10:54.264805796+00:00 |
| Tags | eval-scheduled |
| Eval score | 0.91 |
| └ blocking impact | 0.92 |
| └ completeness | 0.92 |
| └ coordination overhead | 0.88 |
| └ correctness | 0.95 |
| └ downstream usability | 0.90 |
| └ efficiency | 0.85 |
| └ intent fidelity | 0.81 |
| └ style adherence | 0.90 |
Description
Description
User reports: launched a new chat configured for codex, got a claude session. Model selection on chat creation is being ignored (or overridden) somewhere in the chat-creation pipeline.
Verbatim: 'lol. i just tried to launch a chat with codex and got... claude. lol lol.'
Likely suspects:
- The
new chatdialog /wg service create-chat(or whatever the entry point is) doesn't pass the chosen model spec to the spawn - Project-level
coordinator.model(claude:opus in this user's config) silently wins over the per-chat selection - Per CLAUDE.md, agency tasks ignore project cascade and pin to claude:haiku — chat agents may have analogous logic incorrectly applied
This is distinct from the codex worker-task handler bug (already fixed in b6c786cef). That was about prompt-stdin wiring for wg add worker tasks. This bug is in the chat-spawn code path, which is a different surface.
Investigation order
- Repro: launch a fresh chat, explicitly pick codex / gpt-5.5 in whatever the UI offers. Confirm via
wg agents --alivewhat handler actually spawned. - Find the chat-spawn code path (likely
src/commands/service/coordinator_agent.rs,src/commands/service/mod.rs, or the IPC layer between TUI and dispatcher). Trace where the model selection flows from UI → spawn args → executor wrapper. - Identify where the override happens (config cascade vs hardcoded vs IPC drop) and fix it.
- Add a regression test: spawning a chat with explicit model spec must result in a worker subprocess invoked with that model.
Validation
-
Failing test first: spawning a chat agent with
model = codex:gpt-5.5results in a codex CLI subprocess (mock the subprocess, assert on argv) - Implementation makes the test pass
-
Live smoke: open TUI, create a new chat picking codex, confirm
wg agents --aliveshows codex executor - Live smoke: same with claude — assert no regression
- Live smoke: existing chats spawned pre-fix continue to work on whatever they were on
- cargo build + cargo test pass
Depends on
Required by
- (none)
Log
- 2026-04-28T21:23:33.067629199+00:00 Task paused
- 2026-04-28T21:24:04.235025253+00:00 Task published
- 2026-04-28T21:25:34.131344992+00:00 Spawned by coordinator --executor claude --model opus
- 2026-04-28T21:26:13.610219984+00:00 Starting investigation: looking for chat-spawn code path where model selection might be dropped
- 2026-04-28T21:34:34.796637209+00:00 Root cause: maybe_auto_enable_chat_pty (state.rs:12454) uses config.coordinator.effective_executor() — IGNORES per-coordinator CoordinatorState.executor_override/model_override. Even when chat created with --executor codex, TUI auto-spawns claude binary.
- 2026-04-28T21:46:37.756091638+00:00 Reconciliation: task recovered from orphaned state (agent: agent-937)
- 2026-04-28T21:46:47.775018668+00:00 Spawned by coordinator --executor claude --model opus
- 2026-04-28T21:47:35.044504439+00:00 Resuming after agent-947 spawn — reviewing prior WIP. Fix touches state.rs (resolve_chat_pty_executor_and_model + auto_enable_chat_pty integration + per-handler model arg + WG_MODEL propagation) and spawn_task.rs (reads WG_MODEL alongside WG_EXECUTOR_TYPE). Three regression tests in state.rs, one in spawn_task.rs.
- 2026-04-28T21:51:30.854696554+00:00 Task unclaimed: agent 'agent-947' (PID 638541) process exited
- 2026-04-28T21:51:41.583469200+00:00 Spawned by coordinator --executor claude --model opus
- 2026-04-28T21:58:11.785889403+00:00 Build: clean. New regression tests pass: chat_launched_with_codex_uses_codex_executor, chat_with_no_overrides_uses_global_default, chat_with_only_model_override_keeps_global_executor, spawn_task_propagates_wg_model_env_var. Pre-existing failures in spawn_task::tests (role_override_wins, coordinator_task_gets_coordinator_role, etc) are unrelated — they fail on main without my changes (verified by stash-then-test; stash dropped cleanly).
- 2026-04-28T22:10:03.449297358+00:00 Live smoke verified end-to-end: wg chat create --executor codex --model codex:gpt-5 against claude:opus default → CoordinatorState gets overrides → wg spawn-task with daemon-set WG_EXECUTOR_TYPE/WG_MODEL → 'wg codex-handler --chat .chat-0 -m codex:gpt-5' (NOT claude). Same env vars cleared → falls back to global default (claude/opus). Added grow-only smoke scenario chat_launched_with_codex_uses_codex.sh.
- 2026-04-28T22:10:38.746277545+00:00 Committed: d3b6315b6 — pushed to remote
- 2026-04-28T22:10:54.264819111+00:00 Task pending eval (agent reported done; awaiting `.evaluate-*` to score)
- 2026-04-28T22:14:13.279066442+00:00 PendingEval → Done (evaluator passed; downstream unblocks)