Skip to content

test setup: clear every ORCA_* variable an Orca terminal exports (orca #48, slice 7) - #56

Merged
nachumi-a2zoperations merged 1 commit into
blowzer/fork-onlyfrom
nachumi-a2zoperations/issue-48-inherited-wsl-gate
Nov 15, 2026
Merged

nachumi-a2zoperations merged 1 commit into
blowzer/fork-onlyfrom
nachumi-a2zoperations/issue-48-inherited-wsl-gate

Conversation

@nachumi-a2zoperations

Copy link
Copy Markdown

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.ts already 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 every ORCA_* variable an Orca agent terminal exports, read from a live terminal on 2026-11-15, as the exported list INHERITED_ORCA_TERMINAL_ENV. The runner's own ORCA_* 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/tests that name the variable: a non-zero product count means code under test can read it.

Variable Cleared before Cleared now Product files Test files
ORCA_AGENT_HOOK_ENDPOINT no yes 35 20
ORCA_AGENT_HOOK_ENV no yes 29 8
ORCA_AGENT_HOOK_OPENCODE_TUI no yes 4 0
ORCA_AGENT_HOOK_PORT no yes 40 64
ORCA_AGENT_HOOK_TOKEN no yes 39 59
ORCA_AGENT_HOOK_TRANSPORT no yes 10 5
ORCA_AGENT_HOOK_VERSION no yes 28 11
ORCA_AGENT_PANE no yes 1 7
ORCA_APP_VERSION no yes 7 0
ORCA_CLAUDE_AGENT_VIEW_PLUGIN_DIR no yes 5 2
ORCA_CLAUDE_CONFIG_DIR no yes 5 1
ORCA_CLAUDE_INJECTED_CONFIG_DIR no yes 3 3
ORCA_CLAUDE_PROFILE_POINTER no yes 3 6
ORCA_CLI_BIN_DIR no yes 3 3
ORCA_CODEX_HOME no yes 22 12
ORCA_DURABLE_JOB_PLUGIN_DIR no yes 4 2
ORCA_HISTFILE no yes 5 2
ORCA_IMAGE_PROTOCOL no yes 1 1
ORCA_OPENCODE_AGENT no yes 6 2
ORCA_PANE_KEY no yes 83 70
ORCA_PI_SOURCE_AGENT_DIR no yes 8 4
ORCA_PROJECT_GROUP_ID no yes 4 0
ORCA_RUNTIME_SOURCE_ID yes yes 1 5
ORCA_RUNTIME_SOURCE_INCARNATION yes yes 1 4
ORCA_RUNTIME_SOURCE_PROFILE_PATH yes yes 1 3
ORCA_TAB_ID no yes 37 12
ORCA_TERMINAL_HANDLE no yes 28 40
ORCA_USER_DATA_PATH no yes 33 97
ORCA_WORKSPACE_ID yes yes 15 5
ORCA_WORKSPACE_ROOT no yes 4 0
ORCA_WORKTREE_ID yes yes 41 23
ORCA_WSL_HOSTS_GATE_STATE no yes 1 0

Also cleared, as before: ORCA_AGENT_SESSION_ID and ORCA_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

  • New 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.
  • The setup test + wsl-host-deployment-store: 9/9 (3 were red).
  • Full unit suite with the change (MacBook, load 60–110): 43,243 passed, 51 failed, in 44 files. 36 of those files are in Preflight unit step is red fork-wide: 151 tests in 113 files fail independent of #44 #48's known list. The other 8:
    • 7 Electron tests pass when run alone with the change, so their failure was 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.
  • Preflight check-changed: 14/14.
  • Base: one commit on eed717ef. It shares no file with PR 50 (merged as 3151a1ac); git merge-tree against it is clean.

…#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
@nachumi-a2zoperations
nachumi-a2zoperations merged commit 3889cbe into blowzer/fork-only Nov 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant