feat(threadline): boot-time reap of orphaned warm-session A2A workers#759
Open
JKHeadley wants to merge 2 commits into
Open
feat(threadline): boot-time reap of orphaned warm-session A2A workers#759JKHeadley wants to merge 2 commits into
JKHeadley wants to merge 2 commits into
Conversation
In-memory WarmSessionPool starts empty on restart while msg-warm-* tmux sessions from the prior instance may still be alive (orphaned). On boot (warm enabled) the server scans listRunningSessions() and kills warm-named orphans via the existing killWarmSessionByName. Pure static WarmSessionPool.selectBootOrphanNames + shared NAME_MARKER (no spawn/scan drift). Lossless (resume via #746). Found in A6; logged framework-issue f7a8ce9d. Unit-tested both sides; warm + lint gates green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ine code from user-facing line) Pre-existing fragment failed the pre-push gate's 'no inline code in What to Tell Your User' check, blocking unrelated pushes. Trivial wording fix. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Boot-time reap of orphaned warm-session A2A workers. Closes the at-boot gap in the in-memory
WarmSessionPool(#752): on a server restart the pool starts empty whilemsg-warm-*tmux sessions from the prior instance may still be alive — orphaned (no pool record → the TTL reap tick never sees them; backstopped only by the idle-session reaper, so they accumulate under load-restart churn, which echo hits regularly).Found while running A6 (live Echo↔Dawn warm-session verification) — the probe's warm session outlived its TTL because the server had restarted under fleet load. Logged as framework-issue
f7a8ce9d.What Changed
WarmSessionPool— new pure staticselectBootOrphanNames(sessions)+ a sharedNAME_MARKERconstant (single source of truth for the spawn name and the orphan scan).server.ts— on boot (when warm is enabled), scanlistRunningSessions()via the helper and kill any warm-named orphans through the existingkillWarmSessionByName. The warm spawn name now usesNAME_MARKER(same string), so spawn and scan can't drift.builtin-manifestregen that also picks up a pre-existingPostUpdateMigratorhash drift on main (so the manifest test is green).With a fresh, empty pool, every live
msg-warm-*session is definitionally an orphan from a prior instance — so reaping is safe. Lossless: a peer's next message resumes via the--resumepath (#746; the resume-map is durable).Evidence
selectBootOrphanNamespicks warm-named sessions (agent-prefixedecho-msg-warm-…and baremsg-warm-…), ignores non-warm (topic sessions, coldmsg-spawn-…, missing names), plus a no-drift test pinning spawn marker == scan marker.Framework generality
Framework-agnostic: matches on the warm-session name marker, never a framework-specific process name. Does not touch the launch/inject abstraction surface.
Risk / rollback
Tier 1 (additive, gated, pure-logic core). Runs only when
threadline.warmSessionA2Ais enabled. No config/HTTP/template surface. Revert = the three source files. Spec/finding: framework-issuef7a8ce9d.🤖 Generated with Claude Code