Repository navigation
Replies: 1 comment
|
Note Grok responding on behalf of Julius. This landed in #21505. A |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
Agents link threads as
[title](t3-thread://v1/<threadId>). The client looks that id up only in the environment of the message holding the link. When the linked thread lives on another machine, the link shows its written label with "Thread no longer available", and clicking it opens the current machine's route for an id that machine doesn't have, which lands on a new draft. That happens even when the same client is connected to the machine that has the thread and lists it in the sidebar.I run T3 Code on a Mac and a Windows desktop, with one client connected to both, and agents on each machine hand work across and link the threads they mention. Those links don't resolve. Asking the Mac's server for a thread on the desktop (
t3_thread_readwith44ca5495-b9ab-43f9-8b0a-5d4870c8a923) returnsthread_not_found ... is no longer available, and the client does the same single-environment lookup.Where this happens on
main(52a769d):packages/shared/src/threadLinks.ts#L5-L9MarkdownThreadLink.tsx#L22-L37entities.ts#L43,ThreadFeed.tsx#L1827The client already has what it needs to do better. It keeps a thread index per connected environment (
threadShell.ts#L141) and already walks every enabled environment to build the sidebar (threadShell.ts#L332-L334).Reproduction
Two dev servers with separate state on one Mac, A and B, and a web client on A paired to B through Settings > Connections > Add environment. On B, a thread titled "Thread on box B". On A, a message containing
[box thread (old label)](t3-thread://v1/<that thread's id>).On
main, the link shows its written label, a generic icon and "Thread no longer available":Clicking it goes to
/<A>/<B's thread id>, which A doesn't have, so it lands on a new draft:History
t3-thread://v1/<environmentId>/<threadId>, with tools returning a ready link and a baked title.This proposal keeps #17017's model. The id stays the only reference, and the label is still only a fallback.
Proposed behavior
Client-side resolution only. No change to the link format, contracts, server, or what agents are told to write.
/$environmentId/$threadIdthere.Web and mobile share the lookup (
packages/sharedfor the id forms,packages/client-runtimefor the cross-environment index), so mobile gets the same labels and tap behavior.As a cheap side effect, the few links written in #16782's short-lived
v1/<environmentId>/<threadId>form (on nightly for about a day) would resolve by their thread id. Nothing would emit that form again.With this behavior, the same link from the reproduction shows B's live title and icon:
and opens
/<B>/<thread id>, B's thread:Performance
The lookup reads the thread indexes the client already maintains. It builds one id-to-environment map per message environment and only publishes a new value when a linkable thread appears, moves or is renamed, so status updates, streaming and other shell traffic don't re-render links. No new server requests or websocket traffic.
What it deliberately does not do
ShellStream.ts#L301). Those fall back to today's behavior.Alternatives considered
v1/<environmentId>/<threadId>). Most precise, but it reverses fix(server,web,mobile): thread links reference the thread id, not a baked title #17017 and makes agents responsible for another id that has to be right. The id-only form already identifies the thread; the client just needs to look further.Overlap and duplicates
I searched issues, PRs and discussions for thread links across environments and found no existing proposal or open PR that changes how
t3-thread://links resolve.t3code://threads/<environmentId>/<threadId>), which already carry the environment. Here it's the in-chatt3-thread://link, which by design doesn't.Implementation available
I have a potential implementation ready if this is approved, or as something concrete to discuss scope against: royalaid/t3code
thread-links-cross-environment. It's two commits on top of 52a769d (code with focused tests, plus a one-sentence update todocs/orchestration-v2/orchestrator-mcp-server.md), written with Claude Opus 5.5 in Claude Code. The tests cover: a thread only another environment holds, a thread both hold, a thread none holds, percent-encoded ids, the old link form, and the index staying stable across unrelated updates.vp checkandvp run typecheckpass. I haven't opened a PR and won't until the direction and scope are approved here.Ask
Would a maintainer approve this direction and scope (client-side cross-environment lookup for
t3-thread://links, own environment first, no format change)? If you'd prefer a different tie-break, or want mobile left to a follow-up, I'll change the scope to match.All reactions