fix(coding-agent): preserve sessions during daemon startup - #911
Open
traditio wants to merge 2 commits into
Open
fix(coding-agent): preserve sessions during daemon startup#911traditio wants to merge 2 commits into
traditio wants to merge 2 commits into
Conversation
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
This prevents a slow cold start from cascading into supervisor churn, failed worker recovery, and
Unknown active sessionerrors while the durable session is still on disk.Validation
npx tsx ../../node_modules/vitest/dist/cli.js --run test/daemon-catalog-process.test.ts test/daemon-launch.test.ts— 32 tests passednpm run check— passed (formatting, type checking, installer render, browser smoke)DaemonCatalogClient.start()on the affected WSL-mounted checkout; the dedicated entrypoint reachedreadyconsistently below the former 5-second cutoffNote
Fix session loss during slow daemon startup by waiting for catalog readiness and revalidating supervisors
probeDaemonVersionin daemon-launch.ts now distinguishes 'unresponsive' daemons (connected but no hello within timeout) from 'stale' ones, andensureDaemonRunningwaits within the startup window before giving up.shutdownStaleDaemonIfNotBusyreturns a tri-state ('current' | 'stopped' | 'busy') and skips shutdown if the daemon sends a current hello during staleness checks, preventing replacement of a healthy daemon that was slow to start.DaemonSupervisor.recoverUncertainWorkerOperationsin daemon-supervisor.ts now awaitscatalog.start()before sending SIGKILL, ensuring the catalog is ready to record interrupted work.Macroscope summarized e6407a4.