Skip to content

fix(dolt): disable auto-push by default; require explicit opt-in#3446

Merged
maphew merged 1 commit into
gastownhall:mainfrom
ckumar1:woodhouse/fix-autopush-default-off
Apr 24, 2026
Merged

fix(dolt): disable auto-push by default; require explicit opt-in#3446
maphew merged 1 commit into
gastownhall:mainfrom
ckumar1:woodhouse/fix-autopush-default-off

Conversation

@ckumar1

@ckumar1 ckumar1 commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Problem

bd currently auto-enables Dolt push whenever an origin remote exists. This
is unsafe at any concurrency above one writer.

Root cause: git+ssh remotes (GitHub, Hosted Dolt via SSH) have no
chunk-level upload atomicity. When two agents push concurrently, one push's
manifest update can land before the other's chunks finish uploading. The remote
ends up with a manifest that references .darc blobs that were never stored.
Any subsequent dolt fetch, dolt pull, or dolt push from a client that
ingested that manifest then propagates the dangling reference to new remotes.

We hit this three times in ~24 hours with ~10 concurrent agents writing to the
same database. Each "fix" (new remote + fresh push) was re-corrupted within an
hour because agents fetched the corrupt state, then auto-pushed it elsewhere.

Change

Remove the auto-enable-when-remote-exists logic. isDoltAutoPushEnabled now
returns config.GetBool("dolt.auto-push"), which defaults to false.

To restore auto-push on single-writer setups, add to .beads/config.yaml:

dolt.auto-push: true

or set BD_DOLT_AUTO_PUSH=true.

The explicit-config path (dolt.auto-push: true/false) is unchanged — this
only affects the case where the key is not set at all.

Tests

  • TestIsDoltAutoPushEnabled_DefaultOff (renamed from _DefaultNoStore) now
    documents that the default is false regardless of store state.
  • All existing autopush tests pass.

Notes

I'm happy to discuss whether a warning (rather than silent change) would be
better for existing users who relied on auto-push. The behavior is easy to
restore with one config line, but I wanted to raise the option.

Auto-push was enabled whenever an "origin" remote existed. At any
concurrency above one writer, git+ssh remotes have no chunk-level
upload atomicity: concurrent dolt pushes race on the remote manifest
and can leave it referencing chunks that were never uploaded. Any
subsequent clone/fetch/push then propagates the dangling reference.

Change the default to off. Set dolt.auto-push=true in
.beads/config.yaml (or BD_DOLT_AUTO_PUSH=true) to restore auto-push
on single-writer setups.

Rename TestIsDoltAutoPushEnabled_DefaultNoStore to _DefaultOff —
the test now documents the intended default, not a nil-store edge case.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@maphew maphew force-pushed the woodhouse/fix-autopush-default-off branch from f40fb94 to 5e485fe Compare April 24, 2026 15:44
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@maphew maphew left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after rebase, docs update, and CI repair. Auto-push default-off is the right data-safety default; explicit opt-in preserves single-writer setups.

@maphew maphew merged commit 456a660 into gastownhall:main Apr 24, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants