Repository navigation
fix(anthropic): use identity-resolved executable path for claude-cli on Windows - #138558
synthalorian wants to merge 2 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
|
Codex review: needs real behavior proof before merge. Reviewed September 18, 2026, 3:27 PM ET / 19:27 UTC (Revision 5). ClawSweeper reviewWhat this changesThe branch passes executable identity through the CLI runner and makes the Anthropic Agent SDK use its resolved command on Windows. Merge readiness⛔ Blocked before merge - 9 items remain The prior normal-launch blocker remains unchanged, and the new transcript demonstrates a mocked test rather than a Windows launch. The merged transport replacement changes the repair target but does not establish that ordinary Windows npm launches are fixed. Priority: P1 Review scores
Verification
How this fits togetherThe CLI runner prepares installed command-line agents for OpenClaw turns. The Anthropic plugin receives the prepared invocation, launches Claude Code, and returns its streamed response. flowchart TD
A[Agent turn] --> B[CLI runner]
B --> C{Identity binding required?}
C -->|Yes| D[Resolve executable identity]
C -->|No| E[Generic command lookup]
D --> F[Anthropic transport]
E --> F
F --> G[Claude Code process]
G --> H[Streamed response]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +42, Tests -6. Total +36 across 6 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Resolve supported Windows launchers at the shared invocation boundary and carry command, args, and argv0 into the current direct transport, without adding a parallel identity API. Do we have a high-confidence way to reproduce the issue? Yes, from source: a normal Windows turn without auth binding leaves executableIdentity absent and can pass an npm shim to process spawning. No Windows execution or tests were run in this read-only review. Is this the best way to solve the issue? No. The added handoff misses ordinary launches and duplicates the resolved command already supplied on identity-bound runs; the maintainable repair belongs in current main's prepared invocation path. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1def359971d0. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
sylvesterkaczmarek
left a comment
There was a problem hiding this comment.
Threading the resolved executable identity into the Anthropic backend is the right Windows fix: the spawn path now uses the same implementation identity that auth/tool-availability resolution selected instead of rediscovering a bare npm shim. However, this PR also changes Workboard comment/heartbeat/release results from a raw card payload to { card: ... }. That is an unrelated observable tool-contract change which can break existing consumers; I would split it out or explicitly justify and migrate that response-shape change before landing this Windows fix.
51e2a7d to
0008a58
Compare
…on Windows On Windows, the claude-cli backend cannot launch Claude Code because resolveClaudeAgentSdkOptions passes the bare command string (claude) as pathToClaudeCodeExecutable. The Agent SDK resolves this to npm's extensionless POSIX shim (a shell script), which fails to spawn on Windows. The identity layer already has the correct answer after openclaw#135138: resolveCliExecutableIdentity returns the resolved .cmd path and the actual .exe entrypoint. This fix threads the identity result through to the SDK options resolver so it can use invocation.command on win32. Changes: - Add executableIdentity to CliBackendExecuteContext - Add executableIdentity to PreparedCliRunContext - Store executableIdentity in context when resolved in execute.ts - Pass executableIdentity through to plugin context in execute-plugin.ts - Use identity-resolved path in agent-sdk.runtime.ts on win32 - Add regression tests for Windows and non-Windows paths Fixes openclaw#138424
0008a58 to
11b3971
Compare
|
/ok-to-test |
Live Behavior ProofExecuted the actual changed code path at this PR's head ( Environment
1. Regression test FAILS without the fixTemporarily reverted This reproduces the bug exactly: on 2. Full suite PASSES with the fixRestored the PR's runtime file (worktree clean, 3. What the fix does (verified in the live code)
// On Windows, the bare command resolves to npm's extensionless POSIX shim
// (a shell script), which fails to spawn. The identity layer resolves the
// actual .cmd/.exe entrypoint after #135138.
const pathToClaudeCodeExecutable =
process.platform === "win32" && context.executableIdentity
? context.executableIdentity.invocation.command
: context.command;The regression test simulates 4. Plumbing verifiedThe identity result is threaded through the CLI runner pipeline:
This is the spawn-path counterpart to the identity resolver fix (#134960 / #135138): the identity layer already resolved the correct Windows entrypoint; this change makes the SDK options actually use it. Verdict: without the fix the SDK gets |
|
@clawsweeper re-review — live behavior proof posted above, CI green. Requesting proof-label re-evaluation. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Closing as superseded — the architecture this fix targeted no longer exists. What changed upstream: #138707 ( The fix's intent is absorbed centrally: the new transport declares That is the same The linked issue #138424 is already closed. Thanks to the maintainers for the cleaner architectural resolution. 🦞 |
What Problem This Solves
On Windows, the
claude-clibackend cannot launch Claude Code.resolveClaudeAgentSdkOptionspasses the bare command string (claude) aspathToClaudeCodeExecutable, and the Agent SDK resolves it to npm's extensionless POSIX shim — a shell script that fails to spawn on Windows.This is the spawn-path counterpart to #134960, which fixed the identity resolver. The execution path never received the same treatment.
Root Cause
context.commandis the backend descriptor's barecommandfield ("claude"). The identity layer already resolves the correct.exeentrypoint viaresolveCliExecutableIdentity, but that result was never threaded through to the SDK options.Fix
Threaded the
executableIdentityresult through the CLI runner pipeline intoresolveClaudeAgentSdkOptions. Onwin32,pathToClaudeCodeExecutablenow usesexecutableIdentity.invocation.command(the resolved.exeentrypoint) instead of the bare command.Files changed (6):
src/plugins/cli-backend.types.ts— AddedexecutableIdentitytoCliBackendExecuteContextsrc/agents/cli-runner/types.ts— AddedexecutableIdentitytoPreparedCliRunContextsrc/agents/cli-runner/execute.ts— StoreexecutableIdentityin context when resolvedsrc/agents/cli-runner/execute-plugin.ts— PassexecutableIdentitythrough to plugin execution contextextensions/anthropic/agent-sdk.runtime.ts— Use identity-resolved path on win32extensions/anthropic/agent-sdk.runtime.test.ts— Regression testsEvidence
Closes #138424