Repository navigation
fix: Codex replies fail in standalone OpenClaw - #173473
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR routes standalone self-launches through the shared CLI invocation owner before attempting loose-script discovery. Example: A Codex turn runs from a minimal standalone installation without runtime/openclaw.mjs.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR addresses a concrete standalone runtime failure that remains on main; no definite introduced defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherCLI launch adapters translate executable identity and command arguments into child-process invocations used by native hooks, ACP, TUI, completion refresh, and live probes. flowchart TD
A[Self-launch request] --> B[CLI launch adapter]
B --> C[Standalone identity]
B --> D[Loose entry discovery]
C --> E[Shared invocation owner]
D --> E
E --> F[Child process]
F --> G[Relay or CLI command]
Technical reviewBest possible solution: Keep standalone identity and argument construction in the existing shared owner while preserving loose-install discovery and the dedicated relay worker. Do we have a high-confidence way to reproduce the issue? The minimal artifact deliberately omits loose CLI scripts, and current-main relay discovery consequently reaches the exact reported error; the linked signed packaging run corroborates this path, but no target code was executed during this review. Is this the best way to solve the issue? Recognizing standalone identity before loose discovery repairs the owning boundary and consistently covers sibling launchers without changing configuration, relay protocols, or public APIs. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e95851fa65d3. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +47, Tests +255, Docs +5. Total +307 across 13 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 15, 2026, 5:07 PM ET / 21:07 UTC. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
c93b190 to
9f49792
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9f49792869
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Merged via squash.
|
What Problem This Solves
Fixes Codex agent replies failing with “Cannot resolve OpenClaw CLI executable path for native hook relay” in a minimal Bun standalone installation.
Targets
main. Parent #173154 merged as3bfccdb9bd3df459931e9d6f8751acfc9f147dfa. Only the HR commit was cherry-picked onto fresh main56c315156f4542f197a2b7f727681ba3f41c21b5; no pre-squash parent commits remain. Current head:9f49792869814b2a344ef8d878cfafeb02347115, exactly 13 changed files (+368/-61).User Impact
Standalone self-launches use the executable directly for native hook relays, ACP, TUI, completion refresh, and live CLI probes. Explicit
OPENCLAW_CLI_PATHoverrides and loose Node/Bun launch arguments retain their existing behavior. There is no configuration migration.Why This Change Was Made
The minimal runtime deliberately contains no loose CLI entry files. Callers were requiring those files before consulting the canonical
cli-invocation.mjsowner. The fix recognizes standalone identity first and delegates command construction to that owner; its exports and signatures are unchanged. The infra helper retains loose-install discovery and loader preparation as an adapter. Existing shell quoting,exec,nice, and the dedicated loose relay worker are preserved.Daemon invocation and installation remain owned by #172569 and are untouched. Package/resource discovery, explicit child operands, scheduled-task observation, and separate MCP worker contracts are unchanged. Managed-service handoff and startup were already migrated on the base branch.
Evidence
Signed standalone before/after proof:
c305e2e9, no physical loose CLI entries, real Codex turn failed with the exact relay-resolution error; exit 1 in 61.767s. This reference app used the older Bun compiler revision65d94e715.c93b1901ca8cd667524b3e86fbcd77ff76ba4fff, production-pinned Bun1.4.3-canary.1+94f8f5ffe, JIT on macOS arm64. Production build passed in 379.919s; standalone build in 1229.085s. Developer ID signing and strict verification passed with the manifest-declared entitlements.HR_OK, exit 0 in 35.260s.HR_TOOL_OKmarker and returnedHR_OK, exit 0 in 36.796s. Process observation captured an actual child running<signed-executable> hooks relay --provider codex ... --event pre_tool_use --timeout 9000; there was no interpreter or loose entry argument.appServer.homeScope: "user". No OAuth copies or surviving captured child processes remained. All three physical loose entry paths were absent. Build outputs were deleted after recording manifests, signatures, process evidence, and results.The clean cherry-pick is patch-identical (
git range-diffreports=), and all 13 touched file blobs match the proven head. The existing real Codex-turn proof and scoped-clean review carry over; no conflict resolution or code changes required re-review.Focused regressions rerun on current head
9f49792869814b2a344ef8d878cfafeb02347115, each withpnpm test <file> --maxWorkers=1:ACP test cost: the four cases execute in 41ms total. The 45.186s wrapper run includes 32.189s of compiler preparation; 96% of Vitest duration is transformation. The retained composition test proves that command selection and provider-credential filtering reach the actual spawn boundary. A pure helper test cannot prove that wiring, and retaining composition coverage after extracting a helper would retain its import cost.
Current-head targeted format (0.186s), lint (32.643s), core types (19.226s), docs config (5.502s), and diff checks passed. Full test types and relevant repository ratchets also passed before the patch-identical restack. Codex autoreview returned
scoped-clean; the review is reused for that mechanical restack under repository policy. No substantive code changes followed review.The initial continuation runner referenced an MS signing helper removed during lane cleanup. Signing was resumed successfully with the same documented recipe in a task-owned helper; no rebuild or source change was needed. Exact-head CI run
38837282260completed successfully: all 70 jobs passed. No inherited-failure exception is needed.