Skip to content

[Bug]: Antigravity child-session fix changes root anchors and still collides across parents #5058

Closed

Description

@Ingwannu

Client or integration

Codex CLI/App routed to Google Antigravity.

Area

Provider session identity.

Summary

#5054 fixed same-parent sibling sharing by preferring _codexOwnThreadId, but the resulting identity rule is incomplete in two ways on current dev (c5b39d43e6).

  1. Parentless root requests carry thread-id/session-id but deliberately omit x-codex-parent-thread-id. Before fix(google): give each parallel child its own Antigravity session #5054 they used the first-user-text anchor; now they use the own-thread anchor. Durable Antigravity replay state is keyed by model plus session id, so an upgrade strands the signatures stored under the old root session and can make tool-call follow-ups fail upstream.
  2. A child thread-id is only unique within its parent. Two different parents can each have the same child id, but clientThreadAnchor() hashes only _codexOwnThreadId, so those conversations still share an upstream session.

Expected behaviour

  • Parentless roots retain the pre-fix(google): give each parallel child its own Antigravity session #5054 anchor so existing durable replay entries remain usable.
  • A distinct parent/child pair derives an injective, restart-stable anchor containing both bounded identities.
  • Parent-only clients retain their existing stable fallback.
  • Raw ids never leave the proxy; the wire continues carrying only the numeric hash.

Required regressions

  • a real parentless root with thread-id and no parent header keeps the legacy session id;
  • same child id under two different parents yields different session ids;
  • siblings under one parent remain different;
  • one parent/child pair stays stable across restart, compaction and changed first-user text; and
  • durable thought-signature replay survives an upgrade for an existing root conversation.

Regression origin

Merged in #5054. The current comment claiming a root presents thread-id equal to its parent is inconsistent with src/server/context-history.ts, which deliberately omits the parent header for roots.

Activity

  1. added
    bug
    provider
    on Sep 18, 2026
  2. added
    tools
    on Sep 18, 2026
  3. added a commit that references this issue on Sep 18, 2026
    f02f361
  4. lidge-jun commented on Sep 18, 2026

    @lidge-jun
    Owner

    Fixed on dev by #5062. You were right on both counts, and the second one is the more serious of the two.

    The collision moved rather than closing. I wrote in #5054's own commit message that a thread id is unique only within its parent, quoting codexConversationIdentity, and then anchored on the child alone. The anchor is now the pair, joined by a NUL so the encoding is injective: no Codex id contains one, so a pair cannot be re-read as a different pair or as the parent-only anchor.

    And the root claim was simply false. src/server/context-history.ts says the opposite in as many words — root model requests use (session-id=root, thread-id=root) and do not fabricate a parent key — so a root carries an own thread and no parent, and #5054 handed it a brand-new anchor on the strength of a premise I had not checked. With durable replay keyed by model plus session id, that strands every signature stored under the old root session at upgrade: the exact instability the derivation exists to prevent, introduced while fixing sharing. A parentless root now keeps its pre-#5054 anchor.

    All five regressions you listed are pinned, plus injectivity as its own case: (parent "a", child "b:c") and (parent "a:b", child "c") are asserted distinct, which a separator a Codex id could contain would not give.

    The case I deleted is worth naming, because it is how the wrong premise survived review. #5033: a root turn is byte-identical to what it was before asserted child("hi", "thread-a", "thread-a") — a root presenting its own id as its parent. That shape does not occur, so the test passed while describing nothing real.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugprovidertools

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions