Repository navigation
[Bug]: T3 MCP tools return Authentication required after switching providers back and forth, preventing PR linking #18852
Description
Before submitting
- I searched existing issues and did not find an exact duplicate. Related issue MCP token keeps the old provider after a thread switches back to a reused provider session; delegate_task fails with parent_not_active #16565 is discussed below.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
Observed in an existing thread; not yet reproduced in a fresh thread:
- Start a thread using Claude Sonnet 5.5 and complete several turns.
- Create pull requests and have the agent register them with
link_pull_request. This initially succeeds. - Switch the same thread to Codex GPT-6.1 Sol, complete turns, then switch back to Sonnet 5.5.
- Continue switching between these providers after completed turns.
- On a later Codex turn, create a PR and call
link_pull_request. - Call
list_thread_pull_requestsin the same thread.
Affected thread: e865d22d-5cba-4270-b721-3f4e5b5b5436, titled “Playwright PDF Reports: Stage 5”. Incident date: 2026-10-12 UTC.
Expected behavior
Switching providers between completed turns should preserve access to T3 Code’s MCP tools. The active provider should be able to register new PRs and retrieve the thread’s existing PR links.
Actual behavior
Earlier Claude turns successfully registered PRs #56, #57 and #58 in cobblestackhq/cobble-touchstone.
After repeated Claude/Codex switches:
- Codex’s
link_pull_requestcalls for PRs Add desktop perf trace automation #59 and Fix ChatView header overflow for long thread titles #60 returnedAuthentication required. - Codex’s
list_thread_pull_requestscalls returned the same error. - T3 browser tool calls also reported authentication failures, so this was not limited to PR registration.
- Normal coding turns continued, and PR creation on GitHub succeeded.
- I could no longer see linked PRs in the affected thread.
A subsequent read from another thread confirmed that PRs #56–58 are still stored as links on the affected thread. PRs #59 and #60 are absent from that list. The earlier links were not deleted. Why the existing links were no longer visible in my UI has not been established separately.
Impact
Major degradation or frequent failure
PR creation on GitHub works, but T3 registration and listing repeatedly fail in the affected session. Browser tools are affected too.
Version or commit
Currently installed desktop version: 0.0.46-nightly.20261012.3035.
The version at the exact moment of failure was not separately recorded.
Environment
macOS, T3 Code Nightly desktop.
Providers/models used in the same thread:
- Claude Agent:
claude-sonnet-5-5 - Codex:
gpt-6.1-sol
Logs or stack traces
These outputs were recovered directly from the affected thread’s recorded tool calls. Times below are UTC, from the items’ updatedAt values.
Run 6 — Claude Sonnet 5.5
link_pull_request(.../pull/56) -> alreadyLinked: false
link_pull_request(.../pull/57) -> alreadyLinked: false
link_pull_request(.../pull/58) -> alreadyLinked: false
2026-10-12T22:55:05.490Z — Run 15, Codex GPT-6.1 Sol
t3-code.link_pull_request({
"url": "https://github.com/cobblestackhq/cobble-touchstone/pull/59"
})
-> [{"type":"text","text":"Authentication required"}]
2026-10-12T22:56:19.589Z — Run 15
t3-code.list_thread_pull_requests({})
-> [{"type":"text","text":"Authentication required"}]
2026-10-12T23:05:55.319Z — Run 17, Codex GPT-6.1 Sol
t3-code.link_pull_request({
"url": "https://github.com/cobblestackhq/cobble-touchstone/pull/60"
})
-> [{"type":"text","text":"Authentication required"}]
2026-10-12T23:08:05.670Z — Run 17
t3-code.list_thread_pull_requests({})
-> [{"type":"text","text":"Authentication required"}]
Screenshots, recordings, or supporting files
Recorded provider sequence (run start times, UTC, 2026-10-12):
Run 10 22:42:01 claudeAgent claude-sonnet-5-5
Run 11 22:45:33 codex gpt-6.1-sol
Run 12 22:46:58 codex gpt-6.1-sol
Run 13 22:47:24 codex gpt-6.1-sol
Run 14 22:48:47 claudeAgent claude-sonnet-5-5
Run 15 22:50:02 codex gpt-6.1-sol [PR link/list failures]
Run 16 23:00:22 claudeAgent claude-sonnet-5-5
Run 17 23:02:29 codex gpt-6.1-sol [PR link/list failures]
Read-only verification from another thread on 2026-10-13:
list_thread_pull_requests({
"threadId": "e865d22d-5cba-4270-b721-3f4e5b5b5436"
})
-> succeeds; lists cobblestackhq/cobble-touchstone #56, #57, #58
-> all three have source: agent, state: merged
-> #59 and #60 are not listed
No screenshot or recording was collected. The relevant evidence is included inline; the full thread contains unrelated project work and credentials and is not attached. No server-side credential trace has been collected. Credential revocation or reuse remains a hypothesis.
Related issues
#16565 describes a reused provider session retaining an MCP credential scoped to the other provider after switching back. Its demonstrated error is parent_not_active; this incident returns Authentication required, including for PR listing.
This may be another manifestation of the same credential lifecycle problem, but the thread history alone does not prove that. If maintainers consider it the same underlying defect, this report can be consolidated into #16565.
Workaround
No recovery workaround has been tested on the affected provider session. Reading its links from another thread succeeds, but does not restore the failed registrations or the affected thread’s UI.
Report prepared with assistance from Codex using the affected thread’s recorded tool outputs.
Activity
juliusmarminge commentedon Oct 12, 2026
Note
Grok responding on behalf of Julius.Thanks for the detailed timeline. I'm closing this as a duplicate of #16565. The root cause is the same, and only the error you see is different.
On main, each thread has a single MCP credential slot. When
prepareMcpSessionswitches a thread to another provider, it callsrevokeThread(threadId)before it issues the new token (ProviderSessionManager.ts). Once a token is revoked,McpHttpServerrejects it with a 401invalid_mcp_credential, and the MCP client reports that asAuthentication required. That's why the browser tools failed too: every T3 tool shares the same credential.In your sequence (Codex runs 11–13, then Claude run 14, then Codex run 15), Claude's turn rotated the thread's credential. Codex's app-server only receives
mcp_serversonthread/start/resume/fork, and a shared Codex session keeps an idle thread loaded for up to 30 minutes, so Codex kept calling with the revoked token. #16565 hits the other half of the same problem. There, a reused session keeps a token scoped to the wrong provider, so you getparent_not_activeinstead of a 401.Open PR #17096 (which fixes #16565) predicts this exact Claude → Codex → Claude → Codex case in its "Known limits" section. A full fix needs either a credential per (thread, provider instance) or releasing the previous provider's session when you switch providers. I've noted on #16565 that this is the 401 form of the bug, so the fix should cover both.
Workaround: restart T3, or wait more than 30 minutes before switching back to Codex so it resumes the thread and picks up the current token. Your links for #56–58 are still stored. #59 and #60 were never written because those calls failed, so you can re-link them with
link_pull_requestafter a restart.