Repository navigation
fix(agents): fall back from tool search code under Electron - #122037
vincentkoc merged 1 commit into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 20, 2026, 4:36 AM ET / 08:36 UTC. ClawSweeper reviewWhat this changesThe PR makes Tool Search select its existing structured search, describe, and call controls instead of the isolated code child when OpenClaw is hosted by Electron. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessKeep open: current main still selects code mode solely from Node permission-flag support, while the code child launches Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherTool Search compacts a large authorized tool catalog for an agent run. Its configuration chooses either an isolated Node code bridge or structured controls, which then expose the same catalog and dispatch final calls through OpenClaw. flowchart LR
A[Agent Tool Search setting] --> B[Runtime capability check]
B -->|Node child available| C[Isolated code bridge]
B -->|Electron host| D[Structured search controls]
C --> E[Authorized tool catalog]
D --> E
E --> F[Policy-checked tool call]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +5, Tests +19. Total +24 across 2 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: Keep one capability decision at Tool Search configuration resolution: require both Node permission support and a non-Electron host for code mode, then use the existing structured fallback without a second child-launch path or new setting. Do we have a high-confidence way to reproduce the issue? Yes—source reproducibly establishes the failure shape: current main launches Is this the best way to solve the issue? Yes. The guard is at the configuration owner before controls are exposed, reuses the documented structured fallback, and avoids weakening the isolated child or adding an Electron-specific launch/config path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1d2986b06fbe. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
Punchcard-Session: ember-cedar-willow-tp
4566b08 to
5a6a535
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
…#122037) Punchcard-Session: ember-cedar-willow-tp
Summary
What Problem This Solves
The capability check treated support for Node's
--permissionflag as sufficient for launching the isolated tool-search code child. The launcher usesprocess.execPath, however, so an Electron-hosted process attempts to launch the Electron executable rather than a plain Node child.This is fixed at the existing tool-search configuration owner. Electron exposes
process.versions.electron, and Node definesprocess.execPathas the executable that started the process. The normal structured-tools fallback already exists, so no alternate child-launch path, environment override, config, or compatibility shim is added.Dependency contracts:
Evidence
5a6a5359a5a2cbef45b42c6a8b72ea3aedb83f3a.run_73140575c15cpassedsrc/agents/tool-search.test.ts(131/131) andsrc/agents/tool-surface-plan.test.ts(25/25), 156/156 total.run_46cba0f22c03checked out the exact head, installed Electron 43.3.0, clearedDISPLAY,WAYLAND_DISPLAY, andELECTRON_RUN_AS_NODE, and executed the production resolution, catalog, structured-search, and structured-call path from an Electron browser process.SHA256SUMS. Archive SHA-256:b352019a2d04b15f1949213a2a4c2b62570871f03b882abb710b404504b27ba5; verdict SHA-256:804e14273ee83fb49d4c70f959e14f621b80edaa975bb5c70c325de8cd7c4674; log SHA-256:d299c6c104e8afe4246db0c7b7ec2d8efa7a1bcbdd69674cabf9782aa061a606.openclaw/ci-gate.Machine-readable verdict:
{"schemaVersion":1,"verdict":"pass","targetSha":"5a6a5359a5a2cbef45b42c6a8b72ea3aedb83f3a","boundary":["actual-electron-main-process","production-tool-search-config-resolution","production-tool-search-catalog-compaction","production-structured-search-control","production-structured-call-control"],"runtime":{"electron":"43.3.0","node":"24.18.1","processType":"browser","defaultApp":true,"execPathSha256":"d3f141ac6c8aed896065c6a87b4952b2fa9c0520c84063499babfc7b464929aa"},"assertions":{"actualElectronRuntime":true,"actualElectronBrowserProcess":true,"defaultCodeRequestFellBackToTools":true,"codeControlHidden":true,"structuredSearchVisible":true,"structuredDescribeVisible":true,"structuredCallVisible":true,"structuredSearchReturnedAuthorizedTarget":true,"structuredCallExecutedAuthorizedTargetOnce":true,"structuredCallResultObserved":true},"observations":{"resolvedMode":"tools","visibleControls":["tool_call","tool_describe","tool_search"],"catalogToolCount":1,"targetCalls":1},"redaction":{"credentialsIncluded":false,"filesystemPathsIncluded":false,"toolPayloadIncluded":false}}Production delta: +6/-1. Test delta: +19/-0. The production growth is the platform/runtime capability invariant and its inline rationale.
Punchcard-Session: ember-cedar-willow-tp
Fixes #121927