fix(webui): preserve oversized turn history with record pagination (#6586)
This commit is contained in:
1 parent
5c1083df7f
commit
3c61bcfdf0
34 files changed
+3466
-380
No files matched your search
@@ -95,6 +95,7 @@ function makeClient() {
|
||||
getRunGeneration: lifecycle.getRunGeneration.bind(lifecycle),
|
||||
canReconcileCanonicalCompletion,
|
||||
reconcileCanonicalCompletion,
|
||||
settleFragmentRunLifecycle: vi.fn(lifecycle.settleFragmentRunLifecycle.bind(lifecycle)),
|
||||
fenceCanonicalCompletedTurns: lifecycle.fenceCanonicalCompletedTurns.bind(lifecycle),
|
||||
getGoalState: lifecycle.getGoalState.bind(lifecycle),
|
||||
onTranscript: lifecycle.onTranscript.bind(lifecycle),
|
||||
@@ -244,7 +245,7 @@ function streamedThreadPayload(
|
||||
projection_id: `answer:${row.turnId}:${row.streamId}:${endSeq}`,
|
||||
turn_id: row.turnId, turn_phase: "answer", turn_seq: endSeq,
|
||||
stream_id: row.streamId, text: row.content,
|
||||
projection_receipts: [{ turn_id: row.turnId, ranges: [[textSeq, endSeq]] }],
|
||||
text_from_seq: textSeq,
|
||||
...(row.mergeNext ? { resuming: true, merge_next: true } : {}),
|
||||
});
|
||||
}
|
||||
@@ -4568,7 +4569,7 @@ describe("ThreadShell", () => {
|
||||
));
|
||||
});
|
||||
|
||||
it("keeps the live answer cursor when a resumed turn is still running", async () => {
|
||||
it("catches up the active answer and keeps its cursor when a resumed turn is still running", async () => {
|
||||
const client = makeClient();
|
||||
let historyCalls = 0;
|
||||
const turnId = "turn-active-resume";
|
||||
@@ -4644,6 +4645,7 @@ describe("ThreadShell", () => {
|
||||
expect(client.sendMessage).not.toHaveBeenCalled();
|
||||
act(() => client._emitStatus("open"));
|
||||
await waitFor(() => expect(historyCalls).toBe(2));
|
||||
await screen.findByText("partial answer missed");
|
||||
expect(client.sendMessage).not.toHaveBeenCalled();
|
||||
|
||||
act(() => {
|
||||
@@ -4655,7 +4657,7 @@ describe("ThreadShell", () => {
|
||||
});
|
||||
});
|
||||
|
||||
await waitFor(() => expect(screen.getByText("partial answer resumed")).toBeInTheDocument());
|
||||
await waitFor(() => expect(screen.getByText("partial answer missed resumed")).toBeInTheDocument());
|
||||
expect(screen.queryByText(" resumed")).not.toBeInTheDocument();
|
||||
expect(client.sendMessage).not.toHaveBeenCalled();
|
||||
|
||||
|
||||
Reference in new issue
Block a user