Repository navigation
fix(bin): clear supervisor paths from worker launches - #75
Merged
Merged
Conversation
… wake queue Every pane-backed launch now unsets FM_WAKE_QUEUE, FM_WAKE_QUEUE_LOCK, the home path overrides, FM_SNAPSHOT_CACHE_DIR and the crew-state meta/status overrides before the worker starts, so a worker's own test runs cannot read or write the supervising home's live queue. FM_HOME and the task inbox are kept.
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.
Replaces #74
Intent
Q2249 B (2026-11-18, Jobs page): "Q2249 b" - use the leftover Claude allowance on, among other things, the small fix that stops worker test runs leaking fake notifications into this home's real wake queue.
Seen twice on 2026-11-18: a worker's test drain read /root/firstmate/state/.wake-queue because the worker shell inherited FM_WAKE_QUEUE; later four fake procevent wakes (example-file, flow-source, order-source, remote-source) landed in the real queue.
What Changed
FM_WAKE_QUEUE,FM_WAKE_QUEUE_LOCK,FM_ROOT_OVERRIDE, andFM_STATE_OVERRIDEfrom pane-backed worker launches so workers do not use the supervising home’s queue or state paths.Risk Assessment
✅ Low: This is a small, bounded change: one export at the start of every pane-backed launch, using empty values that every consumer's
:-default treats as unset, plus a test that runs the emitted launch under a supervisor-like pane environment (sh, and fish when installed). The only gap is that the T3 Code worker path and the test-runner unset lists don't apply the same scrub.Testing
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-spawn.sh:7806- The scrub is only added to the pane-backed LAUNCH text, so the same leak can still happen through other paths. fm-wake-lib.sh:10 resolvesFM_WAKE_QUEUE=${FM_WAKE_QUEUE:-$STATE/.wake-queue}, so any inherited non-empty FM_WAKE_QUEUE beats a test's own FM_HOME/STATE. That is exactly the reported sequence: tests/fm-extension-binding.test.sh:2604 runsFM_HOME=$H_EXAMPLE fm-procevent start example-file, and the wake is appended to the supervisor's queue. Paths still exposed:(1) T3 Code ship/scout workers. The
backend=t3codebranch builds T3CODE_ENV (bin/fm-spawn.sh:7866-7868). It clears FM_ROOT_OVERRIDE/FM_STATE_OVERRIDE only for secondmates (7873-7877) and never clears FM_WAKE_QUEUE/FM_WAKE_QUEUE_LOCK. A T3 provider starts from the server's environment, so a T3 server that inherited the supervisor's FM_WAKE_QUEUE passes it to the worker, and that worker's test drain hits the live queue. This is the same 'backend server inherited it' premise the pane fix relies on.(2) The test-run boundary. tests/lib.sh:79-81 and bin/fm-test-run.sh:2852 already unset FM_HOME, FM_ROOT_OVERRIDE and FM_STATE_OVERRIDE so suites start from the environment CI gives them. They leave FM_WAKE_QUEUE and FM_WAKE_QUEUE_LOCK set, so any shell carrying them still leaks: a T3 worker, a worker pane spawned before this fix and not yet relaunched, or the supervisor running a suite directly.
Remedy: add
FM_WAKE_QUEUE= FM_WAKE_QUEUE_LOCK= FM_ROOT_OVERRIDE= FM_STATE_OVERRIDE=to T3CODE_ENV for ship/scout, and add FM_WAKE_QUEUE and FM_WAKE_QUEUE_LOCK to the unset lists in tests/lib.sh:79-81 and bin/fm-test-run.sh:2852. The test-side unset is the earliest shared boundary that protects every test run, however the variable arrived.⏭️ **Test** - skipped
Step was skipped.
✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.