From f23e2afb6b46bb2ff2e9d6bc4ba54700cb4388c3 Mon Sep 17 00:00:00 2001 From: beads/crew/emma Date: Sun, 8 Feb 2026 00:10:37 -0800 Subject: [PATCH] fix: set sync.mode=dolt-native in DB during bd migrate --to-dolt (dolt-test-cb6x) Without this, ShouldExportJSONL defaults to git-portable mode after migration, causing 10-25s JSONL export on every bd write operation. Discovered by gastown/max via gt-dookzl investigation. Co-Authored-By: Claude Opus 4.6 Executed-By: beads/crew/emma Rig: beads Role: crew --- cmd/bd/migrate_dolt.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd/bd/migrate_dolt.go b/cmd/bd/migrate_dolt.go index 9a10b7f7f..420655990 100644 --- a/cmd/bd/migrate_dolt.go +++ b/cmd/bd/migrate_dolt.go @@ -139,6 +139,15 @@ func handleToDoltMigration(dryRun bool, autoYes bool) { exitWithError("import_failed", importErr.Error(), "partial Dolt directory has been cleaned up") } + // Set sync.mode to dolt-native in the DB so ShouldExportJSONL skips + // the expensive JSONL export. Without this, the migrated DB has no + // sync.mode set, defaulting to git-portable (10-25s export tax per write). + if err := doltStore.SetConfig(ctx, SyncModeConfigKey, SyncModeDoltNative); err != nil { + printWarning(fmt.Sprintf("failed to set sync.mode in DB: %v", err)) + } else { + printSuccess("Set sync.mode = dolt-native in database") + } + // Commit the migration commitMsg := fmt.Sprintf("Migrate from SQLite: %d issues imported", imported) if err := doltStore.Commit(ctx, commitMsg); err != nil {