Repository navigation
fix(terminal): give plain fish tabs Orca's codex function without changing fish's startup - #24284
Conversation
…nging fish's startup A `codex` typed into a plain fish tab ran without --no-daemon because only wrapped fish tabs (startup command / ready marker) got Orca's codex function. Plain fish spawns now prepend an Orca data dir to XDG_DATA_DIRS and record the exact prefix in ORCA_FISH_XDG_DATA_DIRS_PREFIX. Fish sources the dir's fish/vendor_conf.d snippet, which first restores XDG_DATA_DIRS (unset again if it was unset), erases the marker, drops its dir from fish's derived vendor/function/ completion paths, then defines the shared fish codex function at the first prompt so the user's config.fish still wins. fish argv is unchanged; wrapped tabs keep their existing -C path. A local fallback to another shell restores the user's XDG_DATA_DIRS instead of deleting it. Bumps the terminal daemon protocol to v39 so new tabs move to a daemon that injects the env; v38 owners stay attachable. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
| export function getLocalShellReadyWrapperPaths(root: string): readonly string[] { | ||
| const zshDir = `${root}/zsh` | ||
| return [`${zshDir}/.zshenv`, `${zshDir}/${ZSH_WRAPPER_DIR_MARKER_FILE}`, `${root}/bash/rcfile`] | ||
| return [ |
There was a problem hiding this comment.
If the fish snippet cannot be written while the zsh and bash wrapper files are available, the shared whole-tree check still marks every wrapper unusable. Those shells then lose their startup integration because of a fish-only file failure; checking availability per shell would keep the failure contained.
Knowledge Base Used: Terminal runtime and interaction
There was a problem hiding this comment.
ℹ️ No critical issues — one coverage observation below.
Reviewed changes
- Plain fish gets an env-only launch config —
local-pty-shell-ready.tsanddaemon/shell-ready.tsnow returnargs: nullplus anXDG_DATA_DIRSprefix for markerless fish, leavingfish -lbyte-for-byte; wrapped fish (ready / startup command) is untouched. - New
fish-xdg-data-dirs-handoff.ts— prepends<wrapperRoot>/fish-xdg-datatoXDG_DATA_DIRS, records the exact prefix inORCA_FISH_XDG_DATA_DIRS_PREFIX, and supplies both a NoderestoreFishXdgDataDirstwin and thefish/vendor_conf.dsnippet that undoes the prefix (env,__fish_vendor_*dirs,fish_function_path,fish_complete_path) then definescodexon the firstfish_prompt. - Both wrapper filesets emit the snippet — local and daemon trees, written through the existing content-addressed machinery; wrapper-path existence checks include it so stale trees rebuild.
- Fallback restore —
spawnShellWithFallbackhands the user's ownXDG_DATA_DIRSback before scrubbing stale launch keys and no longer deletes it, since restore owns that key. - Protocol bump 38 → 39 —
daemon-protocol-version.tsand the local-build compatibility contract, with the attachable list and version tests updated. Wrapped fish deliberately keeps its-Cpath so no tab runs both mechanisms.
ℹ️ The snippet's real-fish behavior is not exercised by CI
The only tests that drive the snippet through an actual fish are gated on resolveFishBinary() and skip when fish is absent, and the shell contracts CI job — the one lane that installs fish and sets ORCA_REQUIRE_FISH=1 — runs a fixed file list that does not include fish-xdg-data-dirs-handoff.test.ts. In the normal shards the whole describe.skipIf(!fish.available) block skips, so the load-bearing behavior (fish actually sources vendor_conf.d, the restore yields state identical to a no-Orca fish, and a typed codex becomes the function at the first prompt) is verified only on developer machines. The unit tests that do run cover the Node env helpers and the snippet's contents, but nothing asserts that fish parses the emitted script as intended.
Technical details
# Real-fish coverage only runs off CI
## Affected sites
- `src/main/fish-xdg-data-dirs-handoff.test.ts` — `describe.skipIf(!fish.available)('fish vendor snippet in a real fish', ...)` covers the env round-trip, path cleanup, typed-codex wrapping, opt-out and config.fish precedence, but is skipped whenever fish is not installed.
- `.github/workflows/pr.yml` — the `shell contracts` job's "Test real shell contracts" step enumerates an explicit file list; `fish-xdg-data-dirs-handoff.test.ts` is not on it. Other live-fish suites (e.g. `src/main/pty/codex-shell-no-daemon.test.ts`) are.
## Required outcome
The snippet's end-to-end behavior should be guarded by CI, not only by manual runs, so a later change to the generated fish script (or a fish version difference on the runner) cannot pass green while the mechanism is broken.
## Suggested approach
Add `src/main/fish-xdg-data-dirs-handoff.test.ts` to the `shell contracts` step's `vitest run` list. Optionally mirror the other live-fish suites by asserting `fishRequirementViolation(lookup)` is null in an always-running test in the file.
## Open questions for the human
Is the omission intentional (e.g. runtime budget), or is the file simply not yet wired into that lane?DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (14)
💤 Files with no reviewable changes (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughFish shell launches can receive an Orca vendor configuration directory through Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The Fish handoff preserves launch arguments, restores inherited environment values, and retains protocol v38 compatibility according to the supplied changes. No actionable merge-blocking issue is established; merge after normal checks pass. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change stays within user-owned terminal startup and preserves important cleanup, user-override, and opt-out controls. No security regression is demonstrated, but startup-file integrity, downstream hook preparation, and older-daemon behavior are only partially established. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…_DIRS fish never reads vendor_conf.d under -N/--no-config (also abbreviated or clustered), so the snippet could not undo the prefix; and the restore cannot tell an empty XDG_DATA_DIRS from an unset one. Both now launch untouched. Run the real-fish handoff tests in the shell contracts job, where fish is required, so they no longer skip in CI. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
-N/--no-configand emptyXDG_DATA_DIRSnow skip the handoff —getFishXdgDataDirsLaunchEnvreturns{}when fish args disable config loading (-N,-lN,--no-c+, matched by the newfishArgsSkipConfig) or when inheritedXDG_DATA_DIRSis'', so no prefix is injected that the snippet could never undo.shellArgsplumbed to the handoff decision — the daemon plan passesuserShellArgsand simplifies the arg expression touserShellArgs ?? shellLaunch.args ?? ['-l']; the local plan captures{ inheritedXdgDataDirs, shellArgs }before the closure re-runs. Both are behavior-preserving for wrapped fish.- Prior coverage gap closed —
fish-xdg-data-dirs-handoff.test.tsis now in theshell contractsCI list and gains an always-runningfishRequirementViolationassertion, so a missing fish fails rather than silently skipping the load-bearing real-fish tests. - New launch-env test —
fish-xdg-data-dirs-no-config-launch.test.tsdrives both the daemon and local spawn paths and assertsXDG_DATA_DIRSis left untouched for-N/--no-config/-lNwhile a plain-lstill hands off.
Verified the two changed test files pass locally (35 passed | 7 skipped; the skipped block is the real-fish suite, absent on this host).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Ubuntu runners ship snapd's fish vendor snippet, which sets XDG_DATA_DIRS on every fish start, so "unset" was never the right oracle there. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Made the unset-restore fish test environment-robust — the
restores an unset XDG_DATA_DIRScase infish-xdg-data-dirs-handoff.test.tsnow compares thexdg=/XDG_DATA_DIRS=/child-cleanprobe lines against a baseline fish run without Orca, instead of hardcodingxdg=unset. A distro vendor snippet (e.g. Ubuntu's snapd) that setsXDG_DATA_DIRSitself no longer trips the assertion. Themarker-leftandnot.toContain(root)checks are retained, so the env round-trip and fish-path cleanup remain covered.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…ets the codex hook Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
| return {} | ||
| } | ||
| // Why empty counts as unset: fish and the XDG spec read both as the default, so restoring '' as unset is invisible. | ||
| const prefix = inheritedXdgDataDirs ? dataDir : `${dataDir}:${XDG_DATA_DIRS_DEFAULT}` |
There was a problem hiding this comment.
Empty XDG loads vendor directories
If a plain tab uses fish older than 4.7 and inherits an explicitly empty XDG_DATA_DIRS, this branch adds /usr/local/share:/usr/share. Those fish versions would not search those vendor directories with an empty value. If either directory contains vendor scripts, the tab can run startup code the user's environment excluded; vendor function and completion paths also remain for the session. The snippet removes Orca's directory, but does not undo the added default directories.
Knowledge Base Used: Terminal runtime and interaction
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- An empty
XDG_DATA_DIRSis now handled like unset —getFishXdgDataDirsLaunchEnvdropped theinheritedXdgDataDirs === ''skip, so a plain fish tab launched with an explicitly empty variable gets thedataDir:/usr/local/share:/usr/shareprefix and, after the snippet's restore, ends with the variable unset rather than empty. The rationale holds: fish and the XDG spec read''and unset as the same default, so the tab's own path derivation is unchanged and only the set-empty-versus-unset distinction for children differs. - Unit test updated to pin the new contract — the empty case now asserts the exact launch env (
{ XDG_DATA_DIRS: '<dataDir>:/usr/local/share:/usr/share', ORCA_FISH_XDG_DATA_DIRS_PREFIX: <same> }) andrestoreFishXdgDataDirsdeleting both keys, replacing the priortoEqual({})skip assertion.
Verified locally: src/main/fish-xdg-data-dirs-handoff.test.ts, src/main/fish-xdg-data-dirs-no-config-launch.test.ts, and src/main/providers/local-pty-utils.test.ts — 50 passed, 7 skipped (the real-fish block, absent on this host). The prior review's coverage gap is closed (the file is on the shell contracts CI list). No inline comments.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
The primary shell's launch config now records the pre-launch value of each key it writes. A fallback shell restores those values (unsetting keys that had none) instead of deleting the keys, which hands back an inherited XDG_DATA_DIRS after a fish fallback and an inherited ZDOTDIR after a zsh->bash fallback, with no per-shell special case. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ippet - Remove restoreFishXdgDataDirs; the generic fallback restore covers it. - Snippet: read ":$XDG_DATA_DIRS:" directly and filter Orca's vendor dirs with one string match per variable. - Require inheritedXdgDataDirs in both getShellLaunchConfig option shapes. - Drop the test-only FISH_XDG_DATA_DIRS_HANDOFF_DAEMON_PROTOCOL_VERSION. - Fix stale fish comments and trim redundant -N launch cases. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
|
||
| set -l orca_fish_dir (string split -m 1 : -- $prefix)[1]/fish | ||
| for var in __fish_vendor_confdirs __fish_vendor_functionsdirs __fish_vendor_completionsdirs fish_function_path fish_complete_path | ||
| set $var (string match -v -- "$orca_fish_dir/*" $$var) |
There was a problem hiding this comment.
Fish cleanup removes user paths If the wrapper root contains a literal
* or ?, fish treats it as part of this match pattern rather than as part of the directory name. The cleanup can then remove unrelated user search paths, making functions or completions disappear from this tab.
Knowledge Base Used: Terminal runtime and interaction
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Restored the user's own launch env on shell fallback —
local-pty-finalize-environment.tsnow capturesprimaryPreLaunchEnv(the value each launch-env key had before Orca wrote it) andspawnShellWithFallbackrestores those values per attempt instead of deleting the keys, so a fish→zsh fallback hands back the user'sXDG_DATA_DIRSand a zsh→bash fallback hands back an inheritedZDOTDIR. The per-attempt recompute unwinds the previous fallback's own env before applying the next. - Dropped the Node restore twin and its protocol constant —
restoreFishXdgDataDirsand the unusedFISH_XDG_DATA_DIRS_HANDOFF_DAEMON_PROTOCOL_VERSIONare gone;PROTOCOL_VERSIONstays39and the attachable list is unchanged. The captured-preLaunchEnv path fully supersedes the twin. - Simplified the fish vendor snippet — the XDG restore no longer pre-joins
$XDG_DATA_DIRS, and the five fish path variables are cleaned with onestring match -v -- "$orca_fish_dir/*"each, replacing the nestedcontains/set -eloops. - Tightened the launch-config signatures — both transports take an optional options object,
local-pty-shell-ready.tstakesfishLaunch?, and the tests that only exercise wrapped shells now passinheritedXdgDataDirs: undefined.
Verified locally: pnpm tc clean; local-pty-utils.test.ts, fish-xdg-data-dirs-no-config-launch.test.ts, fish-xdg-data-dirs-handoff.test.ts, and codex-launch-shell-wrapping.test.ts all pass (45 passed, 7 skipped — the real-fish block, fish absent on this host).
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Merged
origin/main(71766487) into the branch — the only new commit is a merge-up (d36d30a4);incrementalDiffPathis null and the merge carries no authored logic delta. Two of the PR's own files picked up main's newer content:.github/workflows/pr.yml(main's CI routing rework) andsrc/main/providers/local-pty-launch-plan.ts(main's unconditionalensureNodePtySpawnHelperExecutable(), dropping thecanUseBunPtyguard). - The branch's authored edits survive the merge —
git diff d36d30a4 71766487is exactlyprimaryPreLaunchEnvinlocal-pty-launch-plan.tsplus thefish-xdg-data-dirs-handoff.test.tsline in theshell contractslist; nothing else diverges from main. No conflict-resolution code. - Merged tree verified —
fish-xdg-data-dirs-handoff.test.ts,fish-xdg-data-dirs-no-config-launch.test.ts,local-pty-utils.test.ts,codex-launch-shell-wrapping.test.ts, andlocal-pty-pi-owner-env.test.ts: 48 passed, 7 skipped (the real-fish block, absent on this host). All prior Pullfrog review threads are resolved; the prior review stands.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
Only XDG_DATA_DIRS is restored, by exact prefix; Orca's dir holds nothing but this snippet, so leaving it on fish's derived paths loads nothing else and drops the glob match.
There was a problem hiding this comment.
ℹ️ No critical issues — one stale comment to clean up, plus a PR-body inconsistency.
Reviewed changes
Reviewed the delta since the prior pullfrog review (a2c0027, “stop scrubbing fish's lookup paths after the handoff”) against 2baf2c1, which is 2 files (test + source).
- Dropped the fish derived-path scrub —
__orca_fish_xdg_handoffnow restores onlyXDG_DATA_DIRSby exact prefix and no longer strips Orca's dir from__fish_vendor_*dirs,fish_function_path, orfish_complete_path. The wrapper dir holds only the snippet, so nothing else loads from it; re-sourcing the snippet is idempotent (the marker is gone, so the function returns early). No functional regression found. - Simplified the real-fish tests to match — removed the
fishScansXdgDefaultWhenUnsetversion probe and the separate unset-restore case, foldingundefinedinto the baselineit.each;STATE_PROBEno longer prints the derived path variables.
ℹ️ Nitpicks
- The PR body's Testing bullet "
$__fish_vendor_confdirsis identical to a fish started without Orca" now contradicts the mechanism section, which states Orca's directory stays on fish's derived paths. Update or drop the bullet.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
…nging fish's startup (stablyai#24284) * fix(terminal): give plain fish tabs Orca's codex function without changing fish's startup A `codex` typed into a plain fish tab ran without --no-daemon because only wrapped fish tabs (startup command / ready marker) got Orca's codex function. Plain fish spawns now prepend an Orca data dir to XDG_DATA_DIRS and record the exact prefix in ORCA_FISH_XDG_DATA_DIRS_PREFIX. Fish sources the dir's fish/vendor_conf.d snippet, which first restores XDG_DATA_DIRS (unset again if it was unset), erases the marker, drops its dir from fish's derived vendor/function/ completion paths, then defines the shared fish codex function at the first prompt so the user's config.fish still wins. fish argv is unchanged; wrapped tabs keep their existing -C path. A local fallback to another shell restores the user's XDG_DATA_DIRS instead of deleting it. Bumps the terminal daemon protocol to v39 so new tabs move to a daemon that injects the env; v38 owners stay attachable. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * fix(fish): skip the XDG handoff for -N/--no-config and empty XDG_DATA_DIRS fish never reads vendor_conf.d under -N/--no-config (also abbreviated or clustered), so the snippet could not undo the prefix; and the restore cannot tell an empty XDG_DATA_DIRS from an unset one. Both now launch untouched. Run the real-fish handoff tests in the shell contracts job, where fish is required, so they no longer skip in CI. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * test(fish): compare the unset-restore case against a fish without Orca Ubuntu runners ship snapd's fish vendor snippet, which sets XDG_DATA_DIRS on every fish start, so "unset" was never the right oracle there. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * fix(fish): treat an empty XDG_DATA_DIRS like unset so the tab still gets the codex hook Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * fix(pty): put back the user's own launch env on a shell fallback The primary shell's launch config now records the pre-launch value of each key it writes. A fallback shell restores those values (unsetting keys that had none) instead of deleting the keys, which hands back an inherited XDG_DATA_DIRS after a fish fallback and an inherited ZDOTDIR after a zsh->bash fallback, with no per-shell special case. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * refactor(fish): drop the Node restore twin and simplify the vendor snippet - Remove restoreFishXdgDataDirs; the generic fallback restore covers it. - Snippet: read ":$XDG_DATA_DIRS:" directly and filter Orca's vendor dirs with one string match per variable. - Require inheritedXdgDataDirs in both getShellLaunchConfig option shapes. - Drop the test-only FISH_XDG_DATA_DIRS_HANDOFF_DAEMON_PROTOCOL_VERSION. - Fix stale fish comments and trim redundant -N launch cases. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * refactor(fish): stop scrubbing fish's lookup paths after the handoff Only XDG_DATA_DIRS is restored, by exact prefix; Orca's dir holds nothing but this snippet, so leaving it on fish's derived paths loads nothing else and drops the glob match. * docs(fish): drop the comment for the removed vendor-dir cleanup --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]> Backport: keeps PROTOCOL_VERSION at 38. This release replaces v37 (1.4.218) services anyway, and main's v39 also carries later daemon work this branch lacks. (cherry picked from commit ae41eb4)

ELI5
Orca has a small
codexhelper that starts Codex in a way that keeps each tab's agent status separate. fish tabs only got that helper when Orca was already launching something in them. If you opened a normal fish tab and typedcodexyourself, you got plain Codex, and it shared one background server across tabs. Now every fish tab gets the helper, and fish still starts exactly the way it did before.What Changed
Before: in a plain fish tab (no startup command),
type codexshowed the binary. A hand-typedcodexran without--no-daemon, so Codex 0.156+ started its shared background server and per-tab agent status broke.After: in a plain fish tab,
codexis Orca's function fromsrc/shared/codex-shell-function.ts, and a hand-typedcodexgets--no-daemon(it already did in zsh and bash). Nothing else in the shell changes:fish -l.XDG_DATA_DIRSis back to its original value, or unset again if it was unset.codexfunction or alias still wins, andORCA_CODEX_ISOLATE=0still opts out.Mechanism. fish loads startup snippets from
<dir>/fish/vendor_conf.dfor every directory inXDG_DATA_DIRS. This is the standard way a terminal adds shell integration to fish without changing its arguments, and it plays the same role as the zsh wrapper'sZDOTDIRhand-back.fish-xdg-data/fish/vendor_conf.d/orca-shell-integration.fish. It is built by the same content-addressed fileset machinery, for both the in-process provider and the terminal daemon.XDG_DATA_DIRSand records the exact prefix it added inORCA_FISH_XDG_DATA_DIRS_PREFIX.XDG_DATA_DIRS(or unsets the variable if nothing is left), and erases the marker. Orca's directory stays in the lookup paths fish already derived from it for that session; it holds only this snippet, so nothing else loads from it.fish_prompthandler that runs the shared fish codex definition, unchanged. That definition runs afterconfig.fish, the same timing wrapped tabs have today. So acodexthe user defines inconfig.fish, or adds toPATHthere, is seen first.XDG_DATA_DIRSafter a fish fallback, and also an inheritedZDOTDIRafter a zsh→bash fallback.When
XDG_DATA_DIRSwas unset, Orca adds the XDG spec default (/usr/local/share:/usr/share) after its own directory. fish 4.7 and newer scans exactly those directories when the variable is unset, so the resulting paths are identical; this was checked against Homebrew fish 4.9.3 at/opt/homebrew. fish older than 4.7 used a different default when unset (its own data directory, or nothing). On those versions a plain Orca tab also searches/usr/local/share/fish/vendor_*.d. Nothing fish loaded before is dropped, and the variable itself is still restored to unset.Daemon: the terminal daemon spawns these shells, so
PROTOCOL_VERSIONgoes 38 → 39 (same pattern as #23907). New tabs move to a daemon that sets the env; v38 owners stay attachable.Why
--init-command": that changes how every fish tab starts, and we rejected it earlier. The env approach leaves argv alone and cleans up after itself before the user'sconfig.fishruns.-Cpath byte-for-byte, and plain tabs use the vendor snippet. No shell ever runs both. If both ever did run, the shared definition only wraps whentype -t codexisfile, so the second run would do nothing. Moving wrapped tabs onto the snippet as well would have changed when theircodexgets defined, and would have made them depend on the wrapper tree being written. I kept them unchanged.getFishCodexShellLaunchPreflight()verbatim, and a test checks that.Related: Linear STA-9051.
Linked Issue
Related: STA-9051 (Linear). Follow-up to #23900 / #23933 / #23907.
Visual Proof
N/A. There is nothing visible in the UI; the change is in shell startup. Terminal transcripts are under Testing.
Testing
Live in a real Orca-spawned tab, macOS: isolated headless runtime (
orca-dev serve,ORCA_BACKGROUND_LAUNCH=1 ORCA_DISABLE_MACOS_LOGIN_SHELL=1, throwaway user data, HOME and CODEX_HOME). A fakecodexwas first on PATH, andcommand -v codexconfirmed it was the fake. Homebrew fish 4.9.3, served by the v39 daemon:/opt/homebrew/bin/fish -l.type codexshows the function.XDG_DATA_DIRSis unset, the marker is gone,envhas no Orca entries, andconfig.fishran.$__fish_vendor_confdirsmatches a fish started without Orca, plus Orca's own directory, which holds only the snippet.complete -C 'brew 'andcomplete -C 'docker 'return the same counts (117 and 58) with and without Orca, so Homebrew vendor completions still load.codex exec helloran as--no-daemon exec hello.codex --remote ws://xran without the flag, as the skip list intends.XDG_DATA_DIRS=/opt/e2e-a:/opt/e2e-binherited, the tab shows exactly that value, and children see exactly that value.codexdefined inconfig.fish: the user function wins.terminal create --command "codex exec …"): it still launches with-C. The startup command and a later typedcodexboth got--no-daemon, and no XDG env was injected.XDG_DATA_DIRS.Live, Linux (Docker): Debian bookworm with fish 3.6.0 and Debian trixie with fish 4.0.2. The real daemon and local launch-config code was run inside each container, and fish ran interactively under
script(8 runs: both versions × both paths × unset/set):fish -l,codexis the function, typedcodexgets--no-daemon, the marker is gone, children see no Orca dir, andconfig.fishran.XDG_DATA_DIRS, all derived paths are identical to a run without Orca. With it unset, they differ only by the extra/usr/local/share/fish/vendor_*.ddescribed above.config.fishcodexfunction wins, andORCA_CODEX_ISOLATE=0opts out, on both versions.No regression for other shells: I dumped
getShellLaunchConfigfor zsh, bash, pwsh, powershell.exe and fish across feature sets and with and without a startup command, on both transports, for main and for this branch. The only differences are the plain-fish rows. zsh.zshenvand bash rcfile bytes are identical once the content-hash directory name is normalized.Automated:
fish-xdg-data-dirs-handoff.test.ts: env prepend and marker for unset, existing, and already-containing values; an empty value handled like unset; the skip for-N/--no-configargs; the snippet path; and the snippet embedding the shared function verbatim. Its real-fish tests run in theshell contractsCI job, which requires fish.fish-xdg-data-dirs-no-config-launch.test.ts: both the daemon and local spawn paths leaveXDG_DATA_DIRSalone for-Nand still hand off for-l.codexis wrapped; opt-out; user function wins; non-interactive fish gets no hook.local-pty-utils.test.ts(fishXDG_DATA_DIRS, zsh→bashZDOTDIR); updated launch-config tests; protocol-version tests.pnpm tc, oxlint andcheck:code-quality:changedare clean.repro-13767-shell-ready-marker-lost-to-exec.test.tsalso fails locally on unmodifiedorigin/main, so that failure predates this change.Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
wsl.exe. Follow-up.-N/--no-config(fish then never reads the snippet), Orca injects nothing, so that tab keeps its env exactly but gets nocodexfunction. An emptyXDG_DATA_DIRSis handled like unset (the XDG spec and fish 4.7+ read both as the default; older fish only gains the two default vendor dirs), so that tab still gets the function and ends up with the variable unset.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)