Repository navigation
fix(spawn): pre-trust worktree mise configs for every harness - #49
Conversation
Reviewer's GuidePre-trusts each worker worktree by propagating it through MISE_TRUSTED_CONFIG_PATHS for pane launches and T3 Code harness environments, with shell-compatibility, backend, and configuration tests documenting the behavior and its non-persistent trust model. Sequence diagram for worktree mise trust during worker launchsequenceDiagram
participant Spawn as fm-spawn.sh
participant Prefix as fm_launch_mise_env
participant Shell as Pane shell
participant Prep as Task prep
participant Mise as mise
participant Agent as Worker harness
Spawn->>Prefix: fm_launch_mise_env(WT, LAUNCH)
Prefix-->>Spawn: shell-safe MISE_TRUSTED_CONFIG_PATHS prefix
Spawn->>Shell: Source filtered launch command
Shell->>Shell: Append WT to inherited trust
Shell->>Prep: Run launch command and task prep
Prep->>Mise: mise env
Mise-->>Prep: Load configs beneath WT without prompt
Prep->>Agent: Start worker
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
Hey - I've found 3 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="bin/fm-launch-mise-env-lib.sh" line_range="11-12" />
<code_context>
+ # The pane shell, fish included, parses only test, &&, || and export here;
+ # inherited trust expands in the destination shell, after filtering.
+ # shellcheck disable=SC2016
+ printf '[ -n "$MISE_TRUSTED_CONFIG_PATHS" ] && export MISE_TRUSTED_CONFIG_PATHS="$MISE_TRUSTED_CONFIG_PATHS":%s || export MISE_TRUSTED_CONFIG_PATHS=%s; %s' \
+ "$quoted" "$quoted" "$2"
+}
</code_context>
<issue_to_address>
**Untrusted configs execute automatically**
When a worker runs on a project containing a contributor-controlled mise config with executable behavior and its prep or agent invokes mise, the launch prefix adds the entire worker directory to `MISE_TRUSTED_CONFIG_PATHS`, and the T3 Code environment does the same, so mise skips its trust gate and loads the contributor-controlled config under the worker's account. A config with executable behavior can then run code with that account's access when the prep or agent invokes mise.
Require an explicit trust opt-in for each project before adding its directory to `MISE_TRUSTED_CONFIG_PATHS`, or keep mise's trust confirmation in place for untrusted projects.
Also at `bin/fm-spawn.sh:7327`, `bin/fm-spawn.sh:7397`.
</issue_to_address>
### Comment 2
<location path="bin/fm-launch-mise-env-lib.sh" line_range="11" />
<code_context>
+ # The pane shell, fish included, parses only test, &&, || and export here;
+ # inherited trust expands in the destination shell, after filtering.
+ # shellcheck disable=SC2016
+ printf '[ -n "$MISE_TRUSTED_CONFIG_PATHS" ] && export MISE_TRUSTED_CONFIG_PATHS="$MISE_TRUSTED_CONFIG_PATHS":%s || export MISE_TRUSTED_CONFIG_PATHS=%s; %s' \
+ "$quoted" "$quoted" "$2"
+}
</code_context>
<issue_to_address>
**Colon paths corrupt mise trust**
When the resolved worktree path contains `:`, `fm_launch_mise_env` and the T3 `MISE_TRUSTED_CONFIG_PATHS=$WT` assignment serialize the path as multiple list entries, so mise misses the worktree config or trusts a path outside it; the worker launch prompts or fails, or loads an unintended config.
Preserve colon-containing worktree paths as a single mise trust entry, or refuse the launch rather than emitting split entries.
Also at `bin/fm-spawn.sh:7327`, `bin/fm-launch-mise-env-lib.sh:12`.
</issue_to_address>
### Comment 3
<location path="bin/fm-launch-mise-env-lib.sh" line_range="11" />
<code_context>
+ # The pane shell, fish included, parses only test, &&, || and export here;
+ # inherited trust expands in the destination shell, after filtering.
+ # shellcheck disable=SC2016
+ printf '[ -n "$MISE_TRUSTED_CONFIG_PATHS" ] && export MISE_TRUSTED_CONFIG_PATHS="$MISE_TRUSTED_CONFIG_PATHS":%s || export MISE_TRUSTED_CONFIG_PATHS=%s; %s' \
+ "$quoted" "$quoted" "$2"
+}
</code_context>
<issue_to_address>
**Later pane commands retain trust**
When a sourced launch command returns to an interactive pane, the launch prefix exports the worktree path without restoring the prior `MISE_TRUSTED_CONFIG_PATHS`, so later commands in that pane continue trusting it, including after the worktree is reused or during unrelated mise invocations.
Scope the trust setting to the launch command or restore the pane's prior value when that command returns.
Also at `bin/fm-spawn.sh:7397`.
</issue_to_address>| printf '[ -n "$MISE_TRUSTED_CONFIG_PATHS" ] && export MISE_TRUSTED_CONFIG_PATHS="$MISE_TRUSTED_CONFIG_PATHS":%s || export MISE_TRUSTED_CONFIG_PATHS=%s; %s' \ | ||
| "$quoted" "$quoted" "$2" |
There was a problem hiding this comment.
🟠 High · Untrusted configs execute automatically
When a worker runs on a project containing a contributor-controlled mise config with executable behavior and its prep or agent invokes mise, the launch prefix adds the entire worker directory to MISE_TRUSTED_CONFIG_PATHS, and the T3 Code environment does the same, so mise skips its trust gate and loads the contributor-controlled config under the worker's account. A config with executable behavior can then run code with that account's access when the prep or agent invokes mise.
Require an explicit trust opt-in for each project before adding its directory to MISE_TRUSTED_CONFIG_PATHS, or keep mise's trust confirmation in place for untrusted projects.
Also at bin/fm-spawn.sh:7327, bin/fm-spawn.sh:7397.
Prompt for AI agents
In `bin/fm-launch-mise-env-lib.sh` at lines 11-12:
**Untrusted configs execute automatically**
When a worker runs on a project containing a contributor-controlled mise config with executable behavior and its prep or agent invokes mise, the launch prefix adds the entire worker directory to `MISE_TRUSTED_CONFIG_PATHS`, and the T3 Code environment does the same, so mise skips its trust gate and loads the contributor-controlled config under the worker's account. A config with executable behavior can then run code with that account's access when the prep or agent invokes mise.
Require an explicit trust opt-in for each project before adding its directory to `MISE_TRUSTED_CONFIG_PATHS`, or keep mise's trust confirmation in place for untrusted projects.
Also at `bin/fm-spawn.sh:7327`, `bin/fm-spawn.sh:7397`.| # The pane shell, fish included, parses only test, &&, || and export here; | ||
| # inherited trust expands in the destination shell, after filtering. | ||
| # shellcheck disable=SC2016 | ||
| printf '[ -n "$MISE_TRUSTED_CONFIG_PATHS" ] && export MISE_TRUSTED_CONFIG_PATHS="$MISE_TRUSTED_CONFIG_PATHS":%s || export MISE_TRUSTED_CONFIG_PATHS=%s; %s' \ |
There was a problem hiding this comment.
🟡 Medium · Colon paths corrupt mise trust
When the resolved worktree path contains :, fm_launch_mise_env and the T3 MISE_TRUSTED_CONFIG_PATHS=$WT assignment serialize the path as multiple list entries, so mise misses the worktree config or trusts a path outside it; the worker launch prompts or fails, or loads an unintended config.
Preserve colon-containing worktree paths as a single mise trust entry, or refuse the launch rather than emitting split entries.
Also at bin/fm-spawn.sh:7327, bin/fm-launch-mise-env-lib.sh:12.
Prompt for AI agents
In `bin/fm-launch-mise-env-lib.sh` at line 11:
**Colon paths corrupt mise trust**
When the resolved worktree path contains `:`, `fm_launch_mise_env` and the T3 `MISE_TRUSTED_CONFIG_PATHS=$WT` assignment serialize the path as multiple list entries, so mise misses the worktree config or trusts a path outside it; the worker launch prompts or fails, or loads an unintended config.
Preserve colon-containing worktree paths as a single mise trust entry, or refuse the launch rather than emitting split entries.
Also at `bin/fm-spawn.sh:7327`, `bin/fm-launch-mise-env-lib.sh:12`.| # The pane shell, fish included, parses only test, &&, || and export here; | ||
| # inherited trust expands in the destination shell, after filtering. | ||
| # shellcheck disable=SC2016 | ||
| printf '[ -n "$MISE_TRUSTED_CONFIG_PATHS" ] && export MISE_TRUSTED_CONFIG_PATHS="$MISE_TRUSTED_CONFIG_PATHS":%s || export MISE_TRUSTED_CONFIG_PATHS=%s; %s' \ |
There was a problem hiding this comment.
🟡 Medium · Later pane commands retain trust
When a sourced launch command returns to an interactive pane, the launch prefix exports the worktree path without restoring the prior MISE_TRUSTED_CONFIG_PATHS, so later commands in that pane continue trusting it, including after the worktree is reused or during unrelated mise invocations.
Scope the trust setting to the launch command or restore the pane's prior value when that command returns.
Also at bin/fm-spawn.sh:7397.
Prompt for AI agents
In `bin/fm-launch-mise-env-lib.sh` at line 11:
**Later pane commands retain trust**
When a sourced launch command returns to an interactive pane, the launch prefix exports the worktree path without restoring the prior `MISE_TRUSTED_CONFIG_PATHS`, so later commands in that pane continue trusting it, including after the worktree is reused or during unrelated mise invocations.
Scope the trust setting to the launch command or restore the pane's prior value when that command returns.
Also at `bin/fm-spawn.sh:7397`.…ests went stale after this PR's change. Since round 2, every pane launch line begins with the mise trust statement, so `unset TRACEPARENT; ` is now the second statement on the line, not the first. Two tests still required it to be first: `tests/fm-trace-context-spawn.test.sh:397` ("failed metadata append must unset TRACEPARENT in the launch command", shard 3) and `tests/fm-control-relaunch.test.sh:677` ("disabled relaunch must clear the pane carrier before replacement launch", shard 11). The spawn code still behaves correctly. Rule both tests protect: when the trace record fails or tracing is off, the launch line must clear TRACEPARENT before the agent starts. It does: the line now begins with the mise trust statement, followed by `unset TRACEPARENT; …claude`. Fix: I changed only those two assertions so they require each line to begin with exactly the mise trust statement for that test's worktree, then `unset TRACEPARENT; `, and to contain claude. The expected statement comes from the existing `fm_test_launch_mise_prefix`, using `$WT_DIR` in one test and the case's `$dir/wt` in the other, which is how earlier rounds fixed the other exact launch checks. I found no other tests that require a particular statement at the start of a launch line. No product code changed. Verification: - `tests/fm-trace-context-spawn.test.sh` passes completely. - The edited relaunch test passes when run alone. - shellcheck reports nothing on both files. The full `fm-control-relaunch` suite still fails on this machine, but in other tests. They wait at most 5 seconds for marker files, and the machine's load average was about 7.6. Those tests passed in the CI run. When I briefly raised their waits as a diagnostic (since reverted), the one that had failed passed
…in `tests/fm-startup-network.test.sh`: "summary did not retain and report its capped deadline". This PR didn't cause it. The PR doesn't touch fm-startup-network, fm-home-summary-refresh or their tests, and the same shard passed in the previous CI run of this PR. Round 2 only changed two assertions in other shards. **Cause:** the test races against the clock. `bin/fm-startup-network.sh` caps the home-summary budget to the stage time left, `seconds_until "$stage_deadline"`. That value is counted in whole epoch seconds from `started` and only computed after the worker has spawned and taken a couple of locks. When a second boundary passes in between, which is likely on a loaded runner, the cap is 4 and the summary logs "refresh exceeded its 4-second deadline". The test looked for the fixed string `5-second deadline`. The CI timestamps fit this: the summary started around 09:35:38 and the failure came at 09:35:53, which is the 5s bound plus the test's full 10s wait loop. The expected line never showed up. **Rule the test protects:** the summary's 60s timeout must be capped to the stage budget (5s here), and the log must report that capped deadline. Both the wait loop and the final assertion read this log line, and they were the only places with the hardcoded value. **Fix (test only, no product code changed):** in `tests/fm-startup-network.test.sh`, the wait loop and the final check now use one pattern, `its [1-5]-second deadline` (grep -E), with a comment explaining why the cap can be 4. It still fails if the deadline isn't capped: a 60s deadline doesn't match. **Verification:** - `bash tests/fm-startup-network.test.sh` passes fully on this machine; it also passed before the edit, since the race is timing-dependent. - `shellcheck -x` reports nothing on the file. - Against sample log lines, the old string missed the 4s case and the new pattern matches it. Both match 5s, and both reject 60s
|
Final disposition for head 4bea50f (review ledger).
|
Intent
Observed 2026-10-06 on a Pi worker launched into bbchat: the launch shell sourced the task prep script, which invoked mise in a fresh treehouse worktree; mise asked 'config files are not trusted. Trust them?' and the agent never started until firstmate ran mise trust on the worktree and pressed Enter. Claude workers do not hit it because their recipes pass MISE_TRUSTED_CONFIG_PATHS. Fix: fm-spawn (or the prep script) pre-trusts the worktree's mise config, e.g. mise trust /mise.toml or MISE_TRUSTED_CONFIG_PATHS in the launch environment, for every harness, with a test.
What Changed
fm-spawn.shnow prefixes every pane launch command with a statement from the newbin/fm-launch-mise-env-lib.sh. The statement adds the resolved worktree toMISE_TRUSTED_CONFIG_PATHSbefore the launch command or task prep runs. It appends to any trust the destination already has, keeps working afterenv -iallowlist filtering, and parses in sh, bash, zsh and fish. This prevents the interactive "config files are not trusted" prompt that blocked fresh worktrees. Nothing runsmise trustor writes to a persistent trust store.MISE_TRUSTED_CONFIG_PATHS=<worktree>. This literal value replaces any inherited trust instead of extending it.tests/fm-launch-mise-env.test.sh, which checks quoting, inherited and filtered trust, and parsing in each pane shell. Adds afm_test_launch_mise_prefixhelper totests/lib.shand updates the launch-layout assertions in the t3code, kimi and dispatch-profile suites. Documents the behavior indocs/configuration.mdanddocs/t3code-backend.md.🤖 Generated with Claude Code
Risk Assessment
Testing
I drove real
fm-spawn.shworker launches in disposable lab homes on private tmux servers. At the base commit the pane hung on mise's interactive trust prompt, which reproduces the incident. At the target commit the prep's interactivemise envloaded the worktree config and the agent command started. This held for a root mise.toml, for a repo whose only config is .config/mise.toml, under a real fish 4.9.3 pane (inherited trust appended), under allowlist filtering, and for a real Pi worker whose process environment carried the trust. A sibling directory's config stayed untrusted, and no mise trusted-configs entry or Pi trust store change was written. The T3 Code path is covered only by its focused tests: running it live needs a captain-issued credential. The focused mise, launch-assertion and kimi tests also pass with fish on PATH. All labs, pools and temp files were torn down. Evidence is text pane captures, prep outputs and process environments; there is no UI surface.Evidence: Baseline (base commit) worker pane stuck on mise trust prompt
Source: Baseline (base commit) worker pane stuck on mise trust prompt
$ . '/tmp/fm-mise0313f95e+…/launch…sh' mise config files in ~/.treehouse-fm/dd674b0adb8e/.treehouse/bb-181538/1/bb are not trusted. Trust them? Yes No All ←/→ toggle • y/n/a/enter submit (still blocked when recaptured ~25s later)Evidence: Baseline prep output (agent never reached)
Source: Baseline prep output (agent never reached)
Evidence: Target worker pane: prep completes, agent starts
Source: Target worker pane: prep completes, agent starts
Evidence: Target prep output: worktree mise.toml loaded, sibling refused
Source: Target prep output: worktree mise.toml loaded, sibling refused
MISE_TRUSTED_CONFIG_PATHS=~/.treehouse-fm/33ff665011b7/.treehouse/bb-0d613d/1/bb export FM_MISE_PROBE=root-mise-toml-loaded mise-env-rc=0 mise ERROR Config files in /tmp/fmmise.nySLpk/sibling/mise.toml are not trusted. sibling-rc=1Evidence: .config/mise.toml-only repo: loaded under target
Source: .config/mise.toml-only repo: loaded under target
Evidence: Fish pane shell pane capture
Source: Fish pane shell pane capture
Evidence: Fish pane prep output: inherited trust appended
Source: Fish pane prep output: inherited trust appended
MISE_TRUSTED_CONFIG_PATHS=/opt/existing-trust:~/.treehouse-fm/3e78934e0f08/.treehouse/bb-a56a28/1/bb export FM_MISE_PROBE=root-mise-toml-loaded mise-env-rc=0 sibling-rc=1Evidence: Allowlist (env -i) launch: wrapper and agent environments
Source: Allowlist (env -i) launch: wrapper and agent environments
Evidence: Real Pi worker process environment carries worktree trust
Source: Real Pi worker process environment carries worktree trust
MISE_TRUSTED_CONFIG_PATHS=/.treehouse-fm/133bc2bd6d37/.treehouse/bb-56f8de/1/bb PWD=/.treehouse-fm/133bc2bd6d37/.treehouse/bb-56f8de/1/bbEvidence: Disposable lab driver used for all live spawns
Source: Disposable lab driver used for all live spawns
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-launch-mise-env-lib.sh:7- The trust list only names four root filenames (mise.toml, .mise.toml, .mise/config.toml, .tool-versions), so any other committed config mise loads from the worktree still prompts for trust. That includes .config/mise.toml, .config/mise/config.toml, mise/config.toml, .config/mise/conf.d/*.toml, mise.$MISE_ENV.toml, mise.local.toml, and configs in subdirectories a prep script cd's into. I checked this against the installed mise 2026.10.19 with an isolated state dir. With a worktree containing mise.toml plus .config/mise.toml (or mise.local.toml), setting MISE_TRUSTED_CONFIG_PATHS=<wt>/mise.toml still fails with the untrusted-config error. Setting MISE_TRUSTED_CONFIG_PATHS=<wt> (the directory) trusts everything because mise matches entries by path prefix. A trust entry reached through a symlinked path also matched, so canonicalization is not a concern. Failure case: a repo whose only config is .config/mise.toml gets an untrusted error under a non-interactive launch, or a blocking 'Trust them?' prompt in the launch shell, which is exactly the hang the intent asks to fix. Smaller and complete fix: drop the filename loop and add "$WT" itself to MISE_TRUSTED_CONFIG_PATHS, keeping the existing quoting and inherited-trust prefix. Then update the matching filename lists in the bin/fm-spawn.sh:427-430 header comment, docs/configuration.md:1495-1496, and the per-filename and no-config cases in tests/fm-launch-mise-env.test.sh.bin/fm-spawn.sh:7323- The intent requires pre-trusting the worktree's mise config 'for every harness'. The change only rewrites the pane LAUNCH command (bin/fm-spawn.sh:7395). Workers on the T3 Code backend get their environment from T3CODE_ENV (bin/fm-spawn.sh:7323) instead, and this change deliberately leaves them out (docs/configuration.md:1500: 'T3 Code's server-started provider has no command-launch environment and is not covered'). So a claude or codex worker spawned on backend=t3code that runs mise in its fresh treehouse worktree still hits the untrusted-config error. T3CODE_ENV already carries the pane's other pre-launch facts value for value, so adding "MISE_TRUSTED_CONFIG_PATHS=$WT" there would be a one-line extension. Because the author excluded this path on purpose, please confirm whether T3 Code workers fall under 'every harness'.🔧 Fix applied.
3 issues (2 warnings, 1 info) still open:
bin/fm-launch-mise-env-lib.sh:7- The trust list only names four root filenames (mise.toml, .mise.toml, .mise/config.toml, .tool-versions), so any other committed config mise loads from the worktree still prompts for trust. That includes .config/mise.toml, .config/mise/config.toml, mise/config.toml, .config/mise/conf.d/*.toml, mise.$MISE_ENV.toml, mise.local.toml, and configs in subdirectories a prep script cd's into. I checked this against the installed mise 2026.10.19 with an isolated state dir. With a worktree containing mise.toml plus .config/mise.toml (or mise.local.toml), setting MISE_TRUSTED_CONFIG_PATHS=<wt>/mise.toml still fails with the untrusted-config error. Setting MISE_TRUSTED_CONFIG_PATHS=<wt> (the directory) trusts everything because mise matches entries by path prefix. A trust entry reached through a symlinked path also matched, so canonicalization is not a concern. Failure case: a repo whose only config is .config/mise.toml gets an untrusted error under a non-interactive launch, or a blocking 'Trust them?' prompt in the launch shell, which is exactly the hang the intent asks to fix. Smaller and complete fix: drop the filename loop and add "$WT" itself to MISE_TRUSTED_CONFIG_PATHS, keeping the existing quoting and inherited-trust prefix. Then update the matching filename lists in the bin/fm-spawn.sh:427-430 header comment, docs/configuration.md:1495-1496, and the per-filename and no-config cases in tests/fm-launch-mise-env.test.sh.bin/fm-spawn.sh:7323- The intent requires pre-trusting the worktree's mise config 'for every harness'. The change only rewrites the pane LAUNCH command (bin/fm-spawn.sh:7395). Workers on the T3 Code backend get their environment from T3CODE_ENV (bin/fm-spawn.sh:7323) instead, and this change deliberately leaves them out (docs/configuration.md:1500: 'T3 Code's server-started provider has no command-launch environment and is not covered'). So a claude or codex worker spawned on backend=t3code that runs mise in its fresh treehouse worktree still hits the untrusted-config error. T3CODE_ENV already carries the pane's other pre-launch facts value for value, so adding "MISE_TRUSTED_CONFIG_PATHS=$WT" there would be a one-line extension. Because the author excluded this path on purpose, please confirm whether T3 Code workers fall under 'every harness'.bin/fm-spawn.sh:7341- Added in fix round 1 (T3 Code coverage). On backend=t3code, MISE_TRUSTED_CONFIG_PATHS is written as a literal value into Claude's .claude/settings.local.json env block or Codex's shell_environment_policy.set table. Neither of those sinks expands variables. So when the worktree has a mise config, any MISE_TRUSTED_CONFIG_PATHS that the T3 server process passed down to its provider is replaced, not extended. The pane path keeps it with ${MISE_TRUSTED_CONFIG_PATHS:+...:}. docs/configuration.md:1499 documents the difference, and neither harness config format offers a way to extend the value, so this is an accepted tradeoff, not a defect. Relaunch cleanup works through FM_T3CODE_ENV_KEYS ownership and the codex overlay journal, so a stale value does not persist.🔧 Fix applied.
5 issues (2 errors, 2 warnings, 1 info) still open:
bin/fm-launch-mise-env-lib.sh:7- The trust list only names four root filenames (mise.toml, .mise.toml, .mise/config.toml, .tool-versions), so any other committed config mise loads from the worktree still prompts for trust. That includes .config/mise.toml, .config/mise/config.toml, mise/config.toml, .config/mise/conf.d/*.toml, mise.$MISE_ENV.toml, mise.local.toml, and configs in subdirectories a prep script cd's into. I checked this against the installed mise 2026.10.19 with an isolated state dir. With a worktree containing mise.toml plus .config/mise.toml (or mise.local.toml), setting MISE_TRUSTED_CONFIG_PATHS=<wt>/mise.toml still fails with the untrusted-config error. Setting MISE_TRUSTED_CONFIG_PATHS=<wt> (the directory) trusts everything because mise matches entries by path prefix. A trust entry reached through a symlinked path also matched, so canonicalization is not a concern. Failure case: a repo whose only config is .config/mise.toml gets an untrusted error under a non-interactive launch, or a blocking 'Trust them?' prompt in the launch shell, which is exactly the hang the intent asks to fix. Smaller and complete fix: drop the filename loop and add "$WT" itself to MISE_TRUSTED_CONFIG_PATHS, keeping the existing quoting and inherited-trust prefix. Then update the matching filename lists in the bin/fm-spawn.sh:427-430 header comment, docs/configuration.md:1495-1496, and the per-filename and no-config cases in tests/fm-launch-mise-env.test.sh.bin/fm-spawn.sh:7323- The intent requires pre-trusting the worktree's mise config 'for every harness'. The change only rewrites the pane LAUNCH command (bin/fm-spawn.sh:7395). Workers on the T3 Code backend get their environment from T3CODE_ENV (bin/fm-spawn.sh:7323) instead, and this change deliberately leaves them out (docs/configuration.md:1500: 'T3 Code's server-started provider has no command-launch environment and is not covered'). So a claude or codex worker spawned on backend=t3code that runs mise in its fresh treehouse worktree still hits the untrusted-config error. T3CODE_ENV already carries the pane's other pre-launch facts value for value, so adding "MISE_TRUSTED_CONFIG_PATHS=$WT" there would be a one-line extension. Because the author excluded this path on purpose, please confirm whether T3 Code workers fall under 'every harness'.bin/fm-spawn.sh:7341- Added in fix round 1 (T3 Code coverage). On backend=t3code, MISE_TRUSTED_CONFIG_PATHS is written as a literal value into Claude's .claude/settings.local.json env block or Codex's shell_environment_policy.set table. Neither of those sinks expands variables. So when the worktree has a mise config, any MISE_TRUSTED_CONFIG_PATHS that the T3 server process passed down to its provider is replaced, not extended. The pane path keeps it with ${MISE_TRUSTED_CONFIG_PATHS:+...:}. docs/configuration.md:1499 documents the difference, and neither harness config format offers a way to extend the value, so this is an accepted tradeoff, not a defect. Relaunch cleanup works through FM_T3CODE_ENV_KEYS ownership and the codex overlay journal, so a stale value does not persist.bin/fm-launch-mise-env-lib.sh:10- The new launch prefixexport MISE_TRUSTED_CONFIG_PATHS=${MISE_TRUSTED_CONFIG_PATHS:+"$MISE_TRUSTED_CONFIG_PATHS":}'<wt>'; ...uses POSIX${…:+…}parameter expansion. In the default mode (no launch-env allowlist), the launch file is sourced directly by the pane shell (bin/fm-spawn.sh:7524,. '<launch file>'). The repo explicitly supports fish pane shells: bin/fm-spawn.sh:7250 says "The pane shell, fish included, only parses a simple command, &&, || and that export list", bin/fm-git-strip-ai-trailers.sh:39 says the same, and tests/fm-spawn-dispatch-profile.test.sh:543-572 sources the launch file withfish -c "source …"and rejects${as "syntax fish cannot parse". Fish rejects${VAR}at parse time ("Variables cannot be bracketed"), sosourceruns nothing from the file and the worker never starts. Concrete sequence: a fish-pane user spawns any harness on tmux or herdr with no allowlist, the pane sources the launch file, fish reports a parse error, and no agent launches. The original commit emitted this prefix only when a root mise config existed. Fix round 2 (mise-config-filenames-incomplete) made it unconditional at bin/fm-spawn.sh:7397, so now every launch on a fish pane fails, including repos with no mise config. Related sites: the call site bin/fm-spawn.sh:7397. The fish test in tests/fm-spawn-dispatch-profile.test.sh:546-551 will fail wherever fish is installed. Its no-fish static check (tests/lib.sh:113 fm_test_launch_git_prefix) only inspects the Git prefix, so it does not catch this. tests/fm-launch-mise-env.test.sh exercises only /bin/sh. Remedy: emit a fish-safe statement that keeps the documented append semantics. One option follows the existing Git env-file pattern (bin/fm-spawn.sh:7254-7256): a helper reads the inherited value and writes a plainexport MISE_TRUSTED_CONFIG_PATHS='…'into the private launch dir, which the launch then sources. Another option uses${…}only inside the/bin/sh -cwrapper when LAUNCH_ENV_ENABLED=1. Then add a fish case (or the static fish-token check) for the mise prefix to the focused test.bin/fm-spawn.sh:7397- Fix round 2 madefm_launch_mise_envprependexport MISE_TRUSTED_CONFIG_PATHS=…;to every pane launch. Before that, it was only added when a root mise config existed, and the test fixtures have none. Existing tests compare the staged launch file (captured by tests/fixtures.sh:228-252) with an exact string that starts withexport COMPACT_ADVISER_DISABLE=1; …, and round 2 did not update them. Every launch now starts with the mise export, so these exact-equality checks fail: tests/fm-spawn-dispatch-profile.test.sh:600 (raw launch escape hatch), tests/fm-spawn-dispatch-profile.test.sh:2452 (the claude_expected_launch helper used by many claude launch cases), tests/fm-kimi-harness.test.sh:388, and tests/fm-kimi-harness.test.sh:773. Update these expectations to include the mise trust prefix for the case's resolved worktree, in whatever form the fish-safe fix produces, so they assert the new contract instead of failing.🔧 Fix applied.
1 info still open:
bin/fm-spawn.sh:7341- Added in fix round 1 (T3 Code coverage). On backend=t3code, MISE_TRUSTED_CONFIG_PATHS is written as a literal value into Claude's .claude/settings.local.json env block or Codex's shell_environment_policy.set table. Neither of those sinks expands variables. So when the worktree has a mise config, any MISE_TRUSTED_CONFIG_PATHS that the T3 server process passed down to its provider is replaced, not extended. The pane path keeps it with ${MISE_TRUSTED_CONFIG_PATHS:+...:}. docs/configuration.md:1499 documents the difference, and neither harness config format offers a way to extend the value, so this is an accepted tradeoff, not a defect. Relaunch cleanup works through FM_T3CODE_ENV_KEYS ownership and the codex overlay journal, so a stale value does not persist.✅ **Test** - passed
✅ No issues found.
bash tests/fm-launch-mise-env.test.sh(with and without a downloaded static fish 4.9.3 on PATH; the fish run covers sh, bash and fish pane shells sourcing the launch file)Lab driver (evidence lab-driver.sh): bin/fm-lab-home.sh lab home checked out at a given ref, private tmux server via fm-lab-home tmux-dir, lab project with an untrusted committed mise config plus scripts/prep.sh that runsmise envwith stdin and stderr on the pane tty, realbin/fm-spawn.sh <id> <proj> --mode local-only --yolo on --harness 'sh scripts/prep.sh … && sleep 3600'on backend tmux (treehouse get worktree)Baseline at 40429373: same lab and spawn; pane captured twice, about 25s apartTarget at c5f99599: root mise.toml, bash paneTarget: .config/mise.toml only, bash paneTarget: fish 4.9.3 as the pane/treehouse shell with inherited MISE_TRUSTED_CONFIG_PATHS=/opt/existing-trustTarget: config/launch-env-allowlist (env -i filtering) with inherited trust not allowlisted; read /proc/<agent>/environ from the pane's process treeTarget: real--harness piworker; read the pi process's /proc environ; Pi trust.json sha256 compared before and afterFM_TEST_ONLY=test_spawn_leases_slot_creates_thread_and_starts_launch_turn|test_spawn_codex_scout_writes_toml_env_with_traceparent|test_spawn_secondmate_runs_thread_in_home_with_env bash tests/fm-backend-t3code.test.shSelected cases with fish on PATH: test_launch_preserves_inherited_git_config, test_active_dispatch_profile_allows_raw_launch_command, test_chained_raw_launch_strips_ai_trailer_in_every_step, test_claude_threads_model_and_effort (fm-spawn-dispatch-profile), test_kimi_launch_then_send_is_verified, test_kimi_falls_back_to_expanded_home_binary (fm-kimi-harness)Teardown check: every lab tmux server killed, lab pools under ~/.treehouse-fm removed (directory list matches the pre-run snapshot), ~/.treehouse unchanged, /tmp lab and task dirs removed, worktree clean✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
Summary by Sourcery
Pre-trust each worker worktree's mise configuration so fresh workers start without interactive trust prompts across all supported harnesses and backends.
Bug Fixes:
Enhancements:
Documentation:
Tests: