Skip to content

ADFA-7340 AI Agent Gemini 1.1.1, AI Agent Claude 1.0.1: say why turns still need merging - #191

Open
davidschachterADFA wants to merge 7 commits into
mainfrom
ai-agent-gemini/ADFA-7340
Open

davidschachterADFA wants to merge 7 commits into
mainfrom
ai-agent-gemini/ADFA-7340

Conversation

@davidschachterADFA

@davidschachterADFA davidschachterADFA commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

ADFA-7340

What: corrects one comment in AI Agent Gemini and one in AI Agent Claude, and bumps the two plugins to 1.1.1 (versionCode 3) and 1.0.1 (versionCode 2), as the repository's CLAUDE.md asks of any change. No code changes.

Why: both backends merge consecutive same-role turns. Their comments gave the wrong reason.

The merge is still needed, and both comments now give the real reasons, which hold with and without #188:

  • AI Core's agent loop stores no assistant turn for a reply with no text, and sends tool results as a user turn. Without ADFA-7340 AI-Core: show the model its own native call when it wrote nothing #188 that includes a native call made with no prose, so its results follow the previous user turn: the most common run. With ADFA-7340 AI-Core: show the model its own native call when it wrote nothing #188, AI Core stores a turn naming the call. A user turn it adds after an empty reply, asking the model to go on or for a required tool, also follows the previous user turn.
  • A chat AI Core restores from its messages (ChatViewModel.rebuildHistoryFrom) leaves out an agent reply that had no text or never finished. It also starts with the compaction summary as a user turn.
  • Gemini also maps SYSTEM and TOOL turns, which other callers may send, to user turns.

Commits:

  • 75e5bd5 and 8d22cfd: the first Gemini wording and its version.
  • b91dc64: corrected that wording's restore claim.
  • a6c511a: both comments, after an independent review of this PR. It found the Gemini comment incomplete and the Claude one overstated.
  • 803c6b8: AI Agent Claude 1.0.1.
  • 30e8606: "no text and no call", from that review's re-check.
  • e601ddf: both comments hold whether or not AI Core stores a bare native call. "No text and no call" implied that a reply with only a call is stored, which is true only with ADFA-7340 AI-Core: show the model its own native call when it wrote nothing #188 (the cloud session's review, ADFA-7131 comment 41750).

Tests: at e601ddf, testDebugUnitTest (Gemini 128, Claude 210), assemblePlugin for both, and addons check pass locally.

Merging: any time; the comments are true before and after #188.

Version clash: #193 (ADFA-7286) also takes AI Agent Claude to 1.0.1 (versionCode 2), and git merges the two without a conflict. Whichever of #191 and #193 merges second must be bumped to 1.0.2 (versionCode 3) before it merges.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn

davidschachterADFA and others added 3 commits November 29, 2026 19:16
The comment on buildContents said the transcript stops alternating because
AI Core's agent loop drops an ASSISTANT turn that carried only a native
call. ADFA-7340 (addons #188) makes AI Core store a turn naming that call,
so the reason is out of date. The merge is still needed: SYSTEM and TOOL
turns go as user turns here, and chats saved by an older AI Core still
have the user message and its tool results side by side. Comment only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
A PATCH bump for the comment change, as the repository's CLAUDE.md asks
of any change to a plugin. versionCode 3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
… repeat

The first wording said a chat saved by an older AI Core keeps the user
message and its tool results side by side. A restored chat is rebuilt
from its messages and keeps no tool turns, so that was wrong. What the
rebuild does leave out is an agent reply that held only a native call,
or that never finished, which can put two user turns in a row, before
and after ADFA-7340. Comment only; the version stays 1.1.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
davidschachterADFA and others added 3 commits November 29, 2026 23:37
…peat

An independent review of this PR found the Gemini comment true but
incomplete, and AI Agent Claude's overstated:
- AI Core's agent loop stores no assistant turn for a reply with no text,
  so the user turn it adds next (asking the model to go on, or for a
  required tool) follows the previous user turn. That holds with ADFA-7340
  too, which adds a turn only for a reply that called tools.
- A chat AI Core restores leaves out an agent reply that had no text or
  never finished, and starts with the compaction summary as a user turn.
- AI Core sends no SYSTEM or TOOL turns; other callers may.
Claude's comment said results as user text "leave runs" of same-role
turns; with ADFA-7340 the results follow the stored call turn, so it now
names the cases above. Comments only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
A PATCH bump for the comment change, as the repository's CLAUDE.md asks of
any change to a plugin. versionCode 2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
…no call

The re-check of a6c511a: with ADFA-7340, AI Core stores a turn for a
reply that called tools even when it has no text, so the case that leaves
two user turns in a row is a reply with no text and no call. Both comments
say so, and the Claude one is rewrapped. Comments only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
@davidschachterADFA davidschachterADFA changed the title ADFA-7340 AI-Agent-Gemini: say why turns still need merging (1.1.1) ADFA-7340 AI Agent Gemini 1.1.1, AI Agent Claude 1.0.1: say why turns still need merging Nov 30, 2026
@davidschachterADFA
davidschachterADFA marked this pull request as ready for review November 30, 2026 07:41
@davidschachterADFA

Copy link
Copy Markdown
Contributor Author

@hal-eisen-adfa This is ready for review now (David, 2026-11-30). It started as one Gemini comment and now also corrects AI Agent Claude's similar comment, with AI Agent Claude going to 1.0.1. That follows an independent review that found the Gemini wording incomplete and the Claude one overstated. Comments and versions only; both plugins' tests, assemblePlugin and addons check pass.

@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

  • AI Agent Gemini 1.1.1 (versionCode 3): Bumped from 1.1.0 (versionCode 2).
  • AI Agent Claude 1.0.1 (versionCode 2): Bumped from 1.0.0 (versionCode 1).
  • Gemini docs: buildContents documentation now explains consecutive user turns. Causes include tool results after assistant replies with no text, requests to continue or for a required tool after empty replies, restored history that starts with a compaction summary, and SYSTEM or TOOL turns mapped to user turns. The comment states that AI Core stores a turn naming a native call from ADFA-7340 onward. Code is unchanged.
  • Claude docs: conversation documentation now says same-role runs still occur and are merged. Causes include AI Core storing no assistant turn for a reply with no text, including a native call made with no prose before ADFA-7340, and restored chats that start with two user turns. Blank-turn dropping and SYSTEM-turn handling are unchanged. Code is unchanged.

Risks:

  • The PR changes comments and version metadata only. Runtime behavior does not change.
  • Test results (Gemini 128, Claude 210 passing; assemblePlugin and addons check passing) are author-reported. They were not verified in this review.
  • The comments describe AI Core behavior before and after ADFA-7340. If that behavior changes, the comments become inaccurate.
  • The Claude comment does not state the ADFA-7340 condition. The Gemini comment does. The two comments describe the same rule differently.

The Claude and Gemini plugin versions are incremented. Their conversation-history documentation is expanded to describe additional cases involving consecutive turns with the same role.

Changes: Claude plugin update

Layer / File(s) Summary
Claude version and conversation documentation
plugins/AI-Agent-Claude/build.gradle.kts, plugins/AI-Agent-Claude/src/main/kotlin/com/itsaky/androidide/plugins/aiagentclaude/backend/ClaudeRequestBuilder.kt
The version changes from code 1 and name 1.0.0 to code 2 and name 1.0.1. The conversation documentation adds examples involving assistant replies without text and restored chats that start with consecutive user turns.

Gemini plugin update

Layer / File(s) Summary
Gemini version and history documentation
plugins/AI-Agent-Gemini/build.gradle.kts, plugins/AI-Agent-Gemini/src/main/kotlin/com/itsaky/androidide/plugins/aiagentgemini/backend/GeminiBackend.kt
The version changes from code 2 and name 1.1.0 to code 3 and name 1.1.1. The buildContents documentation adds cases involving tool results and follow-up requests after replies without text, restored history starting with a compaction summary, and SYSTEM and TOOL turns mapped to user turns.

Estimated code review effort: 1 (Trivial) | ~4 minutes

Suggested reviewers: jatezzz

Merge Risk: Minimal · up to e601d

This change only corrects documentation comments and increments plugin versions, so runtime behavior is unchanged. It is safe to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the two plugins and their version bumps (Gemini 1.1.1, Claude 1.0.1) and the main purpose, which is the comment change explaining why consecutive same-role turns still need merging. Th…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description states what changed: two KDoc comments in the AI Agent Gemini and AI Agent Claude plugins were corrected, and both plugin versions were bumped (Gemini 1.1.1/versionCode 3, Claude 1.0.1…
Full details: Title check

Explanation

The title names the two plugins and their version bumps (Gemini 1.1.1, Claude 1.0.1) and the main purpose, which is the comment change explaining why consecutive same-role turns still need merging. This matches the changeset, which only updates KDoc comments and version numbers.

Full details: Description check

Explanation

The description states what changed: two KDoc comments in the AI Agent Gemini and AI Agent Claude plugins were corrected, and both plugin versions were bumped (Gemini 1.1.1/versionCode 3, Claude 1.0.1/versionCode 2). It gives the reasons for the comment changes, the test results, and a version clash with PR #193. This matches the raw summary and the PR objectives, so the description is related to the changeset.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks each version with care.
Claude and Gemini hop to new numbers.
Their turn notes grow a little clearer.
Blank replies leave their marks in the trail.
Restored chats join the springtime path.
The rabbit bounds home, pleased with the change.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 56b127a5-2781-47ca-8660-65b0536fb522
Commits

Reviewing files that changed from the base of the PR and between 30e8606 and e601ddf.

Files selected for processing: 2

  • plugins/AI-Agent-Claude/src/main/kotlin/com/itsaky/androidide/plugins/aiagentclaude/backend/ClaudeRequestBuilder.kt
  • plugins/AI-Agent-Gemini/src/main/kotlin/com/itsaky/androidide/plugins/aiagentgemini/backend/GeminiBackend.kt
Files skipped from review as they are similar to previous changes: 2

  • plugins/AI-Agent-Claude/src/main/kotlin/com/itsaky/androidide/plugins/aiagentclaude/backend/ClaudeRequestBuilder.kt
  • plugins/AI-Agent-Gemini/src/main/kotlin/com/itsaky/androidide/plugins/aiagentgemini/backend/GeminiBackend.kt

Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

@davidschachterADFA davidschachterADFA left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Review of #191 at 30e8606ca7. Base main; read against #188's head and main.

MINOR

  • plugins/AI-Agent-Gemini/src/main/kotlin/com/itsaky/androidide/plugins/aiagentgemini/backend/GeminiBackend.kt:480 - comment omits call-only reply drop that is still true until #188 merges

Verdict: COMMENT. This PR is authored by the account posting the review, and GitHub refuses APPROVE and REQUEST_CHANGES on your own PR. Severity rules: CodeOnTheGo REVIEW.md and CLAUDE.md (a ticket moves to QA with no outstanding critical, high or medium findings); addons has no written rule, so the default applied.


Generated by Claude Code

* always alternates: the agent loop drops an ASSISTANT turn that carried only a native call
* and no prose, leaving the user message and the tool results it produced adjacent.
* Consecutive same-role turns are merged into one content, because the history a caller passes
* does not always alternate. AI Core's agent loop stores no assistant turn for a reply with no

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

MINOR: The reworded comment says AI Core stores no assistant turn for a reply with no text and no call, which reads as if a call-only reply is stored; at this PR's head and on main it is not.

AgentLoop.kt:300 only stores a turn when historyText is non-blank, and a native call with no prose has a blank one, so the call-only reply is also dropped and the user message and tool results sit adjacent. Only #188 (c3eed33, bareCallTurn) changes that. The PR body says it merges any time and the comments hold either way, but before #188 lands this comment omits the most common cause of repeated roles, and a reader will think the merge is needed only for the rare cases.

Fix: merge after #188, or add 'and, until addons #188, a reply that carried only a native call' to the comment.


Generated by Claude Code

…a bare native call

The comments said AI Core stores no assistant turn "for a reply with no
text and no call", which implies a reply that is only a native call is
stored. On AI Core without ADFA-7340 (addons #188) it is not: the loop
stores nothing for blank text and then adds the tool results as a user
turn, which is the most common run of same-role turns. Both comments now
say so, and that AI Core from ADFA-7340 on stores a turn naming the call.
(Review on addons #191, ADFA-7131 comment 41750.)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vh2DAYT7GPoC2cDzo8LErn
@davidschachterADFA

Copy link
Copy Markdown
Contributor Author

@hal-eisen-adfa e601ddf fixes the one MINOR from the latest review of this PR. Both comments said AI Core stores no assistant turn "for a reply with no text and no call", which implies a reply that is only a native call is stored. That's true only once addons #188 lands. Without it, AI Core stores nothing for a call made with no prose and then adds the tool results as a user turn, which is the most common run of same-role turns. Both comments now say that, and that AI Core stores a turn naming the call from ADFA-7340 on, so they hold either way. Comments only; Gemini 128 and Claude 210 tests, assemblePlugin for both, and the addons check pass. The PR body is updated.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant