[Bug]: t3_thread_read says a live thread is unavailable when given its T3 link
Area
apps/server, MCP
Steps to reproduce
- In a T3 thread, start a delegated task. Save the returned
childThreadIdandlink. - Call
t3_thread_readwith the exactchildThreadId. The read succeeds. - Call
t3_thread_readwith the returnedlinkasthreadId. Repeat with just the link destination.
A delegated thread ID has the form thread:delegated-task:command%3Amcp%3A…. The corresponding link destination is t3-thread://v2/<environment-id>/thread:delegated-task:command%3Amcp%3A….
Expected behavior
A pasted T3 thread link should resolve to the same thread with the usual linked-environment checks, or the error should identify the input as a link and tell the caller to pass the exact ID, including the thread: prefix and percent escapes.
Actual behavior
Both link forms return thread_not_found and say the thread is no longer available, even though reading the exact ID succeeds. Removing the prefix or decoding the escapes also produces a miss, since those characters are part of the stored ID.
Impact
Occasional failure when an agent is given a copied link. Passing the exact thread ID works.
Version and environment
Reproduced through the MCP tool on Windows desktop, 0.1.9-nightly.20261111.4501.fork.6. I inspected upstream main at 6ab633f6d6, where the read handler also takes the supplied ID directly and the shared package already has a thread-link parser. I did not run an upstream build.
I tried one more case on main with a synthetic subagent thread. If I pass the decoded ID directly to t3_thread_read, it suggests the correct ID with the %3A escapes. If I put that same decoded ID in a t3-thread:// link, it just says the thread is unavailable. Could the link case give the same hint?