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 64697b300e0..3422726b7ca 100644 --- a/src/main/ipc/pty/host-env/spawn-env-keys.ts +++ b/src/main/ipc/pty/host-env/spawn-env-keys.ts @@ -12,11 +12,14 @@ export const AGENT_HOOK_RUNTIME_ENV_KEYS = [ 'ORCA_CLAUDE_AGENT_STATUS_SETTINGS' ] as const -// Inherited Claude child stamps would disable independent-pane transcript persistence. +// Inherited Claude child stamps make an independent pane act as the launching session's child. export const CLAUDE_CHILD_SESSION_STAMP_ENV_KEYS = [ + 'CLAUDECODE', 'CLAUDE_CODE_CHILD_SESSION', 'CLAUDE_CODE_SESSION_ID', - 'CLAUDE_CODE_BRIDGE_SESSION_ID' + 'CLAUDE_CODE_BRIDGE_SESSION_ID', + 'CLAUDE_CODE_EXECPATH', + 'CLAUDE_CODE_ENTRYPOINT' ] as const // Inherited structured-session IDs would make every pane claim the parent orchestration caller. diff --git a/src/main/ipc/pty/pty-spawn-env-terminal-basics.test.ts b/src/main/ipc/pty/pty-spawn-env-terminal-basics.test.ts index f476fa505db..b8246352e7c 100644 --- a/src/main/ipc/pty/pty-spawn-env-terminal-basics.test.ts +++ b/src/main/ipc/pty/pty-spawn-env-terminal-basics.test.ts @@ -471,11 +471,17 @@ describe('registerPtyHandlers', () => { const env = await spawnAndGetEnv(undefined, { CLAUDE_CODE_CHILD_SESSION: '1', CLAUDE_CODE_SESSION_ID: '85935aed-98a7-4094-89a8-85c75e1a5a95', - CLAUDE_CODE_BRIDGE_SESSION_ID: 'session_01UCkWN5nDXNyD1V7cfamCxa' + CLAUDE_CODE_BRIDGE_SESSION_ID: 'session_01UCkWN5nDXNyD1V7cfamCxa', + CLAUDECODE: '1', + CLAUDE_CODE_EXECPATH: '/old/claude', + CLAUDE_CODE_ENTRYPOINT: 'cli' }) expect(env.CLAUDE_CODE_CHILD_SESSION).toBeUndefined() expect(env.CLAUDE_CODE_SESSION_ID).toBeUndefined() expect(env.CLAUDE_CODE_BRIDGE_SESSION_ID).toBeUndefined() + expect(env.CLAUDECODE).toBeUndefined() + expect(env.CLAUDE_CODE_EXECPATH).toBeUndefined() + expect(env.CLAUDE_CODE_ENTRYPOINT).toBeUndefined() }) it('strips an inherited agent session id so a pane never claims that session', async () => { // Inherited structured-session IDs must not make every pane claim the parent orchestration caller.