fix(spawn): launch every spawned agent with the compact adviser disabled - #115
Merged
Merged
Conversation
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.
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
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.shnow prefixes every assembled launch command withexport COMPACT_ADVISER_DISABLE=1;. This covers crewmate, scout and secondmate launches, on fresh spawns and relaunches. It also survives raw launch commands, remote secondmates andconfig/launch-env-allowlistfiltering. The pane shell also gets the same export through the existing pre-launch channel, next toGOTMPDIR.docs/configuration.mdand thefm-spawn.sh --helpheader 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.tests/fm-spawn-compact-adviser-disable.test.shandtests/fm-spawn-compact-adviser-disable-remote.test.sh. Both are registered in thebackend-dispatchfamily inbin/fm-test-run.sh. Fixtures and the existing kimi-harness, dispatch-profile and launch-confirm tests were updated for the new export line.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=1placed 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.
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.
mutex bash tests/fm-spawn-compact-adviser-disable.test.shmutex bash tests/fm-spawn-compact-adviser-disable-remote.test.shmutex bash tests/fm-spawn-launch-confirm.test.shmutex bash tests/fm-spawn-dispatch-profile.test.sh✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.