fix(plan): deflake plan mode integration tests#20477
Conversation
Summary of ChangesHello @Adib234, 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 primarily focuses on improving the reliability and coverage of existing tests. It re-enables a previously skipped integration test to ensure proper validation of file writing behavior in plan mode and enhances the test utility's ability to accurately determine the success status of tool calls by handling varied data types for the success attribute. Highlights
Changelog
Activity
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
|
|
Hi @Adib234, 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! |
There was a problem hiding this comment.
Code Review
This pull request addresses test flakiness by enabling a previously skipped integration test for plan mode. The underlying fix improves the robustness of the test rig by handling both boolean and string values for the 'success' attribute when parsing tool call logs. This is a good change to improve test stability. I've kept the original comment suggesting a small refactoring to address duplicated logic in the test rig, which will enhance maintainability.
|
Size Change: -2 B (0%) Total Size: 25.8 MB ℹ️ View Unchanged
|
a54ad70 to
b734b75
Compare
|
deflake.yaml was changed to run my integration test multiple times to see if it succeeds to show that it's not flakey anymore |
integration-tests/plan-mode.test.ts
Outdated
| core: ['write_file', 'read_file', 'list_directory'], | ||
| allowed: ['write_file'], | ||
| it('should allow write_file to the plans directory in plan mode', async () => { | ||
| const plansDir = '.gemini/tmp/v1/session/plans'; |
There was a problem hiding this comment.
this path can be confusing for someone trying to update plans, can we use a realistic path like:
| const plansDir = '.gemini/tmp/v1/session/plans'; | |
| const plansDir = '.gemini/tmp/foo/123/plans'; |
same for other examples below
Summary
As title suggests, the main fixes made were to harden the directory the plans were being stored in to make sure the policy passes and convert the test to interactive which aligns with how plan mode writes can happen.
Details
Related Issues
Fixes #20458
How to Validate
Pre-Merge Checklist