fix(ida): recover cleanup after worker sessions are reaped

Accept the supervisor absent-session response only for the owned session, then independently verify session and private-input absence before releasing the workspace. Keep failed inventory verification retryable without resending a completed close.

Validation: 59 focused source tests passed, including live private-input peers, unavailable inventory, and mismatched session IDs. Real IDA engine behavior remains unverified. Fixes #1710.
This commit is contained in:
morluto
2026-10-12 04:40:41 +08:00
parent dc303a8ee8
commit 12fa8fd9f9
3 changed files with 129 additions and 18 deletions
+5
View File
@@ -242,3 +242,8 @@ export const closeDatabaseSchema = z
backend: z.enum(["worker", "gui"]),
})
.passthrough();
/** Supervisor response when the requested worker was already reaped. */
export const absentDatabaseCloseSchema = (sessionId: string) =>
z
.object({ error: z.literal(`Session not found: ${sessionId}`) })
.passthrough();