Repository navigation
fix(nodes): make node-placed Claude CLI turns work end to end - #16
Merged
Merged
Conversation
Every turn of a Claude CLI session adopted on a paired node failed:
- invokeNodeClaudeCliRun and the node skill runtime read scope.context,
which the session-work admission lease deliberately drops in favor of
resolveGatewayContext ("Gateway node runtime unavailable"). Read the
context through getInProcessGatewayRequestContext instead.
- prepareCliSessionBinding probed the Gateway-local Claude transcript for a
node-placed session, always missed, cleared the binding, and the fork
claim then failed ("CLI session fork marker is no longer available").
- The post-turn isCliBindingFlushed probe missed the same way, so the fork
successor id was never persisted and every later turn started fresh.
Node placement comes from resolveCliExecutionTarget, which prepare.ts
already uses to skip its own probe. Tests now run the node helpers under
the real admitted-turn scope shape instead of a hand-built request scope.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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.
Problem
On 2026.10.2, every turn of a Claude CLI session adopted on a paired headless node failed. Upstream
mainhas the same code.invokeNodeClaudeCliRunand the node skill runtime readscope.context. The session-work admission lease removes that field on purpose (withPluginRuntimeGatewayContextResolver,delete scoped.context), so every node-placed turn failed with "Gateway node runtime unavailable" (via bothchat.sendand theagentRPC).prepareCliSessionBindingchecked for the Claude transcript on the Gateway's disk. For a node session the transcript is on the node, so the check always missed and cleared a valid binding. The fork claim then failed with "CLI session fork marker is no longer available".isCliBindingFlushedcheck missed the same way. The fork's new session id was never persisted, so every later turn started a fresh Claude session.Solution
getInProcessGatewayRequestContext(), which checks the live resolver first.resolveCliExecutionTarget, whichprepare.tsalready uses to skip its own check.Evidence
node-agent-cli-runtimeandnode-claude-skill-runtimenow run under the real admitted-turn scope. They failed with the production errors before the fix.attempt-execution.cliandcli-runner.context-enginegained a node-placed case each. Both failed before the fix.execHost: "node"withoutexecNode, a state the placement owner rejects. It now includesexecNode.pnpm teston the 7 affected files: 189 passed, wall time about 98 s across 4 shards.pnpm tsgois clean.--profile m0) with a headless node in Docker:chat.abortstopped the run in 9 ms, with noclaudeprocess left on the node.Fork-only for now; not sent upstream.
🤖 Generated with Claude Code