Skip to content
Source
Docs
Explore
Skills
MCP servers
For agents
Search or jump to…
Sign in
Sign up
pingdotgg
/
t3code
Pull requests
pingdotgg
t3code
Public
Synced with GitHub
Popular #1
Fork
0
0
0
0
1
2
3
4
5
6
7
8
9
Code
Architecture
Issues
Pull requests
Community
Assets
Artifacts
Releases
CI
Agents
Settings
fix(server): turn starts in long threads no longer read the whole thread
#35723
Send to my agent
Open
juliusmarminge
wants to merge 7 commits into
main
from
refs/pull/35723/head
·
opened
3 weeks ago
View on GitHub
Conversation
10
Commits
7
Files changed
2
Impact
Showing
2 changed files
with
26 additions
and
0 deletions
.
x
0 of 2 viewed, 2 left
Files
Hide whitespace
Unified
Split
24 additions and 0 deletions
+24
-0
apps/server/src/orchestration-v2/ProjectionStore.test.ts
Modified
Diff
Before/After
Viewed
apps/server/src/orchestration-v2/ProjectionStore.test.ts
View file
Expand up
Show all 7,434 lines
@@ -7435,6 +7435,30 @@
7435
7435
lookupPlans.
push
(plan);
7436
7436
}
7437
7437
7438
+
// A retry handoff reads its missed runs' history; that must not walk every item of the thread.
7439
+
const
history =
traceSqlStatements
();
7440
+
const
missedItems =
yield
* projectionStore
7441
+
.
getTurnStartHistory
(threadId, [selectedRunId])
7442
+
.
pipe
(
Effect
.
withTracer
(history.
tracer
));
7443
+
assert.
deepEqual
(
7444
+
missedItems.
map
((item) => item.
id
),
7445
+
selectedIds,
7446
+
);
7447
+
const
historyLookup = history.
statements
.
find
((statement) =>
7448
+
statement.
includes
(
"FROM orchestration_v2_projection_turn_items"
),
7449
+
);
7450
+
assert.
isDefined
(historyLookup);
7451
+
const
historyPlan = (
yield
* sql.
unsafe
<{
readonly
detail:
string
}>(
7452
+
`EXPLAIN QUERY PLAN
${
historyLookup
}
`
,
7453
+
[threadId, selectedRunId],
7454
+
))
7455
+
.
map
((row) => row.
detail
)
7456
+
.
join
(
"\n"
);
7457
+
assert.
match
(
7458
+
historyPlan,
7459
+
/^SEARCH .*\((?:thread_id=\? AND )?run_id=\?(?: AND thread_id=\?)?\)/m
,
7460
+
);
7461
+
7438
7462
assert.
deepEqual
((
yield
*
readItems
(threadId, emptyRunId)).
ids
, []);
7439
7463
assert.
deepEqual
(
Home
Search
Explore
Menu