Metadata
| Status | done |
|---|---|
| Assigned | agent-675 |
| Agent identity | f51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e |
| Created | 2026-04-27T13:11:47.011376005+00:00 |
| Started | 2026-04-27T13:12:12.524912498+00:00 |
| Completed | 2026-04-27T13:36:17.468271063+00:00 |
| Tags | eval-scheduled |
| Eval score | 0.92 |
| └ blocking impact | 0.90 |
| └ completeness | 0.98 |
| └ constraint fidelity | 0.85 |
| └ coordination overhead | 0.85 |
| └ correctness | 0.95 |
| └ downstream usability | 0.90 |
| └ efficiency | 0.85 |
| └ intent fidelity | 0.81 |
| └ style adherence | 0.92 |
Description
Description
chat-agent-loops shipped (commit 704ed26f8 by agent-228) but does NOT actually prevent the chat-loop thrashing. Live evidence in /home/erik/workgraph just now:
[dispatcher] Priority dispatch order: [.chat-2:50(d458)]
[dispatcher] Spawning agent for: .chat-2 - Chat 2 (executor: claude)
.chat-2 was dispatched 458 times. 5+ agents alive on it simultaneously, more spawning every tick. Until I manually archived it (wg service archive-chat 2), it was burning tokens nonstop.
Likely cause
The merged fix probably touched a different code path than the actual cycle-reactivation trigger. The right fix is in src/graph.rs evaluate_all_cycle_iterations: skip cycles whose config-owner task has tag chat-loop or coordinator-loop. I made this exact change locally during a prior session, but it got overwritten when other commits landed (and I didn't commit my version).
Required fix (same as my prior local bandaid)
In src/graph.rs (look for pub fn evaluate_all_cycle_iterations):
let Some((config_owner_id, cycle_config)) = found else {
continue;
};
// Chat-loop tasks are event-driven (wake on inbox), NOT polled by
// cycle reactivation. Skip them — otherwise the chat agent gets
// re-spawned on every dispatcher tick when its inbox is empty.
if let Some(owner_task) = graph.get_task(&config_owner_id)
&& owner_task.tags.iter().any(|t| t == "chat-loop" || t == "coordinator-loop")
{
continue;
}
let reactivated = reactivate_cycle(...);
This is the bandaid until wg-chat-as (chat as first-class entity, no graph involvement at all) lands.
Hard gate
Before claiming done:
- Create a fresh chat (
wg service create-chat --name foo) - Don't send any messages
- Wait 5 minutes
- Daemon log MUST show ZERO 'Spawning agent for: .chat-N' lines after the initial spawn
wg agents --aliveMUST show at most 1 supervisor for the chat (not 5+)- Dispatch count for the chat task must be 1 (not climbing)
Lessons learned (smoke-gate-is should catch this)
The chat-agent-loops 'done' was a false positive — the agent claimed done without verifying the user-visible spam pattern actually stopped. Same verification-gap class as tui-agent-activity → tui-log-view, agency-picks-claude → agency-still-picks → STILL needed local-providers fix from me. Document this as another scenario in the smoke manifest.
Depends on
Required by
- (none)
Log
- 2026-04-27T13:11:47.004435909+00:00 Task paused
- 2026-04-27T13:11:56.078136883+00:00 Task published
- 2026-04-27T13:12:12.320950781+00:00 Lightweight assignment: agent=Careful Programmer (f5143935), exec_mode=full, context_scope=graph, reason=Careful Programmer's proven track record (0.71 score, 97 tasks) on correctness-critical work matches this bug fix's strict verification gates and resource-exhaustion risk if wrong.
- 2026-04-27T13:12:12.524916666+00:00 Spawned by coordinator --executor claude --model opus
- 2026-04-27T13:12:25.507142458+00:00 Starting work — investigating evaluate_all_cycle_iterations in src/graph.rs
- 2026-04-27T13:25:02.718174958+00:00 Applied guard in src/graph.rs::reactivate_cycle (covers wg-done sync path) + reactivate_cycle_on_failure + evaluate_all_cycle_iterations (defense-in-depth). 4 new regression tests pass; full lib + cycle-detection suites green (2 pre-existing wg-init CLI failures unrelated).
- 2026-04-27T13:30:37.052435278+00:00 Verified bandaid is necessary AND sufficient: temporarily reverted graph.rs and the new smoke FAILED with the exact bug signature from the user report ('Re-activated by cycle iteration (iteration 1/unlimited)', loop_iteration=1, status=open after wg done). Restored fix and smoke passes.
- 2026-04-27T13:31:25.359455082+00:00 Committed: 04bd120e3 — pushed to remote
- 2026-04-27T13:36:17.468280491+00:00 Task marked as done