Skip to content

fix(antigravity): keep the signature from a standalone thought part - #941

Merged
Ingwannu merged 1 commit into
lidge-jun:devfrom
devmello:fix/897-standalone-thought-signature
Aug 3, 2026
Merged

Ingwannu merged 1 commit into
lidge-jun:devfrom
devmello:fix/897-standalone-thought-signature

Conversation

@devmello

@devmello devmello commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #897. When Antigravity returns the reasoning signature on its own thought part instead of on the functionCall part, the replay cache dropped it, so the next turn went out unsigned and upstream rejected it. The cache now pairs a standalone thought signature with the functionCall that follows it in the same parts array. A signature on the call part itself still wins, an unpaired one is dropped at the end of the array, and byte accounting is untouched. Pairing stays within one observed array; a thought and its call split across streamed chunks is out of scope since the reported captures are same-array.

Verification

  • Four new tests in tests/google-antigravity-replay.test.ts: the standalone shape replays, the call's own signature wins, no backward or cross-observe pairing, and non-thought parts do not attach.
  • Unit repro: [{thought, thoughtSignature}, {functionCall}] lost its signature before the fix and round-trips after.
  • bun run test, typecheck, lint:gui, privacy:scan.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Summary by CodeRabbit

  • Bug Fixes

    • Improved replay handling for function calls preceded by standalone thought signatures.
    • Ensured the correct signature is used when multiple signatures are present.
    • Prevented signatures from being incorrectly reused across unrelated events or attached to unsupported content.
    • Preserved existing validation and cache-size protections for valid replayed calls.
  • Tests

    • Added coverage for signature pairing, precedence, isolation, and invalid attachment scenarios.

A reasoning signature arriving on its own thought part was dropped by
the replay cache, so the next turn failed upstream validation. Pair it
with the functionCall that follows in the same parts array.

Fixes lidge-jun#897
@github-actions github-actions Bot added the bug Something isn't working label Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b19c1563-16c3-4b1d-8da5-691bb48215be

📥 Commits

Reviewing files that changed from the base of the PR and between 6a7351b and db293dc.

📒 Files selected for processing (2)
  • src/adapters/google-antigravity-replay.ts
  • tests/google-antigravity-replay.test.ts

📝 Walkthrough

Walkthrough

The replay observer now carries signatures from standalone thought parts to the next function call in the same parts array. Call-local signatures take precedence. Tests cover pairing order, state isolation, and invalid non-thought signatures.

Changes

Antigravity replay cache

Layer / File(s) Summary
Pending signature association and validation
src/adapters/google-antigravity-replay.ts:368-369, src/adapters/google-antigravity-replay.ts:385-407, tests/google-antigravity-replay.test.ts:67-112
The observer stores signatures from standalone thought parts and applies them to the next function call. A call’s own signature takes precedence, and pending state is cleared after pairing. Calls without a usable signature or identity remain skipped. Tests verify immediate forward pairing, precedence, no backward or cross-observation pairing, and rejection on non-thought parts.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: lidge-jun

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: preserving signatures from standalone thought parts in Antigravity replay.
Linked Issues check ✅ Passed The adapter and tests implement standalone thought-signature pairing, call-signature precedence, same-array limits, and unchanged replay mechanics required by issue #897.
Out of Scope Changes check ✅ Passed The changes are limited to Antigravity replay pairing logic and focused tests directly related to issue #897.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@Ingwannu Ingwannu left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed as a real provider-compatibility defect. The patch keeps the repair narrow: same-array forward pairing only, call-local signature precedence, no cross-observation carry, no non-thought attachment, and no change to the existing replay cache limits or identity key.

Verification:

  • applied cleanly on current dev (3cd75ab0)
  • bun test tests/google-antigravity-replay.test.ts: 39 passed
  • bun run typecheck: passed
  • repository Cross-platform CI and React Doctor: passed

No blocking findings.

@Ingwannu
Ingwannu merged commit 230aea9 into lidge-jun:dev Aug 3, 2026
19 checks passed
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
…idge-jun#941)

A reasoning signature arriving on its own thought part was dropped by
the replay cache, so the next turn failed upstream validation. Pair it
with the functionCall that follows in the same parts array.

Fixes lidge-jun#897
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants