The best way to control Claude Code, Codex and more from any computer or phone
fix(server): shell reads no longer walk a thread's finished tool calls (#39235)
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Navid Nadali committed
Nov 19, 2026 at 18:30 UTC
2fe74b00fa3e97d803f9bfed7e1f6b034c233dbc
2 files changed
+13
apps/server/src/orchestration-v2/ProjectionStore.test.ts
+12
@@ -7121,6 +7121,18 @@ it.layer(layerTest)("ProjectionStoreV2", (it) => {
7121
}
7122
}
7123
}
7124
+
7125
+ // Without the hint the planner walks every settled command, tool, and subagent item.
7126
+ const pendingQuery = statements.find((statement) =>
7127
+ statement.includes("AS owning_provider_instance_id"),
7128
+ );
7129
+ assert.isDefined(pendingQuery);
7130
+ const pendingPlan = yield* planOf(pendingQuery);
7131
+ assert.include(
7132
+ pendingPlan.find((detail) => detail.startsWith("SEARCH i ")) ?? "",
7133
+ "orchestration_v2_projection_turn_items_shell_pending_idx",
7134
+ pendingPlan.join("\n"),
7135
+ );
7136
}),
7137
);
7138
apps/server/src/orchestration-v2/ProjectionStore.ts
+1
@@ -8492,6 +8492,7 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
8492
) => sql<ShellPendingTurnItemRow>`
8493
SELECT i.thread_id, i.payload_json, p.provider_instance_id AS owning_provider_instance_id
8494
FROM orchestration_v2_projection_turn_items i
8495
+ INDEXED BY orchestration_v2_projection_turn_items_shell_pending_idx
8496
LEFT JOIN orchestration_v2_projection_provider_threads p
8497
ON p.provider_thread_id = i.provider_thread_id
8498
LEFT JOIN orchestration_v2_projection_runs r