Skip to content

fix(daemon): report the running daemon's TTL in daemon status (#4238) - #4241

Merged
ruvnet merged 1 commit into
ruvnet:mainfrom
kevin9327:fix/daemon-status-ttl-4238
Oct 17, 2026
Merged

ruvnet merged 1 commit into
ruvnet:mainfrom
kevin9327:fix/daemon-status-ttl-4238

Conversation

@kevin9327

Copy link
Copy Markdown
Contributor

Fixes the second bug in #4238.

Problem

ruflo daemon status builds a fresh WorkerDaemon in the status process (getDaemon(projectRoot)) and printed that instance's config.ttlMs, which is the 12h default. A background daemon started with --ttl 0 (or any other TTL) was therefore reported as TTL: 12h (self-shutdown). daemon status --all already reads the real value from .claude-flow/daemon-state.json.

Fix

In the single-workspace status action, when the background daemon is running, read config.ttlMs from daemon-state.json. This uses the same block that already does this for aiWorkersEnabled (#2661). If the state file is missing or unreadable, the old in-process value is still used.

Bug 1 in the issue (--ttl 0 dropped by the launcher)

I did not change this. On current main, the parser keeps declared type: 'string' option values as strings (see __tests__/parser-string-options.test.ts), and daemon start declares ttl as string. I checked that daemon start --ttl 0 now parses as "0" (string), so startBackgroundDaemon forwards 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 live daemon.pid and a daemon-state.json (ttlMs: 0 and ttlMs: 2h), runs the real daemon status action, and checks the printed box.

  • Without the fix: 2 failed (box shows TTL: 12h (self-shutdown)).
  • With the fix: 2 passed.

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 full npm ci.

AI assistance

An AI coding agent (Grok Bot) helped write this change. I reproduced the bug, reviewed the diff, and ran the tests.

…#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.
@kevin9327
kevin9327 requested a review from ruvnet as a code owner October 17, 2026 03:29
@ruvnet
ruvnet merged commit e733bda into ruvnet:main Oct 17, 2026
110 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants