internal/runtime/executor: Antigravity first OAuth refresh changes antigravitySignatureCacheScope, stranding pre-refresh Claude thinking signatures
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- go
- Domain
- authentication
Research direction
Read internal/runtime/executor/antigravity_executor_auth.go, specifically refreshTokenWithOptions around lines 230-251, alongside antigravitySignatureGrantIdentity and antigravitySignatureCacheScope. Trace how cpa_signature_cache_grant gets set in the trailing else branch after access_token is already overwritten on line 242, then compute the pre-refresh grant identity before that assignment. Done looks like the repro TestRepro_AntigravityFirstRefreshBreaksSignatureCacheScope passing with the scope unchanged, plus the existing executor tests still green under go test -race ./internal/runtime/executor.
Written by the indexing model from the issue text.
Description
Is it a request payload issue?
- Yes, this is a request payload issue.
- No, it's another issue (
internal/runtime/executor).
Describe the bug
Commit 85225381 (fix(antigravity): isolate signature cache by credential) scopes the Antigravity Claude signature cache via antigravitySignatureCacheScope(auth), which embeds antigravitySignatureGrantIdentity(auth) (cpa_signature_cache_grant if set, otherwise grant(refresh_token, access_token)).
However, before a credential's first refresh, cpa_signature_cache_grant and cpa_signature_cache_grant_binding are absent from auth.Metadata, so grantRetained in refreshTokenWithOptions (internal/runtime/executor/antigravity_executor_auth.go:230-251) is "". Consequently, if grantRetained != "" && grantBinding == currentBinding (line 234) is false, auth.Metadata["access_token"] is overwritten on line 242, and the trailing else branch (lines 248-251) initializes cpa_signature_cache_grant using antigravitySignatureGrantIdentity(auth) after access_token was replaced. This binds cpa_signature_cache_grant to the new access_token instead of the pre-refresh access_token, mutating antigravitySignatureCacheScope on the first refresh and stranding all pre-refresh cached Claude thinking signatures.
Environment & verification scope
- CLIProxyAPI revision:
origin/devat32842348(confirmed onv8.1.285225381) - OS / Go: Windows 11 amd64,
go1.27.4 - CLI Type / Provider:
antigravity
End-to-End Pipeline Trace (Verified on origin/dev 32842348)
- Pre-refresh credential (
refresh_token: "r1",access_token: "a1",project_id: "p1", nocpa_signature_cache_grant) computesantigravitySignatureCacheScope(auth)="id:...\x00grant:<hash(r1,a1)>\x00p1". refreshTokenWithOptions(internal/runtime/executor/antigravity_executor_auth.go:230-251) overwritesauth.Metadata["access_token"] = "a2"atline 242before callingantigravitySignatureGrantIdentity(auth)atline 249.antigravitySignatureCacheScope(updated)changes to"id:...\x00grant:<hash(r1,a2)>\x00p1", causing subsequent signature cache lookups to miss.
Minimal reproduction & Observed vs Expected
go test -v -race -count=1 -run TestRepro_AntigravityFirstRefreshBreaksSignatureCacheScope ./internal/runtime/executor
Observed output (origin/dev 32842348):
=== RUN TestRepro_AntigravityFirstRefreshBreaksSignatureCacheScope
repro_v812_exec_test.go:46: antigravitySignatureCacheScope changed on first refresh:
before="id:ag-first-refresh\x00grant:dda1f107bf886c07\x00p1"
after ="id:ag-first-refresh\x00grant:a4c1303e72ffac5a\x00p1"
--- FAIL: TestRepro_AntigravityFirstRefreshBreaksSignatureCacheScope (0.02s)
| Check / Field | Observed (origin/dev 32842348) |
Expected |
|---|---|---|
antigravitySignatureCacheScope after 1st refresh |
Changed (dda1f107bf886c07 -> a4c1303e72ffac5a) |
Preserved (dda1f107bf886c07) |
Suggested minimal fix
In refreshTokenWithOptions (internal/runtime/executor/antigravity_executor_auth.go:230-251), compute the pre-refresh antigravitySignatureGrantIdentity(auth) before overwriting auth.Metadata["access_token"] on line 242, and store that pre-refresh grant identity in cpa_signature_cache_grant when grantRetained == "" (for the same grantBinding).
What ran / Not run
- Ran: Hermetic
go test -v -race -count=1 -run TestRepro_AntigravityFirstRefreshBreaksSignatureCacheScope ./internal/runtime/executoragainstorigin/dev(32842348). - Not run: Live upstream OAuth refresh (scope-key mutation is deterministic in
refreshTokenWithOptions).
- Dominant language
- Go
- Stars
- 59.4k
- Forks
- 9.1k
- Avg merge
- 14h 20m
- Merged PRs (30d)
- 67
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from router-for-me/CLIProxyAPI
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
router-for-me/CLIProxyAPI#7976 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
router-for-me/CLIProxyAPI#7975 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
router-for-me/CLIProxyAPI#7974 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
router-for-me/CLIProxyAPI#7973 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
router-for-me/CLIProxyAPI#7972 ·
Maintainers usually reply within 1 day
All issues in router-for-me/CLIProxyAPI
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Add CybeDefendOpen
Difficulty 1/5 Under an hour Newbie friendliness 66/100
slavakurilyak/awesome-ai-agents#1031 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
kagent-dev/kagent#3792 ·
Maintainers usually reply within 1 day
-
ai-driven-qa bug claude Minor
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
linagora/cozy-stack#5374 ·
Maintainers usually reply within 1 day
-
new-compilers request
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
compiler-explorer/compiler-explorer#9640 ·
Maintainers usually reply within 1 day