Repository navigation
fix(daemon): report the running daemon's TTL in daemon status (#4238) - #4241
Merged
Merged
Conversation
…#4238) daemon status printed config.ttlMs of the default-config WorkerDaemon it builds in the status process, so a background daemon started with --ttl 0 showed 'TTL: 12h (self-shutdown)'. Read ttlMs from daemon-state.json when the background daemon is running, as is already done for aiWorkersEnabled and for daemon status --all.
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.
Fixes the second bug in #4238.
Problem
ruflo daemon statusbuilds a freshWorkerDaemonin the status process (getDaemon(projectRoot)) and printed that instance'sconfig.ttlMs, which is the 12h default. A background daemon started with--ttl 0(or any other TTL) was therefore reported asTTL: 12h (self-shutdown).daemon status --allalready reads the real value from.claude-flow/daemon-state.json.Fix
In the single-workspace
statusaction, when the background daemon is running, readconfig.ttlMsfromdaemon-state.json. This uses the same block that already does this foraiWorkersEnabled(#2661). If the state file is missing or unreadable, the old in-process value is still used.Bug 1 in the issue (
--ttl 0dropped by the launcher)I did not change this. On current
main, the parser keeps declaredtype: 'string'option values as strings (see__tests__/parser-string-options.test.ts), anddaemon startdeclaresttlasstring. I checked thatdaemon start --ttl 0now parses as"0"(string), sostartBackgroundDaemonforwards it. It looks like 3.53.0/3.56.10 predate that parser change.Tests
New
__tests__/daemon-status-ttl-4238.test.ts. It creates a temp workspace with a livedaemon.pidand adaemon-state.json(ttlMs: 0andttlMs: 2h), runs the realdaemon statusaction, and checks the printed box.TTL: 12h (self-shutdown)).Other daemon-related tests (
vitest run __tests__ -t daemon): one failure,worker-daemon-resource-thresholds › loads daemon settings from config.yaml in the ESM runtime. That test is in a file this change does not touch. I ran it in a partial local workspace setup with linked packages, not a fullnpm ci.AI assistance
An AI coding agent (Grok Bot) helped write this change. I reproduced the bug, reviewed the diff, and ran the tests.