Repository navigation
test setup: clear every ORCA_* variable an Orca terminal exports (orca #48, slice 7) - #56
Merged
nachumi-a2zoperations merged 1 commit intoNov 15, 2026
Conversation
…#48, slice 7) Root cause of wsl-host-deployment-store.test.ts failing (3 tests, on Node and on Bun) when run from an Orca terminal: the Orca app publishes its resolved WSL hosts gate state to every process it starts (ORCA_WSL_HOSTS_GATE_STATE=closed in this terminal), and isWslHostsServing() prefers an inherited state over the gate a test sets (ORCA_INTERNAL_WSL_HOSTS=1). The gate read "closed", so an unreadable WSL record's environment was not hidden. A run started over ssh (the Dell gates) has no such variable and passed. Fix: vitest-caller-identity-env-setup.ts already clears the launching terminal's inherited Orca identity "so test branches depend on fixture env, not which agent launched runner". Per the Leader, it now clears every ORCA_* variable an Orca agent terminal exported on 2026-11-15 (32, read from a live terminal; product code reads most of them), plus the two identity names it cleared before that this terminal did not set: 34 names, exported as INHERITED_ORCA_TERMINAL_ENV. The runner's own ORCA_* settings (ORCA_VITEST_RUNTIME, ...) are not in it. No product code changes. Tests (vitest-caller-identity-env-setup.test.ts, red first): the WSL gate state is cleared; every listed variable is cleared and the runner's ORCA_VITEST_RUNTIME is kept. Evidence: - the setup test + wsl-host-deployment-store: 9/9 (3 were red); - full unit suite with the change: 43,243 passed, 51 failed in 44 files; 36 of those are in #48's known list. The 8 others: 7 Electron tests pass alone with the change (load); filesystem-watcher-real fails 5/5 with nothing cleared and 5/5 with everything cleared on this MacBook now, so it does not depend on this change. Refs #48
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.
Refs #48 (slice 7:
wsl-host-deployment-store.test.ts, 3 red tests). #48 stays open for the rest.Root cause
The Orca app publishes its resolved WSL hosts gate state to every process it starts: this terminal has
ORCA_WSL_HOSTS_GATE_STATE=closed.isWslHostsServing()prefers an inherited state over the gate a test sets (ORCA_INTERNAL_WSL_HOSTS=1, stubbed by the test). So the gate read "closed", and an unreadable WSL record's environment was not hidden. This fails on Node and on Bun alike, in any Orca terminal, which means every agent session. A run started over ssh (the Dell gates) has no such variable and passes.Fix
config/scripts/test-runtime/environment/vitest-caller-identity-env-setup.tsalready clears the launching terminal's inherited Orca identity "so test branches depend on fixture env, not which agent launched runner". At the Leader's ask it now clears everyORCA_*variable an Orca agent terminal exports, read from a live terminal on 2026-11-15, as the exported listINHERITED_ORCA_TERMINAL_ENV. The runner's ownORCA_*settings (ORCA_VITEST_RUNTIME,ORCA_UNIT_MODULE_CACHE_PATH, …) are not in it. Product code is unchanged.Every ORCA_* variable an Orca terminal exports, against the setup
"Product" and "tests" count the files under
src/teststhat name the variable: a non-zero product count means code under test can read it.ORCA_AGENT_HOOK_ENDPOINTORCA_AGENT_HOOK_ENVORCA_AGENT_HOOK_OPENCODE_TUIORCA_AGENT_HOOK_PORTORCA_AGENT_HOOK_TOKENORCA_AGENT_HOOK_TRANSPORTORCA_AGENT_HOOK_VERSIONORCA_AGENT_PANEORCA_APP_VERSIONORCA_CLAUDE_AGENT_VIEW_PLUGIN_DIRORCA_CLAUDE_CONFIG_DIRORCA_CLAUDE_INJECTED_CONFIG_DIRORCA_CLAUDE_PROFILE_POINTERORCA_CLI_BIN_DIRORCA_CODEX_HOMEORCA_DURABLE_JOB_PLUGIN_DIRORCA_HISTFILEORCA_IMAGE_PROTOCOLORCA_OPENCODE_AGENTORCA_PANE_KEYORCA_PI_SOURCE_AGENT_DIRORCA_PROJECT_GROUP_IDORCA_RUNTIME_SOURCE_IDORCA_RUNTIME_SOURCE_INCARNATIONORCA_RUNTIME_SOURCE_PROFILE_PATHORCA_TAB_IDORCA_TERMINAL_HANDLEORCA_USER_DATA_PATHORCA_WORKSPACE_IDORCA_WORKSPACE_ROOTORCA_WORKTREE_IDORCA_WSL_HOSTS_GATE_STATEAlso cleared, as before:
ORCA_AGENT_SESSION_IDandORCA_STRUCTURED_SESSION, which this terminal did not set. That makes 34 names in all. Before this PR the setup cleared 7, of which 5 are exported by this terminal.Tests
vitest-caller-identity-env-setup.test.ts, red first: the WSL gate state is cleared; every listed variable is cleared; and the runner'sORCA_VITEST_RUNTIMEis kept.wsl-host-deployment-store: 9/9 (3 were red).filesystem-watcher-realfails 5/5 with nothing cleared and 5/5 with everything cleared on this MacBook now, so it does not depend on this change.check-changed: 14/14.eed717ef. It shares no file with PR 50 (merged as3151a1ac);git merge-treeagainst it is clean.