Repository navigation
fix(bin): report quota-stalled workers as agent gone in crew-state - #5952
Open
mehulbhagwani wants to merge 7 commits into
Open
mehulbhagwani wants to merge 7 commits into
mehulbhagwani wants to merge 7 commits into
Conversation
|
mehulbhagwani
force-pushed
the
fm/fm-bug-quota-stall
branch
2 times, most recently
from
September 29, 2026 11:24
132c3fb to
e206c6e
Compare
mehulbhagwani
force-pushed
the
fm/fm-bug-quota-stall
branch
from
October 1, 2026 11:47
e206c6e to
51521cd
Compare
Comment on lines
+1301
to
+1309
| tmux:missing|herdr:missing) | ||
| # A valid ship/scout terminal declaration outranks the death verdict: the | ||
| # harness is gone because the turn finished, not because state is unknown. | ||
| case "$LOG_VERB" in | ||
| "done") | ||
| if [ "$KIND" = ship ]; then | ||
| emit_ship_status_done | ||
| fi | ||
| emit "done" status-log "$(status_line_note "$LOG_LINE")" |
There was a problem hiding this comment.
Dead Secondmate Appears Finished
When a local secondmate’s endpoint is missing or dead and its status log ends in done: or failed:, this branch reports the terminal status and exits before reporting the lost endpoint. The readable shell-only check excludes secondmates, but this new override does not. Consumers of crew state therefore miss the secondmate’s liveness failure.
Knowledge Base Used: Disable endless escalation for dead agent records
…ed in script header
A shell-only pane with no attributed run was reporting unknown on the dead-endpoint path before a valid ship/scout done: or failed: status could be preserved. Check the status log first on every death-class verdict.
This reverts commit 51521cd526d6cd38a27d64da0178dee38b476a86.
A documentation pass committed a full duplicate of tests/fm-crew-state.test.sh as tests/crewstate_targeted_run.sh; it is not a test entry point and only duplicates the real suite.
mehulbhagwani
force-pushed
the
fm/fm-bug-quota-stall
branch
from
October 2, 2026 12:58
51521cd to
26f878d
Compare
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Make every open mehulbhagwani PR on kunchenguid/firstmate clean for Kun to merge.
PRs: #5954 #5953 #5952 #5951 #5919 #5709 #4932
For each: checkout that PR head branch on origin/fork, rebase onto current upstream main, fix red CI (behavior portable serial jobs), ensure no-mistakes attestation head_sha MATCHES PR head, push to the PR branch (update existing PR in place — do NOT open new PRs), confirm CI green and mergeable CLEAN.
Priority: 5954 and 5952 already green—verify still clean; then 5953, 5951 red serial jobs; 5919 conflicts; 5709 attestation mismatch; 4932 two serial fails.
Do not merge on Kun's repo (no authority). Leave PRs ready. Report final status table.
Fix all 7 fast.
This run validates and updates existing PR #5952 in place (branch fm/fm-bug-quota-stall on the mehulbhagwani fork): crew-state surfaces agent-free, quota-stalled workers. A readable endpoint holding only its shell (harness exited, for example on a provider usage-limit error) reads unknown/none as agent gone before stale busy or non-terminal status evidence can report working, while a valid ship/scout terminal done: or failed: declaration is still preserved on that shell-only path. A later commit that copied the done/failed override into every unreadable dead/missing/unreachable endpoint branch was reverted: it broke the existing contract that a missing window ignores a stale status log (CI 'dead window -> unknown'), and Greptile flagged that it made a dead secondmate look finished. A stray full duplicate of the crew-state test suite (tests/crewstate_targeted_run.sh) was removed. The branch was rebased onto main, so the push must update the existing PR branch (force with lease) and the PR body attestation must bind to the new head. Do not open a new PR.
What Changed
bin/fm-crew-state.sh: when a readable endpoint holds only its shell (the harness exited, for example after a provider usage-limit error), crew-state now reportsunknown/none(agent gone) before stale busy or non-terminal status evidence can reportworking. A valid ship/scout terminaldone:orfailed:declaration is still honored on that shell-only path. Unreadable dead/missing/unreachable endpoints keep their existing behavior, including ignoring a stale status log when the window is missing.tests/fm-crew-state.test.sh: adds cases covering the shell-only agent-gone path, including that stale busy/non-terminal status does not read as working and that terminaldone:/failed:declarations are preserved.Risk Assessment
✅ Low: The change adds one narrowly gated early check in a read-only status script. It applies only to tmux and herdr endpoints that are readable and positively classified as agent-gone, it excludes secondmates, and it keeps the terminal done/failed handling the existing path uses.
Testing
I ran the crew-state suite, which runs the real fm-crew-state.sh against fixture endpoints. The new tests for the quota-stalled shell-only pane and for terminal status on a shell-only endpoint passed. The second full run had 285 ok and no failures. One earlier run failed once on 'a killed reader reports the same unavailable reader path'. That failure is unrelated to this change and passed on rerun, so I treat it as flaky. I did not launch a live Herdr or tmux harness, so no scenario was driven against the real running product.
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
bash tests/fm-crew-state.test.sh(twice, fixture-based)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.