Add an integration test for ACP#14748
Conversation
|
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. |
Summary of ChangesHello @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
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
| 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'); | ||
| } |
There was a problem hiding this comment.
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');There was a problem hiding this comment.
This test is very basic, it only verify that a JRPC response is received.
|
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! |
|
I reformatted the PR description to help the bot find the issue 🤷♂️ |
|
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: Thank you for your understanding and for being a part of our community! |
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