Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): failed threads no longer scan every tool item for errors #18628

Mergedrealhasanshoaib(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/18628/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 7 changed files with 10 additions and 3 deletions (loading 4).

x
0 of 7 viewed, 7 left
1 addition and 1 deletionapps/server/src/orchestration-v2/ProjectionSettlement.test.tsModified
View file
@@ -520,7 +520,7 @@
// node_id, so a node_ordinal lookup walks the whole history once per thread.
const itemLookups = plan.filter((row) => row.detail.startsWith("SEARCH item "));
assert.lengthOf(itemLookups, 2);
- assert.isTrue(itemLookups.every((row) => row.detail.includes("turn_items_thread_run_idx")));
+ assert.isTrue(itemLookups.every((row) => row.detail.includes("turn_items_failed_error_idx")));
// The pending secret request lookup is bounded the same way.
const secretLookups = plan.filter((row) => row.detail.startsWith("SEARCH secret "));
assert.lengthOf(secretLookups, 1);
9 additions and 0 deletionsapps/server/src/orchestration-v2/ProjectionStore.test.tsModified
View file
@@ -3426,6 +3426,15 @@
assert.isAbove(sessionLookup, bindingLookup, marker);
assert.include(plan[sessionLookup], "(provider_session_id=?)");
+ const errorLookups = plan.filter(
+ (detail) =>
+ /^SEARCH (?:item|error) /.test(detail) && !detail.includes("(turn_item_id=?)"),
+ );
+ assert.lengthOf(errorLookups, marker.includes("blocking") ? 2 : 1, marker);
+ for (const errorLookup of errorLookups) {
+ assert.include(errorLookup, "turn_items_failed_error_idx");
+ assert.include(errorLookup, "(thread_id=? AND run_id=? AND node_id=?)");
+ }