-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Problem
The daemon marks opencode sessions as stopped within seconds of launch, even though the actual opencode processes run for 20+ minutes and complete their work (opening PRs, etc.). This means:
- No webhook is fired (or fired prematurely when the session hasn't done anything yet)
- The supervisor SOP never triggers for real coding sessions
- The lifecycle fuse (feat: three-prong session lifecycle fuse for opencode adapter #144) doesn't prevent this false detection
Evidence
Two sessions launched on 2026-03-12 at ~9:21 PM PT:
| Session | Started | Stopped (daemon) | Actual runtime | Result |
|---|---|---|---|---|
| d7b63b65 | 04:21:44 UTC | 04:21:54 UTC (10s) | ~20 min | PR #9271 opened |
| 3c623816 | 04:21:52 UTC | 04:21:54 UTC (2s) | ~20 min | PR #9272 opened |
Both marked stopped at the exact same timestamp (04:21:54.644Z), suggesting a batch cleanup/poll false positive rather than individual fuse detection.
No exitCode recorded. No webhooks received by OrgLoop. Supervisor never fired.
Meanwhile, the e2e test sessions (trivial 'echo hello world' prompts) correctly triggered the full webhook → supervisor chain. Those sessions genuinely completed in seconds.
Expected Behavior
The three-prong fuse should:
- Monitor the exit file for the opencode session
- Poll PID liveness (
kill(pid, 0)) - Master timeout as safety net
Only fire session.stopped when one of these signals confirms the session is actually done.
Daemon Context
Daemon PID: 13604, restarted at 21:13 PT (8 min before these launches). Running latest code with #144 (lifecycle fuse) merged.
agentctl status <id> showed stopped correctly, and agentctl list -a doesn't show these sessions at all (pruned from the listing but present in state.json).
Related
- feat: three-prong session lifecycle fuse for opencode adapter #144 (lifecycle fuse — merged)
- feat: three-prong session lifecycle fuse for opencode adapter #145 (PR that merged the fuse)
- OrgLoop
agentctl-supervisorroute relies on accurate lifecycle webhooks