Skip to content

Packaged gateway fails to start: suspected agent-user execute permission issue with Koffi native dependency #77

Description

@xlinush

Summary

The packaged OpenClaw gateway fails to start inside its isolated agent session with a reported Koffi module-loading / "module not found" error. Anna and Linus both reproduced the failure after updating the bundled OpenClaw version.

Primary hypothesis: the isolated agent user's security context can read the packaged JavaScript but lacks the permissions required to load/execute Koffi's native binaries, or a native library they depend on, from the installed MSIX package.

This is a suspected cause, not yet confirmed. A module-loading error alone does not distinguish denied access from a missing binary, a missing dependent DLL, or an architecture mismatch.

Affected scenario

  • Windows MSIX installation with isolated agent sessions enabled/required.
  • Current bundled OpenClaw: v2026.9.4, commit 3a9d69db306cd7f081e06254cb89c4bcc14a7107.
  • Koffi 3.1.6 is declared as a direct runtime dependency in that release and in v2026.8.1/v2026.8.2. It was first reported to ship as a direct dependency in stable v2026.8.1.
  • The application runs directly from the immutable MSIX package; the bundled Node.js runtime is provisioned separately for the agent session.

Reproduction

On an affected Windows machine:

  1. Install the session-enabled MSIX containing the newer OpenClaw payload.
  2. Run clawctl setup to provision the isolated agent session and runtime.
  3. Run clawctl gateway-service start.
  4. Observe that the gateway does not start successfully and its diagnostics report a Koffi loading / module-not-found error.

Expected: the gateway starts under the isolated agent user and can load its required native dependencies without weakening session isolation.

Actual: gateway startup fails while loading Koffi. The exact failing binary path and underlying Windows loader error still need to be captured.

Investigation needed

  • Capture the full Koffi error, native binary path, and Windows loader/access failure under the actual agent-user token.
  • Verify that the architecture-correct Koffi binary and its dependent DLLs are present in the installed package.
  • Check effective read/execute access and relevant package/session restrictions for that user, rather than relying on whether loading succeeds as the interactive user.
  • Add an isolated-session startup/native-module regression check; a successful package build alone does not exercise this runtime permission boundary.

Any fix should preserve isolation and avoid broadly granting write or execute access without identifying the specific blocked resource.

Current direction

Investigate and implement a real, isolation-preserving fix for native dependency loading in the packaged gateway, rather than work around the failure by packaging an older Koffi-free OpenClaw release.

Continue the investigation and repair work Anna put together in #75, which stages native-bearing dependency packages in the isolated agent's LocalState and redirects native package resolution. Treat that PR as a repair candidate to review and refine, not as an already accepted or fully validated fix.

Before resolving this issue, confirm the underlying loader/access failure and validate the resulting fix in installed packages, including fresh installs, state-preserving in-place upgrades, and both x64 and ARM64. Preserve the isolated-session boundary and the immutable packaged application outside the narrowly scoped native-dependency staging.

The compatibility-build draft #76 has been closed. Its results remain useful diagnostic history, but the downgrade/older-release direction is not being pursued as the fix. Keep this issue open until installed gateway recovery is demonstrated.

Compatibility experiment (closed)

A compatibility build packages OpenClaw v2026.7.33, commit b60a4e9fa97cddf1869a1866d879b3051783cf12, while retaining the current launcher and isolated-session changes. Its dependency manifest/lockfile and generated packages contain no Koffi dependency.

Simply reverting the previous upstream pin would select v2026.8.2, which still declares Koffi; that is not a Koffi-free comparison.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Emergency: data loss, security bypass, crash loop, or unusable core runtime.bugSomething isn't workingclawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.impact:crash-loopThis issue is about crashes, hangs, restart loops, or process-level availability.impact:ux-release-blockerA non-technical user is blocked without terminal, logs, config, or support.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions