Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(history): bound human-turn pages and invalidate oversized caches #24169

Closedluke2x(GitHub profile, opens in a new tab)wants to merge 5 commits intomain fromrefs/pull/24169/headopened View on GitHub

Showing 2 changed files with 47 additions and 35 deletions.

x
0 of 2 viewed, 2 left
41 additions and 29 deletionsapps/server/src/orchestration-v2/threadHistoryPaging.test.tsModified
View file
@@ -155,30 +155,21 @@
​
describe("threadHistoryPaging", () => {
- it("keeps a human turn whole up to the turn row budget and pages a longer one from inside", () => {
- const humanTurn = (length: number) => {
- const items = Array.from({ length }, (_, index) => makeRow(index));
- items[0] = {
- ...items[0]!,
- item: {
- ...items[0]!.item,
- type: "user_message",
- createdBy: "user",
- creationSource: "web",
- inputIntent: "turn_start",
- messageId: MessageId.make("long-human-turn"),
- text: "Continue",
- attachments: [],
- },
- } as OrchestrationV2ProjectedTurnItem;
- return items;
- };
-​
- const whole = selectRecentTimelineWindow({ items: humanTurn(180), snapshotSequence: 1 });
- expect(whole.items).toHaveLength(180);
- expect(whole.hasMoreHistory).toBe(false);
-​
- const items = humanTurn(THREAD_HISTORY_PAGE_POLICY.maxTurnItems + 100);
+ it("bounds a single human turn and pages every item exactly once", () => {
+ const items = Array.from({ length: 180 }, (_, index) => makeRow(index));