WI session lifecycle: keep sessions open until WI is done #256

Merged
toasterson merged 1 commit from claude/wi-019f0918-wi-session-lifecycle-keep-sessions-open into main 2026-06-28 12:15:31 +00:00
Owner

Anima work item 019f0918-ad42-7e21-b51b-7d1e4adafbea.

What to build

Ensure that an implementing agent session stays live (or is transparently re-attachable) for the entire lifetime of an in-flight Work Item. A cold session on an in-flight WI is a bug, not a normal state. This covers: session keep-alive (runner heartbeat already exists; verify WI sessions aren't abandoned mid-flight), rebind window (runner reconnect within 30min reclaims sessions; verify this holds for WI-bound sessions), and explicit session close when the WI reaches done or is parked awaiting human.

Pushed context

  • CONTEXT.md glossary: Thread participant ("A cold session on an in-flight WI is a bug, not a normal state")
  • ADR 0013
  • Files: crates/anima-server/src/services/runner.rs (rebind window, fail_orphaned_sessions), crates/anima-server/src/services/bridge.rs (start_planning_session, start_companion_session), crates/anima-server/src/orchestrator/ (WI dispatch loop)

Acceptance criteria

  • WI-bound sessions are not abandoned while the WI is in implementing or diff-ready
  • When a runner reconnects within the rebind window, WI sessions are reclaimed (not failed)
  • When a WI reaches done, its session is explicitly closed
  • When a WI is parked (needs-human), the session stays open for the human to pick up in-thread
  • cargo test --workspace --exclude anima-desktop --exclude anima-server passes
Anima work item `019f0918-ad42-7e21-b51b-7d1e4adafbea`. ## What to build Ensure that an implementing agent session stays live (or is transparently re-attachable) for the entire lifetime of an in-flight Work Item. A cold session on an in-flight WI is a bug, not a normal state. This covers: session keep-alive (runner heartbeat already exists; verify WI sessions aren't abandoned mid-flight), rebind window (runner reconnect within 30min reclaims sessions; verify this holds for WI-bound sessions), and explicit session close when the WI reaches `done` or is parked awaiting human. ## Pushed context - CONTEXT.md glossary: Thread participant ("A cold session on an in-flight WI is a bug, not a normal state") - ADR 0013 - Files: crates/anima-server/src/services/runner.rs (rebind window, fail_orphaned_sessions), crates/anima-server/src/services/bridge.rs (start_planning_session, start_companion_session), crates/anima-server/src/orchestrator/ (WI dispatch loop) ## Acceptance criteria - [ ] WI-bound sessions are not abandoned while the WI is in `implementing` or `diff-ready` - [ ] When a runner reconnects within the rebind window, WI sessions are reclaimed (not failed) - [ ] When a WI reaches `done`, its session is explicitly closed - [ ] When a WI is parked (needs-human), the session stays open for the human to pick up in-thread - [ ] `cargo test --workspace --exclude anima-desktop --exclude anima-server` passes
toasterson changed title from WIP: WI session lifecycle: keep sessions open until WI is done to WI session lifecycle: keep sessions open until WI is done 2026-06-27 14:00:15 +00:00
toasterson deleted branch claude/wi-019f0918-wi-session-lifecycle-keep-sessions-open 2026-06-28 12:15:31 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
toasterson/Anima!256
No description provided.