Skip to content

fix(google): append continue nudge for Claude-on-Antigravity prefill - #2066

Merged
lidge-jun merged 1 commit into
lidge-jun:devfrom
jeongjin0:fix/google-claude-prefill-guard
Aug 19, 2026
Merged

fix(google): append continue nudge for Claude-on-Antigravity prefill#2066
lidge-jun merged 1 commit into
lidge-jun:devfrom
jeongjin0:fix/google-claude-prefill-guard

Conversation

@jeongjin0

@jeongjin0 jeongjin0 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Claude-on-Antigravity rejects a history that ends on a model turn as assistant prefill (The conversation must end with a user message).
  • Context compaction, previous_response_id expansion, and interrupted-turn replay can all produce that shape.
  • The Anthropic adapter already appends a user (continue) nudge (src/adapters/anthropic.ts). This applies the same guard on the CCA Claude path only, in Gemini wire format (role: "user", parts: [{ text: "(continue)" }]).
  • Gemini-native Antigravity models are unchanged. User-tailed and tool-result-tailed histories are unchanged.

Closes #2065

Related: #1916 already contains a broader stripTrailingClaudePrefill change, but that PR is draft, hygiene-blocked, and conflicted. This PR keeps only the prefill guard and does not take the pop-the-last-model-turn approach.

Verification

  • bun test tests/google-claude-prefill-guard.test.ts — 5 pass
  • bun test tests/google-adapter.test.ts tests/google-antigravity-wire.test.ts tests/google-hardening.test.ts tests/google-claude-prefill-guard.test.ts tests/anthropic-tail-guard.test.ts — 86 pass
  • bun run typecheck — pass
  • bun run privacy:scan — pass
  • bun run test — 9848 pass, 8 skip, 1 unrelated flake in tests/native-profile-drain-server.test.ts (reproduced green in isolation)
  • Live CCA request with google-antigravity/claude-opus-4-6-thinking and an assistant-tail history returned HTTP 200

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.

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • All CI tests are green on my local testing.

  • I pushed my PR to the latest dev commit.

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

Summary by CodeRabbit

  • Bug Fixes

    • Improved Claude request handling when conversation context is empty or ends with an assistant response.
    • Prevented unnecessary continuation prompts for supported user or tool-result contexts and non-Claude models.
  • Tests

    • Added coverage for Claude continuation behavior across empty, assistant, user, tool-result, and non-Claude request scenarios.

Claude-on-Antigravity rejects a history that ends on a model turn as
assistant prefill. Context compaction and interrupted-turn replay can
produce that shape. Mirror the anthropic adapter's user (continue)
nudge on the CCA Claude path only.

Closes lidge-jun#2065
@github-actions

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added bug Something isn't working review-ready labels Aug 18, 2026
@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

✅ READY

  • all PR quality gates passed; the review readiness checklist is complete.

Review readiness checklist

  • ✅ All CI tests are green on my local testing.
  • ✅ I pushed my PR to the latest dev commit.
  • ✅ I resolved all correct Codex and CodeRabbit findings.
  • ✅ My PR is ready for review.

4/4 boxes ticked.

This pull request is already Ready for Review.
The review-ready label marks this PR as ready; review automation runs independently.
Maintainers: @lidge-jun @Ingwannu @Wibias

@coderabbitai

coderabbitai Bot commented Aug 18, 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: 6c747dbb-ea42-4d3e-8842-8cb3729c7fc3

📥 Commits

Reviewing files that changed from the base of the PR and between bcc77c0 and dbc7e99.

📒 Files selected for processing (2)
  • src/adapters/google.ts
  • tests/google-claude-prefill-guard.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The Google adapter now appends a user (continue) message for empty or model-ending Claude-on-Antigravity histories. Tests verify continuation nudging and preserve behavior for user-ending, tool-result, and non-Claude requests.

Changes

Claude prefill guard

Layer / File(s) Summary
History guard and validation
src/adapters/google.ts, tests/google-claude-prefill-guard.test.ts
buildRequest appends a user (continue) message when Claude-on-Antigravity contents are empty or end with a model turn. Tests validate Claude continuation behavior, unchanged user-ending and tool-result histories, empty contexts, and non-Claude models.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to dbc7e

This is a localized fix for Claude-on-Antigravity assistant-prefill histories, with the affected behavior covered by tests; no actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: wibias, ingwannu, 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 and concisely describes the Google Claude-on-Antigravity fix.
Linked Issues check ✅ Passed The adapter guard and tests address issue #2065 by nudging model-tailed and empty Claude-on-Antigravity histories with user (continue).
Out of Scope Changes check ✅ Passed The changes are limited to the Google adapter guard and focused tests required for the reported prefill error.
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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@lidge-jun
lidge-jun merged commit 9636998 into lidge-jun:dev Aug 19, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working review-ready

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants