fix(daemon): Use syncbranch.IsConfigured() for autoPull (#837)

* test(daemon): Prove autoPull reads sync.branch from SQLite

- Verify daemon reads sync.branch from SQLite config source
- Show config.yaml sync-branch is ignored (YAML-only key)
- Add skipped tracer bullet test for issue #831

Coverage: daemon autoPull config resolution

* fix(daemon): Use syncbranch.IsConfigured() for autoPull

Problem:
- Daemon's periodic sync never activated when sync-branch configured in config.yaml
- autoPull check only read sync.branch from SQLite, missing YAML-only configuration

Solution:
- Replace SQLite-only check with syncbranch.IsConfigured()
- Update test to validate correct detection of YAML-configured sync branch

Impact:
- Periodic sync now activates correctly when sync-branch is configured in config.yaml
- Fixes daemon hanging issue for users with YAML-only configuration
This commit is contained in:
Peter Chanthamynavong
2026-01-01 10:48:14 -08:00
committed by GitHub
parent a1f706d17a
commit 9801102aa2
2 changed files with 153 additions and 2 deletions

View File

@@ -17,6 +17,7 @@ import (
"github.com/steveyegge/beads/internal/daemon"
"github.com/steveyegge/beads/internal/rpc"
"github.com/steveyegge/beads/internal/storage/sqlite"
"github.com/steveyegge/beads/internal/syncbranch"
)
var daemonCmd = &cobra.Command{
@@ -108,8 +109,10 @@ Run 'bd daemon' with no flags to see available options.`,
autoPull = false
}
} else {
// Default: auto_pull is true when sync.branch is configured
if syncBranch, err := store.GetConfig(ctx, "sync.branch"); err == nil && syncBranch != "" {
// Default: auto_pull is true when sync-branch is configured
// Use syncbranch.IsConfigured() which checks env var and config.yaml
// (the common case), not just SQLite (legacy)
if syncbranch.IsConfigured() {
autoPull = true
}
}