Repository navigation
fix(afk): deliver Codex wake events reliably via native submit confirmation - #8314
artburkart wants to merge 14 commits into
Conversation
[Medium impact] The reviewed changes appear safe to merge; no new actionable issue remains. Reviews (8) · Last reviewed commit: "no-mistakes(ci): Fixed ci-1 (Greptile) b..." · Reviewed by Greptile |
|
Speaking as Kun's firstmate: thank you @artburkart, and welcome. Moving Codex digests onto Herdr's native Where it stands: waiting on you for two things.
When both are done, please re-raise with FYI, not blocking: the Known limitation you listed is noted for Kun's decision. Callers without Contract-class (my own read): new-default. For every unconfigured Herdr+Codex home, delivery moves from paste/Enter to a native prompt with no retry. Digest receipts and the daemon/primary drain split also change unconfigured presentation behaviour. So once the full suite is green, this goes to Kun for a merge-or-leave decision and won't auto-merge. VISION.md: aligns on every rule except two I can't settle yet: adapter verification (the live evidence above) and whether the ambiguity hold surfaces to the captain. Both are covered by the asks above. |
d192161 to
c490eda
Compare
|
Thanks for the review.
The decision on default delivery for Herdr+Codex homes is Kun's to make. |
|
Speaking as Kun's firstmate: thanks @artburkart. The rollback fix looks right: both position files now travel with the buffer, and Where it stands: waiting on you for two things.
After both are in, this goes to the maintainer suite and then to Kun for a decision on the default change. |
A drain that reaches the primary session publishes delivery receipts the daemon honors, while the daemon's own queue drain does not, so classification still sees events its own drain read.
…moved wherever the escalation buffer is discarded (fm-afk-start clear_stale_artifacts, fm-afk-return clear_delivery_artifacts, fm-afk-launch restore); extended the clear-stale unit test. ci-2: escalate_flush_frozen now writes the native-unconfirmed ambiguity marker when INJECT_RETRY_UNSAFE is set, so ambiguous frozen digests are held; added test_frozen_native_ambiguity_holds. fm-afk-launch tests passed. fm-daemon.test.sh ran 174 passing, 0 failing, including the new test, before hitting the 590s timeout, so the remainder of that file did not run
…h rollback The away-mode launch backup and rollback loops preserved the escalation buffer but not its .positions and .frozen-positions sidecars, so a failed launch restored the buffer without its delivery receipts. Back up and restore both sidecars with the buffer, and add a regression test.
The live submit-confirm e2e treated Codex as ready once its composer read empty, but Herdr's agent status can still report unknown for several seconds afterwards, so the native submit guard refused the send. Also wait, bounded, for Herdr to report the agent idle or done, and fail with the last observed status on timeout. The submit guard itself is unchanged.
4eefa90 to
aa0d5dd
Compare
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
…ch before sending. The daemon's retry hold is keyed to its own harness, but the Herdr backend picks native Codex submission from the pane's live identity. In `bin/backends/herdr.sh`, `fm_backend_herdr_send_text_submit` now returns `send-failed` without submitting when the pane is Codex and `FM_HERDR_EXPECTED_HARNESS` is set to something other than `codex`. A non-Codex daemon targeting a Codex pane via `FM_SUPERVISOR_TARGET` can therefore no longer send natively without `INJECT_RETRY_UNSAFE` being set. Callers that don't set the expected harness (direct `fm-send`, etc.) behave as before, and the daemon path for a Codex daemon is unchanged. I added the regression test `test_send_text_submit_refuses_codex_pane_when_expected_harness_differs` to `tests/fm-backend-herdr.test.sh`. It uses a Codex pane with the expected harness set to `claude`, and asserts the result is `send-failed` and nothing is prompted or typed. `bash tests/fm-backend-herdr.test.sh` exited 0 with 256 `ok` lines and no `not ok`. I did not run the daemon test suite
|
Speaking as Kun's firstmate: thanks @artburkart. The clean re-raise landed: the attestation binds I read the whole diff at Where it stands: waiting on you for one thing, the live Codex evidence. Thanks for trying the opt-in e2e. I can see the Herdr lab never reported running within 60 seconds, so no Codex case ran. This PR still replaces the default delivery path for every Herdr home with a Codex primary, so we need Contract-class: new-default (my own read, unchanged). Once the live evidence is in and CI is green, we run the full suite, and then this goes to Kun as a decision on the default change. |
|
Live evidence for the native Codex route, run on macOS at head The Codex scenario sends a 6,000-character prompt through Herdr's native An earlier live run found that the guard's Codex readiness check could fire before Herdr's native status settled. |
|
Speaking as Kun's firstmate: thanks @artburkart, that's the evidence I asked for. The live run at Where it stands: nothing is waiting on you now. It's waiting on us. The head is unchanged, the attestation binds it with no skipped steps, the quick checks pass, Greptile is 5/5 and all four threads are resolved. The next step is the full suite. We're holding all new full-suite runs until main is green again: main currently fails Contract-class: new-default (my own read, unchanged). It changes the default delivery path for every Herdr home with a Codex primary. Once the full suite is green, it goes to Kun as a merge-or-leave decision rather than auto-merging. |
|
Speaking as Kun's firstmate: thanks @artburkart. Nothing is waiting on you. Every author-side gate is met on |
What Changed
bin/backends/herdr.sh) and the classifier (bin/fm-classify-lib.sh) gain native-submit confirmation for Codex wake injection. Ambiguous or unconfirmed submits are marked and held rather than blindly retried.bin/fm-supervise-daemon.sh,bin/fm-wake-drain.sh) track delivery positions and frozen digests alongside the escalation buffer. Primary receipts start at the confirmed delivery cursor, and a stale wedge no longer keeps a captured endpoint.fm-afk-start,fm-afk-returnandfm-afk-launchnow clear or restore the positions and frozen-positions sidecars wherever the escalation buffer is discarded or rolled back. Docs are updated, and tests are added or extended for the daemon, herdr backend, AFK launch, lifecycle e2e and the live herdr submit-confirm e2e.Risk Assessment
✅ Low: The changes are bounded to supervision delivery and receipt handling, with no substantiated remaining defect or intent contradiction after accounting for recorded decisions.
Testing
I tried the live Herdr+Claude submit-confirm e2e with its opt-in flag. The isolated Herdr lab session never reported running within 60s, and a second manual provision attempt via bin/fm-herdr-lab.sh failed the same way. Live Codex scenarios therefore went untested. As a fallback I ran tests/fm-backend-herdr.test.sh and tests/fm-daemon.test.sh. Both exited 0, but they use stubs, so they establish no live result. The working tree is clean.
bin/fm-herdr-lab.sh provisionattempts (the e2e test's own and a manual one) failed: the lab session never reported running within 60s. A working Herdr server in this sandbox would let this be…Evidence: live submit e2e log
Source: live submit e2e log
Evidence: backend test log
Source: backend test log
Evidence: daemon test log
Source: daemon test log
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
bin/fm-herdr-lab.sh provisionattempts (the e2e test's own and a manual one) failed: the lab session never reported running within 60s. A working Herdr server in this sandbox would let this be…FM_HERDR_SUBMIT_CONFIRM_LIVE=1 bash tests/fm-herdr-submit-confirm-live-e2e.test.sh (provisioning failed)bin/fm-herdr-lab.sh prepare/provision of a probe lab (provision failed; teardown refused for a missing tripwire)bash tests/fm-backend-herdr.test.sh (exit 0, stubbed)bash tests/fm-daemon.test.sh (exit 0, stubbed)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.