Repository navigation
claude: read session history from the provider's Claude home - #12
Merged
Merged
Conversation
Forking a Claude thread failed with "Session ... not found" whenever the provider instance sets its own Claude home (homePath, exported as CLAUDE_CONFIG_DIR). The orchestrator rewrite (pingdotgg#2829) called the SDK's forkSession and getSubagentMessages inside the server. Those helpers find transcripts through process.env.CLAUDE_CONFIG_DIR, cached on first use, so they searched the server's home, not the instance's. Both now run in the existing claude-history worker child, started with the instance's environment, as the old adapter did. The subagent lookup failed the same way but silently: its caller swallows the error. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Encode worker options with Schema, fail with the runner's tagged error, and build the test's Claude homes through FileSystem and Path. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Forking a Claude thread failed with
Claude Agent SDK query failed.(cause:Session <id> not found in project directory) whenever the Claude instance sets its own Claude home (homePath→CLAUDE_CONFIG_DIR). The SDK's history helpers readCLAUDE_CONFIG_DIRfromprocess.envand cache it, so inside the server they searched the server's home. The orchestrator rewrite (upstream pingdotgg#2829) dropped the child-process worker the old adapter used.claudeHistoryWorker.tslearnsgetSubagentMessages(agentId,limit).Evidence
New
ClaudeAdapterV2.queryRunner.test.ts: the server'sCLAUDE_CONFIG_DIRpoints at an empty dir; the transcript lives in the provider's home, passed asenvironment.Tests 2 failed (2)—Caused by: Error: Session 6f0c6a52-… not foundandexpected null to equal 'toolu_01SubagentLaunch'After:
Tests 2 passed (2)ClaudeAdapterV2.test.ts+ new file: 150/150 pass.tsc --noEmitclean,vp fmt --checkandvp lintclean.AntigravityAdapterV2.test.tsfailures inorchestration-v2/Adapters/also fail on unchangedcustom-v2.getSubagentMessageswithCLAUDE_CONFIG_DIR=~/.claude-poolreturns the launch id for a real subagent.Merge Danger
Door: two-way
Revert the commit to return to in-process calls. No stored data changes.
Blast Radius: small
Only Claude thread forks and the subagent launch lookup. Each now spawns one short child process (30 s timeout). Desktop builds run it with
ELECTRON_RUN_AS_NODE=1, as the old adapter did. The single-executable uses the existing__claude-historysubcommand.🤖 Generated with Claude Code