Skip to content

fix(beads): detect embeddeddolt/ directory in database discovery#2909

Merged
maphew merged 1 commit into
gastownhall:mainfrom
maphew:fix/embedded-dolt-ci-tests
Mar 30, 2026
Merged

fix(beads): detect embeddeddolt/ directory in database discovery#2909
maphew merged 1 commit into
gastownhall:mainfrom
maphew:fix/embedded-dolt-ci-tests

Conversation

@maphew

@maphew maphew commented Mar 30, 2026

Copy link
Copy Markdown
Collaborator

Problem

All 20 "Embedded Dolt Cmd" CI test shards fail on main with:

Error: no beads database found

This was introduced by #2906 (GH#2903 fix) which correctly stopped creating the empty .beads/dolt/ directory in embedded mode. However, findDatabaseInBeadsDir() in internal/beads/beads.go still only checked for .beads/dolt/ — it didn't know about .beads/embeddeddolt/ where the embedded engine actually stores data.

Root Cause

findDatabaseInBeadsDir() calls cfg.DatabasePath(beadsDir) which returns .beads/dolt, then checks if that directory exists. Since embedded mode (now the default) stores data in .beads/embeddeddolt/<prefix>/ and no longer creates the .beads/dolt/ marker directory, the check fails and every command exits with "no beads database found".

Fix

  • Check for .beads/embeddeddolt/ before .beads/dolt/ in findDatabaseInBeadsDir() (embedded is now the default mode)
  • Also update hasBeadsProjectFiles() to recognize embeddeddolt/ as a valid project directory

Testing

  • All three previously-failing test suites pass locally: TestEmbeddedConfig, TestEmbeddedKV, TestEmbeddedReady
  • TestEmbeddedInit (22 subtests) all pass
  • Non-embedded tests unaffected

findDatabaseInBeadsDir() only checked for .beads/dolt/ when looking for
an existing database. In embedded mode (now the default), the database
lives under .beads/embeddeddolt/ and .beads/dolt/ is no longer created
during init (GH#2903). This caused all commands to fail with 'no beads
database found' because the discovery function couldn't find the DB.

Fix: check for .beads/embeddeddolt/ in addition to .beads/dolt/ in both
findDatabaseInBeadsDir() and hasBeadsProjectFiles(). The embedded path
is checked first since it's the default mode.

Fixes all 20 Embedded Dolt Cmd CI shards that were failing on main.

Amp-Thread-ID: https://ampcode.com/threads/T-019d3efe-8243-72ab-b800-7e5fa900af83
Co-authored-by: Amp <amp@ampcode.com>
@maphew maphew merged commit b706786 into gastownhall:main Mar 30, 2026
31 checks passed
@maphew maphew deleted the fix/embedded-dolt-ci-tests branch March 30, 2026 14:13
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.

1 participant