fix(dolt): server mode should support multi-process access
Code review fix: In server mode, Dolt connects to an external sql-server and should NOT be single-process-only. The whole point of server mode is to enable multi-writer access. Changes: - Add Config.GetCapabilities() method that considers server mode - Update daemon_guard, daemon_autostart, daemons, main to use GetCapabilities() - Add TestGetCapabilities test - Update init command help text to document server mode flags The existing CapabilitiesForBackend(string) is kept for backward compatibility but now includes a note to use Config.GetCapabilities() when the full config is available. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -255,11 +255,12 @@ Stops the daemon gracefully, then starts a new one.`,
|
||||
}
|
||||
workspace := targetDaemon.WorkspacePath
|
||||
|
||||
// Guardrail: don't (re)start daemons for single-process backends (e.g., Dolt).
|
||||
// Guardrail: don't (re)start daemons for single-process backends (e.g., embedded Dolt).
|
||||
// This command may be run from a different workspace, so check the target workspace.
|
||||
// Note: Dolt server mode supports multi-process, so GetCapabilities() is used.
|
||||
targetBeadsDir := beads.FollowRedirect(filepath.Join(workspace, ".beads"))
|
||||
if cfg, err := configfile.Load(targetBeadsDir); err == nil && cfg != nil {
|
||||
if configfile.CapabilitiesForBackend(cfg.GetBackend()).SingleProcessOnly {
|
||||
if cfg.GetCapabilities().SingleProcessOnly {
|
||||
if jsonOutput {
|
||||
outputJSON(map[string]string{"error": fmt.Sprintf("daemon mode is not supported for backend %q (single-process only)", cfg.GetBackend())})
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user