feat: complete stateless daemon core — eliminate remaining shadow state#117
Merged
feat: complete stateless daemon core — eliminate remaining shadow state#117
Conversation
Implements ADR 004: Stateless Daemon Core. - reconcileAndEnrich() detects sessions that disappear from adapter discover() results and marks them stopped + autoUnlock - 30-second grace period for recently-launched sessions to avoid false positives from adapter discovery latency - session.list handler now fans out discover() to all adapters in parallel with 5s per-adapter timeouts - Merges results and enriches with daemon launch metadata (prompt, group, spec, cwd) - session.status also fans out to adapters for fresh data - Graceful degradation: failed adapters are skipped, partial results returned. Sessions from failed adapters fall back to launch metadata. - Removed SessionTracker.poll(), reapStaleEntries(), validateAllSessions(), pruneDeadSessions(), pruneOldSessions(), listSessions(), activeCount(), startPolling(), stopPolling() - Removed 5-second polling interval and all background state reconciliation - Simplified StateManager usage to only persist launch metadata, locks, and fuses - Added lightweight 30s PID liveness check for lock cleanup (startLaunchCleanup) — much cheaper than full adapter fan-out - MetricsRegistry decoupled from SessionTracker; active session count updated on session.list calls - session.prune kept for backward compat but now just runs PID liveness cleanup - Adapters own session truth. Daemon owns what it launched. - session.list = fan out adapter.discover() → merge → return - No daemon-side session registry for listing - Handle adapter failures gracefully (partial results, not errors) Fixes #51 Co-Authored-By: Charlie Hulcher <charlie@kindo.ai>
The afterEach cleanup races with fake-timer-driven writes; maxRetries prevents ENOTEMPTY on CI. Co-Authored-By: Charlie Hulcher <charlie@kindo.ai>
c-h-
pushed a commit
that referenced
this pull request
Mar 10, 2026
Features: - Phase 1 ACP adoption — Codex adapter via ACP transport (#127) - Callback metadata + lifecycle webhooks (#123) - ADR-001: adopt ACP as primary agent interface (#126) - Stateless daemon core (#117) Fixes: - Eliminate pending- session IDs — resolve real ID at launch (#131) - Webhook numeric exit_status + compatible HMAC headers (#128) - Daemon env derivation at spawn time (#119) - Binary resolve util update (#121) Docs: - Full documentation audit and alignment (#132)
c-h-
added a commit
that referenced
this pull request
Mar 10, 2026
Features: - Phase 1 ACP adoption — Codex adapter via ACP transport (#127) - Callback metadata + lifecycle webhooks (#123) - ADR-001: adopt ACP as primary agent interface (#126) - Stateless daemon core (#117) Fixes: - Eliminate pending- session IDs — resolve real ID at launch (#131) - Webhook numeric exit_status + compatible HMAC headers (#128) - Daemon env derivation at spawn time (#119) - Binary resolve util update (#121) Docs: - Full documentation audit and alignment (#132) Co-authored-by: Doink (OpenClaw) <charlie+doink@kindo.ai>
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.
Architectural Inversion: Eliminate Shadow State (Round 2)
PR #52 started the stateless daemon work but state tracking crept back. This completes the elimination.
Changes (-3,171 / +230 lines)
Design principle (AGENTS.md)
All tests pass (468/468). Build clean. Lint clean.
Fixes #109, fixes #110, fixes #111, fixes #113