fix(session): retain fork tail until the first inbox change

This commit is contained in:
Dudu-0223 committed 2026-09-11 14:58:46 +08:00
1 parent 896a6c3e47
commit 0f8552df7f
11 files changed
+55 -34

No files matched your search

@@ -240,7 +240,12 @@ export class SessionCommandController {
{ sessionId: request.sessionId },
)
}
const cut = SessionLogOffset(boundary.seq + 1)
let cut = SessionLogOffset(boundary.seq + 1)
while (cut < source.events.length
&& source.events[cut]?.type !== 'turn/start'
&& source.events[cut]?.type !== 'agent/inbox/spliced') {
cut = SessionLogOffset(cut + 1)
}
let workspace: Workspace | undefined
try {
workspace = await this.forkWorkspace(source.header)