Skip to content

[Bug]: Attached-thread context block gives threadId as thread_<uuid>, but thread tools only accept the bare UUID #19639

Closed

Description

@tensorcopy

Before submitting

Area

apps/server (the tool lookup), with the ID format coming from packages/shared / apps/web.

Summary

When a thread is attached as context, every ID the product shows for it has a thread_ prefix, and the thread tools reject that form. t3_thread_read only accepts the bare UUID.

On 0.0.46-nightly.20261014.3118 the <t3_context> block that tells the agent which ID to pass also carries the prefix. This differs from #15849, which reports that the envelope's threadId: line was the one place with the bare UUID. The agent now has no correct ID in view.

The error text adds to the confusion: it says the thread "is no longer available", although the thread exists and is readable with the bare UUID.

Steps to reproduce

  1. In a running thread, attach another existing thread as a context reference and send a message.
  2. The agent receives all of these (UUID shortened):
    • inline marker: [Thread: <title>; ref=thread_<uuid>]
    • link: t3-context://v1/thread/thread_<uuid>
    • context block: <context kind="thread" id="thread_<uuid>"> followed by threadId: thread_<uuid>, and the instruction "Read its history with t3_thread_read(threadId)"
  3. The agent calls t3_thread_read with {"threadId": "thread_<uuid>"}, the value from the threadId: line.
  4. The call fails.
  5. Calling t3_thread_read with {"threadId": "<uuid>"} (prefix removed) succeeds.

Expected behavior

The ID that the context block names as threadId should work when passed to the thread tools. I confirmed the failure for t3_thread_read and t3_thread_configuration; I did not test the others. Either:

  • show the canonical bare thread ID on the threadId: line (keep thread_<uuid> only as the marker/envelope pairing key), or
  • make the thread tools accept the context ID form.

The triage comment on #15849 lists a third option that also covers server-created thread IDs, which contain : and cannot be recovered by stripping a prefix: after an exact miss, resolve the supplied ID against the contextId of a user-attached thread record and read that record's threadId.

Actual behavior

{"_tag":"OrchestratorMcpFailure","code":"thread_not_found","message":"Thread thread_<uuid> is no longer available."}

t3_thread_configuration fails the same way with The thread was not found. The same calls with the bare UUID return the thread. The error does not say that the ID format is the problem, so an agent may report the thread as deleted. I only found the cause because t3_thread_search returns thread IDs as bare UUIDs, which showed that the prefix was the difference.

Impact

Minor bug or occasional failure. It affects every attached-thread reference. The workaround is simple, but only if the agent or user knows to strip the prefix.

Version or commit

0.0.46-nightly.20261014.3118

Environment

Linux x64 remote server. The calling agent ran on Claude Code. The attached threads were created from the web client and ran on OpenCode. The failure happened for two different attached threads.

Workaround

Remove the leading thread_ from the ID before calling the thread tools.

Activity

  1. chrisohearn commented on Oct 19, 2026

    @chrisohearn

    Another form of the same ID mismatch, on 0.0.46 nightly (Linux), seen 2026-10-14 and reproduced today: agent-created threads have server-minted IDs mcp:<uuid>, and the bare <uuid> misses.

    • t3_thread_read({threadId: "<uuid>"}) on an agent-created thread → {"code":"thread_not_found","message":"Thread <uuid> is no longer available."}
    • t3_thread_read({threadId: "mcp:<uuid>"}) → OK.
    • The reverse also holds for a user-created thread: bare <uuid> → OK, mcp:<uuid> → thread_not_found.
    • t3_thread_send behaves the same way.

    How agents get the bare form: coordinators are often user-created threads with bare IDs, and agents carry that form over to agent-created peers. Native subagents add a third form, thread:provider:….

    Impact. The "no longer available" wording led two separate agents to conclude that the peer thread or its owner had been deleted. Both then needed another thread to relay the correct ID.

    Request. On an exact miss, either resolve the ID when it matches exactly one live thread's UUID suffix, or return an error that says the thread could not be found under this ID form, rather than "no longer available". The misleading wording is the larger problem.

  2. juliusmarminge commented on Oct 21, 2026

    @juliusmarminge
    Member

    Duplicate of #15849: the same attached-thread reference supplies a thread_<uuid> value that fails in t3_thread_read, while the canonical thread ID succeeds. This report adds the newer context-envelope observation and clearer error output. The original is closed as not planned; this closure does not claim the bug is fixed. Checked the issue history and 19 pages of open issues covering the last 90 days; no app reproduction was run for this duplicate disposition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions