fix(core): commit staged revert before admitting new prompt (#34338)
This commit is contained in:
parent
04c6bed240
commit
42a3cf9645
2 changed files with 56 additions and 2 deletions
|
|
@ -370,7 +370,11 @@ export const layer = Layer.effect(
|
|||
prompt: Effect.fn("V2Session.prompt")((input) =>
|
||||
Effect.uninterruptible(
|
||||
Effect.gen(function* () {
|
||||
yield* result.get(input.sessionID)
|
||||
const session = yield* result.get(input.sessionID)
|
||||
// A staged revert must be committed before admitting new input so the prompt
|
||||
// continues from the reverted boundary rather than stale post-boundary history.
|
||||
if (session.revert)
|
||||
yield* SessionRevert.commit(session).pipe(Effect.provideService(EventV2.Service, events))
|
||||
const prompt = resolvePrompt(input.prompt)
|
||||
const messageID = input.id ?? SessionMessage.ID.create()
|
||||
const delivery = input.delivery ?? "steer"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue