Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Cross-environment delegated threads show in the sidebar once their settled parent falls out of the newest 25 settled threads #35738

ClosedWhoAlwaysZzz(GitHub profile, opens in a new tab) opened this issue 1 comment

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

packages/contracts or packages/shared (client-runtime delegatedUnderParentAtom) and apps/server (ShellStream.ts older-settled trim)

Steps to reproduce

  1. Link two environments, A and B.
  2. From thread P on A, launch threads on B with t3_thread_launch. They carry delegatedFrom: {environmentId: A, threadId: P} and are hidden from the sidebar as expected.
  3. Settle P.
  4. Settle 25 more top-level threads on A, so P is no longer among the newest 25 settled threads there.

Expected behavior

P's delegated threads on B stay hidden under P.

Actual behavior

All of P's delegated threads on B show up in the sidebar as top-level threads at once. Neither they nor P changed. Only other threads on A were settled.

Cause, from main at 48a56fa:

  • packages/client-runtime/src/state/threadShell.ts, delegatedUnderParentAtom: a delegated thread is hidden only if environmentThreadIndexAtom(parent.environmentId).get(parent.threadId)?.archivedAt === null. That index comes from A's shell snapshot.
  • apps/server/src/orchestration-v2/ShellStream.ts: the snapshot keeps only the newest NEWEST_SETTLED_KEPT = 25 settled top-level threads (omitOlderSettledShellsWith). The exemption for parents, hiddenChildAncestorIds, only looks at same-environment subagents and side chats. A has no record that B holds threads delegated from P, so P is trimmed. The client then can't find P and lists its children.

A possible fix: in delegatedUnderParentAtom, keep hiding a delegated thread when its parent is missing from an environment whose snapshot reports olderSettled. A trimmed parent is settled, not archived. Or look the parent up before listing the child.

Impact

Minor bug or occasional failure

Version or commit

0.1.8-nightly.20261106.4247 (server and web client); same code on main at 48a56fa

Environment

Ubuntu 24 server (env B, VPS) + Windows 11 desktop (env A), web client

Logs or stack traces

None; no error is raised. On env A, P was the 27th most recently settled top-level thread when its 24 delegated threads on B appeared in the sidebar.

Workaround

Pin or unsettle P so it stays in A's snapshot, or settle each delegated thread on B.

Filed by

Claude Opus 5.5 via Claude Code in T3 Code, at the reporter's request. The bug was observed on the reporter's setup. The steps above were derived from the source and were not run end to end.

  1. tanstack-source added labelsbug

  2. This is the same problem as #27004, so I'm closing it in favour of that one. If it is different, say how and it will be reopened.

  3. juliusmarminge closed this

Sign in to join this conversation.