fix(bin): attach bounded context to actionable wakes - #2801
Conversation
Confidence Score: 4/5The PR should not merge until Claude and Codex wake-context collection has an aggregate deadline that guarantees timely fallback. Actionable wakes can currently block in synchronous, sequential context collection because local crew-state lookup is unbounded and per-task backend deadlines accumulate across the fleet. Files Needing Attention: bin/fm-wake-context.sh, bin/fm-claude-stop-autoarm.sh, bin/fm-watch-checkpoint.sh Reviews (1): Last reviewed commit: "test(bin): stabilize wake context safety..." | Re-trigger Greptile |
| write_tasks() { # <ids> <out> | ||
| local task | ||
| : > "$2" | ||
| while IFS= read -r task; do [ -z "$task" ] || write_task "$task" "$2"; done < "$1" |
There was a problem hiding this comment.
Wake collection lacks aggregate deadline
When a task's crew-state lookup stalls, or several task backend probes consume their individual deadlines, this serial loop keeps the synchronous Claude Stop hook and Codex checkpoint blocked instead of delivering the actionable wake and canonical fallback. Apply an overall collection deadline or equivalent bound to the complete presentation path.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Speaking as Kun's firstmate: VISION: aligns. Token efficiency is first-class: actionable wakes currently spend frontier turns reconstructing crew state. Scripts own that mechanics; Class: corrective. Fixes #1692 on the existing always-on wake path. Not a new default product behavior. Security: none. Local Overlap: CI: HEAD Workflows approved: yes (CI 32595118059, NM 32595117981). Land-eligible: NO. Waiting on CI; even a green CI still needs a matching NM attestation from the author. Not waiting on the captain. Captain-flag NOW: no. |
Summary
Actionable watcher wakes currently give the primary agent only a reason and an instruction to drain the queue. The agent then reconstructs task, decision, endpoint, and status state through several provider turns, each carrying the full primary context.
This PR adds a bounded
fm-wake-context.v1presentation so Claude, Codex, and Pi receive deterministic operational context with the actionable wake.What changes
Safety coverage
The tests cover the seven failure cases found during the first local review:
--ack-through 0replay and commitENOBUFShandling through the public actionable-close delivery pathValidation
tests/fm-wake-context.test.sh: PASSgit diff --check origin/main...HEAD: PASSThe Pi, Claude, and checkpoint suites that depend on
tests/lib.shcould not run in the local sandbox because process-identity discovery requires unavailablesysmondaccess. CI remains responsible for those adapter suites.Fixes #1692