fix(test): auto-acknowledge tool-result follow-ups in mock LLM server (#20528)
This commit is contained in:
@@ -84,13 +84,17 @@ export namespace SessionProcessor {
|
||||
const status = yield* SessionStatus.Service
|
||||
|
||||
const create = Effect.fn("SessionProcessor.create")(function* (input: Input) {
|
||||
// Pre-capture snapshot before the LLM stream starts. The AI SDK
|
||||
// may execute tools internally before emitting start-step events,
|
||||
// so capturing inside the event handler can be too late.
|
||||
const initialSnapshot = yield* snapshot.track()
|
||||
const ctx: ProcessorContext = {
|
||||
assistantMessage: input.assistantMessage,
|
||||
sessionID: input.sessionID,
|
||||
model: input.model,
|
||||
toolcalls: {},
|
||||
shouldBreak: false,
|
||||
snapshot: undefined,
|
||||
snapshot: initialSnapshot,
|
||||
blocked: false,
|
||||
needsCompaction: false,
|
||||
currentText: undefined,
|
||||
@@ -250,7 +254,7 @@ export namespace SessionProcessor {
|
||||
throw value.error
|
||||
|
||||
case "start-step":
|
||||
ctx.snapshot = yield* snapshot.track()
|
||||
if (!ctx.snapshot) ctx.snapshot = yield* snapshot.track()
|
||||
yield* session.updatePart({
|
||||
id: PartID.ascending(),
|
||||
messageID: ctx.assistantMessage.id,
|
||||
|
||||
Reference in New Issue
Block a user