fix(chat): allow failed turns to be forked

Failed turns can end in Paseo-generated timeline items without provider
message IDs. Anchor forks to canonical timeline positions while retaining
legacy boundaries for compatibility.

Place the fork summary before the new prompt and delimit it as structured
chat history.
This commit is contained in:
Mohamed Boudra
2026-07-14 14:40:37 +02:00
parent c0b801b805
commit 162c7ce127
23 changed files with 486 additions and 108 deletions
+2
View File
@@ -538,6 +538,7 @@ function normalizeListCommandsOptions(
return { agentId: input, ...legacyOptions };
}
export interface AgentForkContextOptions {
boundaryCursor?: FetchAgentTimelineCursor;
boundaryMessageId?: string;
requestId?: string;
}
@@ -2555,6 +2556,7 @@ export class DaemonClient {
type: "agent.fork_context.request",
agentId,
requestId: resolvedRequestId,
...(options.boundaryCursor ? { boundaryCursor: options.boundaryCursor } : {}),
...(options.boundaryMessageId ? { boundaryMessageId: options.boundaryMessageId } : {}),
});