Repository navigation
fix(daemon-client): document the drain timeout and tighten ensureDaemon follow-ups - #3783
Conversation
|
There was a problem hiding this comment.
All reported issues were addressed across 11 files
You’re at about 97% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Size Report
Startup median (7 runs, lower is better):
|
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
You’re at about 97% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
… force retire Retire through the typed result instead of casting the thrown error's details. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…assert the stop command in the startup hint test Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…d force retirement Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Rebased onto main (after the plugin v2 stack, #3767–#3770). No review comments were outstanding: all three threads were already replied to and resolved. 🤖 Generated with Claude Code |
45b022e to
11200c0
Compare
|
The PR is ready at 11200c0, and I found no problems in the code. Not blocking: the hint in daemon-lifecycle-errors.ts leaves out --state-dir when the state dir equals the default, but that default ignores AGENT_DEVICE_STATE_DIR, which the CLI reads. If the shell exports that variable and an SDK caller passes ~/.agent-device, the hint suggests 'agent-device devices' and that starts a daemon in the wrong directory. Always including --state-dir, as daemonStopCommand does, would fix it and let you drop the default branch and its test. You can take this or leave it, and moving the error factory into daemon-lifecycle-errors.ts is optional too. I did not run the tests. By reading the diff, the onStart 'missing' assertion and both hint assertions would fail on the merge-base code. No test covers the daemon_retirement_unconfirmed branch after a drain, but it behaves like the old rethrow. The 60 s figure is written by hand in the docs, help, CHANGELOG and the test, and nothing ties it to DRAIN_DEADLINE_MS. All of them match today. The three open inline threads (#3783 (comment), #3783 (comment), #3783 (comment)) are fixed at this commit, so please resolve them. Both Smoke Tests jobs are still running with no failures. They cover the CLI and MCP path through ensureDaemon, but they start a missing daemon and do not reach the drain or force-retire branches this PR changes. Once both jobs finish green, the PR can merge. |
The default-directory comparison ignored AGENT_DEVICE_STATE_DIR, so a caller passing the default directory while the shell exports that variable got a hint that starts a daemon elsewhere. The retirement-unconfirmed error factory moves to daemon-lifecycle-errors.ts. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Applied the 13:35Z review in 0fa2373:
🤖 Generated with Claude Code |
|
I re-reviewed 0fa2373 and the code looks good. The hint text and the error-constructor move from the earlier review are now in place, and I found nothing else to change. I read the diff and searched the code at this commit but did not run tests. The change only touches error and hint text, the error constructor, a CHANGELOG line and one removed unit test, so it does not affect a device or daemon runtime route. The only check that has not passed is Smoke Tests, which is still running with no failure so far, so it needs to finish green before merge. No conflicts. |
Part of #3747. References #3754 and #3780 (merged before these landed).
Follow-ups to the quiesce/ensure stack:
daemon-drain-timeoutand the post-drain force retire inclient-api.mdand thehelplifecycle topic.stopAndRetireDaemonresult (stopDaemonForTakeover), replacing the cast onerror.details.retirement.Replaced unreachable daemon), notReplaced idle daemon.daemon-not-runninghint names--state-dir <dir>when the directory is not the default.isDaemonNotRunningError(error)replaces the bare reason string indaemon-client-ensuring.ts.session-store.tsusesDAEMON_SHUTTING_DOWN_REASON.ensureDaemonagainst a busy daemon withstartingUp: trueasserts the startup hint.Already on main, so unchanged: the client reads the
startingUpcensus (readDaemonQuiesceCensus) anddaemonBusyErrorgives the startup hint; the stale comment indaemon-client-metadata.tsno longer exists.The "answers a probe" stand-in keeps serving
/health: a stand-in that stops serving is the previous test (no probe answered, force retire). Its comment now says it models a stuck drain.🤖 Generated with Claude Code