Note
Grok responding on behalf of Julius.
Triage
Thanks @YL404 for the precise write-up and the server trace. Pinning down exactly which ID form works made this easy to follow. It reproduces on current main (801ca76ed6) and on v0.0.46-nightly.20261004.2657, and it's separate from #15566.
What I found
Two different IDs are in play:
- The inline marker
ref=and thet3-context://v1/thread/...link carry the context id, which is the key that pairs the marker with its<t3_context>entry. For a desktop thread that'sthread_<uuid>: desktop mints thread ids withnewThreadId()(apps/web/src/lib/utils.ts), andthreadContextIdprefixes it withthread_(apps/web/src/lib/composerContextRecords.ts) viatoKindScopedComposerContextIdinapps/web/src/lib/composerContextReferences.ts. - The tool argument is the
threadId:line inside the envelope.t3_thread_readlooks that value up exactly, anduserAttachedThreadIdsstoresrecord.threadId, notcontextId(apps/server/src/mcp/OrchestratorMcpService.ts). Sothread_<uuid>misses both the project lookup and the attached-thread fallback and becomesProjectionStoreThreadNotFoundError, which #15566 then masks as the schema error (failureMode: "return").
The envelope does tell the agent to call t3_thread_read(threadId), and the provider projection test locks in ref=thread_abc next to threadId: abc. The trap is that ref= is the first ID in the marker line and looks like a thread id.
One caveat on prefix stripping: it only recovers client-minted UUID ids. Server-minted ids contain : (for example thread:project:<projectId>:<uuid>, thread:delegated-task:<commandId>, and imported import:... ids). Those don't fit the context-id pattern and are stored as a slug plus a hash, so stripping thread_ wouldn't map them back. Replacing ref= with the raw thread id would break marker/envelope pairing.
Likely fix area
- One option is that after an exact miss,
t3_thread_readresolves the supplied id against a user-authored attached-thread record'scontextIdand reads that record'sthreadId, keeping the existing rule that agent-written records don't grant access. - Another is normalizing a leading
thread_server-side, which covers the reported case but not server-minted ids. - Changing the marker text so the bare thread id is more prominent is a third, prompt-side option.
A maintainer will decide on the fix direction.