feat(finalize-session): allow re-finalizing an ended session with --reopen

Agents without a true session-end event (Antigravity CLI, Kiro, ZCode,
Pool) keep capturing under the same session id after a manual finalize,
but the finalize-session discovery step only matched open sessions, so a
second finalize silently found nothing.

Add an opt-in --reopen flag (requires --session-id) that threads
include_ended=true through GET /admin/open-sessions for the exact-id
lookup only; the bulk listing still excludes ended sessions and
include_ended without session_id is a 400. The server-side session-end
path already distinguishes ReEnd from AlreadyEnded, so a re-run with
nothing new stays a harmless no-op while new observations get a fresh
summary page (via supersession), handoff, and opt-in consolidation.
This commit is contained in:
Lucas Oliveira
2026-09-21 15:31:17 -03:00
parent 1fe32bc2be
commit 9524fef2dd
8 changed files with 213 additions and 6 deletions
+3
View File
@@ -808,6 +808,9 @@ explicitly:
ai-memory finalize-session --agent antigravity-cli
# add --all only to close every matching open Antigravity session in this scope
# or add --session-id <uuid> to close one exact concurrent session
# if the conversation continued after a first finalize, re-close it to cover
# the new observations (a re-run with nothing new is a harmless no-op)
ai-memory finalize-session --agent antigravity-cli --reopen --session-id <uuid>
```
### Devin CLI