@devries-cameron20 / t3code-1 / commits / f981b7a226
Fork 0

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

perf(client): skip idle inbox placement serialization (#27460)

Co-authored-by: maria-rcks <maria@kuuro.net>

Utkarsh Patil committed Nov 3, 2026 at 07:03 UTC f981b7a226268e69b8f81c68ae7604e331f1ba57
1 file changed +15 -12
packages/client-runtime/src/state/threadInbox.ts
+15 -12
@@ -123,7 +123,7 @@ export function createInboxReturnTracker() {
123 const keyOf = (thread: ThreadKeyInput) => `${thread.environmentId}:${thread.id}`;
124 const states = new Map<
125 string,
126 - { working: boolean; deadline: number | null; placement: string }
126 + { working: boolean; deadline: number | null; placement: string | null }
127 >();
128 const returns = new Map<string, number>();
129 const listeners = new Set<() => void>();
@@ -184,17 +184,21 @@ export function createInboxReturnTracker() {
184 for (const thread of threads) {
185 const key = keyOf(thread);
186 present.add(key);
187 - const placement = JSON.stringify([
188 - thread.archivedAt,
189 - thread.deletedAt,
190 - thread.pinnedAt,
191 - thread.settledOverride,
192 - thread.settledAt,
193 - thread.snoozedAt,
194 - thread.snoozedUntil,
195 - thread.activeOrderKey,
196 - ]);
187 const previous = states.get(key);
188 + const actual = isThreadWorking(thread);
189 + const placement =
190 + actual || previous?.working
191 + ? JSON.stringify([
192 + thread.archivedAt,
193 + thread.deletedAt,
194 + thread.pinnedAt,
195 + thread.settledOverride,
196 + thread.settledAt,
197 + thread.snoozedAt,
198 + thread.snoozedUntil,
199 + thread.activeOrderKey,
200 + ])
201 + : null;
202 const actionable =
203 thread.hasPendingApprovals ||
204 thread.hasPendingUserInput ||
@@ -210,7 +214,6 @@ export function createInboxReturnTracker() {
214 thread.pinnedAt != null ||
215 thread.settledOverride === "settled" ||
216 effectiveSnoozed(thread, { now: observedAt });
213 - const actual = isThreadWorking(thread);
217 // Only shelf placement is held: execution state and attention requests stay authoritative.
218 const deadline =
219 !actual && previous?.working && !actionable && !moved && !excluded