Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): bound snapshot activity payload memory #9000

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/9000/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 5 changed files with 145 additions and 12 deletions (loading 4).

x
0 of 5 viewed, 5 left
145 additions and 12 deletionsapps/server/src/orchestration/Layers/ProjectionSnapshotQuery.test.tsModified
View file
@@ -21,6 +21,7 @@
import * as ThreadPlanProgress from "../ThreadPlanProgress.ts";
import { ProjectionSnapshotQuery } from "../Services/ProjectionSnapshotQuery.ts";
import { encodeThreadDetailPageCursor } from "../threadDetailCursor.ts";
+import { projectThreadDetailSnapshot } from "../ActivityPayloadProjection.ts";
​
const asProjectId = (value: string): ProjectId => ProjectId.make(value);
const asTurnId = (value: string): TurnId => TurnId.make(value);
@@ -2389,9 +2390,84 @@
'thread-w',
'turn-5',
'tool',
- 'tool.completed',
+ CASE
+ WHEN sequence = 2 THEN 'tool.updated'
+ WHEN sequence IN (3, 70) THEN 'context-window.updated'
+ ELSE 'tool.completed'
+ END,
'ran tool',
- printf('{"sequence":%d}', sequence),
+ CASE
+ WHEN sequence IN (2, 80) THEN json_object(
+ 'itemType', 'command_execution',
+ 'toolCallId', 'cross-batch-call',
+ 'title', CASE WHEN sequence = 80 THEN 'Build completed' ELSE 'Build' END,
+ 'status', 'completed',
+ 'data', json_object(
+ 'toolCallId', 'cross-batch-call',
+ 'item', json_object(