Skip to content

fix(spawn): launch every spawned agent with the compact adviser disabled - #115

Merged
marano merged 1 commit into
mainfrom
fm/fm-upstream-port-launch-staging
Sep 24, 2026
Merged

marano merged 1 commit into
mainfrom
fm/fm-upstream-port-launch-staging

Conversation

@marano

@marano marano commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

Intent

Port two upstream firstmate improvements as our own changes, following the captain's selection to take all eight recommended upstream items once main's CI is healthy. This pass covers the two that edit the same file, bin/fm-spawn.sh. Item 1, upstream #4994: launch-command staging. The launch command measured 950-983 bytes against a roughly 1024-byte truncation limit, which leaves 41 bytes of margin on a live configuration; the fix writes the assembled launch command to a private file and types only a short line that sources it (files: bin/fm-spawn.sh, bin/fm-teardown.sh). Item 8, upstream #4877: set COMPACT_ADVISER_DISABLE=1 for every spawned agent (crewmate, scout, secondmate, fresh spawn and relaunch). Porting rule: port as our own changes through the normal path, do not cherry-pick, because every candidate touches a file this home has already modified and upstream is not merged, rebased onto or re-tracked.

What Changed

  • bin/fm-spawn.sh now prefixes every assembled launch command with export COMPACT_ADVISER_DISABLE=1;. This covers crewmate, scout and secondmate launches, on fresh spawns and relaunches. It also survives raw launch commands, remote secondmates and config/launch-env-allowlist filtering. The pane shell also gets the same export through the existing pre-launch channel, next to GOTMPDIR.
  • docs/configuration.md and the fm-spawn.sh --help header describe the guarantee: it is unconditional, has no config or flag, and applies only to agents Firstmate launches. The doc wording about the launch environment allowlist is adjusted to match.
  • Added tests/fm-spawn-compact-adviser-disable.test.sh and tests/fm-spawn-compact-adviser-disable-remote.test.sh. Both are registered in the backend-dispatch family in bin/fm-test-run.sh. Fixtures and the existing kimi-harness, dispatch-profile and launch-confirm tests were updated for the new export line.
  • The launch-command staging item (upstream #4994, writing the launch command to a private file and typing a short line that sources it) is not in this diff. Only the compact-adviser item (upstream #4877) is.

Item 1 was already solved on main

Item 1 (launch-command staging) was already delivered by #95, which writes the launch command to a private launch file and types only a short line that sources it, so no product change for it is in this PR.
Measured on the longest realistic configuration (task id blu-orgunit-lock-live-tenant-walkthrough, --effort xhigh, an allowlist of 30 names): the longest typed line is 62 bytes against a launch command of several thousand bytes, versus the roughly 1024-byte truncation limit.
This PR adds only a regression case pinning that margin, plus item 8.

Risk Assessment

✅ Low: The change is a small, unconditional export COMPACT_ADVISER_DISABLE=1 placed before the env-clearing wrapper, so it works with and without launch-env filtering, and it comes with tests and docs; the launch-file staging from item 1 was already present in the base, so nothing in the diff contradicts the intent.

Testing

I ran the four spawn test files the diff touches, each as its own run. The two new compact-adviser tests, the launch-confirm test and the dispatch-profile test all showed only passing lines. They exercise spawn, secondmate, relaunch, remote routing and both allowlist postures. The test-runner exit codes came back blank because of how the loop piped the output, so I judged results from the printed ok lines. The item 1 staging behaviour is only covered by an existing launch-confirm test, not by anything in this diff. I saw no screenshots or other artifacts, since this is shell-script behaviour with no UI.

  • Live validation: ✅ go - 6 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Fresh ship spawn starts its agent with COMPACT_ADVISER_DISABLE=1, with or without an allowlist ✅ pass live tests/fm-spawn-compact-adviser-disable.test.sh, first three cases ok
Secondmate spawn and relaunch keep the switch in both allowlist postures ✅ pass live tests/fm-spawn-compact-adviser-disable.test.sh, secondmate and relaunch cases ok
A compound raw launch-command still starts its agent with the switch on ✅ pass live tests/fm-spawn-compact-adviser-disable.test.sh, compound raw launch case ok
A remote-routed second mate keeps the switch through the cleared allowlisted environment ✅ pass live tests/fm-spawn-compact-adviser-disable-remote.test.sh, ALL TESTS PASSED
The longest launch types no line over 62 bytes while the command itself is 4668 bytes (staging beats the ~1024-byte truncation limit) ✅ pass live tests/fm-spawn-launch-confirm.test.sh, 'the longest launch types no line over 62 bytes' ok
Dispatch profiles, harness launches and secondmate launches are not regressed ✅ pass live tests/fm-spawn-dispatch-profile.test.sh, all cases ok

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.

  • Live validation: ✅ go - 6 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Fresh ship spawn starts its agent with COMPACT_ADVISER_DISABLE=1, with or without an allowlist ✅ pass live tests/fm-spawn-compact-adviser-disable.test.sh, first three cases ok
Secondmate spawn and relaunch keep the switch in both allowlist postures ✅ pass live tests/fm-spawn-compact-adviser-disable.test.sh, secondmate and relaunch cases ok
A compound raw launch-command still starts its agent with the switch on ✅ pass live tests/fm-spawn-compact-adviser-disable.test.sh, compound raw launch case ok
A remote-routed second mate keeps the switch through the cleared allowlisted environment ✅ pass live tests/fm-spawn-compact-adviser-disable-remote.test.sh, ALL TESTS PASSED
The longest launch types no line over 62 bytes while the command itself is 4668 bytes (staging beats the ~1024-byte truncation limit) ✅ pass live tests/fm-spawn-launch-confirm.test.sh, 'the longest launch types no line over 62 bytes' ok
Dispatch profiles, harness launches and secondmate launches are not regressed ✅ pass live tests/fm-spawn-dispatch-profile.test.sh, all cases ok
  • mutex bash tests/fm-spawn-compact-adviser-disable.test.sh
  • mutex bash tests/fm-spawn-compact-adviser-disable-remote.test.sh
  • mutex bash tests/fm-spawn-launch-confirm.test.sh
  • mutex bash tests/fm-spawn-dispatch-profile.test.sh
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Every crewmate, scout, and secondmate 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.

Two carriers deliver it: an export in the pane shell beside GOTMPDIR, and an
export at the head of the launch command, which also covers a compound raw
launch and survives the cleared launch environment.

Also pins the launch-file typing from #95 with a case that spawns the longest
real launch (long task id, effort flag, allowlist of thirty names) and bounds
the longest typed line.
@marano
marano merged commit fdbd6e7 into main Sep 24, 2026
16 checks passed
@marano
marano deleted the fm/fm-upstream-port-launch-staging branch September 24, 2026 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant