@devries-cameron20 / t3code-1 / commits / 62d33c126a
Fork 0

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

fix(server): agents can see whether a thread is pinned (#32727)

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

shadi committed Nov 14, 2026 at 22:33 UTC 62d33c126a02464b06f32b9c1cfeec37b17b69e4
5 files changed +22 -3
apps/server/src/mcp/OrchestratorMcpService.activity.test.ts
+2
@@ -210,6 +210,7 @@ it("readThread preserves caller access errors and prefers activity-run status ov
210 threadId === parentThreadId
211 ? ({
212 ...projection.thread,
213 + pinnedAt: now,
214 blockedOnThreadWait: true,
215 pendingBackgroundTasks,
216 } as unknown as OrchestrationV2ThreadShell)
@@ -244,6 +245,7 @@ it("readThread preserves caller access errors and prefers activity-run status ov
245 expect(result.thread.status).toBe("running");
246 expect(result.thread.latestRunId).toBe(cancelledRunId);
247 expect(result.thread.activeRunId).toBe(activeRunId);
248 + expect(result.thread.pinned).toBe(true);
249 expect(result.thread.blockedOnThreadWait).toBe(true);
250 expect(result.thread.pendingBackgroundTasks).toEqual([
251 { taskId: "task-subagent", kind: "subagent", childThreadId },
apps/server/src/mcp/OrchestratorMcpService.test.ts
+13 -2
@@ -4632,11 +4632,18 @@ describe("OrchestratorMcpService thread list", () => {
4632 capabilities: new Set(["orchestration"]),
4633 issuedAt: 1,
4634 };
4635 - const shell = (id: string, projectId: string, snoozed: boolean, waiting = false) => ({
4635 + const shell = (
4636 + id: string,
4637 + projectId: string,
4638 + snoozed: boolean,
4639 + waiting = false,
4640 + pinned = false,
4641 + ) => ({
4642 ...liveThreadShell(ThreadId.make(id)),
4643 projectId: ProjectId.make(projectId),
4644 status: "completed" as const,
4645 snoozedUntil: snoozed ? DateTime.makeUnsafe("2099-01-01T00:00:00Z") : null,
4646 + pinnedAt: pinned ? DateTime.makeUnsafe("2026-01-01T00:00:00Z") : null,
4647 blockedOnThreadWait: waiting,
4648 pendingBackgroundTasks: waiting
4649 ? [
@@ -4655,7 +4662,7 @@ describe("OrchestratorMcpService thread list", () => {
4662 const shells = [
4663 shell("thread:a-snoozed", "project:a", true),
4664 shell("thread:a-awake", "project:a", false),
4658 - shell("thread:b-snoozed", "project:b", true, true),
4665 + shell("thread:b-snoozed", "project:b", true, true, true),
4666 {
4667 ...shell("thread:a-awaiting-command", "project:a", false),
4668 activityRunStatus: null,
@@ -4728,6 +4735,10 @@ describe("OrchestratorMcpService thread list", () => {
4735 ["thread:b-snoozed", "project:b"],
4736 ],
4737 );
4738 + assert.deepStrictEqual(
4739 + listed.threads.map((thread) => thread.pinned),
4740 + [false, true],
4741 + );
4742 assert.deepStrictEqual(
4743 listed.threads.map((thread) => [thread.blockedOnThreadWait, thread.pendingBackgroundTasks]),
4744 [
apps/server/src/mcp/OrchestratorMcpService.ts
+2
@@ -948,6 +948,7 @@ function listItemFromShell(
948 ...threadPullRequests(shell.pullRequests),
949 ...threadSettlement(shell),
950 ...threadSnooze(shell, nowMs),
951 + pinned: shell.pinnedAt != null,
952 ...threadBackgroundWork(shell),
953 parentThreadId: shell.lineage.parentThreadId,
954 relationshipToParent: shell.lineage.relationshipToParent,
@@ -1014,6 +1015,7 @@ function threadDetail(
1015 archived: projection.thread.archivedAt !== null,
1016 ...threadSettlement(projection.thread),
1017 ...threadSnooze(shell, nowMs),
1018 + pinned: shell.pinnedAt != null,
1019 ...threadBackgroundWork(shell),
1020 createdAt: DateTime.formatIso(projection.thread.createdAt),
1021 updatedAt: DateTime.formatIso(projection.thread.updatedAt),
docs/orchestration-v2/orchestrator-mcp-server.md
+1 -1
@@ -400,7 +400,7 @@ gets the link Copy thread copies, `https://app.t3.codes/threads/<environmentId>/
400 on the server's `T3CODE_HOSTED_APP_URL`, for threads in this environment. The
401 hosted app offers the desktop app, the mobile app, or itself.
402
403 -List and read results report `snoozed` and `snoozedUntil`, and
403 +List and read results report `snoozed`, `snoozedUntil`, and `pinned`, and
404 `t3_thread_list` filters on `snoozed`. The server's `isSnoozed` follows the
405 client's `effectiveSnoozed`, so agents and the sidebar agree: a snoozed thread
406 wakes early only when it has a pending request or fails after snoozing. Completed
packages/contracts/src/orchestratorMcp.ts
+4
@@ -415,6 +415,8 @@ export const OrchestratorMcpThreadListItem = Schema.Struct({
415 snoozed: Schema.Boolean,
416 snoozedUntil: Schema.NullOr(IsoDateTime),
417 /** Absent from linked environments that predate it. */
418 + pinned: Schema.optional(Schema.Boolean),
419 + /** Absent from linked environments that predate it. */
420 blockedOnThreadWait: Schema.optional(Schema.Boolean),
421 /** Absent from linked environments that predate it. */
422 pendingBackgroundTasks: Schema.optional(Schema.Array(OrchestratorMcpThreadBackgroundTask)),
@@ -490,6 +492,8 @@ export const OrchestratorMcpThreadDetail = Schema.Struct({
492 snoozed: Schema.Boolean,
493 snoozedUntil: Schema.NullOr(IsoDateTime),
494 /** Absent from linked environments that predate it. */
495 + pinned: Schema.optional(Schema.Boolean),
496 + /** Absent from linked environments that predate it. */
497 blockedOnThreadWait: Schema.optional(Schema.Boolean),
498 /** Absent from linked environments that predate it. */
499 pendingBackgroundTasks: Schema.optional(Schema.Array(OrchestratorMcpThreadBackgroundTask)),