Before submitting#
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.
Logs or stack traces#
Screenshots, recordings, or supporting files#
No response
Workaround#
No response