Agent Store sync stops ('database connection is not open') after a private worker's store is closed — local changes are then lost on restart

Where does the bug appear (feature/product)?

Cloud Agent (GitHub, Slack, Web, Linear)

Describe the Bug

Environment

  • macOS 15.4.1 (24E263), Apple Silicon
  • Cursor 3.23.23
  • Self-hosted (private) worker on the same Mac (<worker-id>), process ~/Library/Application Support/Cursor/User/globalStorage/anysphere.cursor-agent-worker/agent-cli/.local/bin/cursor-agent
  • Agent Stores under ~/Library/Application Support/Cursor/AgentStores/cursor_agent_stores/
  • Affected: project store A <store-A>, project store B <store-B>, user store <user-store>
  • Setup: one cloud Project coordinator runs several subagents on this private worker. Each subagent opens a “private worker claim” Agent Store and closes it when its turn ends.

Symptom

  • A Project store stops syncing in both directions for hours: local changes never reach the cloud, and cloud changes never arrive locally. meta.last_complete_round_ms in the store’s .sync/index.sqlite stays frozen.
  • .sync/sync.lock stays held by the worker pid and is refreshed every minute. The worker is alive, but every sync attempt fails.
  • After Cursor is restarted (which restarts the worker), the store is re-pulled from the cloud copy. Files that exist only on the Mac are deleted, and files edited on the Mac revert to the older cloud version. This happened to project store A twice on 2026-10-07. In one case it went from 1,492 files (767 MB) to 479 files (305 MB), and 49 files existed only on the Mac. We recovered them only because we keep our own local backups.

Pattern

In the worker log (~/Library/Application Support/Cursor/User/globalStorage/anysphere.cursor-agent-worker/cursor-agent-worker-<id>.log, times in UTC), the line Agent Store closed for private worker claim <claim> appears. Within about 0.3–60 seconds, other mounted stores start failing with Agent Store sync failed … errorMessage: "The database connection is not open". They never recover until the worker process is restarted.

Store First “not open” (UTC) Preceded by Failures since
<user-store> 2026-10-07 14:56:36.511 closed for private worker claim <claim-1> at 14:56:36.200 2,954+
project store B 2026-10-07 15:04:39.827 closed for private worker claim <claim-2> at 15:03:46.043 2,053+
project store A 2026-10-07 18:29:05.412 (last complete round 18:23:16) sync.lock re-acquired at the same millisecond (acquiredAt 1791397745410); other stores already failing 2,280+, still failing every 3–10 s
project store A (previous worker run) 2026-10-06 23:41:31.881 (last complete round froze at 07:04 UTC the next day) closed for private worker claim <claim-4> at 23:41:30.416 9,915 until the worker restart at 13:50 UTC, which re-pulled the store and lost the Mac-only files

Log excerpts (worker log, UTC; IDs replaced)

14:56:36.200 INFO  Agent Store closed for private worker claim <claim-1>
14:56:36.511 INFO  Agent Store sync failed for <user-store> meta={errorMessage: "The database connection is not open"}

15:03:46.043 INFO  Agent Store closed for private worker claim <claim-2>
15:04:39.827 INFO  Agent Store sync failed for <store-B> meta={errorMessage: "The database connection is not open"}

18:29:05.412 INFO  Agent Store sync failed for <store-A> meta={errorMessage: "The database connection is not open"}
18:29:09.438 INFO  Agent Store sync failed for <store-A> meta={errorMessage: "The database connection is not open"}
18:29:49.061 INFO  Agent Store closed for private worker claim <claim-3>

(previous worker run)
23:41:30.416 INFO  Agent Store closed for private worker claim <claim-4>
23:41:31.881 INFO  Agent Store sync failed for <store-A> meta={errorMessage: "The database connection is not open"}

(2026-10-08 00:07 UTC, still failing)
00:07:13.319 INFO  Agent Store sync failed for <store-A> meta={errorMessage: "The database connection is not open"}

.sync/sync.lock of project store A, read 2026-10-08 00:01 UTC (mtime refreshed every minute):

{"uid":501,"pid":<worker-pid>,"hostname":"<host>","windowId":"<worker-pid>-<window-id>","acquiredAt":1791397745410}

.sync/index.sqlite meta at that time: last_complete_round_ms = 2026-10-07 18:23:16 UTC, last_listing_applied_ms = 18:28:38 UTC, deletion_armed = 1. There were 61 local files not yet pushed: either missing from files, or with a different stat_size/stat_mtime_ns.

Steps to reproduce (as observed)

  1. Run a private worker with an Agent Store-enabled Project. Keep the Project store mounted and syncing.
  2. From a cloud coordinator, run several subagents on that worker. Each one opens a private worker claim Agent Store and closes it at the end of its turn.
  3. After a claim is closed (Agent Store closed for private worker claim …), the other mounted stores begin failing with “The database connection is not open”, and their last_complete_round_ms stops advancing.
  4. Write files into the Project store locally. They are never pushed.
  5. Restart Cursor (which restarts the worker). The store is re-pulled from the cloud, and the local-only files and local edits from the stuck period are deleted or reverted.

Expected behaviour

  • Closing one private claim should not close the SQLite connection used by other mounts. Each mount should own its connection, or a shared connection should be reference-counted.
  • If a mount’s DB connection is closed, the sync loop should reopen it, or surface a visible error. It should not keep failing silently while holding sync.lock.
  • When a store is remounted after a stuck period, local-only files and local edits should be pushed or kept as conflict copies. They should not be deleted or overwritten by an older cloud version.

Other observations

  • Files of 100 MB or more never appear in files (the largest indexed file is 92 MB), so they exist only locally and are also lost on a re-pull.
  • On the same day there were many 503 / getaddrinfo ENOTFOUND api2.cursor.sh errors (03:40–04:17 UTC), and the local folders of two other project stores disappeared entirely. We have no logs that link that to this bug.
  • Workaround on our side: hourly local backups, a watcher that reads .sync/index.sqlite and alerts when a store has stopped completing rounds while it has unsent changes, and a content-based restore after a remount.

Steps to Reproduce

  1. On macOS, run a self-hosted (private) Cursor worker with several Agent Stores mounted and syncing.
  2. From a cloud coordinator, run several subagents on that worker. Each one opens a private worker claim Agent Store and closes it at the end of its turn.
  3. After a claim is closed (“Agent Store closed for private worker claim …”), the other mounted stores begin failing with “The database connection is not open”, and their last_complete_round_ms stops advancing.
  4. Write files into the Project store locally. They are never pushed.
  5. Restart Cursor (which restarts the worker). The store is re-pulled from the cloud, and the local-only files and local edits from the stuck period are deleted or reverted.

Expected Behavior

Closing one private claim should not close the SQLite connection used by other mounts. If a mount’s DB connection is closed, the sync loop should reopen it or show a visible error instead of failing silently while holding sync.lock. When a store is remounted after a stuck period, local-only files and local edits should be pushed or kept as conflict copies, not deleted or overwritten by an older cloud version.

Operating System

MacOS

Version Information

Cursor 3.23.23 (macOS 15.4.1)

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey @ryo, thanks for the report and the log excerpts, they lined up exactly with what we found.

When one subagent’s claim on your machine closes, it can close the local sync database that the other mounted stores on the same worker are still using. Those stores then keep failing until the worker restarts. A fix for this is in the works for the worker!

Until the fix reaches your worker, a couple of things should reduce the risk:

  1. Before you restart Cursor or the worker, copy anything you added or changed in the project store folder since the “database connection is not open” errors started. A restart can re-pull the store from the cloud copy.
  2. If you can, run the coordinator’s subagents in the cloud rather than on this machine, or run fewer of them at the same time on it. The failure starts when one subagent’s store closes while others are still open.

Files of 100 MB or larger are over the per-file sync limit, so they stay local only and aren’t uploaded. Please keep separate copies of those too.

Your backup and watcher setup is the right call for now.