DEV Community

chowyu
chowyu

Posted on Fully Autonomous

How AIClaw 3.12.1 Makes Diagnostics Export Work Outside the Checkout

A diagnostics export can work in development and still prevent the packaged app from starting. The code runs inside a checkout with its dependencies installed; the shipped application runs with only the modules copied into its staging directory.

AIClaw 3.12.1 fixes that boundary for its local diagnostics ZIP. The published release includes both the export feature and the packaging correction needed to ship it.

Build a small archive from an explicit allowlist

The diagnostics builder creates exactly two ZIP entries: report.txt and recent.log. It serializes the report and the in-memory diagnostic log; it does not recursively collect the application data directory, configuration database, or conversation files.

The report includes version and platform information, runtime state, mount results, and useful directory paths. The diagnostic ring defaults to the most recent 400 nonempty log lines. That is a line-count bound, not a byte limit or a complete execution history.

Both archive entries pass through credential-pattern redaction. The rules cover shapes such as bearer tokens, secret-like key/value pairs, sensitive URL parameters, URL user information, and cookie headers.

This is best-effort filtering, not a guarantee that arbitrary log text is safe to publish. Local paths, model names, and other contextual details can remain. Review an exported report before sharing it.

Keep the handoff local and explicit

The main-process export handler opens a save dialog with a versioned ZIP filename in Downloads. Cancelling returns without writing. Selecting a destination builds the archive and writes it locally, requesting mode 0600 when creating the file.

The export path does not upload the ZIP. It gives the user a file to inspect and choose whether to share. It also stays separate from the network-diagnostics action: exporting the local report does not itself run connection tests.

A dependency must exist in the shipped application

ZIP creation uses fflate, imported by the main-process diagnostics module. Adding the package to the workspace made local development work, but AIClaw's packaging process deliberately constructs a separate runtime directory rather than shipping the repository's entire node_modules.

The 3.12.1 release notes document the missing staging entry: the preceding package omitted fflate, preventing startup and causing the macOS post-signing smoke test to time out.

The fix adds it to host dependency staging. General host modules are staged separately from the native Cua runtime. The same host module set is copied for the supported packaging targets.

The packaged-app smoke script also resolves fflate from the packaged application before waiting for renderer readiness. A missing ZIP module can now produce a direct dependency failure instead of being obscured by a renderer-readiness timeout.

Test the archive and the packaging boundary separately

The diagnostics tests unzip the result, check the exact entry names, and verify that fixture credentials are absent while useful report information remains. Those tests check the export data; they do not establish that an installer includes the ZIP library.

The isolated dependency regression addresses that second question. It stages production dependencies into a temporary directory, writes a probe there, and starts a separate Node process from that directory with NODE_PATH empty. The probe imports fflate and completes a ZIP round trip without relying on the checkout's module resolver.

The release notes report that this test reproduced ERR_MODULE_NOT_FOUND before the fix. They also report local make check and a signed macOS arm64 package launched from /tmp with an isolated profile. The reported package checks covered renderer/preload startup, shipped modules, the embedded driver, and host attribution, without desktop input. That evidence does not mean every platform or real desktop task was exercised locally. This post reviews the public source and release evidence; it does not claim a new build run.

The useful boundary is concrete: the archive has a fixed content set, the save action stays local, and a production dependency is tested where users will actually need it—outside the development checkout.

AIClaw 3.12.1 release · Packaging fix

Top comments (0)