@devries-cameron20 / t3code Mirror · read-only / commits / 1f55acf13b
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, 16:00 UTC

fix(client-runtime): refresh settled counts when threads move project (#36543)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

Wout Stiens committed Nov 14, 2026 at 09:09 UTC 1f55acf13b464e5d9882bc0acfab3ae0d7c8e95b
2 files changed +8 -4
packages/client-runtime/src/state/olderSettledThreads.test.ts
+4
@@ -93,6 +93,10 @@ describe("olderSettledCountKey", () => {
93 expect(key([...base, row("woken", { createdDay: 5 })])).not.toBe(start);
94 // A local row that turns older (a backdated auto-settle).
95 expect(key([base[0]!, row("open", { createdDay: 60, settledDay: 20 })])).not.toBe(start);
96 + // An older row that moves to another project.
97 + expect(key([{ ...base[0]!, projectId: ProjectId.make("project-b") }, base[1]!])).not.toBe(
98 + start,
99 + );
100 });
101
102 it("stays put for new threads and subagents", () => {
packages/client-runtime/src/state/olderSettledThreads.ts
+4 -4
@@ -80,9 +80,9 @@ export function sortOlderSettledScopes(
80
81 /**
82 * Changes whenever the older count can: any removal (by largest sequence, so a repeat counts), an
83 - * older row that arrives or changes, or an old row arriving outside the set (unsettled). Threads
84 - * created after the cut never enter it, as threads settle after creation. Archived-thread events
85 - * arrive as removals too, each costing one count read.
83 + * older row that arrives, changes or moves project, or an old row arriving outside the set
84 + * (unsettled). Threads created after the cut never enter it, as threads settle after creation.
85 + * Archived-thread events arrive as removals too, each costing one count read.
86 */
87 export function olderSettledCountKey(
88 threads: ReadonlyArray<OrchestrationV2ThreadShell>,
@@ -96,7 +96,7 @@ export function olderSettledCountKey(
96 if (!isListedThreadLineage(thread.lineage)) continue;
97 const older = isOlderSettledThreadShell(thread, beforeMs);
98 if (older || DateTime.toEpochMillis(thread.createdAt) < beforeMs) {
99 - rows.push(`${thread.id}:${older ? 1 : 0}`);
99 + rows.push(`${thread.id}:${thread.projectId}:${older ? 1 : 0}`);
100 }
101 }
102 return `${lastRemoval}|${rows.sort().join(",")}`;