fix(v2): cancel/pause/resume recurring tasks via series_id

Recurring tasks spawn a new messages_in row per occurrence. Cancel
only matched the completed row the agent remembered, leaving the
live next occurrence running. Tag every row in a recurrence chain
with the originating task's id (series_id) so cancel/pause/resume
can reach any live row in the series. Cancel also clears recurrence
to prevent the sweep from cloning a cancelled task. Kind-aware id
prefix on recurrences (task- instead of msg-) keeps list_tasks output
consistent across occurrences.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
exe.dev user
2026-04-16 15:51:37 +00:00
committed by Daniel
parent 419d04fee0
commit 8ef30ad289
5 changed files with 245 additions and 17 deletions

View File

@@ -26,6 +26,7 @@ import {
upsertSessionRouting,
replaceDestinations,
insertMessage,
migrateMessagesInTable,
type DestinationRow,
} from './db/session-db.js';
import { log } from './log.js';
@@ -305,7 +306,9 @@ function extractAttachmentFiles(
/** Open the inbound DB for a session (host reads/writes). */
export function openInboundDb(agentGroupId: string, sessionId: string): Database.Database {
return openInboundDbRaw(inboundDbPath(agentGroupId, sessionId));
const db = openInboundDbRaw(inboundDbPath(agentGroupId, sessionId));
migrateMessagesInTable(db);
return db;
}
/** Open the outbound DB for a session (host reads only). */