Metadata
| Status | done |
|---|---|
| Assigned | agent-802 |
| Created | 2026-07-25T14:19:29.360167938+00:00 |
| Started | 2026-07-25T20:44:33.272817998+00:00 |
| Completed | 2026-07-26T06:09:04.403864266+00:00 |
| Tags | bug, dispatcher, model-registry, core |
| Tokens | 24100195 in / 60624 out |
| Failure reason | Agent exited with code 1 |
Description
Objective
Resolve the bug documented in wg-bug-openrouter-model-resolution.md (repo root) — the authoritative spec. The dispatcher wedges (zero spawns for a 60-min cooldown, re-triggered on every restart) whenever the active model uses a provider that is not a built-in registry entry (e.g. pi:zai:glm-5.2) AND the OpenRouter-backed registry refresh is unavailable (no OPENROUTER_API_KEY). The dependency is accidental: the pi executor resolves zai natively and never touches OpenRouter, yet OpenRouter's absence bricks dispatch.
Root cause (per the bug file)
wg has no static/native knowledge of non-built-in providers; its only dynamic model-learning path is wg profile refresh, hardcoded to OpenRouter (src/model_scout.rs; src/commands/service/mod.rs run_registry_refresh / do_registry_refresh). When that refresh cannot fetch (no key), it fails into a 60-min circuit breaker (record_registry_refresh_outcome, RegistryRefreshState.cooldown_until) that gates spawning; model resolution then cannot turn the spec into a spawnable model and the spawn breaker trips too.
Work — the 5-point fix from the bug file "Suggested fix"
- Decouple dispatch from the catalog refresh — a failed/cooling-down
profile refreshMUST NOT block spawning. Refresh is metadata (pricing/rankings), not a dispatch prerequisite. - Fail-soft model resolution — if a spec does not match a registry entry, defer to the executor (pi resolves zai itself); only hard-fail when the EXECUTOR reports it cannot resolve.
- First-class static model registration — implement the
[[model_registry]]schema the warning text already implies, documented, so non-OpenRouter providers resolve with no network refresh. - Allow disabling the OpenRouter refresh entirely (e.g.
registry.openrouter_refresh = false). NOTE: the immediate mitigationcoordinator.registry_refresh_interval = 0is ALREADY applied in this project — it disables the periodic refresh, but that is a workaround; the decoupling in 1-3 is the real fix so dispatch never depends on it. - Surface unresolvable models loudly at config-load /
wg service start, not only in daemon logs.
Constraints
- Do not regress the pi handler or built-in Anthropic resolution.
- Backward compatible — existing OpenRouter-keyed setups keep working.
- Add tests: (a) non-built-in provider spawns with NO OpenRouter key and an empty registry; (b) refresh failure/cooldown never gates spawning; (c) a
[[model_registry]]entry resolves without network.
Validation (from the bug file "Expected behavior")
- Dispatcher spawns workers for a model the configured executor resolves on its own, with NO OpenRouter dependency and an empty registry.
- A failing catalog/refresh lookup for an unknown model is NON-FATAL to dispatch (no 60-min cooldown blocking spawns).
-
A documented
[[model_registry]](or equivalent) lets a non-OpenRouter provider be declared and resolved without contacting OpenRouter. - Auth/resolution is delegated to the executor when it owns it (pi for zai).
-
wg service startfails loudly with a clear message if a configured model is unresolvable AND refresh is unavailable, instead of silently wedging. -
The bug file's reproduction (no-key start +
wg add "noop") now spawns instead of wedging.
Reference
wg-bug-openrouter-model-resolution.md (repo root) — full report, evidence, reproduction.
Depends on
- (none)
Required by
Log
- 2026-07-25T14:19:29.348501299+00:00 Task paused
- 2026-07-25T14:19:38.633641640+00:00 Task published
- 2026-07-25T14:19:51.480449110+00:00 Spawned by coordinator --executor pi --model zai:glm-5.2 --isolation required-worktree
- 2026-07-25T14:27:16.372723287+00:00 Starting fix. Plan: (1) add [registry].openrouter_refresh config + fail-soft refresh that skips cleanly when OpenRouter unconfigured/disabled (decouple Points 1&4); (2) fail-soft model resolution in validate_config — skip unresolved-model-id warning for executor-owned handler-first specs (pi:zai:...) and for [[model_registry]] entries (Points 2&3); (3) document [[model_registry]] schema; (4) surface model diagnostics loudly at service start (Point 5); (5) tests + smoke scenario.
- 2026-07-25T15:28:45.486810583+00:00 Task unclaimed: agent 'agent-749' (PID 1635181) process exited
- 2026-07-25T15:28:46.183017174+00:00 Minted evaluation pipeline evalp-ccf35f319bb2ebe303b0d174 for source attempt 2 (coordinator dead-agent retry)
- 2026-07-25T15:29:57.991615027+00:00 Spawned by coordinator --executor pi --model zai:glm-5.2 --isolation required-worktree
- 2026-07-25T15:30:19.675181528+00:00 Reconciliation: task recovered from orphaned state (was InProgress, agent: agent-760)
- 2026-07-25T15:30:19.675194439+00:00 Minted evaluation pipeline evalp-80244e0bea858652994a0d71 for source attempt 3 (coordinator orphan reconciliation retry)
- 2026-07-25T15:30:20.138759642+00:00 Spawn failed (attempt 1/5): isolated worktree /home/bot/wg/.wg-worktrees/agent-749 is owned by live attempt agent-760 for task 'fix-decouple-dispatch' (status Working); no process launched. Recover by terminating/reaping that attempt or archive the worktree explicitly after inspection. exec_mode=default, executor=pi
- 2026-07-25T15:30:31.517409431+00:00 Spawned by coordinator --executor pi --model zai:glm-5.2 --isolation required-worktree
- 2026-07-25T15:30:55.899625454+00:00 Reconciliation: task recovered from orphaned state (was InProgress, agent: agent-763)
- 2026-07-25T15:30:55.899638984+00:00 Minted evaluation pipeline evalp-884e0306abe4c826703c4423 for source attempt 4 (coordinator orphan reconciliation retry)
- 2026-07-25T15:31:11.449118564+00:00 Spawned by coordinator --executor pi --model zai:glm-5.2 --isolation required-worktree
- 2026-07-25T15:31:35.923305841+00:00 Reconciliation: task recovered from orphaned state (was InProgress, agent: agent-766)
- 2026-07-25T15:31:35.923319961+00:00 Minted evaluation pipeline evalp-e96879fc56f28d4edb4a16d4 for source attempt 5 (coordinator orphan reconciliation retry)
- 2026-07-25T15:31:36.383355742+00:00 Spawn failed (attempt 2/5): isolated worktree /home/bot/wg/.wg-worktrees/agent-749 is owned by live attempt agent-766 for task 'fix-decouple-dispatch' (status Working); no process launched. Recover by terminating/reaping that attempt or archive the worktree explicitly after inspection. exec_mode=default, executor=pi
- 2026-07-25T15:31:41.392477279+00:00 Spawn failed (attempt 3/5): isolated worktree /home/bot/wg/.wg-worktrees/agent-749 is owned by live attempt agent-766 for task 'fix-decouple-dispatch' (status Working); no process launched. Recover by terminating/reaping that attempt or archive the worktree explicitly after inspection. exec_mode=default, executor=pi
- 2026-07-25T15:31:46.626747021+00:00 Spawned by coordinator --executor pi --model zai:glm-5.2 --isolation required-worktree
- 2026-07-25T15:32:10.942903746+00:00 Reconciliation: task recovered from orphaned state (was InProgress, agent: agent-769)
- 2026-07-25T15:32:10.942917336+00:00 Minted evaluation pipeline evalp-4a744603f807e03e3e86fddb for source attempt 6 (coordinator orphan reconciliation retry)
- 2026-07-25T15:32:11.548659560+00:00 Spawn failed (attempt 4/5): isolated worktree /home/bot/wg/.wg-worktrees/agent-749 is owned by live attempt agent-769 for task 'fix-decouple-dispatch' (status Working); no process launched. Recover by terminating/reaping that attempt or archive the worktree explicitly after inspection. exec_mode=default, executor=pi
- 2026-07-25T15:32:16.457717326+00:00 Spawn failed (attempt 5/5): isolated worktree /home/bot/wg/.wg-worktrees/agent-749 is owned by live attempt agent-769 for task 'fix-decouple-dispatch' (status Working); no process launched. Recover by terminating/reaping that attempt or archive the worktree explicitly after inspection. exec_mode=default, executor=pi
- 2026-07-25T15:32:16.457717326+00:00 Circuit breaker tripped: spawn failed 5 times. Last error: isolated worktree /home/bot/wg/.wg-worktrees/agent-749 is owned by live attempt agent-769 for task 'fix-decouple-dispatch' (status Working); no process launched. Recover by terminating/reaping that attempt or archive the worktree explicitly after inspection. exec_mode=default, executor=pi. Task marked incomplete for evaluator review.
- 2026-07-25T19:04:18.619306850+00:00 Task reset for retry from incomplete (attempt #6) — reason: spawn breaker tripped (spawn_failures=5) after orphaned-worktree/profile-invalid fallout; retrying on zai
- 2026-07-25T19:04:18.619344011+00:00 Minted evaluation pipeline evalp-62553ff2e086a42445ecb5e5 for source attempt 7 (resume-in-place retry)
- 2026-07-25T19:09:30.215120240+00:00 Spawned by coordinator --executor pi --model zai:glm-5.2 --isolation required-worktree
- 2026-07-25T19:25:19.986260893+00:00 Committed: 436c9942 — pushed to remote. Prior agent's 5-point fix verified complete: (1) run_registry_refresh skips cleanly + clears stale breaker when no OpenRouter key; (2) fail-soft validate_config skips unresolved-model warning for executor-owned specs; (3) registry_resolves_spec matches [[model_registry]] via inner dialect + docs/model-registry.md; (4) [registry].openrouter_refresh=false; (5) surface_model_resolution_diagnostics at wg service start.
- 2026-07-25T19:25:23.122821820+00:00 Validated: cargo build + cargo test (config 231 ok, dispatch::plan 42 ok, service bin 336 ok), cargo fmt --check clean, cargo clippy no errors. Smoke scenario dispatch_decoupled_from_openrouter_registry PASS.
- 2026-07-25T19:26:35.590939187+00:00 Reconciliation: task recovered from orphaned state (was InProgress, agent: agent-780)
- 2026-07-25T19:26:35.590981828+00:00 Minted evaluation pipeline evalp-51f83d76b3ae0787a9108e0e for source attempt 8 (coordinator orphan reconciliation retry)
- 2026-07-25T19:26:37.192048516+00:00 Spawned by coordinator --executor pi --model zai:glm-5.2 --isolation required-worktree
- 2026-07-25T19:28:33.178185629+00:00 Task reset for retry from in-progress (attempt #7) — reason: cancelled per user; clean retry at max_agents=2
- 2026-07-25T19:28:33.178227401+00:00 Minted evaluation pipeline evalp-0b502dcdd4512d70036cbaa5 for source attempt 9 (resume-in-place in-progress retry)
- 2026-07-25T20:44:33.340767212+00:00 Spawned by coordinator --executor pi --model zai:glm-5.2 --isolation required-worktree
- 2026-07-25T21:15:56.023072557+00:00 Agent exited without wg done — entering failed-pending-eval for rescue evaluation
- 2026-07-26T06:09:04.403865617+00:00 Consumed durable verdict verdict-evalp-0b502dcdd4512d70036cbaa5-evaluate-c1a81bfb3cd1050c exactly once: score=0.70, outcome=done