Repository navigation
feat: shrink standalone sidecars and bundle SQLite - #172802
Conversation
|
ClawSweeper reviews are opt-in for maintainers. If a review is required, finish the work and validation first, then comment |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ddac94407e
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d1ec6b758b
ℹ️ 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".
66c5dd6 to
38d033f
Compare
|
Codex review: needs real behavior proof before merge. What this changesThis PR replaces the full standalone runtime copy with selected resources, embeds dependency code, and bundles SQLite on macOS. Example: Run a macOS arm64 standalone artifact on a Mac without Homebrew SQLite.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 4 items remain Keep this maintainer-backed PR open: current main lacks its minimal sidecar and bundled SQLite, and the linked desktop work depends on it. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe standalone builder consumes a completed OpenClaw runtime and produces an executable, resource sidecar, and manifest used by deployment and desktop packaging. flowchart TD
A[Built source runtime] --> B[Bun builder and adapters]
B --> C[Embedded executable]
B --> D[Resource sidecar]
B --> E[Artifact manifest]
C --> F[Standalone CLI and Gateway]
D --> F
F --> G[Plugins and SQLite]
Technical reviewBest possible solution: Ship one resource-selection owner with embedded application code, contained native resources, bundled SQLite, and complete artifact replacement. Do we have a high-confidence way to reproduce the issue? Current-main source confirms the full-sidecar pruning policy and external SQLite requirement; the reported artifact measurements were not independently reproduced during this read-only review. Is this the best way to solve the issue? Reusing the existing SQLite builder and selector, sharing workspace alias rules, and replacing the previous pruning path is a coherent solution without a competing runtime owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a10d95485b5d. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: Image-backed executable admission requires final-effect evidence, although source inspection established no concrete exploitable bypass. EvidenceSecurity concerns:
What I checked:
Likely related people:
PR surfaceSource +14, Tests +3180, Docs +50, Other +1982. Total +5226 across 22 files. Added test files: 5. View PR surface stats
LabelsLabel changes: No label 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, 3:16 AM ET / 07:16 UTC. |
19a7e3e to
7c57577
Compare
Retain runtime-referenced native resources and embed opaque required modules. Keep source aliases on image facts, retain public templates, and exclude private documentation.
7c57577 to
bf0d98d
Compare
|
Merged via squash.
|
* build: minimize the standalone runtime sidecar * fix: compile minified standalone runtime dependencies * fix: classify executable-bit dependency licenses once * test: fix standalone fixture checks * fix: resolve standalone package export paths * fix: admit embedded SQLite workers in standalone builds * fix: resolve hoisted packages from standalone runtime * fix: discover installed packages under Bun * fix: admit embedded plugin public surfaces * fix: admit embedded sidecar modules and native resolutions * test: preserve workspace alias fixture types * fix: preserve standalone plugin admission and diagnostics * fix: filter standalone native payloads by target * fix: preserve standalone native and metadata dependencies Retain runtime-referenced native resources and embed opaque required modules. Keep source aliases on image facts, retain public templates, and exclude private documentation. * fix: exclude resolved child programs from standalone graph * fix: preserve standalone resolution directory boundaries * fix: reject unsafe standalone runtime symlinks * fix: include MDX in standalone documentation * fix: collapse duplicate standalone resource destinations * fix: preserve collapsed native resource source aliases * fix: embed lazy conditional standalone module resolutions * fix: preserve standalone CLI respawn arguments * fix: resolve standalone worker sources by lexical scope * fix: retain standalone module loader path resolver * fix: resolve renamed standalone filesystem imports
What Problem This Solves
Follow-up to #172384 for desktop packaging #171755. The standalone executable embedded the application, but its loose sidecar still copied the dependency tree. That left tens of thousands of files and pnpm symlinks for macOS to assess and the desktop app to seed.
The sidecar now contains 5,963 files with no symlinks. It also bundles SQLite, so a clean Mac does not need Homebrew to start OpenClaw.
Implementation
scripts/build-mac-sqlite.shandscripts/lib/sqlite-macos.jsonto produceruntime/lib/libsqlite3.dylib; there is one SQLite build owner.OPENCLAW_SQLITE_LIBRARYremains the explicit override, followed by bundled SQLite in standalone builds. Normal installs retain their existing selection paths. The bundled dylib must be signed with the app.sidecarPluginsin the manifest.sidecarPluginsis currently empty: bundled plugin code remains in the executable.Evidence
Current qualification source:
bf0d98d76cbb12ebfad45d5d043ebd200b011430. Both modes use the production-pinned Bun1.4.3-canary.1+94f8f5ffe(commit94f8f5ffec48f47b3b3fb84891ef5ced046f5814, executable SHA-25610da5107e6eabd746f82715b59779ecbcba171fe15698e26d26543ecc9f82667). The results below are cycle-21 evidence; older compiler successes are not reused.The historical comparison includes source/dependency differences and predates added docs and bundled SQLite. The raw snapshot is the actual pre-prune tree. The derived full control overlays final native/resource paths onto that snapshot so the exact signed executable can run; it is not another original builder output. Per-category totals reconcile to each signed manifest. JIT and bytecode have equal category counts/bytes but distinct signed hashes.
--version, first Gateway ready, clean shutdown and per-copy audit. See observations below.The original signed PRB JIT and bytecode artifacts both fail the hidden-host-SQLite control with
Install one with brew install sqlite. The current signed artifacts pass the isolated config/Doctor/two-Gateway-lifetime sequence with the bundled library mapped. The full strict and 4+4 functional campaigns run separately: the macOS seatbelt policy cannot permit the setuid process utility needed by the normal spawn-broker shutdown. This limitation is retained in the SQLite sequence report.The file audit combines the Node fs observer and native libc interposition. It checks physical resources after recorded relocation and accounts for the 18 image-owned metadata probes against immutable builder diagnostics. This is not a kernel syscall trace; dyld-private/raw syscalls are outside that observer scope. The interposed diagnostic copies are separate from the signed hardened-runtime functional campaigns.
The original TypeScript-only fixture used copy installation, which now correctly requires compiled JavaScript. It was corrected to the documented
plugins install --linkdevelopment path; copied compiled-plugin coverage remains separate in the broader feature fixture. The failed attempt's receipt/log/result were preserved, and its separate delayed PID/UUID crash audit was clean. Ten completed early-stage receipts were reused unchanged from the original cycle-21 specification; the linked-fixture revision changed only that fixture's install mode and expected success text, without rebuilding either artifact or changing the frozen harness.The original broader feature sequence retained one JIT team-preset timeout at 180 seconds; all other original assertions passed. The exact isolated JIT assertion passed on replay with unchanged timeout and expectations (139.070 seconds including wrapper/audit). The original exit-1 receipt remains intact. High host load is a correlation, not a proven cause or repair. The native-minimal run also retains an earlier Gateway readiness timeout under high host load; its full retry passed with the original limits (1,256.758 seconds for both modes). The failed attempt remains included in the final crash audit.
Per-category historical comparison
Bytes are logical file bytes. This is the historical PRB comparison, with the source/dependency and added-docs/SQLite caveats above.
Focused tests and local checks
317 passing tests and one existing skip across 14 files. This combines fresh runs with source-bound, unchanged-input evidence; it is not one suite run. Each command is
pnpm test <file> --maxWorkers=1.test/scripts/bun-standalone-sidecar.test.tstest/scripts/bun-standalone-contract.test.tstest/scripts/bun-standalone-snapshot.test.tstest/scripts/bun-standalone-sqlite.test.tssrc/infra/node-sqlite.test.tssrc/plugins/sdk-alias.test.tssrc/plugins/sdk-alias-workspace.test.tstest/scripts/bun-standalone-module-resolution.test.tstest/scripts/bun-standalone-native.test.tstest/scripts/bun-standalone-imports.test.tstest/scripts/bun-standalone-metadata.test.tstest/scripts/bun-standalone-entry.test.tssrc/entry.respawn.test.tstest/scripts/bun-standalone-workers.test.tsFull changed checks at
87919cad4185completed in 1,380.714 seconds: 44/46 passed. The two failures were reproduced on clean pinned main: max-lines stale entries (19.651 seconds) and dead exports (108.525 seconds; 21 overlapping findings across scans). The subsequent metadata-only delta has fresh type/lint/format/tests. This local result remains red; the current-head CI result above is green. No CI rerun or inherited-CI admin exception was needed. Codex reviews are clean through P2 for the final delta and prior owner changes.Fresh-path timing observations
The primary layout comparison uses the exact same signed executable per mode. Each row is one observation on the shared host, with warm caches and the same supervised harness settings (
OPENCLAW_NO_RESPAWN=1). Copies use APFS clonefile (cp -cfor the executable,cp -c -Rforruntime/); no whole physical copy was made per run. Default respawn is covered separately. These observations do not establish a cold-machine, notarization, or general startup-speed claim.--versionsecondsHistorical PRB measurements used physical
cp -Xand different source/dependency/compiler artifacts. The table shows three-sample historical medians against the current single observations; it cannot isolate the pruning change. The first historical pair remains excluded for the recorded concurrent task-owned typecheck; the source report retains both included and excluded observations.The manifest also carries per-category file/byte totals, the actual 52 SQLite compile options, and pinned SQLite source archive provenance. Example excerpt:
{ "runtime": { "fileCount": 5963, "sizeBytes": 704741109, "symlinkCount": 0, "sidecarPlugins": [], "sqlite": { "source": "bundled", "path": "lib/libsqlite3.dylib", "version": "3.53.4", "sha256": "e40c480b7d37b38226e8b647f1876cd1e3c6fdf965aa0ad5222828219e46ac15", "extensionLoadingSupported": true } } }