fix(dolt): proper server mode support for routing and storage

- FindDatabasePath now handles Dolt server mode (no local dir required)
- main.go uses NewFromConfigWithOptions for Dolt to read server settings
- Routing uses factory via callback to respect backend configuration
- Handle Dolt "database exists" error (error 1007) gracefully

Previously, Dolt server mode failed because:
1. FindDatabasePath required a local directory to exist
2. main.go bypassed server mode config when creating Dolt storage
3. Routing always opened SQLite regardless of backend config

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
beads/crew/emma
2026-01-24 00:26:23 -08:00
committed by Steve Yegge
parent 13c362e67e
commit e82f5136c1
5 changed files with 71 additions and 41 deletions

View File

@@ -6,6 +6,7 @@ import (
"github.com/steveyegge/beads/internal/routing"
"github.com/steveyegge/beads/internal/storage"
"github.com/steveyegge/beads/internal/storage/factory"
"github.com/steveyegge/beads/internal/types"
"github.com/steveyegge/beads/internal/utils"
)
@@ -41,7 +42,8 @@ func resolveAndGetIssueWithRouting(ctx context.Context, localStore storage.Stora
}
beadsDir := filepath.Dir(dbPath)
routedStorage, err := routing.GetRoutedStorageForID(ctx, id, beadsDir)
// Use factory.NewFromConfig as the storage opener to respect backend configuration
routedStorage, err := routing.GetRoutedStorageWithOpener(ctx, id, beadsDir, factory.NewFromConfig)
if err != nil {
return nil, err
}