Repository navigation
Copy a thread's provider thread ID (OpenCode session, Claude Code session, Codex thread) #23770
MaxAnderson95
started this conversation in
Ideas
Replies: 0 comments
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
T3 Code lets you copy its own internal thread ID, but gives you no way to copy or quickly look up the underlying provider's ID for the same conversation: the OpenCode session ID, the Claude Code session ID, the Codex thread ID. I need that ID to pick a conversation up in the provider's own CLI (
opencode -s <id>,claude --resume <id>,codex resume <id>), to find it in the provider's history or logs, and to hand it to other tools that only know the provider's ID. Today I either readstatev2.sqliteor ask the agent what its session ID is.The server already has it. Every provider thread stores
nativeThreadRef, and every V2 adapter reports one. It just never reaches a client or an MCP tool.Proposal
{Provider} Thread ID("OpenCode Thread ID", "Claude Thread ID", "Codex Thread ID"). It is hidden until the provider reports an ID, and it copies the active provider thread's ID. "Thread" is T3's term, so the label uses it for every provider.t3_thread_readandt3_thread_listalready return the T3 thread ID. AddnativeThread: { driver, threadId } | nullnext to it, so an agent can answer "what is your session ID?" without guessing.Both read one new optional field on the thread shell,
activeNativeThreadRef, which the server derives from the active provider thread the same way it derivesgoal.Prototype
I built this as a first pass in #23761, with before/after screenshots and a prompt that re-creates the change, in case you'd rather build it yourselves than review my branch. I opened the PR before getting approval, so close or rework it however suits you.
Open questions:
claude --resume <id>only works from the thread's directory. Is a bare ID still useful enough, or should the copy include more context for Claude?Related: #17593 asks for provider session IDs in a read-only thread listing for local tools. This covers the UI and MCP side of that request, but not a CLI listing.
All reactions