8000 Bug: auto-sync daemon silently fails because packaged runtime is missing chokidar · Issue #57 · GeminiLight/MindOS · GitHub
[go: up one dir, main page]

Skip to content

Bug: auto-sync daemon silently fails because packaged runtime is missing chokidar #57

Open

Description

@Jerry-jwz

Summary

The automatic Git sync daemon can silently fail in the packaged Linux x64 runtime because chokidar is not present in the extracted runtime. Manual mindos sync now still works, so the configured sync can appear healthy while file watching and periodic pulls are not running.

I reproduced the end-to-end behavior with MindOS 1.1.60 and also verified the missing dependency against the latest published @geminilight/mindos-linux-x64@1.1.61 artifact.

Environment

  • OS: Linux x64
  • Installed CLI used for the end-to-end reproduction: mindos/1.1.60 node/v24.18.0 linux-x64
  • Latest artifact checked separately: @geminilight/mindos-linux-x64@1.1.61
  • Sync config: Git provider, enabled: true, 30-second auto-commit interval, 300-second auto-pull interval

Observed behavior

With sync configured and MindOS running:

  • mindos sync now succeeds.
  • Editing the knowledge base does not trigger the expected automatic sync.
  • The periodic pull does not run.
  • MindOS startup does not report that the sync daemon failed.

The extracted 1.1.60 runtime was located at:

~/.mindos/runtime-cache/1.1.60/linux-x64

It did not contain node_modules/chokidar.

Latest artifact reproduction (1.1.61)

I downloaded the published @geminilight/mindos-linux-x64@1.1.61 package, ran its binary with an isolated MINDOS_BINARY_CACHE_DIR, and inspected the extracted runtime:

RUNTIME_ROOT_PRESENT=yes
CHOKIDAR_PRESENT=no

Calling startSyncDaemon() with sync enabled and a temporary Git repository produces:

SYNC_DAEMON_START_ERROR_CODE=ERR_MODULE_NOT_FOUND
SYNC_DAEMON_START_ERROR_MESSAGE=Cannot find package 'chokidar' imported from .../runtime-cache/1.1.61/linux-x64/bin/lib/sync.js

Likely cause

packages/mindos/bin/lib/sync.js dynamically imports chokidar:

const chokidar = await import('chokidar');

Although packages/mindos/package.json declares chokidar, the embedded platform runtime does not materialize it at the runtime root. The generated platform package manifest also has no runtime dependencies.

The failure is then hidden in packages/mindos/bin/commands/start.js by calls such as:

startSync
7362
Daemon(mindRoot).catch(() => {});

The same empty catch is used by the product server's sync-daemon lifecycle callbacks, so users receive no visible error.

Verified workaround

As a local test, I linked the globally installed package's chokidar into the extracted runtime:

~/.mindos/runtime-cache/1.1.60/linux-x64/node_modules/chokidar
  -> <global @geminilight/mindos>/node_modules/chokidar

After restarting MindOS:

  • the file watcher updated lastSync after the configured 30-second interval;
  • the periodic pull updated lastPull after 5 minutes;
  • lastError remained null and no conflicts were reported.

Suggested fix

  1. Include chokidar and its runtime dependency closure in packaged/extracted runtimes that execute bin/lib/sync.js.
  2. Add a packaging regression check that starts the sync daemon, or at least resolves/imports chokidar from the extracted runtime root.
  3. Report sync-daemon startup failures instead of silently swallowing them.

Activity

  1. GeminiLight commented on Jul 28, 2026

    @GeminiLight
    Owner

    Thanks for the detailed reproduction. This is fixed on public main now in commit a37c355.

    What changed:

    • platform runtime builds now embed the CLI sync daemon dependency closure, including chokidar and its transitive dependency, into the extracted runtime archive
    • generated platform package manifests now declare the watcher dependency for JS/fallback runtimes
    • sync daemon startup/reconfigure/restart failures are now reported instead of being silently swallowed

    Verification included a linux-x64 platform-runtime smoke where node_modules/chokidar and readdirp were present and a bare import('chokidar') succeeded from the generated runtime root, plus the relevant sync/package/start tests and the repository pre-push checks.

    Leaving this open until the next npm patch release is published and the published platform package can be verified.

  2. added a commit that references this issue on Aug 24, 2026
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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0