Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): agent-driven threads keep their recent rows when checkpoint data is large #21187

Mergedfixfon(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/21187/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 38 additions and 1 deletion.

x
0 of 2 viewed, 2 left
35 additions and 0 deletionsapps/server/src/orchestration-v2/threadHistoryPaging.test.tsModified
View file
@@ -689,6 +689,41 @@
expect(bounded.projection.visibleTurnItems).toEqual(actionable.visibleTurnItems);
});
​
+ it("keeps agent-only turns visible when checkpoint file lists fill the byte budget", () => {
+ const items = Array.from({ length: 3 }, (_, turn) => {
+ const first = makeRow(turn * 5);
+ const prompt = {
+ ...first,
+ item: {
+ ...first.item,
+ type: "user_message" as const,
+ createdBy: "agent" as const,
+ creationSource: "provider" as const,
+ inputIntent: "turn_start" as const,
+ messageId: MessageId.make(`agent-prompt-${turn}`),
+ text: `Step ${turn}`,
+ attachments: [],
+ },
+ } as OrchestrationV2ProjectedTurnItem;
+ return [prompt, ...Array.from({ length: 4 }, (_, index) => makeRow(turn * 5 + index + 1))];
+ }).flat();
+ const files = Array.from(
+ { length: 15_000 },
+ (_, index) =>
+ `work/ws-${index % 40}/.jj/repo/store/extra/${index.toString(16).padStart(40, "0")}`,
+ );
+ const projection = {
+ ...makeProjection(items),
+ checkpoints: [{ id: "checkpoint-1", files }],