fix(host-sweep): reopen outbound DB as writable for orphan claim cleanup
PR #2151 added deleteOrphanProcessingClaims() to resetStuckProcessingRows(), but outDb is always opened readonly (openOutboundDb uses immutable: true). The write silently failed, leaving orphan processing_ack rows that block future message delivery for the session. Fix: add openOutboundDbRw() alongside the existing readonly opener and use it in resetStuckProcessingRows() to open a short-lived writable handle just for the delete. The readonly handle is still used for all reads above. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -30,6 +30,7 @@ import {
|
||||
ensureSchema,
|
||||
openInboundDb as openInboundDbRaw,
|
||||
openOutboundDb as openOutboundDbRaw,
|
||||
openOutboundDbRw as openOutboundDbRwRaw,
|
||||
upsertSessionRouting,
|
||||
insertMessage,
|
||||
migrateMessagesInTable,
|
||||
@@ -355,6 +356,11 @@ export function openOutboundDb(agentGroupId: string, sessionId: string): Databas
|
||||
return openOutboundDbRaw(outboundDbPath(agentGroupId, sessionId));
|
||||
}
|
||||
|
||||
/** Open the outbound DB for a session with write access. Only safe to call when no container is running. */
|
||||
export function openOutboundDbRw(agentGroupId: string, sessionId: string): Database.Database {
|
||||
return openOutboundDbRwRaw(outboundDbPath(agentGroupId, sessionId));
|
||||
}
|
||||
|
||||
/**
|
||||
* Write a message directly to a session's outbound DB so the host delivery
|
||||
* loop picks it up. Used by the command gate to send denial responses
|
||||
|
||||
Reference in New Issue
Block a user