Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): bound thread activity hydration #6153

Mergedt3-code-bot[bot](GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/6153/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 124 additions and 0 deletions (loading 1).

x
0 of 2 viewed, 2 left
124 additions and 0 deletionsapps/server/src/orchestration/Layers/ProjectionSnapshotQuery.test.tsModified
View file
@@ -2281,6 +2281,130 @@
+ it.effect("bounds activity hydration and preserves unresolved requests", () =>
+ Effect.gen(function* () {
+ yield* seedFanOutThread();
+ const snapshotQuery = yield* ProjectionSnapshotQuery;
+ const sql = yield* SqlClient.SqlClient;
+​
+ yield* sql`DELETE FROM projection_thread_activities`;
+ yield* sql`
+ WITH RECURSIVE activity_rows(sequence) AS (
+ SELECT 1
+ UNION ALL
+ SELECT sequence + 1 FROM activity_rows WHERE sequence < 501
+ )
+ INSERT INTO projection_thread_activities (
+ activity_id, thread_id, turn_id, tone, kind, summary, payload_json, sequence, created_at
+ )
+ SELECT
+ printf('activity-%04d', sequence),
+ 'thread-w',
+ 'turn-5',
+ 'tool',
+ 'tool.completed',
+ 'ran tool',
+ printf('{"sequence":%d}', sequence),
+ sequence,
+ '2026-03-01T00:04:00.000Z'