Repository navigation
fix(bin): suppress inactivity alerts for captain-held work - #4171
black0rpheus wants to merge 10 commits into
Conversation
…claims Closes the spawn-side half of the worktree-pool-collision guard pair: bin/fm-teardown.sh's require_exclusive_worktree_slot_record (already shipped in kunchenguid#3837) refuses to return a slot another live task's state/*.meta claims, but nothing on the spawn side stopped treehouse from handing a fresh spawn the same slot in the first place. spawn_worktree_slot_conflict_task scans every locally registered Firstmate home's state/*.meta for the candidate worktree before accepting it; a collision sends 'treehouse get' again into the same pane (bounded by FM_SPAWN_SLOT_CONFLICT_RETRIES, default 3) rather than adopting a contested slot, and exhausting every attempt refuses the launch and names the task already holding it. Fixes two pre-existing test fixtures that happened to reuse one fake pane path across sequential spawns within a single test (fm-spawn-dispatch-profile batch tests, fm-spawn-pool-base-freshen's submodule-pin seed helper) - real treehouse never hands a second call the slot an earlier call's still-running task occupies, so those fixtures needed a second, genuinely distinct slot or an explicit teardown between reused spawns to match reality. Fixes kunchenguid#2754, Fixes kunchenguid#3075
…d spawn-side collision guard
…r a just-rejected worktree slot
…rktree as settled
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
The two required workflow runs are currently marked |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0524ef7591
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| FM_HOME="$FM_HOME" FM_STATE_OVERRIDE="$STATE" \ | ||
| "$CAPTAIN_HOLD_BIN" open "$id" >/dev/null 2>&1 |
There was a problem hiding this comment.
Budget the hold probe before advancing the scan
When the supported FM_INACTIVE_RECONCILE_BUDGET_SECS=1 is used, this new synchronous subprocess consumes part of the per-child budget, but the subsequent state read still receives the original timeout. In test_stalled_state_read_is_bounded_and_scan_progresses, after child a times out and terminal child b is visited, the outer backstop consistently kills reconciliation after creating b's pending receipt but before writing .wake-queue; the cursor is already advanced to b, so later scans can stall on a again without surfacing b. Account for this probe in the remaining timeout or recompute the deadline before the state read and publication so detected outcomes still reach the durable wake queue.
AGENTS.md reference: AGENTS.md:L175-L175
Useful? React with 👍 / 👎.
Intent
Prevent completed work awaiting a captain decision from generating repeated inactivity alerts while preserving its evidence and local work unchanged.
What Changed
Risk Assessment
✅ Low: The change is narrowly scoped, uses the authoritative captain-hold predicate after cheap eligibility checks, preserves held-task evidence, and includes behavioral regressions without introducing unrelated components.
Testing
The focused regression suite passed, and isolated live CLI scenarios proved suppression and preservation for dirty and clean captain-held work, reproduced the old alert on the base implementation, and confirmed non-held or unreadable-hold cases still alert normally.
Evidence: HOLD_FOR_CAPTAIN live product validation transcript
Source: HOLD_FOR_CAPTAIN live product validation transcript
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 2 issues found → auto-fixed (3) ✅
bin/fm-inactive-reconcile.sh:496- The intent is limited to “completed work awaiting a captain decision,” but this early return suppresses reconciliation for every captain-held task before determining its current state. A held in-flight task whose run silently transitions tofailedwill produce no inactive failure alert. Narrow suppression to tasks with authoritative completion evidence; broader suppression requires user approval.bin/fm-spawn.sh:3042- The cross-home worktree-slot collision scanner, retry loop, retry configuration, documentation, and associated test suite are unrelated to suppressing inactivity alerts for captain-held completed work. No stated intent requirement needs this component; remove the spawn feature and its supporting changes from this branch.🔧 Fix applied.
1 warning still open:
bin/fm-inactive-reconcile.sh:470- The predicate only needs theopencommand's exit status, but--identityforces a secondtasks-axi showafter the first already established an open captain hold. If that redundant read fails or times out while crew state reports done, the hold is misclassified as absent and an inactivity alert is queued. Remove--identityand the output check; use the successful exit status ofopen "$id".🔧 Fix applied.
1 warning still open:
bin/fm-inactive-reconcile.sh:494- The hold lookup runs before the cheap terminal-ledger and inactivity-age exclusions, so every recently active task triggers a new captain-hold process and repeated tasks-axi compatibility/show probes. A sufficiently populated fleet can exhaust the 10-second scan budget before reaching an actually inactive failed task, delaying its alert by another reconciliation interval. Move the ledger and age checks ahead of this predicate while retaining the hold check before current-state inspection for eligible inactive tasks.🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-inactive-reconcile.test.shIsolated live CLI workflow using realtasks-axi,bin/fm-captain-hold.sh hold/open, and threebin/fm-inactive-reconcile.sh scan --startupinvocations for dirty held workIsolated live CLI workflow for clean local-only held work with an absent endpointLive adversarial scan of completed non-held work using realbin/fm-crew-state.shand a tmux endpointLive base-versus-target counterfactual using the basefm-inactive-reconcile.shexecutable against the same open captain-held taskLive fail-safe scan with an unreadable captain-hold source✅ **Document** - passed
✅ No issues found.
🔧 Fix applied.
1 warning still open:
✅ **Push** - passed
✅ No issues found.