feat: daemon starts in background with local-only workflow support - #38
Merged
Conversation
- `choo daemon start` now starts the daemon in the background by default - Added `--foreground` flag for blocking mode (useful for debugging) - Daemon checks if already running before starting (via PID file) - Integrated web server into daemon (serves on :8080 by default) - `choo daemon stop` properly shuts down daemon via gRPC callback - `choo daemon stop` handles "not running" case gracefully - Added job manager adapter to bridge jobManagerImpl to gRPC JobManager interface - Registered DaemonService with gRPC server for status/stop commands Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix daemon backgrounding with proper process group separation (Setpgid=true prevents Ctrl+C from killing daemon) - Add `daemon logs` command with -f/--follow and -n/--lines flags - Auto-start daemon when running `choo run` if not already running - Support CLI attach to existing running workflows (get-or-create pattern) - Make event forwarding order-independent (Store always updated, Hub late-bindable) - Fix UNIQUE constraint error by cleaning up completed runs before creating new ones (DeleteNonActiveRunByBranch) - Reorder graceful shutdown to cancel jobs first, then stop servers Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add EnsureBranchOnRemote check to daemon's job manager, matching inline mode behavior. The check auto-pushes the target branch if it doesn't exist on remote, or fails early with a clear error message. - Add cleanup of non-active runs in gRPC StartJob to prevent UNIQUE constraint violations when restarting jobs for the same branch. - Add ErrJobNotFound sentinel error and nil check in job manager adapter. - Implement transitive edge reduction in DAG visualization for cleaner graph display. Removes redundant edges where a dependency is already reachable through another path. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Workers now auto-detect local vs remote workflow: - Check if origin/<target> exists locally before fetching - Use local branch ref for rebase when no remote tracking - Skip fetch for local-only branches Daemon job manager no longer checks/pushes target branch on startup. Orchestrator still pushes feature branch and creates PR at the end (unless NoPR config is set), which works regardless of whether the target branch initially had remote tracking. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The daemon job manager was not passing FeatureBranch, FeatureMode, or ClaudeCommand to the orchestrator config. This caused the orchestrator to skip PR creation even when all units were complete. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Validate target branch and tasks dir before attaching to existing job to prevent mis-attachment to jobs with different configurations - Use reference counting for connection state tracking to correctly handle multiple concurrent jobs (SetConnected now increments/decrements) - Replace fixed 500ms sleep with exponential backoff polling loop for daemon startup verification (5 retries with backoff up to ~3s total) - Optimize log reading to read from end of file instead of loading entire file into memory (efficient tail-like implementation) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enables the daemon to start jobs in the background with proper feature mode configuration. Adds support for local-only workflows where workers skip remote operations when no remote tracking exists. Fixes orchestrator PR creation when all units are pre-completed, and ensures feature branch is pushed with PR at workflow end.
Changes:
Depends on #36 (daemon mode foundation).
🤖 Generated with Claude Code