Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.
TypeScript adeagent-ideai-agentsautomationbotclaude-codecodexghosttygrok-bothermes-agentmobile-appmuseopenclawopencodeorchestrationpiruntimeterminalworktreesyc-backed
perf(native-chat): skip WSL distro walk for host-native transcript hook paths (STA-3786) (#36152)
Neil4f052ad0c342
diff --git a/src/main/native-chat/session-file-resolver-wsl-scan-gate.test.ts b/src/main/native-chat/session-file-resolver-wsl-scan-gate.test.tsindex 72b4d7246b1..c46e24fede4 100644--- a/src/main/native-chat/session-file-resolver-wsl-scan-gate.test.ts+++ b/src/main/native-chat/session-file-resolver-wsl-scan-gate.test.ts@@ -138,6 +138,18 @@ describe('Codex WSL scan gate', () => {expect(mocks.walk).not.toHaveBeenCalled()})+ it('skips running-distro roots when a host hook path is not flushed yet', async () => {+ await expect(+ resolveSessionFilePath('codex', 'session-id', {+ transcriptPath: `${LOCAL_SESSIONS_DIR}\\2026\\rollout-1-session-id.jsonl`+ })+ ).resolves.toBeNull()++ expect(mocks.walk).toHaveBeenCalled()+ expect(mocks.walk.mock.calls.some(([dir]) => dir.startsWith('\\\\wsl'))).toBe(false)+ expect(mocks.gate).not.toHaveBeenCalled()+ })+it('surfaces the hook-path refusal when the id search also misses', async () => {const refusal = new WslTranscriptFsError('unavailable', 'stuck permits')mocks.gate.mockImplementation(async (options: { operation?: string; path: string }) => {diff --git a/src/main/native-chat/session-file-resolver.ts b/src/main/native-chat/session-file-resolver.tsindex fb029bfedf0..5b524beadb5 100644--- a/src/main/native-chat/session-file-resolver.ts+++ b/src/main/native-chat/session-file-resolver.ts@@ -82,13 +82,14 @@ export async function resolveSessionFilePath(}let unavailable: WslTranscriptFsError | undefinedconst hookPath = options.transcriptPath?.trim()+ const jsonlHookPath = hookPath && extname(hookPath) === '.jsonl' ? hookPath : undefined// SSH paths are readable only on their attested host; never fall back to this machine.if (hookPath && parseSshTranscriptPath(hookPath)) {- return extname(hookPath) === '.jsonl' ? hookPath : null+ return jsonlHookPath ?? null}- if (hookPath && extname(hookPath) === '.jsonl') {+ if (jsonlHookPath) {try {- const hostReadable = await toHostReadableTranscriptPath(hookPath, {+ const hostReadable = await toHostReadableTranscriptPath(jsonlHookPath, {signal,wslDistro: options.wslDistro})@@ -118,7 +119,15 @@ export async function resolveSessionFilePath(return null}- const resolved = await resolveSessionFileById(transcriptAgent, sessionId, options, signal)+ // Host hook paths prove a host-launched agent, so its transcript cannot be in a guest.+ const wslTier = !jsonlHookPath+ const resolved = await resolveSessionFileById(+ transcriptAgent,+ sessionId,+ options,+ wslTier,+ signal+ )if (!resolved && unavailable) {throw unavailable}@@ -129,6 +138,7 @@ async function resolveSessionFileById(transcriptAgent: NativeChatTranscriptAgent,sessionId: string,options: ResolveSessionFileOptions,+ wslTier: boolean,signal?: AbortSignal): Promise<string | null> {if (transcriptAgent === 'opencode') {@@ -143,7 +153,7 @@ async function resolveSessionFileById(if (transcriptAgent === 'claude') {const override = options.claudeProjectsDirreturn resolveTiered('claude', trimmedId, override ? [override] : claudeProjectsDirs(), {- wslTier: !override,+ wslTier: wslTier && !override,signal,strictErrors: options.strictErrors})@@ -151,7 +161,7 @@ async function resolveSessionFileById(if (transcriptAgent === 'codex') {const override = options.codexSessionsDirsreturn resolveTiered('codex', trimmedId, override ?? codexSessionsDirs(), {- wslTier: !override,+ wslTier: wslTier && !override,...(override ? {} : { accountDirs: codexAccountSessionsDirs }),signal,strictErrors: options.strictErrors@@ -160,7 +170,7 @@ async function resolveSessionFileById(if (transcriptAgent === 'grok') {const override = options.grokSessionsDirreturn resolveTiered('grok', trimmedId, [override ?? grokSessionsDir()], {- wslTier: !override,+ wslTier: wslTier && !override,signal,strictErrors: options.strictErrors})@@ -169,7 +179,7 @@ async function resolveSessionFileById(const override = options.ompSessionsDirconst root = resolveOmpSessionsDir({ sessionsDir: override })return resolveTiered('omp', trimmedId, root ? [root] : [], {- wslTier: override === undefined,+ wslTier: wslTier && override === undefined,signal,strictErrors: options.strictErrors})