Regression: `agent worker start` no longer works per-repo — and the documented `--data-dir` escape hatch is also broken

Where does the bug appear (feature/product)?

Cursor CLI

Describe the Bug

agent worker start used to work independently per repo — running it in each of several repo checkouts gave each one its own worker (also matches the current docs: “To serve more than one repo, start a worker in each repo’s checkout”). As of CLI 2026.08.04-aaa8809, a new global exclusive lock on ~/.local/share/cursor-agent/worker.lock means only one worker can run on the whole machine at a time; starting a second one in a different repo fails with “another worker daemon is already running for this data dir”. The documented fix, the --data-dir <path> flag, is silently ignored (verified via the session log’s worker-mode:config line, which always shows the default global path regardless of the flag). Setting the equivalent CURSOR_DATA_DIR env var instead works correctly, so this is specifically a --data-dir CLI flag wiring bug, not a broken feature overall.

Steps to Reproduce

  1. cd ~/repo-a && agent worker start — starts fine, worker registers for repo-a.
  2. cd ~/repo-b && agent worker start — fails immediately:
    Error starting exec-daemon: another worker daemon is already running for this data dir: ~/.local/share/cursor-agent/worker.lock
  3. Try the documented workaround: agent worker --data-dir ./.cursor-agent start (flag placed before start, per agent worker --help) — succeeds with “Worker is now running”, no error.
  4. But check the session log (~/.local/share/cursor-agent/logs or the tmp cursor-agent-logs dir) for the worker-mode:config line — dataDir still shows the default global path, not ./.cursor-agent. Same result with an absolute path instead of relative.
  5. Instead run CURSOR_DATA_DIR=~/repo-b/.cursor-agent agent worker start — this time the log correctly shows dataDir: "~/repo-b/.cursor-agent", and both workers can run concurrently without conflict.

Expected Behavior

agent worker start should be usable independently per repo without any extra flags/env vars, as before and as the docs still describe. Failing that, at minimum the documented --data-dir flag should actually take effect (matching what CURSOR_DATA_DIR already does correctly).

Operating System

MacOS

Version Information

CLI:
CLI Version: 2026.08.04-aaa8809
OS: darwin (arm64)
Terminal: ghostty
Shell: zsh

For AI issues: which model did you use?

N/A — not a model/AI issue, this is a CLI worker daemon infrastructure bug.

For AI issues: add Request ID with privacy disabled

N/A

Additional Information

Root cause: I diffed the cached CLI builds under ~/.local/share/cursor-agent/versions/. The exclusive-lock module (SQLite BEGIN EXCLUSIVE on <dataDir>/worker.lock, throwing WorkerDaemonAlreadyRunningError) does not exist in the two previous builds I had cached (2026.07.09-a3815c0, 2026.07.23-e383d2b) — it’s new in 2026.08.04-aaa8809. Since the data dir defaults to one fixed path regardless of repo, this new lock is effectively global, which is what breaks the previously-working per-repo workflow.

That old workflow was genuinely nice — cd <repo>; agent worker start, no flags, no per-repo config to remember, and it just worked for as many repos as I had open at once. I’d really like to get back to that level of simplicity rather than needing to set CURSOR_DATA_DIR by hand for every repo (or juggle --worker-dir on a single shared worker instead).

Ask:

  1. Ideally, restore per-repo worker isolation as the default.
  2. If a global lock is intentional going forward, please fix --data-dir so it actually takes effect, and update the my-machines docs (“start a worker in each repo’s checkout”) accordingly.

Happy to provide full debug logs / agent worker debug --json output if useful.

Does this stop you from using Cursor

Yes - Cursor is unusable

Thanks for the detailed report and investigation. I confirmed both behaviors:

  1. Workers in different checkouts currently share the same default data directory, so the new lock prevents them from running simultaneously.
  2. The published CLI ignores --data-dir in this command path. This has been corrected in the current code, but the fix is not in the published CLI yet.

For now, your environment-variable workaround is the right approach:

CURSOR_DATA_DIR="$PWD/.cursor-agent" agent worker start

Use a different directory in each checkout. Keep an eye out for a new version of the CLI coming soon!

Many thanks! I look forward to using the new version!