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
[Provider] Antigravity session id keys on thread id alone, so parallel children of one parent share an upstream session #5033
Codex CLI and Codex App, any flow that runs parallel subagents under one parent.
Provider or upstream service
Google Antigravity (Cloud Code Assist).
OpenCodex version
2.59.0 (dev).
Endpoint or capability
Upstream session identity for Cloud Code Assist requests.
Current behaviour
antigravitySessionId derives the upstream session from _clientThreadId alone. The general lane resolver deliberately keys on parent-plus-thread-id instead, because a thread id is only unique within its parent. The consequence is that parallel Codex children under one parent collapse onto a single upstream Antigravity session rather than getting one session each.
This is provable from source and does not need a reproduction: the two derivations are visibly different, and the general resolver's choice of parent-plus-thread is commented as deliberate.
It was found while investigating #5008 (intermittent first-send 400 on google-antigravity/gemini-3.8-flash). It is filed separately on purpose. It is a plausible amplifier for that report — collapsing concurrent turns onto one session lane is exactly the condition under which carried upstream state could interfere — but it has not been shown to be its cause, and it is worth fixing on its own terms regardless of how #5008 resolves.
Expected behaviour
Two concurrent children of the same parent should not share one upstream Antigravity session. The identity used here should be as unique as the one the general lane resolver builds, or there should be a recorded reason why this surface may key on less.
Minimal redacted request or reproduction
Static: compare the derivation in antigravitySessionId with the general lane resolver's parent-plus-thread-id key. No credentials or prompt content are involved.
Actual response or error
Not an error in itself. The observable effect is that concurrent children present as one upstream session.
Confirmed against current dev. The collision is real, and the narrow fix should not redefine _clientThreadId.
request-prepare.ts currently sets _clientThreadId from x-codex-parent-thread-id, while antigravitySessionId() hashes that value through clientThreadAnchor(). In a fan-out, siblings therefore receive the same upstream session id. The general lane helper already has the correct identity rule: parent qualifies the child thread-id/session id, rather than replacing it.
The safest implementation boundary is to derive a bounded provider-private Antigravity session scope from the inbound headers during request preparation (using the same parent-plus-specific precedence as sessionLaneIdFromRequest) and carry that scope into antigravitySessionId. Keep _clientThreadId unchanged because it also owns previous-response/replay semantics, and changing its meaning would widen the patch into continuation state.
Required regressions:
same parent plus different child thread ids produce different Antigravity session ids;
the same parent/child pair remains stable across compaction and changed first-user text;
parent-only clients retain their current stable identity;
clients with no usable thread headers keep the existing first-user-text fallback;
no raw parent or child id is emitted on the wire (only the existing bounded numeric hash).
This should be fixed independently of #5008. Landing it removes a proven cross-child collision; it does not by itself prove or close the reporter's intermittent adjacency 400.
antigravitySessionId now anchors on the request's own thread-id, falling back to the parent id for clients that send only that. Your reading of the source was right: _clientThreadId carries x-codex-parent-thread-id, so every parallel child presented the same id.
On the "or there should be a recorded reason why this surface may key on less" branch — it may not, but it also may not adopt the general lane key. codexConversationKeyFor is an HMAC under CODEX_LINEAGE_KEY = randomBytes(32), so it is process-random and changes across a proxy restart. This derivation's stated requirement is the opposite: identical on turn N and N+1, because the replay cache observes thought signatures on turn N's response and re-injects them on N+1's request. Taking the lane key would have fixed the sharing by introducing the instability the existing comment names as the failure mode. thread-id is Codex's own value and survives compaction and restart alike.
Blast radius, stated exactly: a root turn presents thread-id equal to its parent id, so its anchor is byte-identical and nothing moves for a single-threaded conversation. A child's anchor moves once, at deploy, costing that conversation one turn of signature association. A client that sends no thread-id is unchanged.
Also worth recording for whoever reads this next to #5008: this is now fixed, so if that report persists, collapsed session lanes are no longer available as the explanation.
Activity
Ingwannu commentedon Sep 18, 2026
Confirmed against current
dev. The collision is real, and the narrow fix should not redefine_clientThreadId.request-prepare.tscurrently sets_clientThreadIdfromx-codex-parent-thread-id, whileantigravitySessionId()hashes that value throughclientThreadAnchor(). In a fan-out, siblings therefore receive the same upstream session id. The general lane helper already has the correct identity rule: parent qualifies the childthread-id/session id, rather than replacing it.The safest implementation boundary is to derive a bounded provider-private Antigravity session scope from the inbound headers during request preparation (using the same parent-plus-specific precedence as
sessionLaneIdFromRequest) and carry that scope intoantigravitySessionId. Keep_clientThreadIdunchanged because it also owns previous-response/replay semantics, and changing its meaning would widen the patch into continuation state.Required regressions:
This should be fixed independently of #5008. Landing it removes a proven cross-child collision; it does not by itself prove or close the reporter's intermittent adjacency 400.
fix(google): give each parallel child its own Antigravity session (#5054
lidge-jun commentedon Sep 18, 2026
Fixed on
devby #5054, merged as9939b884f0.antigravitySessionIdnow anchors on the request's ownthread-id, falling back to the parent id for clients that send only that. Your reading of the source was right:_clientThreadIdcarriesx-codex-parent-thread-id, so every parallel child presented the same id.On the "or there should be a recorded reason why this surface may key on less" branch — it may not, but it also may not adopt the general lane key.
codexConversationKeyForis an HMAC underCODEX_LINEAGE_KEY = randomBytes(32), so it is process-random and changes across a proxy restart. This derivation's stated requirement is the opposite: identical on turn N and N+1, because the replay cache observes thought signatures on turn N's response and re-injects them on N+1's request. Taking the lane key would have fixed the sharing by introducing the instability the existing comment names as the failure mode.thread-idis Codex's own value and survives compaction and restart alike.Blast radius, stated exactly: a root turn presents
thread-idequal to its parent id, so its anchor is byte-identical and nothing moves for a single-threaded conversation. A child's anchor moves once, at deploy, costing that conversation one turn of signature association. A client that sends nothread-idis unchanged.Also worth recording for whoever reads this next to #5008: this is now fixed, so if that report persists, collapsed session lanes are no longer available as the explanation.