Repository navigation
Backlog
Labels
bugSomething is broken or behaving incorrectly.needs-triageIssue needs maintainer review and initial categorization.
Description
Before submitting
- 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
- Configure an OAuth-authenticated remote HTTP MCP server for the Antigravity provider (e.g. Atlassian Cloud MCP in
mcp_config.json:{"mcpServers":{"atlassian":{"url":"https://mcp.atlassian.com/v2/mcp"}}}). - Ensure
mcp_oauth_tokens.jsonis populated under~/.t3/userdata/providers/antigravity/<id>/antigravity-acp/(e.g. symlinked from~/.gemini/antigravity-cli/mcp_oauth_tokens.json, since T3 spawnsantigravity acpwith an isolated--gemini-dirand--app-data-dir). - Start Thread A (Antigravity) and invoke an Atlassian MCP tool — succeeds.
- While Thread A stays open, open or resume Thread B (and/or Thread C), which spawns additional
antigravity acpprocesses sharing the same--gemini-dir/--app-data-dirandmcp_oauth_tokens.json. - Wait ~10–15 minutes (past Atlassian's grace window for superseded tokens) and invoke an Atlassian MCP tool again in Thread A.
Expected behavior
- Thread A continues to be able to call Atlassian MCP tools while a valid OAuth token exists (the token on disk has an 8-hour lifetime,
expires_in: 28800). - Opening additional Antigravity threads does not rotate/invalidate OAuth MCP sessions for already-running threads.
Actual behavior
Active threads intermittently lose remote OAuth MCP access mid-session with:
calling "tools/call": sending "tools/call": Unauthorized: rejected by transport
Even though the symlink is intact and mcp_oauth_tokens.json on disk holds a valid, unexpired token (~7.5 hours remaining):
- Every new
antigravity acpstartup forces an OAuth refresh:connector.go:240logsConnection with stored token failed for atlassian. Attempting refresh before removing...followed byconnector.go:258] Successfully refreshed token for atlassianon every process launch (observed 10/10 times over ~4 hours, including launches only 1m43s apart). - Token rotation breaks already-running threads: Each startup refresh rotates Atlassian's OAuth token pair and writes the new token to the shared
mcp_oauth_tokens.json. Already-runningantigravity acpprocesses keep the older access token in memory and never reloadmcp_oauth_tokens.jsonfrom disk on a401. Once Atlassian's brief grace window (~10–15 min) lapses, all subsequent MCP calls in older threads fail permanently until restarted. - Secondary failure mode (concurrent startup race): If two threads start simultaneously and race on Atlassian's single-use refresh token, the losing process hits
connector.go:240("Attempting refresh before removing...") and can remove the token frommcp_oauth_tokens.json, forcing a full re-login.
Root cause / split responsibility:
- T3 Code side: Spawns one
antigravity acpprocess per thread pointing at the same--app-data-dir, so multiple independent ACP processes concurrently read/write a sharedmcp_oauth_tokens.jsonwithout coordination (and T3 does not yet proxy/centrally manage OAuth remote MCP connections across Antigravity threads). - Antigravity ACP side:
connector.goforces a token refresh on every startup even when the stored token was refreshed moments earlier, and active sessions do not re-readmcp_oauth_tokens.jsonfrom disk (with locking) on401.
Related issues: #36111, #40284, #38223 (similar stale in-memory vs. on-disk MCP OAuth state issue on Cursor).
Impact
Major degradation or frequent failure
Version or commit
0.1.11 (Desktop, Linux x64) / Antigravity ACP Server 1.5.16
Environment
Fedora Linux 44 (KDE Plasma Desktop Edition, kernel 7.2.13-200.fc44.x86_64), T3 Code Desktop 0.1.11, Antigravity ACP Server 1.5.16, Atlassian remote MCP (https://mcp.atlassian.com/v2/mcp)
Logs or stack traces
# Multiple antigravity acp processes running concurrently for the same --app-data-dir:
1193400 14:33:50 antigravity acp --gemini-dir ~/.t3/userdata/providers/antigravity/<id> --app-data-dir antigravity-acp (Thread A)
1404116 15:21:06 antigravity acp --gemini-dir ~/.t3/userdata/providers/antigravity/<id> --app-data-dir antigravity-acp (Thread B)
1408283 15:22:49 antigravity acp --gemini-dir ~/.t3/userdata/providers/antigravity/<id> --app-data-dir antigravity-acp (Thread C)
# Every process startup forces a refresh (10/10 starts in ~4h):
acp-server-...-1193400.log:
I1125 14:33:51.248166 connector.go:240] Connection with stored token failed for atlassian. Attempting refresh before removing...
I1125 14:33:51.641132 connector.go:258] Successfully refreshed token for atlassian
acp-server-...-1404116.log:
I1125 15:21:07.519338 connector.go:240] Connection with stored token failed for atlassian. Attempting refresh before removing...
I1125 15:21:07.901712 connector.go:258] Successfully refreshed token for atlassian
acp-server-...-1408283.log:
I1125 15:22:50.498717 connector.go:240] Connection with stored token failed for atlassian. Attempting refresh before removing...
I1125 15:22:51.149491 connector.go:258] Successfully refreshed token for atlassian
# Thread A (PID 1193400) MCP tool calls after Thread C rotated the token at 15:22:51:
# 15:28:18 -> succeeded (within grace window)
# 15:37:58 -> failed:
calling "tools/call": sending "tools/call": Unauthorized: rejected by transport
# Meanwhile mcp_oauth_tokens.json on disk is intact and unexpired (mtime 15:22:51):
{
"https://mcp.atlassian.com/v2/mcp": {
"client_id": "https://antigravity.google/oauth/client-metadata.json",
"token": {
"access_token": "<REDACTED>",
"token_type": "Bearer",
"refresh_token": "<REDACTED>",
"expiry": "2026-11-25T23:22:51.149067141+13:00",
"expires_in": 28800
},
"auth_style": 1
}
}Screenshots, recordings, or supporting files
No response
Workaround
- Avoid opening additional Antigravity threads (or launching
agyCLI) while a thread is actively using an OAuth remote MCP server. - When an older thread hits
Unauthorized: rejected by transport, starting a fresh thread/session picks up the valid token already on disk without needing to re-authenticate in the browser.
Reacted by Pavlo Michal
Metadata
Metadata
Assignees
Labels
bugSomething is broken or behaving incorrectly.needs-triageIssue needs maintainer review and initial categorization.
Activity