fix(bin): sync upstream compact-adviser and captain-hold due fixes - #11
Merged
Merged
Conversation
…id#4854) Captain holds have no due semantics and are a hold kind, not a Beads issue type. The create path now waives due.required and maps to native type task. Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(bin): launch every spawned agent with the compact adviser disabled Every crewmate, scout, and secondmate Firstmate launches now starts with COMPACT_ADVISER_DISABLE=1, on a fresh spawn and on a relaunch alike, so an unattended session never activates the compact adviser. The value is unconditional: no configuration file gates it and there is no override, unlike the trace carrier beside it. Three carriers deliver it, because no single one covers every launch shape. The pane shell receives an export beside GOTMPDIR, so the agent's own children inherit it too. The launch command carries an explicit assignment, prepended outermost so it wins over any ambient value the pane already held. The cleared launch environment sets it again at the `env -i` boundary and keeps COMPACT_ADVISER_DISABLE in the fixed operational floor, which is what preserves the switch when config/launch-env-allowlist empties the environment, and what delivers it on a remote host that never had the value. bin/fm-control.sh relaunch, the bootstrap secondmate relaunch, and the remote secondmate transport all rebuild their launch through bin/fm-spawn.sh, so they inherit the same floor. The captain's own primary session is untouched. The two new suites drive the real spawn and then execute the launch command the pane actually received, with the harness replaced by a probe that prints its own environment, rather than matching script text. They cover ship and secondmate launches with the allowlist absent and enabled, the pane export and its ordering, fm-control.sh relaunch, and the full parent to remote-host chain. * no-mistakes(review): Export compact-adviser disable across compound launches * no-mistakes(document): Document spawned-agent compact-adviser environment guarantee
…hold coverage list
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
Captain asked to bring firstmate's fork back in line: move the primary checkout back to main (it had drifted onto a feature branch, 'my-changes', with an unrelated botched merge-conflict artifact left in bin/fm-backend.sh) and sync main with the parent/upstream repo (kunchenguid/firstmate) so origin is at the same level as upstream. This branch is a pure fast-forward merge of upstream/main (2 commits already reviewed and merged upstream: disable compact adviser for spawned agents kunchenguid#4877, and create captain-hold rows when Beads requires due kunchenguid#4854) with no local changes on top - content is unchanged from upstream, same shape as the prior sync-upstream-2026-09-17 branch.
What Changed
bin/fm-spawn.shnow unconditionally exportsCOMPACT_ADVISER_DISABLE=1into every crewmate, scout, and secondmate launch — via theLAUNCHcommand prefix, the pane pre-launch export, the cleared-environment (env -i) floor, and theLAUNCH_ENV_PREFIXallowlist path — so a spawned agent never activates the compact adviser, regardless of raw launches, remote secondmates, or relaunches.bin/fm-captain-hold.shholdnow creates a missing captain row withBD_DUE_REQUIRED=false tasks-axi add --kind captain, waiving Beads'due.requiredpolicy instead of inventing a synthetic due date or registering atypes.customcaptain issue type.bin/fm-test-run.shroutes the two new compact-adviser test files into thebackend-dispatchtest family;tests/fixtures.sh,tests/fm-captain-hold-lifecycle.test.sh,tests/fm-kimi-harness.test.sh, andtests/fm-spawn-dispatch-profile.test.shgained corresponding coverage, and two new test files (fm-spawn-compact-adviser-disable.test.sh,fm-spawn-compact-adviser-disable-remote.test.sh) were added.docs/configuration.mdanddocs/captain-hold-lifecycle.mddocument both behaviors: the compact-adviser kill switch's launch coverage and the captain-hold row creation's due-waiver semantics.🤖 Generated with Claude Code
Risk Assessment
✅ Low: The diff is an exact fast-forward of two already upstream-reviewed commits (kunchenguid#4877, kunchenguid#4854) with no local modifications, no leftover merge-conflict artifacts in bin/fm-backend.sh, and the changed shell logic (env-assignment ordering for COMPACT_ADVISER_DISABLE, BD_DUE_REQUIRED waiver) and new tests are correct and behavior-verifying rather than source-grepping.
Testing
Confirmed the branch is a clean fast-forward sync of the two named upstream commits with no leftover artifacts, and all executable diff-relevant tests passed; one new Beads-specific test self-skipped due to a missing Beads backend in this sandbox, an environment limitation rather than a code defect.
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
git merge-base --is-ancestor to confirm fast-forward ancestrygit diff --stat over base..target to confirm diff scope matches the two named commitsgrep for conflict markers in bin/fm-backend.shbash tests/fm-spawn-compact-adviser-disable.test.shbash tests/fm-spawn-compact-adviser-disable-remote.test.shbash tests/fm-spawn-dispatch-profile.test.shbash tests/fm-kimi-harness.test.shscoped run of the new captain-hold regression testgit status to confirm clean worktree✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.