Repository navigation
fix(ai-vault): list Claude sessions from a wrapper or launch-setting CLAUDE_CONFIG_DIR - #33751
Conversation
…CLAUDE_CONFIG_DIR History, usage and transcript lookup now also scan Claude config folders Orca saw in Claude hook transcript paths (kept across restarts) and the CLAUDE_CONFIG_DIR set in Orca's Claude launch environment. Fixes #23505
|
Warning Review limit reachedYou'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 8 minutes. View limit details
Walkthrough
Priority: Severity of issue fixed: Medium Merge Risk:
|
Adds tests that only Claude hooks record a folder (not same-layout CodeBuddy), non-transcript paths are ignored, and the 32-entry cap holds.
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
733638e4-2703-475c-aef8-443b32cf8502
Files selected for processing: 8-
src/main/agent-hooks/server-claude-config-dir-observation.test.tssrc/main/agent-hooks/server/server-ingest-normalization.tssrc/main/claude-accounts/claude-credential-persistence-ratchet.test.tssrc/main/claude-accounts/claude-observed-config-dirs.tssrc/main/claude-accounts/claude-profile-installed-router.tssrc/main/claude-accounts/claude-profile-router.test.tssrc/main/claude-accounts/runtime-auth-service.test.tssrc/main/claude-accounts/runtime-auth-service.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
-
| if ( | ||
| basename(projectsDir) !== 'projects' || | ||
| this.observed.includes(configDir) || | ||
| this.missing.has(configDir) |
There was a problem hiding this comment.
Retry config directories that become available.
If a hook first reports a path while its config directory is unavailable, Line 49 adds the directory to missing. Line 42 then rejects every later hook for that directory without checking it again. If a mount or directory becomes available while Orca remains open, its sessions stay absent from History until restart. Expire cache entries or retry the filesystem check after a bounded interval.
ELI5
Some people run Claude through a small wrapper script, like
claude-work, that points Claude at a different settings folder (CLAUDE_CONFIG_DIR=~/.claude-work). Others set that folder in Orca's own Claude launch environment setting. Claude saves its chats in that folder, but Agent Session History only looked in~/.claudeand in folders the login shell names. So these chats never showed up. Now Orca remembers any Claude folder it actually sees in use and lists chats from there too.What was still broken after #33506
#33506 covered a
CLAUDE_CONFIG_DIRexported from the shell profile. I reproduced the remaining cases on main with isolatedHOME/CLAUDE_CONFIG_DIRandenv -i, using the realclaude2.1.310:export CLAUDE_CONFIG_DIRin shell rcclaude-work)CLAUDE_CONFIG_DIRRoot cause
$CLAUDE_CONFIG_DIR/projects/<encoded-cwd>/<id>.jsonl, and its hook payloads report that path astranscript_path. Captured from the real CLI:"transcript_path":"/tmp/agint-23505-h1/.claude-work/projects/-private-tmp-agint-23505-h1-proj/5bc3….jsonl".claudeProfileHistoryDirs()only returned the login-shellCLAUDE_CONFIG_DIRand the managed account homes. A wrapper's env var lives only in that one child process. The launch-setting env var was never read.Change
ClaudeObservedConfigDirs. When a local Claude hook arrives, it takestranscript_path, derives<config>from<config>/projects/<dir>/<file>, and saves it touserData/claude-observed-config-dirs.json. It only does this if the folder exists on this host. The list is capped at 32 entries.agentDefaultEnv.claude.CLAUDE_CONFIG_DIRwhen it is set to an absolute path.claudeProfileHistoryDirs()includes both lists and removes duplicates. History scan roots, usage discovery, native-chat transcript lookup and worktree-retirement discovery all go through this one function, so they all pick it up.ClaudeRuntimeAuthService, which runs in both desktop main and orcad. Remote/SSH hosts record and scan their own folders. Paths from WSL or remote panes are skipped because the folder doesn't exist on this host.Not guessed: Orca only adds folders it saw in a hook payload or that come from Orca's own launch setting.
Verification
claude-workwrapper ran under an isolated HOME. I POSTed the captured hook payload over HTTP to a realAgentHookServer, re-created the service as if Orca had restarted, then ranlocalAiVaultScanRoots()+scanAiVaultSessions():claudeProfileProjectsDirs = [], Claude sessions[]claudeProfileProjectsDirs = [".../.claude-work/projects"], sessions["5bc3ce6f-…", "91b9ef8e-…"]claude-work '--resume' '<id>'), so a wrapper set as the Claude command resumes under the right folder.claude-profile-router.test.ts: a hook-observed folder survives a restart, and the launch-setting folder is listed. Both fail on main.pnpm tc:node, the claude-accounts / scanner-roots / claude-usage / hook continuation tests, andcheck:code-quality:changedall pass.Limits / risk
~/.claude/settings.json(and managed account homes). The reporter copied them into~/.claude-work. With no hooks there, Orca never sees anything from that folder. Installing hooks into user-chosen folders is a separate change.claude, Resume still runs plainclaude --resume.Fixes #23505