fix(tui): pin queued compaction below output (#36738)
This commit is contained in:
@@ -177,7 +177,9 @@ export function createSessionRows(sessionID: Accessor<string>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const queuedStart = (rows: SessionRow[]) => {
|
const queuedStart = (rows: SessionRow[]) => {
|
||||||
const index = rows.findIndex((row) => row.type === "message" && isPending(row.messageID))
|
const index = rows.findIndex(
|
||||||
|
(row) => row.type === "compaction-queued" || (row.type === "message" && isPending(row.messageID)),
|
||||||
|
)
|
||||||
return index === -1 ? rows.length : index
|
return index === -1 ? rows.length : index
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1202,6 +1202,21 @@ test("restores queued compaction from durable pending input", async () => {
|
|||||||
{ type: "compaction-queued", inputID: "message-compaction-later" },
|
{ type: "compaction-queued", inputID: "message-compaction-later" },
|
||||||
])
|
])
|
||||||
|
|
||||||
|
emitEvent(events, {
|
||||||
|
id: "evt_text_ended",
|
||||||
|
created: 2,
|
||||||
|
type: "session.text.ended",
|
||||||
|
durable: durable(sessionID, 5),
|
||||||
|
data: {
|
||||||
|
sessionID,
|
||||||
|
assistantMessageID: "message-assistant",
|
||||||
|
ordinal: 0,
|
||||||
|
text: "Active output",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
await wait(() => rows.some((row) => row.type === "part"))
|
||||||
|
expect(rows.map((row) => row.type)).toEqual(["part", "compaction-queued", "compaction-queued"])
|
||||||
|
|
||||||
emitEvent(events, {
|
emitEvent(events, {
|
||||||
id: "evt_compaction_started",
|
id: "evt_compaction_started",
|
||||||
created: 2,
|
created: 2,
|
||||||
|
|||||||
Reference in New Issue
Block a user