Skip to content

Add an integration test for ACP#14748

Closed
gsabran wants to merge 2 commits intogoogle-gemini:mainfrom
gsabran:gui/acp-test
Closed

Add an integration test for ACP#14748
gsabran wants to merge 2 commits intogoogle-gemini:mainfrom
gsabran:gui/acp-test

Conversation

@gsabran
Copy link

@gsabran gsabran commented Dec 8, 2025

Summary

Add an integration test to ensure ACP is not broken. This test validate that the initial handshake is successful.

Details

This relates to a recent regression:
#14159
#14137
#13795

The regression would have been prevented if the test had existed.

Related Issues

#14137

How to Validate

This is a new test, it'll be validated in CI

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@gsabran gsabran requested a review from a team as a code owner December 8, 2025 23:03
@google-cla
Copy link

google-cla bot commented Dec 8, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @gsabran, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a crucial integration test for the Application Control Protocol (ACP), focusing on the successful execution of its initial JSON-RPC handshake. The primary goal is to enhance the robustness of the system by proactively catching potential issues that could lead to regressions in ACP functionality. Additionally, a minor adjustment was made to the test infrastructure to ensure accurate output handling during ACP-specific test runs.

Highlights

  • New Integration Test for ACP: A new integration test has been added specifically for the Application Control Protocol (ACP) to validate its JSON-RPC handshake mechanism. This test ensures that the initialize method returns a valid JSON-RPC 2.0 response.
  • Regression Prevention: This new test aims to prevent future regressions related to ACP, similar to a recent issue where the ACP protocol was inadvertently broken.
  • Test Helper Update: The TestRig utility in test-helper.ts has been updated to correctly handle output when running in --experimental-acp mode. It now prevents stderr content from being included in the test result, as ACP communication is expected to be pure JSON-RPC.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a new integration test for the ACP JSON-RPC protocol to prevent a past regression. The test validates that the initial handshake is successful. A small change is also made to the test helper to support this new test. The new test has a logic flaw where it would pass even if the handshake returns an error. I've suggested a fix to make the test stricter and correctly validate a successful handshake.

Comment on lines +70 to +79
const hasResult = 'result' in parsed;
const hasError = 'error' in parsed;
expect(hasResult || hasError).toBe(true);
expect(hasResult && hasError).toBe(false);

// For a successful initialize, we expect a result
if (hasResult) {
expect(parsed.result).toBeDefined();
expect(typeof parsed.result).toBe('object');
}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The current test logic allows the test to pass even if the JSON-RPC response contains an error object. For a test that validates a successful handshake, it should explicitly fail if an error is returned and assert that a result is present.

    // A successful initialize should have a 'result' and no 'error'.
    expect(parsed).not.toHaveProperty('error');
    expect(parsed).toHaveProperty('result');

    // For a successful initialize, we expect a result object
    expect(parsed.result).toBeDefined();
    expect(typeof parsed.result).toBe('object');

Copy link
Author

Choose a reason for hiding this comment

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

This test is very basic, it only verify that a JRPC response is received.

@gemini-cli gemini-cli bot added the status/need-issue Pull requests that need to have an associated issue. label Jan 7, 2026
@bdmorgan
Copy link
Collaborator

Hi @gsabran, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this.

We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines.

Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed.

Thank you for your understanding and for being a part of our community!

@gsabran
Copy link
Author

gsabran commented Jan 15, 2026

Hi @bdmorgan this PR is associated with #14137

What are the steps for it to be merged (other than fixing the new merge conflict) ?

@gsabran
Copy link
Author

gsabran commented Jan 15, 2026

I reformatted the PR description to help the bot find the issue 🤷‍♂️

@gemini-cli
Copy link
Contributor

gemini-cli bot commented Jan 24, 2026

Hi there! Thank you for your contribution to Gemini CLI.

To improve our contribution process and better track changes, we now require all pull requests to be associated with an existing issue, as announced in our recent discussion and as detailed in our CONTRIBUTING.md.

This pull request is being closed because it is not currently linked to an issue. You can easily reopen this PR once you have linked it to an issue.

How to link an issue:
Add a keyword followed by the issue number (e.g., Fixes #123) in the description of your pull request. For more details, see the GitHub Documentation.

Thank you for your understanding and for being a part of our community!

@gemini-cli gemini-cli bot closed this Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/need-issue Pull requests that need to have an associated issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants