Skip to content

CLI-path commands fail in shared Dolt server mode (push/pull/remote) #3219

@s-a-c

Description

@s-a-c

Problem

Several bd dolt subcommands shell out to the raw dolt CLI and assume the repo directory is at .beads/dolt/<database> relative to the project root. In shared-server mode, the actual data lives at a shared root (e.g. ~/.local/share/beads-dolt/<database>).

Command Behavior Impact
bd dolt push Works only if a symlink exists at .beads/dolt/<db> -> shared root Fragile dependency on manual symlink
bd dolt pull Fails with "database is read only" — CLI opens repo directly, conflicting with running server lock Broken in server mode regardless of symlink
bd dolt remote add SQL path succeeds, CLI path fails → state divergence Partially broken
bd dolt remote remove Same dual-path divergence as remote add Partially broken

Root cause

When Beads shells out to dolt push, dolt pull, or dolt remote, it constructs the working directory as .beads/dolt/<database>. This path:

  1. Does not exist by default in shared-server mode (requires a manual symlink to work)
  2. Even if it resolves via symlink, opening the Dolt repo directory directly conflicts with the running server's lock on that same directory (this is why pull fails)

Expected behavior

When dolt_mode: server, CLI-fallback commands should:

  1. Resolve the repo path from explicit configuration (shared data root + database name), not from the per-project .beads/dolt/ convention
  2. For operations that conflict with a running server (like pull), either:
    • Route through SQL instead of CLI
    • Coordinate with the server (stop/start around the operation)
    • Fail with a clear error explaining the server-lock conflict

Path resolution order

  1. Explicit configured data-dir from metadata or config
  2. dolt_server_host + dolt_database from metadata (derive shared root)
  3. Legacy per-project .beads/dolt/<database> fallback only if no server config exists

Environment

  • beads v1.0.0 (Homebrew)
  • macOS, Dolt SQL server managed by launchctl on 127.0.0.1:3307
  • .beads/metadata.json with dolt_mode: server
  • Shared data root: ~/.local/share/beads-dolt

Workaround

Create a per-project symlink: .beads/dolt/<db> -> ~/.local/share/beads-dolt/<db>. This fixes push but pull remains broken due to the server lock conflict.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions