allow opt-in autolaunch of the daemon - #558
Draft
hanabel1 wants to merge 1 commit into
Draft
Conversation
Adds an autoLaunchDaemon user setting (default false) so users can opt into having chunk commands automatically start the watch daemon when it isn't running, without surprising anyone by default. - chunk config set autoLaunchDaemon true/false to enable/disable - --daemon / --no-daemon global flags override the setting per-run - auto-launch is skipped for shell completions, watch (starts its own daemon), the _daemon subcommand itself, and receive-telemetry - IsDaemonCompatible() checks both reachability and build ID so stale daemons from older builds are not delegated to; fixes a 404 error that surfaced when a pre-/validate daemon was still running Co-Authored-By: Claude Sonnet 4.6 <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.
Summary
autoLaunchDaemonuser setting (defaultfalse) — users opt in rather than being surprised by a background process--daemon/--no-daemonglobal flags to override the setting on any individual runEvents
chunk config set autoLaunchDaemon trueenables auto-launch globallychunk validate --no-daemonskips the daemon for that run even when the setting is onchunk validate --daemonforces daemon launch for that run even when the setting is offNot collected
chunk watch(manages its own daemon), the_daemonsubcommand, andreceive-telemetryImplementation
IsDaemonCompatible()added towatchd— checks reachability and build ID match;shouldUseDaemonandtryHookDelegatenow use this instead ofIsDaemonRunning(), so a stale daemon from a previous build is skipped rather than delegated toRunValidatetreats a 404 response asErrDaemonUnavailable(belt-and-suspenders fallback to inline execution)--no-daemonmoved from a hidden local validate flag to a persistent root flag so it applies to all commands; validate reads it viacmd.Flags().GetBoolTest plan
task build && task testpasseschunk config set autoLaunchDaemon true→ subsequent commands start the daemon if not runningchunk validate --no-daemonskips daemon even when setting is on🤖 Generated with Claude Code