@devries-cameron20 / t3code Mirror · read-only / commits / 2aacea6aa5
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 07:15 UTC

perf(server): a failed scheduled run reads only its own error items (#38712)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Nov 18, 2026 at 11:40 UTC 2aacea6aa5551b7df2295ed98be1b562b685c23f
1 file changed +12 -4
apps/server/src/scheduledTasks/ScheduledTaskService.ts
+12 -4
@@ -917,10 +917,18 @@ export const layer = Layer.effect(
917 if (removed.length > 0) yield* notifyChanged;
918 return;
919 }
920 - const { turnItems, messages } = yield* threadManagement.getProjectThreadRecords(thread, [
921 - "turnItems",
922 - "messages",
923 - ]);
920 + // Only the run's failed errors feed latestRootProviderFailure; a long-lived task
921 + // thread holds tens of thousands of items.
922 + const { turnItems, messages } = yield* threadManagement.getProjectThreadRecords(
923 + thread,
924 + ["turnItems", "messages"],
925 + {
926 + messageIds: [messageId],
927 + turnItemRunId: run.id,
928 + turnItemTypes: ["error"],
929 + turnItemStatuses: ["failed"],
930 + },
931 + );
932 // A queued message promoted to a steer cancels its run and joins the active one.
933 if (
934 run.status === "cancelled" &&