Skip to content

Fix OpenClaw 9.3 SQLite worker startup in AppContainer mode - #226

Merged
Angnuo (angnuoli) merged 3 commits into
mainfrom
angnuoli-openclaw-version-upgrade
Sep 11, 2026
Merged

Fix OpenClaw 9.3 SQLite worker startup in AppContainer mode#226
Angnuo (angnuoli) merged 3 commits into
mainfrom
angnuoli-openclaw-version-upgrade

Conversation

@angnuoli

Copy link
Copy Markdown
Collaborator

Description

Fix the startup failure discovered during a real packaged upgrade from OpenClaw 2026.8.2 to 2026.9.3 after #225.

OpenClaw 9.3 launches its SQLite read-only helper from a dedicated sqlite-readonly-worker-* module and passes an optional staging directory. MicroClaw's existing internal-worker recognition only accepted the previous caller and four arguments, so it routed the helper through AppContainer. The helper then failed to resolve the state database with EPERM, causing Gateway startup to fail and the installer to roll back.

Related Issue

Follow-up to #225. No separate issue.

Changes

  • Recognize both the existing SQLite caller and the 9.3 dedicated read-only worker caller within the trusted OpenClaw package.
  • Accept the optional fifth argument only for an existing canonical staging directory directly beneath the local OpenClaw runtime directory, with the current process PID and UUID-shaped name. Reject other locations, nested directories, different PIDs, redirected paths, and surplus arguments.
  • Retain the existing executable, worker-path, database-state, shell-execution and sanitized-environment restrictions. AppContainer stays enabled; this extends the existing internal-helper handling rather than disabling the sandbox.
  • Preserve the upstream worker's killSignal alongside its timeout.
  • Add regression coverage for legacy and 9.3 invocation shapes and invalid staging roots.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • CI/CD or build configuration change
  • Refactoring (no functional changes)

Testing

  • Tests pass locally (cd desktop && npm run test)
  • Renderer tests pass locally (cd desktop/renderer && npm run test)
  • Build succeeds (cd desktop && npm run build)
  • Manual testing performed (describe below)
  • Targeted sandbox regression tests: 355 passed across sandbox-logic.test.ts and sandbox-fs-hooks.test.ts, rerun before publishing. Full test suites were not run.
  • TypeScript no-emit, targeted lint/format checks, and full build.ps1 packaging succeeded.
  • Exercised the official OpenClaw 9.3 synchronous and asynchronous SQLite workers under the active sandbox preload and confirmed snapshot contents.
  • Ran the real generated setup executable against an existing Windows installation. The patched upgrade completed, the transaction was committed, all installer validation results passed, and the installed sandbox hook matched the source hash.

Recorded installation timing

Single-machine upgrade with existing Node 24.18.0, Git, user state, and populated npm cache; not a clean-install benchmark. Successful installation was measured on 2026-09-10.

Stage Seconds
Existing runtime/state backup 185.14
OpenClaw npm installation, including a network retry 190.32
Configuration/state migration (doctor --fix) 78.56
Service startup and deep RPC validation 134.47
Remaining steps 36.05
Installation pipeline total 624.54

Setup extraction/UI preparation took 30.54 seconds; observed setup launch through completion was 656.05 seconds. Backup contained 107,814 files / approximately 2.25 GiB. Final full build took 296.73 seconds, counted separately.

The original failed attempt took 880.89 seconds including automatic rollback; it is excluded from the successful sample. Detailed logs and JSON/CSV timing artifacts remain local and are not committed.

Checklist

  • My code follows the coding guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code where necessary
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or my feature works
  • New and existing unit tests pass locally with my changes

No user-facing configuration or workflow changes require documentation updates. The final checkbox refers to the targeted test selection above.

Angnuo (angnuoli) and others added 3 commits September 10, 2026 10:27
Align installer, desktop, build and CI Node runtime gates with the upstream engine range. Update pinned MXC approval bundles and advertise approval delivery only while MXC is enabled.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Accept the upstream readonly worker caller and optional canonical PID-bound staging directory while retaining existing executable, state and preload restrictions. Preserve the worker kill signal and add regression coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@angnuoli
Angnuo (angnuoli) merged commit 6f080a0 into main Sep 11, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant