fix(tui): remove committed undo messages

This commit is contained in:
Dax Raad 2026-07-06 13:08:25 -04:00
commit 06dcf3f221
5 changed files with 74 additions and 6 deletions

View file

@ -70,9 +70,14 @@ describe("SessionProjector", () => {
})
.run()
const boundary = SessionMessage.ID.make("msg_boundary")
const earlier = SessionMessage.ID.make("msg_earlier")
yield* db
.insert(SessionMessageTable)
.values([assistantRow(boundary, 1), assistantRow(SessionMessage.ID.make("msg_later"), 2)])
.values([
assistantRow(earlier, 0),
assistantRow(boundary, 1),
assistantRow(SessionMessage.ID.make("msg_later"), 2),
])
.run()
yield* db
.insert(SessionContextCheckpointTable)
@ -100,7 +105,7 @@ describe("SessionProjector", () => {
})
expect(
(yield* db.select({ id: SessionMessageTable.id }).from(SessionMessageTable).all()).map((row) => row.id),
).toEqual([boundary])
).toEqual([earlier])
// A committed revert resets the context checkpoint so the next turn re-initializes.
expect(yield* db.select().from(SessionContextCheckpointTable).get().pipe(Effect.orDie)).toBeUndefined()
}),

View file

@ -212,7 +212,8 @@ describe("SessionV2.prompt", () => {
(yield* db.select({ id: SessionMessageTable.id }).from(SessionMessageTable).all().pipe(Effect.orDie)).map(
(row) => row.id,
),
).not.toContain(stale)
).not.toContainAnyValues([boundary.id, stale])
expect(yield* SessionInput.find(db, boundary.id)).toBeUndefined()
}),
)