agent-orchestrator/backend/internal/session_manager
i-trytoohard 78cdc6d5ca
fix(session-manager): terminate sessions even when handle is missing (#360)
* fix(session-manager): terminate sessions even when handle is missing

Kill hard-failed with ErrIncompleteHandle before recording terminal
intent, so a session that lost its runtime/workspace handle (crash,
partial spawn) was un-killable and stuck forever on the dashboard.

MarkTerminated now runs unconditionally; each destroy step is gated
individually on whether that handle exists. If nothing is present to
tear down, the session still terminates — freed=false just signals
nothing was freed. ErrIncompleteHandle is still returned by Restore
and runtimeMessenger.Send, where a missing handle is genuinely fatal.

Updates TestKill_RefusesIncompleteHandle → TestKill_TerminatesIncompleteHandle.

* style: gofmt blank line between test functions

---------

Co-authored-by: AO Bot <ao-bot@composio.dev>
2026-06-21 14:30:00 +05:30
..
manager.go fix(session-manager): terminate sessions even when handle is missing (#360) 2026-06-21 14:30:00 +05:30
manager_test.go fix(session-manager): terminate sessions even when handle is missing (#360) 2026-06-21 14:30:00 +05:30
provision_test.go fix(review): reviewer posts to GitHub and records its verdict autonomously (#259) 2026-06-17 16:34:15 +05:30