You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pass T3CODE_THREAD_ID to Grok (ACP) harness processes, as for Claude #34024
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
Register a stdio MCP server in ~/.grok/config.toml that logs os.environ.get("T3CODE_THREAD_ID").
Start two Grok threads in one project (Grok driver, grok agent stdio over ACP).
Call the tool in each thread. Also run echo $T3CODE_THREAD_ID from a Grok shell.
Expected behavior
We run third-party MCP servers next to T3's own, registered in each harness's own config. Under the Claude driver, every tool call's server process sees T3CODE_THREAD_ID in its environment, so a server can tell which T3 thread is calling without trusting the agent's word.
Expected the same under the Grok driver: set T3CODE_THREAD_ID (and the other thread vars the Claude driver sets) in the environment of the Grok process T3 spawns per thread, or document another stable way for an MCP server to learn the calling thread.
Actual behavior
Under the Grok driver the variable is not set: both the MCP server's env value and echo $T3CODE_THREAD_ID from a Grok shell are empty, while GROK_OAUTH2_REFERRER=t3code is present. With two Grok threads open, a server cannot tell them apart.
Possibly the same gap as #28542 (Codex delegated children), here for Grok.
Impact
Minor bug or occasional failure
Version or commit
v0.1.7 and v0.1.8
Environment
Linux, t3 serve; Grok provider (grok agent stdio, ACP), compared with the Claude provider on the same install.
The Antigravity driver has the same gap, on current main.
buildAntigravityAcpSpawnInput (apps/server/src/provider/antigravityAuthSupport.ts) starts the harness with extendEnv: false. Its environment is antigravityEnvironment(...) plus ANTIGRAVITY_HARNESS_PATH, and the function takes no thread ID, so T3CODE_THREAD_ID never reaches the Antigravity process. It also never reaches the stdio MCP servers registered in its GEMINI_HOME/config/mcp_config.json. The Claude driver sets [AGENT_THREAD_ENV]: input.threadId on its query env, and the ACP MCP bridge gets T3CODE_THREAD_ID in its processEnvironment. The agent process itself is the only one that misses it.
Seen in the bundled server of the Windows desktop build. The same function on main takes no thread ID.
Correction (same day): commands the Antigravity agent runs do see ANTIGRAVITY_CONVERSATION_ID, which matches T3's provider session for the thread, so it can be mapped back to the thread. Whether stdio MCP servers get it too isn't confirmed yet. T3CODE_THREAD_ID would still give Antigravity the same stable way that the Claude driver offers to name the calling thread.
The fix may be the same for every ACP harness: Grok here, Antigravity, and possibly OpenCode and Pi. When the spawn is per thread, pass the thread ID into the spawn input and set T3CODE_THREAD_ID beside the provider's own variables.
This request was for T3CODE_THREAD_ID in the retired grok agent stdio process. The Antigravity driver now forwards per-thread environment variables through its own launch path. #46363 retired that integration in favor of Grok Build through the Cursor SDK, so this is no longer needed.
Activity
a-Fig commentedon Nov 15, 2026
The Antigravity driver has the same gap, on current
main.buildAntigravityAcpSpawnInput(apps/server/src/provider/antigravityAuthSupport.ts) starts the harness withextendEnv: false. Its environment isantigravityEnvironment(...)plusANTIGRAVITY_HARNESS_PATH, and the function takes no thread ID, soT3CODE_THREAD_IDnever reaches the Antigravity process. It also never reaches the stdio MCP servers registered in itsGEMINI_HOME/config/mcp_config.json. The Claude driver sets[AGENT_THREAD_ENV]: input.threadIdon its query env, and the ACP MCP bridge getsT3CODE_THREAD_IDin itsprocessEnvironment. The agent process itself is the only one that misses it.Seen in the bundled server of the Windows desktop build. The same function on
maintakes no thread ID.Correction (same day): commands the Antigravity agent runs do see
ANTIGRAVITY_CONVERSATION_ID, which matches T3's provider session for the thread, so it can be mapped back to the thread. Whether stdio MCP servers get it too isn't confirmed yet.T3CODE_THREAD_IDwould still give Antigravity the same stable way that the Claude driver offers to name the calling thread.The fix may be the same for every ACP harness: Grok here, Antigravity, and possibly OpenCode and Pi. When the spawn is per thread, pass the thread ID into the spawn input and set
T3CODE_THREAD_IDbeside the provider's own variables.juliusmarminge commentedon Dec 1, 2026
This request was for
T3CODE_THREAD_IDin the retiredgrok agent stdioprocess. The Antigravity driver now forwards per-thread environment variables through its own launch path. #46363 retired that integration in favor of Grok Build through the Cursor SDK, so this is no longer needed.