Repository navigation
Conversation
…enClaw, Hermes, Codex)
PR 1/4 of the Windows coding-agents train: a self-contained ACP (Agent
Client Protocol) JSON-RPC-over-stdio adapter layer under
src/main/codingAgent/, ported from the macOS agent runtime
(desktop/macos/agent/src/adapters). Nothing is wired into chat, IPC, or
UI yet — that lands in the next PRs of the stack.
- interface.ts: RuntimeAdapter contract, capability matrix for the four
Windows adapters, binding/attempt types, id-conflation contract guards.
- acp.ts: the generic ACP client (JSON-RPC framing, session lifecycle,
streaming session/update translation, no-progress watchdog, permission
auto-resolution). Windows adaptations vs macOS: Windows env allowlist
(ComSpec/SystemRoot/PATHEXT are required for shell:true spawns and npm
.cmd shims), taskkill /t /f tree-kill in stop() (POSIX process-group
kill does not exist on Windows and a plain kill would orphan the real
agent behind cmd.exe), windowsHide, and ELECTRON_RUN_AS_NODE for the
bundled default adapter.
- claudeCode.ts: default always-available adapter — spawns the bundled
patched-acp-entry.mjs (wrapping @zed-industries/claude-agent-acp, a
pure cross-platform npm package) via a ?asset import; no separately
installed CLI required.
- openclaw.ts / hermes.ts / codex.ts: external-command adapters
activated by OMI_{OPENCLAW,HERMES,CODEX}_ADAPTER_COMMAND or (later)
settings-stored commands, with per-adapter env passthrough
(HERMES_HOME; OPENAI_API_KEY/CODEX_* for the Codex ACP bridge).
- adapterRegistry.ts: static profiles + activation checks with
preference-over-env command resolution for the future settings UI.
- toolPolicyStub.ts: minimal permission policy — auto-approve for the
trusted first-party Claude Code bridge, never a permanent grant for
untrusted external adapters (allow_once or ACP -32001).
- electron-builder.yml: asarUnpack for the entry script and the packages
it imports (a spawned Node child cannot read from the asar archive).
- vitest.config.ts: resolve electron-vite `?asset` imports to the real
source path so main-process modules stay testable.
Verification: cd desktop/windows && pnpm run typecheck (clean),
pnpm run lint (clean), pnpm test — 577 passed / 3 skipped, including
the new mocked-subprocess suites (spawn shapes, env-allowlist secret
non-leakage, taskkill tree-kill, watchdog cancellation, stderr
redaction, permission policy) and acp.integration.test.ts, which spawns
a real Node fake-ACP peer (fixtures/fakeAcpSubprocess.mjs) and runs the
full open → prompt → stream → result → stop lifecycle unmocked.
Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
All reported issues were addressed across 23 files
Confidence score: 5/5
- Safe to merge after the addressed issues were fixed.
You’re at about 94% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact [email protected].
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
…n the adapter core Fixes 11 of the 12 automated-review findings (the asarUnpack one is narrowed rather than removed — electron-builder flattens resolved deps into the package, so the transitive entries are real; the scope-wide @agentclientprotocol/** glob is now the concrete sdk package): - failures.ts: broaden stderr redaction (token/secret/password/credential fields, GitHub ghp_/github_pat_, Slack xox*) and keep the TAIL of long diagnostics so final error lines (and the OpenClaw config sniff strings) survive truncation. New failures.test.ts pins all of it. - acp.ts: gate session/update by the attempt's adapter session id so one process hosting several sessions can never stream into the wrong attempt (updates without a session id still accepted); make the no-watchdog path abort-aware so a cancelled attempt settles even when the adapter never answers session/cancel; strip user:pass@ userinfo from proxy values that URL() can't expose an authority for (e.g. "alice:pass@proxy:3128", where "alice:" parses as a scheme). - patched-acp-entry.mjs: dynamic-import the bridge AFTER the console→ stderr redirect (a static import is hoisted and could pollute stdout). Re-verified live against the real bridge: initialize handshake completes and stdout stays pure JSON-RPC. - electron-builder.yml: narrow asarUnpack to the concrete runtime deps. - tests: assert CLAUDE_CODE_USE_VERTEX deletion and windowsHide on the default spawn; assert adapterSessionId in the integration test; real session/new-level assertion that OpenClaw strips MCP servers and skips set_model; cross-session isolation and no-watchdog cancellation tests; watchdog test context uses the adapter id under test. Verification: pnpm run typecheck (clean), pnpm run lint (clean), pnpm test — 583 passed / 3 skipped; live smoke of the real bridge entry (initialize handshake, no LLM call) passed. Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
All reported issues were addressed across 9 files (changes from recent commits).
You’re at about 95% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact [email protected].
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
…rt early return Follow-up to the PR BasedHardware#9304 review: in the no-watchdog cancellation path, an already-aborted attempt returned before attaching handlers to the underlying session/prompt promise, so a later rejection (e.g. process exit) would surface as an unhandled rejection. Attach the handlers first — finish() guards double-settling — then take the early-abort exit. Regression test covers the pre-aborted + late-rejection sequence. Verification: pnpm run typecheck (clean), pnpm test — 584 passed / 3 skipped. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Thanks for the careful Windows adapter-core port here. The shape is coherent for PR 1/4: it keeps the ACP runtime isolated under I’m not approving this automatically because it is a stacked feature PR with dependency/runtime-agent changes and a large new adapter surface; it needs human maintainer review before merge. A couple of maintainer-review items I’d like checked before this lands:
No urgent security issue found in the static review; this is mainly dependency/runtime-agent policy review rather than a request to split the PR. |
…nt-acp public API Addresses the maintainer dependency review on PR BasedHardware#9304: the bundled Claude bridge was @zed-industries/[email protected] (deprecated, renamed upstream) imported via an internal dist/acp-agent.js path, with monkey-patches on package internals (ClaudeAcpAgent.prototype, the sessions map, query.next) to capture cost/usage. All three fragile boundaries are gone: - Dependency is now @agentclientprotocol/claude-agent-acp@^0.58.1 (the maintained rename; the old name has no post-rename releases). - The entry (renamed patched-acp-entry.mjs → claude-acp-entry.mjs) imports runAcp from the package's PUBLIC export and contains no patches at all — just the console→stderr redirect and runAcp(). - Cost is captured from the bridge's standard usage_update session notifications (documented ACP surface): acp.ts tracks the cumulative session cost per adapter session and reports the per-attempt delta; a per-turn _meta.costUsd on the prompt response still wins when no usage_update was seen (other ACP adapters). electron-builder asarUnpack updated to the renamed package plus its actual transitive runtime imports (@agentclientprotocol/sdk, @anthropic-ai/claude-agent-sdk + its win32-x64 native package). pnpm-workspace.yaml records the supply-chain exclusions pnpm required for these fresh versions. Verification: pnpm run typecheck (clean), pnpm run lint (clean), pnpm test — 585 passed (new cumulative-cost-delta unit test; fixture + integration test now exercise the usage_update path and its precedence over _meta). Live against the real renamed bridge on Windows 11: initialize handshake with pure JSON-RPC stdout, and a full end-to-end task (real file created, cost $0.24 captured via usage_update). Co-Authored-By: Claude Fable 5 <[email protected]>
Verified the maintainer-flagged packaged path by spawning the bridge entry from a real electron-builder build (dist/win-unpacked): the ?asset entry and the unpacked packages resolved, but the handshake failed with ERR_MODULE_NOT_FOUND — @agentclientprotocol/sdk imports zod at runtime and zod sat inside the asar, unreadable by the plain Node child. zod is the only remaining runtime import of the closure (claude-agent-acp → sdk + claude-agent-sdk + zod; the sdk declares no deps of its own and the agent-sdk only optional platform binaries). Verification: pnpm run build:unpack, then an ACP initialize handshake against app.asar.unpacked/out/main/chunks/claude-acp-entry-*.mjs — completes with pure JSON-RPC stdout. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Thanks for the careful review @Git-on-my-level — all three items addressed:
|
|
Thanks for the follow-up and for addressing the earlier dependency concern. I re-reviewed the current head ( I’m still not formally approving because this remains PR 1/4 of a stacked Windows coding-agent runtime feature, touches dependency/runtime packaging, and includes product/security-policy behavior around automatic ACP permission resolution. The existing Maintainer review focus before merge:
No urgent security issue found in this static review, and I’m not asking for a split: the PR is cohesive as an adapter-core slice. This is a positive implementation signal, with human product/security/dependency sign-off still required before merge. |
…ain exception Addresses the maintainer's dependency-review request on PR BasedHardware#9304: the exclude list had no comment explaining why these packages bypass pnpm's minimumReleaseAge quarantine, which reads as an accidental relaxation rather than a reviewed exception. Documents the rationale (first-party publishers — Anthropic / the Agent Client Protocol org, not unknown publishers; freshness, not provenance, is the only reason they'd otherwise be quarantined) and the self-limiting property (entries are pinned to exact installed versions; a future bump re-quarantines until this list is deliberately updated too). No functional change — comment only, verified pnpm still parses the config and installs cleanly. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Thanks for the second pass — appreciate the thoroughness. On the three review items: 1. Permission policy: Understood this needs explicit maintainer sign-off, not more code. 2. Dependency exception: Fair point — the 3. Packaged path: Agreed a human clean-machine check is the right bar. What's been done |
|
Thanks for documenting the This remains a positive implementation signal, and I’m not asking for a split; the PR is cohesive as the Windows adapter-core slice. I’m still not formally approving because the approval gate remains blocked by the stacked feature sequence, new runtime/dependency surface, and the human product/security-policy choice around automatic ACP permission resolution for the bundled Claude Code adapter. The existing Maintainer sign-off before merge should specifically cover:
No urgent security issue found in this static follow-up review. |
|
Thanks for keeping this adapter-core slice self-contained. I reran the current head in a fresh Windows worktree: all 38 One limitation remains in my clean-machine verification: pnpm retried but could not download/write the 247 MB optional |
|
Thanks for running this on a fresh worktree — both observations are accurate and useful. On the missing optional win32-x64 package: I dug into what it actually contains — it's On the missing ACP entry .mjs on this slice: correct and by design — nothing imports the The three maintainer sign-off items (release-age exception, allow_always policy for the |
…ary is missing Closes the silent-failure mode found in PR BasedHardware#9304's fresh-worktree review: @anthropic-ai/claude-agent-sdk-win32-x64 (which contains claude.exe, the executable the SDK spawns for agent turns — SDK 0.3.205 ships no JS fallback) is an optionalDependency, so a failed ~247 MB download leaves `pnpm install` exiting 0 and produces a packaged app whose bundled Claude Code agent answers the ACP handshake but cannot run any task. scripts/ensure-claude-agent-binary.mjs now runs before electron-builder in build:win / build:unpack: it locates claude.exe in either the flattened or pnpm-store layout, rejects absent or truncated (<50 MB) binaries with remediation instructions, and skips on non-Windows platforms. Verification: script run live against this repo (finds the real 236 MB binary in the pnpm store); vitest scripts/ensure-claude-agent-binary .test.mjs — 5 passed (absent package, truncated download, flattened and pnpm layouts, non-Windows skip); eslint clean. Co-Authored-By: Claude Fable 5 <[email protected]>
|
FYI — the packaging guard promised above is now in on the routing branch |
|
Followed up on the promised routing-branch guard at Running That closes the specific silent-packaging gap I raised on this PR. The full routing behavior and packaged task execution still belong on PR 2/4 once it is opened, but I found no new blocker in this guard itself. |
…executable check-agent-deps verifies the coding-agent JS packages resolve, but the Claude Code EXECUTABLE (claude.exe, ~235 MB, spawned by the Claude Agent SDK for every agent turn — SDK 0.3.205 ships no JS fallback) lives in the binary-only optionalDependency @anthropic-ai/claude-agent-sdk-win32-x64: a failed download leaves `pnpm install` exiting 0 and import.meta.resolve() can't see a package with no JS entry. The result is an app where the ACP initialize handshake succeeds and every real task fails to spawn. This failure shape was hit live during the PR BasedHardware#9304 review (flaky network, empty residual .pnpm directory, exit 0), and the reviewer validated this exact check logic against that broken tree on the routing branch. scripts/claude-binary-check.mjs (pure, unit-tested) locates claude.exe in the flattened or pnpm virtual-store layout — requiring the binary itself, so an empty residual store directory doesn't pass — and rejects truncated (<50 MB) downloads; check-agent-deps.mjs reports it through its existing missing-deps path. Non-Windows installs skip. Verification: node scripts/check-agent-deps.mjs on a clean pnpm@10 hoisted install — OK (finds the real 236 MB binary); vitest scripts/claude-binary-check.test.mjs — 6 passed (absent package, empty residual virtual-store dir, truncated download, flattened + store layouts, non-Windows skip); eslint clean; full postinstall chain (incl. verify-pimono-unpack) green with the check wired in.Failure-Class: none Co-Authored-By: Claude Fable 5 <[email protected]>
…executable check-agent-deps verifies the coding-agent JS packages resolve, but the Claude Code EXECUTABLE (claude.exe, ~235 MB, spawned by the Claude Agent SDK for every agent turn — SDK 0.3.205 ships no JS fallback) lives in the binary-only optionalDependency @anthropic-ai/claude-agent-sdk-win32-x64: a failed download leaves `pnpm install` exiting 0 and import.meta.resolve() can't see a package with no JS entry. The result is an app where the ACP initialize handshake succeeds and every real task fails to spawn. This failure shape was hit live during the PR BasedHardware#9304 review (flaky network, empty residual .pnpm directory, exit 0), and the reviewer validated this exact check logic against that broken tree on the routing branch. scripts/claude-binary-check.mjs (pure, unit-tested) locates claude.exe in the flattened or pnpm virtual-store layout — requiring the binary itself, so an empty residual store directory doesn't pass — and rejects truncated (<50 MB) downloads; check-agent-deps.mjs reports it through its existing missing-deps path. Non-Windows installs skip. Verification: node scripts/check-agent-deps.mjs on a clean pnpm@10 hoisted install — OK (finds the real 236 MB binary); vitest scripts/claude-binary-check.test.mjs — 6 passed (absent package, empty residual virtual-store dir, truncated download, flattened + store layouts, non-Windows skip); eslint clean; full postinstall chain (incl. verify-pimono-unpack) green with the check wired in. Failure-Class: none Co-Authored-By: Claude Fable 5 <[email protected]>
#10399) Follow-up to #9304 / #9302, closing the one gap from that review cycle still open on main. `scripts/check-agent-deps.mjs` verifies the coding-agent JS packages resolve, but the Claude Code **executable** (`claude.exe`, ~235 MB — spawned by the Claude Agent SDK for every agent turn; SDK 0.3.205 ships no JS fallback) lives in the binary-only optionalDependency `@anthropic-ai/claude-agent-sdk-win32-x64`: a failed download leaves `pnpm install` exiting 0, and `import.meta.resolve()` can't see a package with no JS entry. Result: an app where the ACP initialize handshake succeeds and every real agent task fails to spawn. This exact failure shape occurred live during the #9304 review (flaky network → error 23 → empty residual `.pnpm` directory → exit 0), and the reviewer validated this check's logic against that broken tree at the time. - `scripts/claude-binary-check.mjs` (pure, unit-tested): locates `claude.exe` in the flattened or pnpm virtual-store layout — requiring the binary itself, so an empty residual store directory doesn't pass — and rejects truncated (<50 MB) downloads. - `check-agent-deps.mjs` reports it through its existing missing-deps path (so it runs at postinstall and standalone, same as today). Non-Windows installs skip. ## Test plan - [x] `node scripts/check-agent-deps.mjs` on a clean pnpm@10 hoisted install — OK, finds the real 236 MB binary - [x] `vitest run scripts/claude-binary-check.test.mjs` — 6 passed (absent package, empty residual virtual-store dir, truncated download, both layouts, non-Windows skip) - [x] Full postinstall chain (incl. verify-pimono-unpack) green with the check wired in - [x] eslint clean Failure-Class: none <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/10399?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
Part 1 of a stacked train (see issue #9302):
Self-contained ACP client under src/main/codingAgent/ ported from desktop/macos/agent/src/adapters — nothing wired into chat/IPC/UI yet. Windows-specific: env allowlist (ComSpec/SystemRoot/PATHEXT), taskkill /t /f tree-kill (no POSIX process groups), windowsHide, ELECTRON_RUN_AS_NODE for the bundled Claude Code bridge.
Verification: pnpm run typecheck + lint clean; pnpm test 577 passed, incl. a real-subprocess integration test (fake ACP peer fixture). Also verified live: the real bridge created a file through this adapter on a Windows 11 machine.