Skip to content

fix(coding-agent): preserve sessions during daemon startup - #911

Open
traditio wants to merge 2 commits into
PrimeIntellect-ai:mainfrom
traditio:traditio-fix-daemon-startup-recovery
Open

fix(coding-agent): preserve sessions during daemon startup#911
traditio wants to merge 2 commits into
PrimeIntellect-ai:mainfrom
traditio:traditio-fix-daemon-startup-recovery

Conversation

@traditio

@traditio traditio commented Aug 8, 2026

Copy link
Copy Markdown

Summary

  • start the saved-session catalog through a dedicated lightweight entrypoint and allow slow filesystems a 30-second startup window
  • treat a connected supervisor without a hello as still starting instead of stale, and revalidate the connected daemon before any stale shutdown
  • start the catalog before terminating a recoverable worker so an interruption marker can be persisted before replacement

This prevents a slow cold start from cascading into supervisor churn, failed worker recovery, and Unknown active session errors 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 passed
  • npm run check — passed (formatting, type checking, installer render, browser smoke)
  • manually exercised DaemonCatalogClient.start() on the affected WSL-mounted checkout; the dedicated entrypoint reached ready consistently below the former 5-second cutoff

Note

Fix session loss during slow daemon startup by waiting for catalog readiness and revalidating supervisors

  • probeDaemonVersion in daemon-launch.ts now distinguishes 'unresponsive' daemons (connected but no hello within timeout) from 'stale' ones, and ensureDaemonRunning waits within the startup window before giving up.
  • shutdownStaleDaemonIfNotBusy returns 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.recoverUncertainWorkerOperations in daemon-supervisor.ts now awaits catalog.start() before sending SIGKILL, ensuring the catalog is ready to record interrupted work.
  • The catalog process in daemon-catalog-process.ts now has a 30-second startup timeout and launches via a dedicated entrypoint under Node environments.

Macroscope summarized e6407a4.

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.

1 participant