diff --git a/src/main/acp/acp-structured-launch-resolution-omp.test.ts b/src/main/acp/acp-structured-launch-resolution-omp.test.ts index 5479a9017a42..1ab195dd85a0 100644 --- a/src/main/acp/acp-structured-launch-resolution-omp.test.ts +++ b/src/main/acp/acp-structured-launch-resolution-omp.test.ts @@ -66,9 +66,8 @@ describe('OMP ACP launch resolution', () => { ANTHROPIC_API_KEY: 'sk-test' } const launch = await resolver(ompRecord(), { launchEnv: userEnv })({ identity }) - // Only the shared pane and hook keys, and an inherited scratch folder: this chat has none. + // Only an inherited scratch folder (this chat has none); the seal strips pane and hook keys. expect(launch.envToDelete).toEqual([ - ...STRUCTURED_CHILD_ENV_TO_DELETE, NATIVE_CHAT_SCRATCH_DIR_ENV, LEGACY_NATIVE_CHAT_VISUALS_DIR_ENV ]) diff --git a/src/main/acp/acp-structured-launch-resolution.ts b/src/main/acp/acp-structured-launch-resolution.ts index 0052950e9e41..fe08d2ff9869 100644 --- a/src/main/acp/acp-structured-launch-resolution.ts +++ b/src/main/acp/acp-structured-launch-resolution.ts @@ -29,7 +29,6 @@ import { spelledProviderTimelineItemKey } from '../native-chat/agent-session-timeline/provider-timeline-identity' import type { StructuredAgentLaunchPartResolver } from '../runtime/structured-agent-launch-composition' -import { STRUCTURED_CHILD_ENV_TO_DELETE } from '../runtime/structured-session-child-env' import { LEGACY_NATIVE_CHAT_VISUALS_DIR_ENV, NATIVE_CHAT_SCRATCH_DIR_ENV, @@ -251,7 +250,6 @@ export function acpStructuredLaunchPart( }, env: withNativeChatVisualsEnv({ ...env, ...skill?.env }, skill ? visuals : null), inheritedEnvToDelete: [ - ...STRUCTURED_CHILD_ENV_TO_DELETE, ...envToDelete, // Without visuals, a folder Orca itself inherited (started from a chat) names another chat's. ...(skill ? [] : [NATIVE_CHAT_SCRATCH_DIR_ENV]), diff --git a/src/main/ipc/pty/host-env/spawn-env-keys.ts b/src/main/ipc/pty/host-env/spawn-env-keys.ts index ed070c7d043d..90621eb92b9e 100644 --- a/src/main/ipc/pty/host-env/spawn-env-keys.ts +++ b/src/main/ipc/pty/host-env/spawn-env-keys.ts @@ -1,6 +1,24 @@ import { ORCA_AGENT_SESSION_ID_ENV } from '../../../../shared/agent-session-caller-env' +import { + ORCA_SCRUB_SAFE_LAUNCH_ENV, + ORCA_SCRUB_SAFE_PANE_ENV +} from '../../../../shared/agent-hook-scrub-safe-env' import { ORCA_STRUCTURED_SESSION_ENV } from '../../../../shared/structured-session-marker' +// Why: what an Orca pane names its shell by; any other process holding them was handed another pane's identity. +export const ORCA_PANE_IDENTITY_ENV_KEYS = [ + 'ORCA_PANE_KEY', + 'ORCA_TAB_ID', + 'ORCA_WORKTREE_ID', + 'ORCA_WORKSPACE_ID', + 'ORCA_PROJECT_GROUP_ID', + 'ORCA_WORKSPACE_ROOT', + 'ORCA_AGENT_LAUNCH_TOKEN', + ORCA_SCRUB_SAFE_PANE_ENV, + ORCA_SCRUB_SAFE_LAUNCH_ENV, + 'ORCA_TERMINAL_HANDLE' +] as const + export const AGENT_HOOK_RUNTIME_ENV_KEYS = [ 'ORCA_AGENT_HOOK_PORT', 'ORCA_AGENT_HOOK_TOKEN', diff --git a/src/main/orcad/orcad-entry.ts b/src/main/orcad/orcad-entry.ts index a56b3b42ab35..2595dfc4d498 100644 --- a/src/main/orcad/orcad-entry.ts +++ b/src/main/orcad/orcad-entry.ts @@ -33,7 +33,7 @@ import { changedAiVaultSearchSettings, type AiVaultSearchSettings } from '../../shared/ai-vault-search-settings' -import { stampRuntimeSourceEnv } from '../../shared/runtime-source-env' +import { dropInheritedLaunchIdentityEnv } from '../startup/inherited-launch-identity-env' import { adoptWslHostLoginEnvironment } from './orcad-wsl-host-login-environment' export { parseArgs } @@ -70,8 +70,8 @@ export type OrcadHandle = { */ export async function startOrcad(options: OrcadOptions = {}): Promise { installOrcadHostAdapters() - // Why: an orcad started from an Orca terminal must not fence its own CLI children to that Orca. - stampRuntimeSourceEnv(process.env, null) + // Why: an orcad started from an Orca terminal or chat is neither, and must not fence its CLI children to that Orca. + dropInheritedLaunchIdentityEnv(process.env) const { readiness, instance, stop } = await startOrcadWithHost( resolveUserDataPath(), (registerCleanup) => startOrcadRuntime(options, registerCleanup), diff --git a/src/main/pi/rpc-launch.ts b/src/main/pi/rpc-launch.ts index 61bb19b2fee9..1ec5d89c905c 100644 --- a/src/main/pi/rpc-launch.ts +++ b/src/main/pi/rpc-launch.ts @@ -25,11 +25,9 @@ const CALLER_ENV_TO_DELETE = [ ORCA_AGENT_SESSION_SPAWN_TOKEN_ENV ] -/** What a structured Pi session strips from its inheritance; the seal keeps a worker's handle. - * Pi gets no scratch folder, so an inherited one can only name another chat's. */ +/** What a structured Pi session strips beyond the seal's pane identity: Pi gets no scratch + * folder, so an inherited one can only name another chat's. */ export const PI_RPC_SESSION_ENV_TO_DELETE: readonly string[] = [ - ...STRUCTURED_CHILD_ENV_TO_DELETE, - 'ORCA_TERMINAL_HANDLE', NATIVE_CHAT_SCRATCH_DIR_ENV, LEGACY_NATIVE_CHAT_VISUALS_DIR_ENV ] diff --git a/src/main/runtime/__snapshots__/structured-agent-launch-parity.test.ts.snap b/src/main/runtime/__snapshots__/structured-agent-launch-parity.test.ts.snap index 49f8b4cc1a1e..47819469d06e 100644 --- a/src/main/runtime/__snapshots__/structured-agent-launch-parity.test.ts.snap +++ b/src/main/runtime/__snapshots__/structured-agent-launch-parity.test.ts.snap @@ -40,32 +40,18 @@ exports[`native-chat launch parity > claude floating fresh 1`] = ` "HOME": "/home", "INHERITED_ONLY": "process", "LANG": "en_US.UTF-8", - "ORCA_AGENT_HOOK_ENDPOINT": "parent-orca_agent_hook_endpoint", - "ORCA_AGENT_HOOK_ENV": "parent-orca_agent_hook_env", - "ORCA_AGENT_HOOK_PORT": "parent-orca_agent_hook_port", - "ORCA_AGENT_HOOK_TOKEN": "parent-orca_agent_hook_token", - "ORCA_AGENT_HOOK_TRANSPORT": "parent-orca_agent_hook_transport", - "ORCA_AGENT_HOOK_VERSION": "parent-orca_agent_hook_version", - "ORCA_AGENT_LAUNCH": "parent-scrub-safe-launch", - "ORCA_AGENT_LAUNCH_TOKEN": "parent-launch-token", - "ORCA_AGENT_PANE": "parent-scrub-safe-pane", "ORCA_AGENT_SESSION_ID": "00000000-0000-4000-8000-000000000003", "ORCA_AGENT_SESSION_SPAWN_TOKEN": "parity-spawn-token", "ORCA_CHAT_SCRATCH_DIR": "/state/chat-scratch/993224b4fe85990df64db926ca5c0346", - "ORCA_CLAUDE_AGENT_STATUS_SETTINGS": "parent-orca_claude_agent_status_settings", "ORCA_CLI_BIN_DIR": "/orca-cli/bin", "ORCA_CLI_COMMAND": "/orca-cli/bin/orca", "ORCA_DATA_ACCOUNT_PROVIDER": "parent-account", "ORCA_ENVIRONMENT": "", "ORCA_OPENCODE_CONFIG_DIR": "/parent/opencode-overlay", "ORCA_PAIRING_CODE": "", - "ORCA_PANE_KEY": "tab_parent:parent-pane", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TAB_ID": "tab_parent", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", - "ORCA_WORKTREE_ID": "parent-worktree", "PARITY_OVERLAY": "claude", "PATH": "/bin:/orca-cli/bin:/opt/login-shell/bin:/usr/bin:/bin", "SHELL_ONLY": "shell", @@ -128,32 +114,18 @@ exports[`native-chat launch parity > claude floating resumed 1`] = ` "HOME": "/home", "INHERITED_ONLY": "process", "LANG": "en_US.UTF-8", - "ORCA_AGENT_HOOK_ENDPOINT": "parent-orca_agent_hook_endpoint", - "ORCA_AGENT_HOOK_ENV": "parent-orca_agent_hook_env", - "ORCA_AGENT_HOOK_PORT": "parent-orca_agent_hook_port", - "ORCA_AGENT_HOOK_TOKEN": "parent-orca_agent_hook_token", - "ORCA_AGENT_HOOK_TRANSPORT": "parent-orca_agent_hook_transport", - "ORCA_AGENT_HOOK_VERSION": "parent-orca_agent_hook_version", - "ORCA_AGENT_LAUNCH": "parent-scrub-safe-launch", - "ORCA_AGENT_LAUNCH_TOKEN": "parent-launch-token", - "ORCA_AGENT_PANE": "parent-scrub-safe-pane", "ORCA_AGENT_SESSION_ID": "00000000-0000-4000-8000-000000000004", "ORCA_AGENT_SESSION_SPAWN_TOKEN": "parity-spawn-token", "ORCA_CHAT_SCRATCH_DIR": "/state/chat-scratch/008bf60b9309e6141ae7eb98acb2a35d", - "ORCA_CLAUDE_AGENT_STATUS_SETTINGS": "parent-orca_claude_agent_status_settings", "ORCA_CLI_BIN_DIR": "/orca-cli/bin", "ORCA_CLI_COMMAND": "/orca-cli/bin/orca", "ORCA_DATA_ACCOUNT_PROVIDER": "parent-account", "ORCA_ENVIRONMENT": "", "ORCA_OPENCODE_CONFIG_DIR": "/parent/opencode-overlay", "ORCA_PAIRING_CODE": "", - "ORCA_PANE_KEY": "tab_parent:parent-pane", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TAB_ID": "tab_parent", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", - "ORCA_WORKTREE_ID": "parent-worktree", "PARITY_OVERLAY": "claude", "PATH": "/bin:/orca-cli/bin:/opt/login-shell/bin:/usr/bin:/bin", "SHELL_ONLY": "shell", @@ -214,32 +186,18 @@ exports[`native-chat launch parity > claude worktree fresh 1`] = ` "HOME": "/home", "INHERITED_ONLY": "process", "LANG": "en_US.UTF-8", - "ORCA_AGENT_HOOK_ENDPOINT": "parent-orca_agent_hook_endpoint", - "ORCA_AGENT_HOOK_ENV": "parent-orca_agent_hook_env", - "ORCA_AGENT_HOOK_PORT": "parent-orca_agent_hook_port", - "ORCA_AGENT_HOOK_TOKEN": "parent-orca_agent_hook_token", - "ORCA_AGENT_HOOK_TRANSPORT": "parent-orca_agent_hook_transport", - "ORCA_AGENT_HOOK_VERSION": "parent-orca_agent_hook_version", - "ORCA_AGENT_LAUNCH": "parent-scrub-safe-launch", - "ORCA_AGENT_LAUNCH_TOKEN": "parent-launch-token", - "ORCA_AGENT_PANE": "parent-scrub-safe-pane", "ORCA_AGENT_SESSION_ID": "00000000-0000-4000-8000-000000000001", "ORCA_AGENT_SESSION_SPAWN_TOKEN": "parity-spawn-token", "ORCA_CHAT_SCRATCH_DIR": "/state/chat-scratch/11e594f481958c10e3015d0bf0447a22", - "ORCA_CLAUDE_AGENT_STATUS_SETTINGS": "parent-orca_claude_agent_status_settings", "ORCA_CLI_BIN_DIR": "/orca-cli/bin", "ORCA_CLI_COMMAND": "/orca-cli/bin/orca", "ORCA_DATA_ACCOUNT_PROVIDER": "parent-account", "ORCA_ENVIRONMENT": "", "ORCA_OPENCODE_CONFIG_DIR": "/parent/opencode-overlay", "ORCA_PAIRING_CODE": "", - "ORCA_PANE_KEY": "tab_parent:parent-pane", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TAB_ID": "tab_parent", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", - "ORCA_WORKTREE_ID": "parent-worktree", "PARITY_OVERLAY": "claude", "PATH": "/bin:/orca-cli/bin:/opt/login-shell/bin:/usr/bin:/bin", "SHELL_ONLY": "shell", @@ -302,32 +260,18 @@ exports[`native-chat launch parity > claude worktree fresh configured 1`] = ` "HOME": "/home", "INHERITED_ONLY": "overlay", "LANG": "C", - "ORCA_AGENT_HOOK_ENDPOINT": "parent-orca_agent_hook_endpoint", - "ORCA_AGENT_HOOK_ENV": "parent-orca_agent_hook_env", - "ORCA_AGENT_HOOK_PORT": "parent-orca_agent_hook_port", - "ORCA_AGENT_HOOK_TOKEN": "parent-orca_agent_hook_token", - "ORCA_AGENT_HOOK_TRANSPORT": "parent-orca_agent_hook_transport", - "ORCA_AGENT_HOOK_VERSION": "parent-orca_agent_hook_version", - "ORCA_AGENT_LAUNCH": "parent-scrub-safe-launch", - "ORCA_AGENT_LAUNCH_TOKEN": "parent-launch-token", - "ORCA_AGENT_PANE": "parent-scrub-safe-pane", "ORCA_AGENT_SESSION_ID": "00000000-0000-4000-8000-000000000031", "ORCA_AGENT_SESSION_SPAWN_TOKEN": "parity-spawn-token", "ORCA_CHAT_SCRATCH_DIR": "/state/chat-scratch/eaed3477e8b61885d231829e3d12e45d", - "ORCA_CLAUDE_AGENT_STATUS_SETTINGS": "parent-orca_claude_agent_status_settings", "ORCA_CLI_BIN_DIR": "/orca-cli/bin", "ORCA_CLI_COMMAND": "/orca-cli/bin/orca", "ORCA_DATA_ACCOUNT_PROVIDER": "parent-account", "ORCA_ENVIRONMENT": "", "ORCA_OPENCODE_CONFIG_DIR": "/parent/opencode-overlay", "ORCA_PAIRING_CODE": "", - "ORCA_PANE_KEY": "tab_parent:parent-pane", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TAB_ID": "tab_parent", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", - "ORCA_WORKTREE_ID": "parent-worktree", "PARITY_OVERLAY": "claude-configured", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", "SHELL_ONLY": "shell", @@ -381,31 +325,18 @@ exports[`native-chat launch parity > claude worktree fresh worker 1`] = ` "HOME": "/home", "INHERITED_ONLY": "process", "LANG": "en_US.UTF-8", - "ORCA_AGENT_HOOK_ENDPOINT": "parent-orca_agent_hook_endpoint", - "ORCA_AGENT_HOOK_ENV": "parent-orca_agent_hook_env", - "ORCA_AGENT_HOOK_PORT": "parent-orca_agent_hook_port", - "ORCA_AGENT_HOOK_TOKEN": "parent-orca_agent_hook_token", - "ORCA_AGENT_HOOK_TRANSPORT": "parent-orca_agent_hook_transport", - "ORCA_AGENT_HOOK_VERSION": "parent-orca_agent_hook_version", - "ORCA_AGENT_LAUNCH": "parent-scrub-safe-launch", - "ORCA_AGENT_LAUNCH_TOKEN": "parent-launch-token", - "ORCA_AGENT_PANE": "parent-scrub-safe-pane", "ORCA_AGENT_SESSION_ID": "00000000-0000-4000-8000-000000000005", "ORCA_AGENT_SESSION_SPAWN_TOKEN": "parity-spawn-token", - "ORCA_CLAUDE_AGENT_STATUS_SETTINGS": "parent-orca_claude_agent_status_settings", "ORCA_CLI_BIN_DIR": "/orca-cli/bin", "ORCA_CLI_COMMAND": "/orca-cli/bin/orca", "ORCA_DATA_ACCOUNT_PROVIDER": "parent-account", "ORCA_ENVIRONMENT": "", "ORCA_OPENCODE_CONFIG_DIR": "/parent/opencode-overlay", "ORCA_PAIRING_CODE": "", - "ORCA_PANE_KEY": "tab_parent:parent-pane", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TAB_ID": "tab_parent", "ORCA_TERMINAL_HANDLE": "structworker_00000000-0000-4000-8000-000000000005", "ORCA_USER_DATA_PATH": "/user-data", - "ORCA_WORKTREE_ID": "parent-worktree", "PARITY_OVERLAY": "claude", "PATH": "/bin:/orca-cli/bin:/opt/login-shell/bin:/usr/bin:/bin", "SHELL_ONLY": "shell", @@ -466,32 +397,18 @@ exports[`native-chat launch parity > claude worktree resumed 1`] = ` "HOME": "/home", "INHERITED_ONLY": "process", "LANG": "en_US.UTF-8", - "ORCA_AGENT_HOOK_ENDPOINT": "parent-orca_agent_hook_endpoint", - "ORCA_AGENT_HOOK_ENV": "parent-orca_agent_hook_env", - "ORCA_AGENT_HOOK_PORT": "parent-orca_agent_hook_port", - "ORCA_AGENT_HOOK_TOKEN": "parent-orca_agent_hook_token", - "ORCA_AGENT_HOOK_TRANSPORT": "parent-orca_agent_hook_transport", - "ORCA_AGENT_HOOK_VERSION": "parent-orca_agent_hook_version", - "ORCA_AGENT_LAUNCH": "parent-scrub-safe-launch", - "ORCA_AGENT_LAUNCH_TOKEN": "parent-launch-token", - "ORCA_AGENT_PANE": "parent-scrub-safe-pane", "ORCA_AGENT_SESSION_ID": "00000000-0000-4000-8000-000000000002", "ORCA_AGENT_SESSION_SPAWN_TOKEN": "parity-spawn-token", "ORCA_CHAT_SCRATCH_DIR": "/state/chat-scratch/e79acd97ac88086665d85a762f43d533", - "ORCA_CLAUDE_AGENT_STATUS_SETTINGS": "parent-orca_claude_agent_status_settings", "ORCA_CLI_BIN_DIR": "/orca-cli/bin", "ORCA_CLI_COMMAND": "/orca-cli/bin/orca", "ORCA_DATA_ACCOUNT_PROVIDER": "parent-account", "ORCA_ENVIRONMENT": "", "ORCA_OPENCODE_CONFIG_DIR": "/parent/opencode-overlay", "ORCA_PAIRING_CODE": "", - "ORCA_PANE_KEY": "tab_parent:parent-pane", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TAB_ID": "tab_parent", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", - "ORCA_WORKTREE_ID": "parent-worktree", "PARITY_OVERLAY": "claude", "PATH": "/bin:/orca-cli/bin:/opt/login-shell/bin:/usr/bin:/bin", "SHELL_ONLY": "shell", @@ -554,32 +471,18 @@ exports[`native-chat launch parity > claude worktree resumed configured 1`] = ` "HOME": "/home", "INHERITED_ONLY": "overlay", "LANG": "C", - "ORCA_AGENT_HOOK_ENDPOINT": "parent-orca_agent_hook_endpoint", - "ORCA_AGENT_HOOK_ENV": "parent-orca_agent_hook_env", - "ORCA_AGENT_HOOK_PORT": "parent-orca_agent_hook_port", - "ORCA_AGENT_HOOK_TOKEN": "parent-orca_agent_hook_token", - "ORCA_AGENT_HOOK_TRANSPORT": "parent-orca_agent_hook_transport", - "ORCA_AGENT_HOOK_VERSION": "parent-orca_agent_hook_version", - "ORCA_AGENT_LAUNCH": "parent-scrub-safe-launch", - "ORCA_AGENT_LAUNCH_TOKEN": "parent-launch-token", - "ORCA_AGENT_PANE": "parent-scrub-safe-pane", "ORCA_AGENT_SESSION_ID": "00000000-0000-4000-8000-000000000032", "ORCA_AGENT_SESSION_SPAWN_TOKEN": "parity-spawn-token", "ORCA_CHAT_SCRATCH_DIR": "/state/chat-scratch/b0c5ad35009f2e02d85f43df8b152891", - "ORCA_CLAUDE_AGENT_STATUS_SETTINGS": "parent-orca_claude_agent_status_settings", "ORCA_CLI_BIN_DIR": "/orca-cli/bin", "ORCA_CLI_COMMAND": "/orca-cli/bin/orca", "ORCA_DATA_ACCOUNT_PROVIDER": "parent-account", "ORCA_ENVIRONMENT": "", "ORCA_OPENCODE_CONFIG_DIR": "/parent/opencode-overlay", "ORCA_PAIRING_CODE": "", - "ORCA_PANE_KEY": "tab_parent:parent-pane", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TAB_ID": "tab_parent", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", - "ORCA_WORKTREE_ID": "parent-worktree", "PARITY_OVERLAY": "claude-configured", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", "SHELL_ONLY": "shell", @@ -615,39 +518,42 @@ exports[`native-chat launch parity > codex floating fresh 1`] = ` "HOME": "/home", "INHERITED_ONLY": "process", "LANG": "en_US.UTF-8", - "ORCA_AGENT_HOOK_ENDPOINT": "parent-orca_agent_hook_endpoint", - "ORCA_AGENT_HOOK_ENV": "parent-orca_agent_hook_env", - "ORCA_AGENT_HOOK_PORT": "parent-orca_agent_hook_port", - "ORCA_AGENT_HOOK_TOKEN": "parent-orca_agent_hook_token", - "ORCA_AGENT_HOOK_TRANSPORT": "parent-orca_agent_hook_transport", - "ORCA_AGENT_HOOK_VERSION": "parent-orca_agent_hook_version", - "ORCA_AGENT_LAUNCH": "parent-scrub-safe-launch", - "ORCA_AGENT_LAUNCH_TOKEN": "parent-launch-token", - "ORCA_AGENT_PANE": "parent-scrub-safe-pane", "ORCA_AGENT_SESSION_ID": "00000000-0000-4000-8000-000000000008", "ORCA_AGENT_SESSION_SPAWN_TOKEN": "parity-spawn-token", "ORCA_CHAT_SCRATCH_DIR": "/state/chat-scratch/fe9eeff554ea6c98aca483076d97614a", - "ORCA_CLAUDE_AGENT_STATUS_SETTINGS": "parent-orca_claude_agent_status_settings", "ORCA_CLI_BIN_DIR": "/orca-cli/bin", "ORCA_CLI_COMMAND": "/orca-cli/bin/orca", "ORCA_DATA_ACCOUNT_PROVIDER": "parent-account", "ORCA_ENVIRONMENT": "", "ORCA_OPENCODE_CONFIG_DIR": "/parent/opencode-overlay", "ORCA_PAIRING_CODE": "", - "ORCA_PANE_KEY": "tab_parent:parent-pane", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TAB_ID": "tab_parent", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", - "ORCA_WORKTREE_ID": "parent-worktree", "PARITY_OVERLAY": "codex", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", "SHELL_ONLY": "shell", "SHELL_UNLISTED": "shell", }, "envToDelete": [ + "ORCA_AGENT_HOOK_ENDPOINT", + "ORCA_AGENT_HOOK_ENV", + "ORCA_AGENT_HOOK_PORT", + "ORCA_AGENT_HOOK_TOKEN", + "ORCA_AGENT_HOOK_TRANSPORT", + "ORCA_AGENT_HOOK_VERSION", + "ORCA_AGENT_LAUNCH", + "ORCA_AGENT_LAUNCH_TOKEN", + "ORCA_AGENT_PANE", "ORCA_CHAT_VISUALS_DIR", + "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", + "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", + "ORCA_TAB_ID", + "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", + "ORCA_WORKTREE_ID", ], "supervisor": { "closeRequest": "stdin-end", @@ -689,39 +595,42 @@ exports[`native-chat launch parity > codex floating resumed 1`] = ` "HOME": "/home", "INHERITED_ONLY": "process", "LANG": "en_US.UTF-8", - "ORCA_AGENT_HOOK_ENDPOINT": "parent-orca_agent_hook_endpoint", - "ORCA_AGENT_HOOK_ENV": "parent-orca_agent_hook_env", - "ORCA_AGENT_HOOK_PORT": "parent-orca_agent_hook_port", - "ORCA_AGENT_HOOK_TOKEN": "parent-orca_agent_hook_token", - "ORCA_AGENT_HOOK_TRANSPORT": "parent-orca_agent_hook_transport", - "ORCA_AGENT_HOOK_VERSION": "parent-orca_agent_hook_version", - "ORCA_AGENT_LAUNCH": "parent-scrub-safe-launch", - "ORCA_AGENT_LAUNCH_TOKEN": "parent-launch-token", - "ORCA_AGENT_PANE": "parent-scrub-safe-pane", "ORCA_AGENT_SESSION_ID": "00000000-0000-4000-8000-000000000009", "ORCA_AGENT_SESSION_SPAWN_TOKEN": "parity-spawn-token", "ORCA_CHAT_SCRATCH_DIR": "/state/chat-scratch/f3e028aaa6530055f01a5e1e849f6765", - "ORCA_CLAUDE_AGENT_STATUS_SETTINGS": "parent-orca_claude_agent_status_settings", "ORCA_CLI_BIN_DIR": "/orca-cli/bin", "ORCA_CLI_COMMAND": "/orca-cli/bin/orca", "ORCA_DATA_ACCOUNT_PROVIDER": "parent-account", "ORCA_ENVIRONMENT": "", "ORCA_OPENCODE_CONFIG_DIR": "/parent/opencode-overlay", "ORCA_PAIRING_CODE": "", - "ORCA_PANE_KEY": "tab_parent:parent-pane", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TAB_ID": "tab_parent", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", - "ORCA_WORKTREE_ID": "parent-worktree", "PARITY_OVERLAY": "codex", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", "SHELL_ONLY": "shell", "SHELL_UNLISTED": "shell", }, "envToDelete": [ + "ORCA_AGENT_HOOK_ENDPOINT", + "ORCA_AGENT_HOOK_ENV", + "ORCA_AGENT_HOOK_PORT", + "ORCA_AGENT_HOOK_TOKEN", + "ORCA_AGENT_HOOK_TRANSPORT", + "ORCA_AGENT_HOOK_VERSION", + "ORCA_AGENT_LAUNCH", + "ORCA_AGENT_LAUNCH_TOKEN", + "ORCA_AGENT_PANE", "ORCA_CHAT_VISUALS_DIR", + "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", + "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", + "ORCA_TAB_ID", + "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", + "ORCA_WORKTREE_ID", ], "supervisor": { "closeRequest": "stdin-end", @@ -761,39 +670,42 @@ exports[`native-chat launch parity > codex worktree fresh 1`] = ` "HOME": "/home", "INHERITED_ONLY": "process", "LANG": "en_US.UTF-8", - "ORCA_AGENT_HOOK_ENDPOINT": "parent-orca_agent_hook_endpoint", - "ORCA_AGENT_HOOK_ENV": "parent-orca_agent_hook_env", - "ORCA_AGENT_HOOK_PORT": "parent-orca_agent_hook_port", - "ORCA_AGENT_HOOK_TOKEN": "parent-orca_agent_hook_token", - "ORCA_AGENT_HOOK_TRANSPORT": "parent-orca_agent_hook_transport", - "ORCA_AGENT_HOOK_VERSION": "parent-orca_agent_hook_version", - "ORCA_AGENT_LAUNCH": "parent-scrub-safe-launch", - "ORCA_AGENT_LAUNCH_TOKEN": "parent-launch-token", - "ORCA_AGENT_PANE": "parent-scrub-safe-pane", "ORCA_AGENT_SESSION_ID": "00000000-0000-4000-8000-000000000006", "ORCA_AGENT_SESSION_SPAWN_TOKEN": "parity-spawn-token", "ORCA_CHAT_SCRATCH_DIR": "/state/chat-scratch/a8353ed0bde97e7845f0996d60267ea5", - "ORCA_CLAUDE_AGENT_STATUS_SETTINGS": "parent-orca_claude_agent_status_settings", "ORCA_CLI_BIN_DIR": "/orca-cli/bin", "ORCA_CLI_COMMAND": "/orca-cli/bin/orca", "ORCA_DATA_ACCOUNT_PROVIDER": "parent-account", "ORCA_ENVIRONMENT": "", "ORCA_OPENCODE_CONFIG_DIR": "/parent/opencode-overlay", "ORCA_PAIRING_CODE": "", - "ORCA_PANE_KEY": "tab_parent:parent-pane", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TAB_ID": "tab_parent", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", - "ORCA_WORKTREE_ID": "parent-worktree", "PARITY_OVERLAY": "codex", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", "SHELL_ONLY": "shell", "SHELL_UNLISTED": "shell", }, "envToDelete": [ + "ORCA_AGENT_HOOK_ENDPOINT", + "ORCA_AGENT_HOOK_ENV", + "ORCA_AGENT_HOOK_PORT", + "ORCA_AGENT_HOOK_TOKEN", + "ORCA_AGENT_HOOK_TRANSPORT", + "ORCA_AGENT_HOOK_VERSION", + "ORCA_AGENT_LAUNCH", + "ORCA_AGENT_LAUNCH_TOKEN", + "ORCA_AGENT_PANE", "ORCA_CHAT_VISUALS_DIR", + "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", + "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", + "ORCA_TAB_ID", + "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", + "ORCA_WORKTREE_ID", ], "supervisor": { "closeRequest": "stdin-end", @@ -833,38 +745,41 @@ exports[`native-chat launch parity > codex worktree fresh configured 1`] = ` "HOME": "/home", "INHERITED_ONLY": "overlay", "LANG": "C", - "ORCA_AGENT_HOOK_ENDPOINT": "parent-orca_agent_hook_endpoint", - "ORCA_AGENT_HOOK_ENV": "parent-orca_agent_hook_env", - "ORCA_AGENT_HOOK_PORT": "parent-orca_agent_hook_port", - "ORCA_AGENT_HOOK_TOKEN": "parent-orca_agent_hook_token", - "ORCA_AGENT_HOOK_TRANSPORT": "parent-orca_agent_hook_transport", - "ORCA_AGENT_HOOK_VERSION": "parent-orca_agent_hook_version", - "ORCA_AGENT_LAUNCH": "parent-scrub-safe-launch", - "ORCA_AGENT_LAUNCH_TOKEN": "parent-launch-token", - "ORCA_AGENT_PANE": "parent-scrub-safe-pane", "ORCA_AGENT_SESSION_ID": "00000000-0000-4000-8000-000000000033", "ORCA_AGENT_SESSION_SPAWN_TOKEN": "parity-spawn-token", "ORCA_CHAT_SCRATCH_DIR": "/state/chat-scratch/0a57e3c82f8be1ecdb1249602bb0e48d", - "ORCA_CLAUDE_AGENT_STATUS_SETTINGS": "parent-orca_claude_agent_status_settings", "ORCA_CLI_BIN_DIR": "/orca-cli/bin", "ORCA_CLI_COMMAND": "/orca-cli/bin/orca", "ORCA_DATA_ACCOUNT_PROVIDER": "parent-account", "ORCA_ENVIRONMENT": "", "ORCA_OPENCODE_CONFIG_DIR": "/parent/opencode-overlay", "ORCA_PAIRING_CODE": "", - "ORCA_PANE_KEY": "tab_parent:parent-pane", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TAB_ID": "tab_parent", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", - "ORCA_WORKTREE_ID": "parent-worktree", "PARITY_OVERLAY": "codex-configured", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", "SHELL_ONLY": "shell", }, "envToDelete": [ + "ORCA_AGENT_HOOK_ENDPOINT", + "ORCA_AGENT_HOOK_ENV", + "ORCA_AGENT_HOOK_PORT", + "ORCA_AGENT_HOOK_TOKEN", + "ORCA_AGENT_HOOK_TRANSPORT", + "ORCA_AGENT_HOOK_VERSION", + "ORCA_AGENT_LAUNCH", + "ORCA_AGENT_LAUNCH_TOKEN", + "ORCA_AGENT_PANE", "ORCA_CHAT_VISUALS_DIR", + "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", + "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", + "ORCA_TAB_ID", + "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", + "ORCA_WORKTREE_ID", ], "supervisor": { "closeRequest": "stdin-end", @@ -904,39 +819,42 @@ exports[`native-chat launch parity > codex worktree fresh worker 1`] = ` "HOME": "/home", "INHERITED_ONLY": "process", "LANG": "en_US.UTF-8", - "ORCA_AGENT_HOOK_ENDPOINT": "parent-orca_agent_hook_endpoint", - "ORCA_AGENT_HOOK_ENV": "parent-orca_agent_hook_env", - "ORCA_AGENT_HOOK_PORT": "parent-orca_agent_hook_port", - "ORCA_AGENT_HOOK_TOKEN": "parent-orca_agent_hook_token", - "ORCA_AGENT_HOOK_TRANSPORT": "parent-orca_agent_hook_transport", - "ORCA_AGENT_HOOK_VERSION": "parent-orca_agent_hook_version", - "ORCA_AGENT_LAUNCH": "parent-scrub-safe-launch", - "ORCA_AGENT_LAUNCH_TOKEN": "parent-launch-token", - "ORCA_AGENT_PANE": "parent-scrub-safe-pane", "ORCA_AGENT_SESSION_ID": "00000000-0000-4000-8000-000000000010", "ORCA_AGENT_SESSION_SPAWN_TOKEN": "parity-spawn-token", - "ORCA_CLAUDE_AGENT_STATUS_SETTINGS": "parent-orca_claude_agent_status_settings", "ORCA_CLI_BIN_DIR": "/orca-cli/bin", "ORCA_CLI_COMMAND": "/orca-cli/bin/orca", "ORCA_DATA_ACCOUNT_PROVIDER": "parent-account", "ORCA_ENVIRONMENT": "", "ORCA_OPENCODE_CONFIG_DIR": "/parent/opencode-overlay", "ORCA_PAIRING_CODE": "", - "ORCA_PANE_KEY": "tab_parent:parent-pane", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TAB_ID": "tab_parent", "ORCA_TERMINAL_HANDLE": "structworker_00000000-0000-4000-8000-000000000010", "ORCA_USER_DATA_PATH": "/user-data", - "ORCA_WORKTREE_ID": "parent-worktree", "PARITY_OVERLAY": "codex", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", "SHELL_ONLY": "shell", "SHELL_UNLISTED": "shell", }, "envToDelete": [ + "ORCA_AGENT_HOOK_ENDPOINT", + "ORCA_AGENT_HOOK_ENV", + "ORCA_AGENT_HOOK_PORT", + "ORCA_AGENT_HOOK_TOKEN", + "ORCA_AGENT_HOOK_TRANSPORT", + "ORCA_AGENT_HOOK_VERSION", + "ORCA_AGENT_LAUNCH", + "ORCA_AGENT_LAUNCH_TOKEN", + "ORCA_AGENT_PANE", "ORCA_CHAT_SCRATCH_DIR", "ORCA_CHAT_VISUALS_DIR", + "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", + "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", + "ORCA_TAB_ID", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", + "ORCA_WORKTREE_ID", ], "supervisor": { "closeRequest": "stdin-end", @@ -976,39 +894,42 @@ exports[`native-chat launch parity > codex worktree resumed 1`] = ` "HOME": "/home", "INHERITED_ONLY": "process", "LANG": "en_US.UTF-8", - "ORCA_AGENT_HOOK_ENDPOINT": "parent-orca_agent_hook_endpoint", - "ORCA_AGENT_HOOK_ENV": "parent-orca_agent_hook_env", - "ORCA_AGENT_HOOK_PORT": "parent-orca_agent_hook_port", - "ORCA_AGENT_HOOK_TOKEN": "parent-orca_agent_hook_token", - "ORCA_AGENT_HOOK_TRANSPORT": "parent-orca_agent_hook_transport", - "ORCA_AGENT_HOOK_VERSION": "parent-orca_agent_hook_version", - "ORCA_AGENT_LAUNCH": "parent-scrub-safe-launch", - "ORCA_AGENT_LAUNCH_TOKEN": "parent-launch-token", - "ORCA_AGENT_PANE": "parent-scrub-safe-pane", "ORCA_AGENT_SESSION_ID": "00000000-0000-4000-8000-000000000007", "ORCA_AGENT_SESSION_SPAWN_TOKEN": "parity-spawn-token", "ORCA_CHAT_SCRATCH_DIR": "/state/chat-scratch/6b7be92641aec20b00f9c40280433e0a", - "ORCA_CLAUDE_AGENT_STATUS_SETTINGS": "parent-orca_claude_agent_status_settings", "ORCA_CLI_BIN_DIR": "/orca-cli/bin", "ORCA_CLI_COMMAND": "/orca-cli/bin/orca", "ORCA_DATA_ACCOUNT_PROVIDER": "parent-account", "ORCA_ENVIRONMENT": "", "ORCA_OPENCODE_CONFIG_DIR": "/parent/opencode-overlay", "ORCA_PAIRING_CODE": "", - "ORCA_PANE_KEY": "tab_parent:parent-pane", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TAB_ID": "tab_parent", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", - "ORCA_WORKTREE_ID": "parent-worktree", "PARITY_OVERLAY": "codex", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", "SHELL_ONLY": "shell", "SHELL_UNLISTED": "shell", }, "envToDelete": [ + "ORCA_AGENT_HOOK_ENDPOINT", + "ORCA_AGENT_HOOK_ENV", + "ORCA_AGENT_HOOK_PORT", + "ORCA_AGENT_HOOK_TOKEN", + "ORCA_AGENT_HOOK_TRANSPORT", + "ORCA_AGENT_HOOK_VERSION", + "ORCA_AGENT_LAUNCH", + "ORCA_AGENT_LAUNCH_TOKEN", + "ORCA_AGENT_PANE", "ORCA_CHAT_VISUALS_DIR", + "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", + "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", + "ORCA_TAB_ID", + "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", + "ORCA_WORKTREE_ID", ], "supervisor": { "closeRequest": "stdin-end", @@ -1048,38 +969,41 @@ exports[`native-chat launch parity > codex worktree resumed configured 1`] = ` "HOME": "/home", "INHERITED_ONLY": "overlay", "LANG": "C", - "ORCA_AGENT_HOOK_ENDPOINT": "parent-orca_agent_hook_endpoint", - "ORCA_AGENT_HOOK_ENV": "parent-orca_agent_hook_env", - "ORCA_AGENT_HOOK_PORT": "parent-orca_agent_hook_port", - "ORCA_AGENT_HOOK_TOKEN": "parent-orca_agent_hook_token", - "ORCA_AGENT_HOOK_TRANSPORT": "parent-orca_agent_hook_transport", - "ORCA_AGENT_HOOK_VERSION": "parent-orca_agent_hook_version", - "ORCA_AGENT_LAUNCH": "parent-scrub-safe-launch", - "ORCA_AGENT_LAUNCH_TOKEN": "parent-launch-token", - "ORCA_AGENT_PANE": "parent-scrub-safe-pane", "ORCA_AGENT_SESSION_ID": "00000000-0000-4000-8000-000000000034", "ORCA_AGENT_SESSION_SPAWN_TOKEN": "parity-spawn-token", "ORCA_CHAT_SCRATCH_DIR": "/state/chat-scratch/4c105fab16e20f574f686cfe2d55d927", - "ORCA_CLAUDE_AGENT_STATUS_SETTINGS": "parent-orca_claude_agent_status_settings", "ORCA_CLI_BIN_DIR": "/orca-cli/bin", "ORCA_CLI_COMMAND": "/orca-cli/bin/orca", "ORCA_DATA_ACCOUNT_PROVIDER": "parent-account", "ORCA_ENVIRONMENT": "", "ORCA_OPENCODE_CONFIG_DIR": "/parent/opencode-overlay", "ORCA_PAIRING_CODE": "", - "ORCA_PANE_KEY": "tab_parent:parent-pane", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TAB_ID": "tab_parent", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", - "ORCA_WORKTREE_ID": "parent-worktree", "PARITY_OVERLAY": "codex-configured", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", "SHELL_ONLY": "shell", }, "envToDelete": [ + "ORCA_AGENT_HOOK_ENDPOINT", + "ORCA_AGENT_HOOK_ENV", + "ORCA_AGENT_HOOK_PORT", + "ORCA_AGENT_HOOK_TOKEN", + "ORCA_AGENT_HOOK_TRANSPORT", + "ORCA_AGENT_HOOK_VERSION", + "ORCA_AGENT_LAUNCH", + "ORCA_AGENT_LAUNCH_TOKEN", + "ORCA_AGENT_PANE", "ORCA_CHAT_VISUALS_DIR", + "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", + "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", + "ORCA_TAB_ID", + "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", + "ORCA_WORKTREE_ID", ], "supervisor": { "closeRequest": "stdin-end", @@ -1133,7 +1057,6 @@ exports[`native-chat launch parity > grok floating fresh 1`] = ` "ORCA_PAIRING_CODE": "", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", "PARITY_OVERLAY": "grok", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", @@ -1153,7 +1076,11 @@ exports[`native-chat launch parity > grok floating fresh 1`] = ` "ORCA_CHAT_VISUALS_DIR", "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", + "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", ], "supervisor": { @@ -1206,7 +1133,6 @@ exports[`native-chat launch parity > grok floating resumed 1`] = ` "ORCA_PAIRING_CODE": "", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", "PARITY_OVERLAY": "grok", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", @@ -1226,7 +1152,11 @@ exports[`native-chat launch parity > grok floating resumed 1`] = ` "ORCA_CHAT_VISUALS_DIR", "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", + "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", ], "supervisor": { @@ -1277,7 +1207,6 @@ exports[`native-chat launch parity > grok worktree fresh 1`] = ` "ORCA_PAIRING_CODE": "", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", "PARITY_OVERLAY": "grok", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", @@ -1297,7 +1226,11 @@ exports[`native-chat launch parity > grok worktree fresh 1`] = ` "ORCA_CHAT_VISUALS_DIR", "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", + "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", ], "supervisor": { @@ -1347,7 +1280,6 @@ exports[`native-chat launch parity > grok worktree fresh configured 1`] = ` "ORCA_PAIRING_CODE": "", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", "PARITY_OVERLAY": "grok-configured", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", @@ -1366,7 +1298,11 @@ exports[`native-chat launch parity > grok worktree fresh configured 1`] = ` "ORCA_CHAT_VISUALS_DIR", "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", + "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", ], "supervisor": { @@ -1435,7 +1371,10 @@ exports[`native-chat launch parity > grok worktree fresh worker 1`] = ` "ORCA_CHAT_VISUALS_DIR", "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", ], "supervisor": { @@ -1486,7 +1425,6 @@ exports[`native-chat launch parity > grok worktree resumed 1`] = ` "ORCA_PAIRING_CODE": "", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", "PARITY_OVERLAY": "grok", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", @@ -1506,7 +1444,11 @@ exports[`native-chat launch parity > grok worktree resumed 1`] = ` "ORCA_CHAT_VISUALS_DIR", "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", + "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", ], "supervisor": { @@ -1556,7 +1498,6 @@ exports[`native-chat launch parity > grok worktree resumed configured 1`] = ` "ORCA_PAIRING_CODE": "", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", "PARITY_OVERLAY": "grok-configured", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", @@ -1575,7 +1516,11 @@ exports[`native-chat launch parity > grok worktree resumed configured 1`] = ` "ORCA_CHAT_VISUALS_DIR", "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", + "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", ], "supervisor": { @@ -1623,7 +1568,6 @@ exports[`native-chat launch parity > omp floating fresh 1`] = ` "ORCA_PAIRING_CODE": "", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", "PARITY_OVERLAY": "omp", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", @@ -1644,7 +1588,11 @@ exports[`native-chat launch parity > omp floating fresh 1`] = ` "ORCA_CHAT_VISUALS_DIR", "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", + "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", ], "supervisor": { @@ -1694,7 +1642,6 @@ exports[`native-chat launch parity > omp floating resumed 1`] = ` "ORCA_PAIRING_CODE": "", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", "PARITY_OVERLAY": "omp", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", @@ -1715,7 +1662,11 @@ exports[`native-chat launch parity > omp floating resumed 1`] = ` "ORCA_CHAT_VISUALS_DIR", "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", + "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", ], "supervisor": { @@ -1763,7 +1714,6 @@ exports[`native-chat launch parity > omp worktree fresh 1`] = ` "ORCA_PAIRING_CODE": "", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", "PARITY_OVERLAY": "omp", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", @@ -1784,7 +1734,11 @@ exports[`native-chat launch parity > omp worktree fresh 1`] = ` "ORCA_CHAT_VISUALS_DIR", "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", + "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", ], "supervisor": { @@ -1832,7 +1786,6 @@ exports[`native-chat launch parity > omp worktree fresh configured 1`] = ` "ORCA_PAIRING_CODE": "", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", "PARITY_OVERLAY": "omp-configured", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", @@ -1852,7 +1805,11 @@ exports[`native-chat launch parity > omp worktree fresh configured 1`] = ` "ORCA_CHAT_VISUALS_DIR", "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", + "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", ], "supervisor": { @@ -1919,7 +1876,10 @@ exports[`native-chat launch parity > omp worktree fresh worker 1`] = ` "ORCA_CHAT_VISUALS_DIR", "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", ], "supervisor": { @@ -1967,7 +1927,6 @@ exports[`native-chat launch parity > omp worktree resumed 1`] = ` "ORCA_PAIRING_CODE": "", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", "PARITY_OVERLAY": "omp", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", @@ -1988,7 +1947,11 @@ exports[`native-chat launch parity > omp worktree resumed 1`] = ` "ORCA_CHAT_VISUALS_DIR", "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", + "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", ], "supervisor": { @@ -2036,7 +1999,6 @@ exports[`native-chat launch parity > omp worktree resumed configured 1`] = ` "ORCA_PAIRING_CODE": "", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", "PARITY_OVERLAY": "omp-configured", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", @@ -2056,7 +2018,11 @@ exports[`native-chat launch parity > omp worktree resumed configured 1`] = ` "ORCA_CHAT_VISUALS_DIR", "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", + "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", ], "supervisor": { @@ -2103,7 +2069,6 @@ exports[`native-chat launch parity > opencode floating fresh 1`] = ` "ORCA_PAIRING_CODE": "", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", "PARITY_OVERLAY": "opencode", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", @@ -2128,7 +2093,11 @@ exports[`native-chat launch parity > opencode floating fresh 1`] = ` "ORCA_DATA_ACCOUNT_PROVIDER", "ORCA_OPENCODE_CONFIG_DIR", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", + "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", "XDG_DATA_HOME", "XDG_STATE_HOME", @@ -2179,7 +2148,6 @@ exports[`native-chat launch parity > opencode floating resumed 1`] = ` "ORCA_PAIRING_CODE": "", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", "PARITY_OVERLAY": "opencode", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", @@ -2204,7 +2172,11 @@ exports[`native-chat launch parity > opencode floating resumed 1`] = ` "ORCA_DATA_ACCOUNT_PROVIDER", "ORCA_OPENCODE_CONFIG_DIR", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", + "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", "XDG_DATA_HOME", "XDG_STATE_HOME", @@ -2253,7 +2225,6 @@ exports[`native-chat launch parity > opencode worktree fresh 1`] = ` "ORCA_PAIRING_CODE": "", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", "PARITY_OVERLAY": "opencode", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", @@ -2278,7 +2249,11 @@ exports[`native-chat launch parity > opencode worktree fresh 1`] = ` "ORCA_DATA_ACCOUNT_PROVIDER", "ORCA_OPENCODE_CONFIG_DIR", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", + "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", "XDG_DATA_HOME", "XDG_STATE_HOME", @@ -2327,7 +2302,6 @@ exports[`native-chat launch parity > opencode worktree fresh configured 1`] = ` "ORCA_PAIRING_CODE": "", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", "PARITY_OVERLAY": "opencode-configured", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", @@ -2351,7 +2325,11 @@ exports[`native-chat launch parity > opencode worktree fresh configured 1`] = ` "ORCA_DATA_ACCOUNT_PROVIDER", "ORCA_OPENCODE_CONFIG_DIR", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", + "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", "XDG_DATA_HOME", "XDG_STATE_HOME", @@ -2424,7 +2402,10 @@ exports[`native-chat launch parity > opencode worktree fresh worker 1`] = ` "ORCA_DATA_ACCOUNT_PROVIDER", "ORCA_OPENCODE_CONFIG_DIR", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", "XDG_DATA_HOME", "XDG_STATE_HOME", @@ -2473,7 +2454,6 @@ exports[`native-chat launch parity > opencode worktree resumed 1`] = ` "ORCA_PAIRING_CODE": "", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", "PARITY_OVERLAY": "opencode", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", @@ -2498,7 +2478,11 @@ exports[`native-chat launch parity > opencode worktree resumed 1`] = ` "ORCA_DATA_ACCOUNT_PROVIDER", "ORCA_OPENCODE_CONFIG_DIR", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", + "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", "XDG_DATA_HOME", "XDG_STATE_HOME", @@ -2547,7 +2531,6 @@ exports[`native-chat launch parity > opencode worktree resumed configured 1`] = "ORCA_PAIRING_CODE": "", "ORCA_REMOTE_PAIRING": "", "ORCA_STRUCTURED_SESSION": "1", - "ORCA_TERMINAL_HANDLE": "term_parent", "ORCA_USER_DATA_PATH": "/user-data", "PARITY_OVERLAY": "opencode-configured", "PATH": "/orca-cli/bin:/bin:/opt/login-shell/bin:/usr/bin:/bin", @@ -2571,7 +2554,11 @@ exports[`native-chat launch parity > opencode worktree resumed configured 1`] = "ORCA_DATA_ACCOUNT_PROVIDER", "ORCA_OPENCODE_CONFIG_DIR", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", + "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", "XDG_DATA_HOME", "XDG_STATE_HOME", @@ -2640,8 +2627,11 @@ exports[`native-chat launch parity > pi floating fresh 1`] = ` "ORCA_CHAT_VISUALS_DIR", "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", ], "supervisor": { @@ -2712,8 +2702,11 @@ exports[`native-chat launch parity > pi floating resumed 1`] = ` "ORCA_CHAT_VISUALS_DIR", "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", ], "supervisor": { @@ -2780,8 +2773,11 @@ exports[`native-chat launch parity > pi worktree fresh 1`] = ` "ORCA_CHAT_VISUALS_DIR", "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", ], "supervisor": { @@ -2847,8 +2843,11 @@ exports[`native-chat launch parity > pi worktree fresh configured 1`] = ` "ORCA_CHAT_VISUALS_DIR", "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", ], "supervisor": { @@ -2916,7 +2915,10 @@ exports[`native-chat launch parity > pi worktree fresh worker 1`] = ` "ORCA_CHAT_VISUALS_DIR", "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", ], "supervisor": { @@ -2985,8 +2987,11 @@ exports[`native-chat launch parity > pi worktree resumed 1`] = ` "ORCA_CHAT_VISUALS_DIR", "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", ], "supervisor": { @@ -3054,8 +3059,11 @@ exports[`native-chat launch parity > pi worktree resumed configured 1`] = ` "ORCA_CHAT_VISUALS_DIR", "ORCA_CLAUDE_AGENT_STATUS_SETTINGS", "ORCA_PANE_KEY", + "ORCA_PROJECT_GROUP_ID", "ORCA_TAB_ID", "ORCA_TERMINAL_HANDLE", + "ORCA_WORKSPACE_ID", + "ORCA_WORKSPACE_ROOT", "ORCA_WORKTREE_ID", ], "supervisor": { diff --git a/src/main/runtime/structured-agent-launch-parity.test.ts b/src/main/runtime/structured-agent-launch-parity.test.ts index 7c61d0901c64..29db6bee30f2 100644 --- a/src/main/runtime/structured-agent-launch-parity.test.ts +++ b/src/main/runtime/structured-agent-launch-parity.test.ts @@ -135,6 +135,7 @@ import { LEGACY_NATIVE_CHAT_VISUALS_DIR_ENV, NATIVE_CHAT_SCRATCH_DIR_ENV } from '../native-chat/native-chat-visuals-delivery' +import { dropInheritedLaunchIdentityEnv } from '../startup/inherited-launch-identity-env' import type { StructuredAgentSessionAcquireInput } from '../native-chat/agent-session-wire/structured-agent-session-adapter' import type { StructuredAgentSessionEventSink } from '../native-chat/agent-session-wire/structured-agent-session-event-sink' import type { JournalHostDatabase } from '../native-chat/agent-session-journal/journal-host-database' @@ -296,6 +297,14 @@ function settingsFor(launch: LaunchCase): Partial { } } +/** This Orca's environment when it was started from a parent Orca pane, after startup dropped + * that pane's identity as every host entry does. */ +function hostEnvironment(): Record { + const env = inheritedEnvironment() + dropInheritedLaunchIdentityEnv(env) + return env +} + /** Every pane, hook, caller, handle, visuals and auth key a parent Orca pane could hand down. */ function inheritedEnvironment(): Record { const env: Record = { @@ -556,7 +565,7 @@ beforeAll(async () => { for (const directory of ['worktree', 'floating', 'floating-pinned', 'home', 'state']) { await mkdir(join(root, directory), { recursive: true }) } - process.env = inheritedEnvironment() + process.env = hostEnvironment() installAppEnvironment() settings = defaultSettings() // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the host wiring reads only the store's getSettings method. @@ -597,7 +606,7 @@ beforeAll(async () => { // and each case inherits the same environment whatever ran before it. beforeEach(() => { installAppEnvironment() - process.env = inheritedEnvironment() + process.env = hostEnvironment() }) afterAll(async () => { diff --git a/src/main/runtime/structured-session-child-env.test.ts b/src/main/runtime/structured-session-child-env.test.ts index 8403fda6dbbd..4ebb5aa9a5bb 100644 --- a/src/main/runtime/structured-session-child-env.test.ts +++ b/src/main/runtime/structured-session-child-env.test.ts @@ -10,6 +10,7 @@ import { SEALED_TEST_SPAWN_TOKEN, sealedChildEnv } from './structured-session-child-env.test-support' +import { sealStructuredSessionChild } from './structured-session-child-env' import { mintStructuredWorkerHandle, mintStructuredWorkerPaneKey, @@ -224,6 +225,63 @@ describe('sealStructuredSessionChild identity', () => { expect(Object.keys(env).filter((key) => key.includes('PANE'))).toEqual([]) }) + it.each(['chat', 'worker'] as const)( + 'strips a pane identity a settings or shell overlay supplies, for a %s of any agent', + (kind) => { + installFakeAppEnvironment({ isPackaged: () => false, getPath: () => USER_DATA }) + const handle = kind === 'worker' ? registerWorker() : null + const sealed = sealStructuredSessionChild({ + sessionId: SESSION_ID, + spawnToken: SEALED_TEST_SPAWN_TOKEN, + env: { + PATH: '/usr/bin', + ORCA_PANE_KEY: 'tab-parent:leaf-parent', + ORCA_WORKSPACE_ID: 'global-floating-terminal', + ORCA_TERMINAL_HANDLE: 'term_parent', + ORCA_AGENT_HOOK_PORT: '4100' + }, + // An agent that asks for no deletions of its own still loses the pane identity. + inheritedEnvToDelete: [] + }) + expect(sealed.env).not.toHaveProperty('ORCA_PANE_KEY') + expect(sealed.env).not.toHaveProperty('ORCA_WORKSPACE_ID') + expect(sealed.env).not.toHaveProperty('ORCA_AGENT_HOOK_PORT') + expect(sealed.env.ORCA_TERMINAL_HANDLE).toBe(handle ?? undefined) + expect(sealed.envToDelete).toEqual( + expect.arrayContaining(['ORCA_PANE_KEY', 'ORCA_WORKSPACE_ID', 'ORCA_AGENT_HOOK_PORT']) + ) + expect(sealed.envToDelete.includes('ORCA_TERMINAL_HANDLE')).toBe(handle === null) + } + ) + + it('on Windows, strips a pane identity an overlay spells in any case, and nothing else', () => { + // Windows reads a child's environment case-insensitively, so `orca_pane_key` still names a pane. + pinPlatform('win32') + installFakeAppEnvironment({ isPackaged: () => false, getPath: () => USER_DATA }) + const sealed = sealStructuredSessionChild({ + sessionId: SESSION_ID, + spawnToken: SEALED_TEST_SPAWN_TOKEN, + env: { + Path: 'C:\\Windows', + orca_pane_key: 'tab-parent:leaf-parent', + Orca_Agent_Hook_Endpoint: 'C:\\hook-endpoint', + orca_terminal_handle: 'term_parent', + // A caller's deliberate lowercase override is not identity and stays. + opencode_config_dir: 'C:\\opencode' + }, + inheritedEnvToDelete: [] + }) + // The host env reached here after startup dropped the identity in every casing. + const child = resolveProviderChildEnv(sealed, { SystemRoot: 'C:\\Windows' }) + + const named = Object.keys(child).filter((key) => + /pane_key|hook_endpoint|terminal_handle/i.test(key) + ) + expect(named).toEqual([]) + expect(child.opencode_config_dir).toBe('C:\\opencode') + expect(child.ORCA_AGENT_SESSION_ID).toBe(SESSION_ID) + }) + it('never names the WSL-scoped launcher, because a structured worker cannot run in WSL', () => { // `orca-ide` is the literal the PTY lane exports for WSL only. A structured session that // resolves to a WSL distro is refused a host scope, so it never becomes a worker at all — diff --git a/src/main/runtime/structured-session-child-env.ts b/src/main/runtime/structured-session-child-env.ts index f565a47886f4..0e33c9cc2200 100644 --- a/src/main/runtime/structured-session-child-env.ts +++ b/src/main/runtime/structured-session-child-env.ts @@ -56,27 +56,22 @@ import { ORCA_AGENT_SESSION_ID_ENV, ORCA_AGENT_SESSION_SPAWN_TOKEN_ENV } from '../../shared/agent-session-caller-env' -import { - ORCA_SCRUB_SAFE_LAUNCH_ENV, - ORCA_SCRUB_SAFE_PANE_ENV -} from '../../shared/agent-hook-scrub-safe-env' import { ORCA_STRUCTURED_SESSION_ENV } from '../../shared/structured-session-marker' import { withCliRuntimeOnPath } from '../../shared/node-cli-command-resolution' import { prependOrcaCliDirToChildPath } from '../cli/orca-cli-child-path' -import { AGENT_HOOK_RUNTIME_ENV_KEYS } from '../ipc/pty/host-env/spawn-env-keys' +import { + AGENT_HOOK_RUNTIME_ENV_KEYS, + ORCA_PANE_IDENTITY_ENV_KEYS +} from '../ipc/pty/host-env/spawn-env-keys' import { resolveStructuredWorkerIdentityForSession } from './structured-worker-authority' /** - * A pane's identity in the inherited environment would let the agent's own Orca status hooks - * report for this session too; the structured session is its one status producer. + * A pane's identity would let the agent's own Orca status hooks report for this session too; the + * structured session is its one status producer. The seal strips it for every agent, from whatever + * environment source supplied it, so no agent can opt out. */ export const STRUCTURED_CHILD_ENV_TO_DELETE: readonly string[] = [ - 'ORCA_PANE_KEY', - 'ORCA_TAB_ID', - 'ORCA_WORKTREE_ID', - 'ORCA_AGENT_LAUNCH_TOKEN', - ORCA_SCRUB_SAFE_PANE_ENV, - ORCA_SCRUB_SAFE_LAUNCH_ENV, + ...ORCA_PANE_IDENTITY_ENV_KEYS, ...AGENT_HOOK_RUNTIME_ENV_KEYS ] @@ -87,9 +82,9 @@ export type SealedStructuredSessionChild = { } /** - * `env` named as this session's child. `inheritedEnvToDelete` is required so every agent states - * what it strips, none included; a key the seal itself names the child by is never stripped (a - * registered worker keeps its handle). `cliRuntimeCommand`: a Node CLI whose own directory goes + * `env` named as this session's child. `inheritedEnvToDelete` is what the agent strips beyond + * STRUCTURED_CHILD_ENV_TO_DELETE, none included; a key the seal itself names the child by is never + * stripped (a registered worker keeps its handle). `cliRuntimeCommand`: a Node CLI whose own directory goes * first on PATH, after the identity's, so it runs on the runtime beside it. */ export function sealStructuredSessionChild(input: { @@ -99,7 +94,7 @@ export function sealStructuredSessionChild(input: { inheritedEnvToDelete: readonly string[] cliRuntimeCommand?: string }): SealedStructuredSessionChild { - const identity = childIdentity(input.sessionId, input.env) + const identity = childIdentity(input.sessionId, withoutPaneIdentity(input.env)) const named = new Set([ ORCA_AGENT_SESSION_ID_ENV, ORCA_STRUCTURED_SESSION_ENV, @@ -111,10 +106,28 @@ export function sealStructuredSessionChild(input: { : identity.env return { env: { ...env, [ORCA_AGENT_SESSION_SPAWN_TOKEN_ENV]: input.spawnToken }, - envToDelete: input.inheritedEnvToDelete.filter((key) => !named.has(key)) + envToDelete: [ + ...new Set([...STRUCTURED_CHILD_ENV_TO_DELETE, ...input.inheritedEnvToDelete]) + ].filter((key) => !named.has(key)) } } +/** On Windows in any casing: the child reads its environment case-insensitively, so an + * `orca_pane_key` from a settings or shell overlay still names a pane there. The inherited host + * env needs no such pass; startup already dropped these keys from Windows' case-insensitive env. */ +function withoutPaneIdentity(env: Record): Record { + const identityKeys = new Set( + STRUCTURED_CHILD_ENV_TO_DELETE.map((key) => + process.platform === 'win32' ? key.toUpperCase() : key + ) + ) + return Object.fromEntries( + Object.entries(env).filter( + ([key]) => !identityKeys.has(process.platform === 'win32' ? key.toUpperCase() : key) + ) + ) +} + function childIdentity( sessionId: string, childEnv: Record diff --git a/src/main/startup/configure-process.test.ts b/src/main/startup/configure-process.test.ts index c0d8123f3a7a..57604787b2d8 100644 --- a/src/main/startup/configure-process.test.ts +++ b/src/main/startup/configure-process.test.ts @@ -394,23 +394,28 @@ describe('configureOrcaUserDataPathEnv', () => { expect(configuredUserDataPath).toBe('/tmp/current-orca-user-data') }) - it('drops a runtime source inherited from the Orca terminal that started this Orca', async () => { + it('drops a runtime source and pane inherited from the Orca terminal that started this Orca', async () => { const { app } = await import('electron') const { configureOrcaUserDataPathEnv } = await import('./configure-process') const saved = { ...process.env } process.env.ORCA_RUNTIME_SOURCE_ID = 'parent-source' process.env.ORCA_RUNTIME_SOURCE_INCARNATION = 'parent-runtime' + process.env.ORCA_PANE_KEY = 'tab-parent:leaf-parent' app.setPath('userData', '/tmp/current-orca-user-data') let inherited: (string | undefined)[] = [] try { configureOrcaUserDataPathEnv() - inherited = [process.env.ORCA_RUNTIME_SOURCE_ID, process.env.ORCA_RUNTIME_SOURCE_INCARNATION] + inherited = [ + process.env.ORCA_RUNTIME_SOURCE_ID, + process.env.ORCA_RUNTIME_SOURCE_INCARNATION, + process.env.ORCA_PANE_KEY + ] } finally { process.env = saved } - expect(inherited).toEqual([undefined, undefined]) + expect(inherited).toEqual([undefined, undefined, undefined]) }) }) diff --git a/src/main/startup/configure-process.ts b/src/main/startup/configure-process.ts index f7e9125ae5a2..7139767d2f03 100644 --- a/src/main/startup/configure-process.ts +++ b/src/main/startup/configure-process.ts @@ -8,7 +8,7 @@ import { getMainE2EConfig } from '../e2e-config' import { DISABLED_CHROMIUM_FEATURES } from './disabled-chromium-features' import { readHttp1CompatibilityMarker } from './http1-compatibility-marker' import { checkServeUserDataPath } from './serve-user-data-path-guard' -import { stampRuntimeSourceEnv } from '../../shared/runtime-source-env' +import { dropInheritedLaunchIdentityEnv } from './inherited-launch-identity-env' import { isLinuxWaylandSession } from '../../shared/linux-wayland-session' import { hasMissingProfileStateDatabaseWithRetainedAuthority, @@ -245,8 +245,8 @@ export function configureOrcaUserDataPathEnv(): void { } // Why: relaunches can inherit a stale ORCA_USER_DATA_PATH; canonicalize before CLI-shared modules build runtime-home paths. process.env.ORCA_USER_DATA_PATH = userDataPath - // Why: an Orca started from another Orca's terminal must not fence its own CLI children to the parent. - stampRuntimeSourceEnv(process.env, null) + // Why: an Orca started from an Orca terminal or chat is neither, and must not fence its CLI children to the parent. + dropInheritedLaunchIdentityEnv(process.env) } export function shouldInstallManagedHooks(isDev: boolean): boolean { diff --git a/src/main/startup/inherited-launch-identity-env.test.ts b/src/main/startup/inherited-launch-identity-env.test.ts new file mode 100644 index 000000000000..7b8ae3d3230d --- /dev/null +++ b/src/main/startup/inherited-launch-identity-env.test.ts @@ -0,0 +1,38 @@ +import { describe, expect, it } from 'vitest' +import { dropInheritedLaunchIdentityEnv } from './inherited-launch-identity-env' + +describe('dropInheritedLaunchIdentityEnv', () => { + it('drops the pane and chat identity of the Orca terminal that started this host', () => { + const parentIdentity = { + ORCA_PANE_KEY: 'tab-parent:leaf-parent', + ORCA_TAB_ID: 'tab-parent', + ORCA_WORKTREE_ID: 'global-floating-terminal', + ORCA_WORKSPACE_ID: 'global-floating-terminal', + ORCA_PROJECT_GROUP_ID: 'parent-group', + ORCA_WORKSPACE_ROOT: '/parent/folder', + ORCA_AGENT_LAUNCH_TOKEN: 'parent-launch', + ORCA_AGENT_PANE: 'tab-parent:leaf-parent', + ORCA_AGENT_LAUNCH: 'parent-launch', + ORCA_TERMINAL_HANDLE: 'term_parent', + ORCA_AGENT_HOOK_PORT: '4100', + ORCA_AGENT_HOOK_TOKEN: 'parent-hook-token', + ORCA_AGENT_HOOK_ENDPOINT: '/parent/endpoint.env', + ORCA_AGENT_SESSION_ID: 'parent-chat', + ORCA_STRUCTURED_SESSION: '1', + ORCA_AGENT_SESSION_SPAWN_TOKEN: 'parent-spawn', + ORCA_CHAT_SCRATCH_DIR: '/parent/scratch', + ORCA_CHAT_VISUALS_DIR: '/parent/visuals', + ORCA_RUNTIME_SOURCE_ID: 'parent-source', + ORCA_RUNTIME_SOURCE_INCARNATION: 'parent-runtime' + } + const env: Record = { + ...parentIdentity, + PATH: '/usr/bin', + ORCA_USER_DATA_PATH: '/this/profile' + } + + dropInheritedLaunchIdentityEnv(env) + + expect(env).toEqual({ PATH: '/usr/bin', ORCA_USER_DATA_PATH: '/this/profile' }) + }) +}) diff --git a/src/main/startup/inherited-launch-identity-env.ts b/src/main/startup/inherited-launch-identity-env.ts new file mode 100644 index 000000000000..c0a9fe231a31 --- /dev/null +++ b/src/main/startup/inherited-launch-identity-env.ts @@ -0,0 +1,35 @@ +import { stampRuntimeSourceEnv } from '../../shared/runtime-source-env' +import { ORCA_AGENT_SESSION_SPAWN_TOKEN_ENV } from '../../shared/agent-session-caller-env' +import { + AGENT_HOOK_RUNTIME_ENV_KEYS, + ORCA_AGENT_SESSION_CALLER_ENV_KEYS, + ORCA_PANE_IDENTITY_ENV_KEYS +} from '../ipc/pty/host-env/spawn-env-keys' +import { + LEGACY_NATIVE_CHAT_VISUALS_DIR_ENV, + NATIVE_CHAT_SCRATCH_DIR_ENV +} from '../native-chat/native-chat-visuals-delivery' + +/** + * What an Orca spawn names its child by: a terminal pane's identity, workspace hints and hook route, + * a chat session's caller identity, and a chat's scratch folder. Orca never sets these on itself, so + * a host that holds one at startup was launched from inside that pane or chat (`pnpm dev`, `orca + * serve` or the app run from an Orca terminal), and every child it spawns would claim to be it. + */ +const INHERITED_LAUNCH_IDENTITY_ENV_KEYS = [ + ...ORCA_PANE_IDENTITY_ENV_KEYS, + ...AGENT_HOOK_RUNTIME_ENV_KEYS, + ...ORCA_AGENT_SESSION_CALLER_ENV_KEYS, + ORCA_AGENT_SESSION_SPAWN_TOKEN_ENV, + NATIVE_CHAT_SCRATCH_DIR_ENV, + LEGACY_NATIVE_CHAT_VISUALS_DIR_ENV +] as const + +/** Drops the launching pane's or chat's identity from a host's own environment, once at startup, + * so nothing the host spawns inherits it. */ +export function dropInheritedLaunchIdentityEnv(env: Record): void { + for (const key of INHERITED_LAUNCH_IDENTITY_ENV_KEYS) { + delete env[key] + } + stampRuntimeSourceEnv(env, null) +}