Skip to content

fix(native-chat): lazy WSL tier for Claude, Grok and omp lookup by id - #27082

Merged
OrcaWin merged 1 commit into
mainfrom
np/p395-wsl-transcript-tier
Oct 10, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
np/p395-wsl-transcript-tier

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​95 $\color{#cf222e}{\Huge{\mathbf{−}}}$​22 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​73
Prod 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​173 $\color{#cf222e}{\Huge{\mathbf{−}}}$​158 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​15

ELI5

When Claude runs inside WSL on Windows, Orca's chat view has to find the session's history file inside the Linux distro. If the agent's hook never told Orca where that file is, Orca looked only in the Windows home folder, gave up, and showed "Transcript unavailable". Codex already had a fallback that also looks inside running distros. This gives Claude, Grok and omp the same fallback.

What Changed

  • Before: Claude (and Grok and omp) inside WSL, with no hook transcript path: chat loads for a while, then shows "Transcript unavailable", while the terminal view works.
  • After: the lookup searches this computer's own folders first and, only if the session is not there, the same agent's folders inside each running distro. It finds the file and chat loads.

Mechanism:

  • wslCodexSessionsDirs becomes wslAgentSessionsDirs(agent). It builds each running distro's roots from the shared table added in the previous PR (AGENT_SESSION_HOME_SEGMENTS), so the WSL roots are the same ones Session History lists.
  • findWslCodexSessionPath becomes findWslSessionPath(agent, …). It keeps the existing behavior: one shared tree walk per root for concurrent lookups, a refresh after a shared miss, and abort handling.
  • A new SESSION_FILE_ID_LAYOUTS table says how each agent names a session's file (Claude <id>.jsonl, Codex rollout-…-<id>.jsonl, Grok <group>/<id>/chat_history.jsonl, omp <stamp>_<id>.jsonl with its subagent-folder prune). Host and WSL lookups both use it.
  • The resolver's four per-agent lookups collapse into one resolveTiered: host roots in order (an earlier root still wins), then the WSL tier on a miss.

Unchanged guards: an SSH transcript path returns before any lookup. A WSL hook path, or an attested distro, still refuses an ID fallback. A caller-supplied root override gets no WSL tier, which keeps one account's transcript from resolving to another's.

Why

The fallback already existed and had been tuned for Codex: lazy, running distros only, gated reads so a stalled distro reads as "unavailable", not "missing". Reusing it for every agent is smaller and safer than writing three more. Picking the newest file across roots was rejected: it would break root priority (the config-dir-first rule and account isolation).

Linked Issue

Refs #13789. The unit test reproduces the hook-less path from that report, and this fixes it. The report predates main's WSL hook-path translation, so we will ask the reporter to confirm on a build with this change before closing.

Visual Proof

N/A: no UI change. The chat view now loads a transcript it used to fail to find.

Testing

  • session-file-resolver-wsl.test.ts, new and failing on the base branch:

    • a Claude, omp or Grok transcript that exists only in a running distro resolves;
    • a distro that is not running is never searched.
  • Guard: when a host Claude root has the session, WSL distros are never listed.

  • Renamed wsl-session-path-scan.test.ts and host-readable-transcript-path.test.ts keep their existing coverage.

  • pnpm test src/main/native-chat: 378 files pass. pnpm tc:node, oxlint and check:code-quality:changed pass.

  • Not run on a real Windows/WSL machine.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Windows/WSL: the tier runs only on Windows, only after the host roots miss, and only for running distros, so it never boots a stopped distro.
  • SSH: unchanged (orca-ssh-transcript: paths return first).
  • macOS/Linux: the WSL tier returns no roots.
  • Wire: none.

Builds on #27079 (merged).

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@OrcaWin
OrcaWin force-pushed the np/p395-wsl-transcript-tier branch from 15bb902 to ece80af Compare October 10, 2026 01:42
Only Codex had a WSL fallback when a transcript is looked up by session id,
so Claude running inside WSL with no hook path was searched only on the
Windows profile and chat showed "Transcript unavailable". Every id lookup
now searches this host's roots first and, only on a miss, each running
distro's roots for the same agent, through the shared per-root WSL scan.

One layout table names how each agent files a session (claude, codex, grok,
omp) for both host and WSL lookups.
@OrcaWin
OrcaWin changed the base branch from np/p395-agent-roots to main October 10, 2026 02:05
@OrcaWin
OrcaWin force-pushed the np/p395-wsl-transcript-tier branch from ece80af to 95db2ef Compare October 10, 2026 02:05
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 11 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 154adc8c-3b65-4490-8cc4-03fb45cb90d7

📥 Commits

Reviewing files that changed from the base of the PR and between 1726a10 and 95db2ef.


📒 Files selected for processing (9)
  • config/scripts/ci-shard-timings.json
  • src/main/ai-vault/session-scanner-roots.ts
  • src/main/native-chat/host-readable-transcript-path.test.ts
  • src/main/native-chat/host-readable-transcript-path.ts
  • src/main/native-chat/session-file-id-layouts.ts
  • src/main/native-chat/session-file-resolver-wsl.test.ts
  • src/main/native-chat/session-file-resolver.ts
  • src/main/native-chat/wsl-session-path-scan.test.ts
  • src/main/native-chat/wsl-session-path-scan.ts


✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR




  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@OrcaWin
OrcaWin merged commit c9b7244 into main Oct 10, 2026
32 checks passed
@OrcaWin
OrcaWin deleted the np/p395-wsl-transcript-tier branch October 10, 2026 02:29
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