Metadata
| Status | done |
|---|---|
| Assigned | agent-818 |
| Agent identity | f51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e |
| Created | 2026-04-27T17:18:53.253456318+00:00 |
| Started | 2026-04-27T18:40:56.230050650+00:00 |
| Completed | 2026-04-27T19:02:38.322414952+00:00 |
| Tags | eval-scheduled |
| Tokens | 10180014 in / 62630 out |
Description
Description
Today (2026-04-27) we found and killed two batches of leaked smoke-test daemons:
Batch 1 (15-19h old, ~67 processes): wg --dir /tmp/.tmpXXX/.workgraph service daemon --max-agents 0 --interval 600
Batch 2 (2-21h old, ~11 processes): wg --dir /tmp/wgsmoke.XXX/.wg service daemon --max-agents 0|1 [--no-coordinator-agent]
Plus 213 /tmp/.tmp*/.workgraph and 31 /tmp/wgsmoke.* directories left behind.
These are unambiguously test-fixture daemons (ephemeral tmp paths, max-agents=0 or 1, --no-coordinator-agent flag). They survive past test exit and accumulate over weeks, eventually contributing to:
- Disk fill (each daemon's tmp dir holds graph state, logs, sockets)
- Process clutter
- And in one case here today, a runaway 125% CPU loop (was actually
wg nex --chat coordinator-0but still fixture-related)
Required
Find the smoke test harness(es) that spawn these daemons and ensure cleanup:
- Setup/teardown discipline — every test that spawns
wg service daemonmust register a teardown that kills the daemon and rms the tmp dir, even on test failure / panic / signal. - Defense in depth — a top-level test runner that finds and kills any
wg service daemonagainst/tmp/wgsmoke.*or/tmp/.tmp*/.workgraphpaths before AND after each test session, so a leak in test N doesn't accumulate into test N+1. - Fixture path discipline — make smoke test fixtures use a single well-known parent dir (e.g.
$XDG_RUNTIME_DIR/wgsmoke/or/tmp/wgsmoke/$session/) so cleanup is onerm -rfof the parent, not a glob hunt.
Files likely to touch
tests/smoke/— the smoke harness;scripts/smoke/if shell-basedtests/integration_*.rs— any test that spawns a daemon (look forspawn_daemon/Command::new("wg").arg("service").arg("daemon")patterns)- Test helper crate / module if shared setup exists
Validation
- Failing test first: integration test that spawns a smoke daemon, kills its parent process abruptly (mid-execution panic), then asserts the daemon process and tmp dir are still cleaned up by the next test session start
- Implementation makes test pass (likely via a session-start sweep + per-test-Drop teardown)
- cargo build + cargo test pass with no regressions
-
Manual: run
cargo test --test smoke(or whatever runs smoke), thenps -ef | grep 'service daemon.*wgsmoke\|--max-agents 0'— should return zero matches;ls /tmp/wgsmoke.* /tmp/.tmp*/.workgraph 2>/dev/nullshould also be empty - Document the cleanup contract in CONTRIBUTING / smoke test README so future test authors know to use the helper
Depends on
Required by
- (none)
Log
- 2026-04-27T17:18:53.248683704+00:00 Task paused
- 2026-04-27T17:19:23.288191706+00:00 Task published
- 2026-04-27T17:24:15.855500959+00:00 Lightweight assignment: agent=Careful Programmer (f5143935), exec_mode=full, context_scope=task, reason=Task is correctness-critical daemon/process cleanup in test harness; Careful Programmer's implementation role and Careful tradeoff (thorough verification, defensive patterns) are ideal for leak-free cleanup and TDD test design.
- 2026-04-27T17:24:16.516726811+00:00 Spawned by coordinator --executor claude --model opus
- 2026-04-27T17:24:23.895827289+00:00 Starting investigation: locate smoke test harness that spawns leaking daemons
- 2026-04-27T17:49:23.793812760+00:00 Task marked as failed: Agent exited with code 1
- 2026-04-27T18:39:11.139741402+00:00 Reset by `wg recover` — reason: openrouter outage cleanup; everything moved to claude:opus
- 2026-04-27T18:39:54.256039057+00:00 Spawned by coordinator --executor claude --model opus
- 2026-04-27T18:40:05.513690385+00:00 Resuming task — inspecting prior agent's WIP changes
- 2026-04-27T18:40:54.096558208+00:00 Task unclaimed: agent 'agent-812' (PID 1982794) process exited
- 2026-04-27T18:40:56.230055499+00:00 Spawned by coordinator --executor claude --model opus
- 2026-04-27T18:56:57.307597519+00:00 Committed: a9a578624 — pushed to origin/wg/agent-770/smoke-tests-leak
- 2026-04-27T19:02:38.322432966+00:00 Task marked as done