Skip to content

feat(threadline): boot-time reap of orphaned warm-session A2A workers#759

Open
JKHeadley wants to merge 2 commits into
mainfrom
echo/warm-orphan-boot-reap
Open

feat(threadline): boot-time reap of orphaned warm-session A2A workers#759
JKHeadley wants to merge 2 commits into
mainfrom
echo/warm-orphan-boot-reap

Conversation

@JKHeadley

Copy link
Copy Markdown
Owner

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 while msg-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 static selectBootOrphanNames(sessions) + a shared NAME_MARKER constant (single source of truth for the spawn name and the orphan scan).
  • server.ts — on boot (when warm is enabled), scan listRunningSessions() via the helper and kill any warm-named orphans through the existing killWarmSessionByName. The warm spawn name now uses NAME_MARKER (same string), so spawn and scan can't drift.
  • Includes a builtin-manifest regen that also picks up a pre-existing PostUpdateMigrator hash 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 --resume path (#746; the resume-map is durable).

Evidence

  • Unit (both sides): selectBootOrphanNames picks warm-named sessions (agent-prefixed echo-msg-warm-… and bare msg-warm-…), ignores non-warm (topic sessions, cold msg-spawn-…, missing names), plus a no-drift test pinning spawn marker == scan marker.
  • tsc clean; warm unit (15, +3) + integration (5) + e2e (1) green (no regression); esm / no-empty-catch / no-silent-fallbacks / framework-agnosticism gates green; builtin-manifest test green.

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.warmSessionA2A is enabled. No config/HTTP/template surface. Revert = the three source files. Spec/finding: framework-issue f7a8ce9d.

🤖 Generated with Claude Code

Instar Agent (echo) and others added 2 commits June 4, 2026 13:56
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>
@vercel

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
instar Ready Ready Preview, Comment Jun 4, 2026 9:01pm

Request Review

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