Repository navigation
fix(daemon): report failed close/disconnect, cancel shutdown timers, scope daemon diagnostics - #4357
Merged
thymikee merged 19 commits intoNov 10, 2026
Conversation
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
Fixes 2026-11-10 audit findings DCORE-1 (= DSESS-3), SRC2-5, DSRV-1, DSRV-2, DCORE-2, DSESS-2, SRC2-6 and SRC2-3. Each was reproduced with a failing test before the fix.
closeanddisconnectno longer report false success:closenow reports a script write that failed with a filesystem error, usingreason: script_write_failedand the target path.disconnectnames a lease it could not release. JSON output addsleaseIdandreleaseError.daemon.log. This covers the shutdown summary, the lease sweep and its retries, and startup recovery.connect limrunis idempotent per session.disconnectremoves generated profiles that no session uses.app.logrotates while a sink is open, as the docs already said.network dumpreadsapp.login blocks instead of holding the whole file as one string.29 files changed, +1266/−194. This is over the 1,000-line guideline because it batches one audit slice (daemon lifecycle, CLI connection and app log) whose fixes share the shutdown and diagnostics-scope seams. Future slices of this size will be split.
Validation
d2689cb: CI passes 19/19 checks, including the non-root unit suite and integration. Earlier localcheck:affected --run --head b8cf1bb(exactCommit=true): format, lint, typecheck, layering, fallow, build and related tests pass.src/daemon-entrypoint.test.ts. That test passes 3 of 3 runs alone, and base code takes the same 2.5–3.4 s on this host. The cause is likely host load but not proven.retire.Generated by Claude Code
<a href="
https://backend.blacksmith.sh/track/enable-autofix?expires=1796918559&installation_model_id=447842&pr_number=4357&ref=codesmith_pr_footer&repository=callstack%2Fagent-device&return_to=https%3A%2F%2Fgithub.com%2Fcallstack%2Fagent-device%2Fpull%2F4357&signature=4724adad9f194f249ea3a1e247e732fccf9ac502fee6836f2c74ca01d16ac93b"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"><img alt="Autofix with [code]smith" src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png" width="190" height="28">Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.<source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg">https://www.cubic.dev/action/auto-fix/pr/callstack/agent-device/4357?returnTo=https%3A%2F%2Fgithub.com%2Fcallstack%2Fagent-device%2Fpull%2F4357&source=description"target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img alt="Turn on auto-fix" src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg">Generated by Claude Code