Skip to content

Comments

feat(acp): support set_mode interface (#18890)#18891

Merged
skeshive merged 1 commit intogoogle-gemini:mainfrom
Mervap:acp/set_mode
Feb 19, 2026
Merged

feat(acp): support set_mode interface (#18890)#18891
skeshive merged 1 commit intogoogle-gemini:mainfrom
Mervap:acp/set_mode

Conversation

@Mervap
Copy link
Contributor

@Mervap Mervap commented Feb 12, 2026

Summary

Adds support for the ACP set_mode interface, allowing clients to change the Approval Mode of an existing session at runtime.

Details

This interface is part of ACP schema definition

Related Issues

Fixes #18890

How to Validate

  1. Run the gemini with --experimental-acp flag
  2. Perform set_mode request with non-default model ID (e.g., YOLO)

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

@Mervap Mervap requested a review from a team as a code owner February 12, 2026 10:37
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Mervap, 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 the capability for clients to dynamically change the approval mode of an existing agent session at runtime, aligning with the Agent Client Protocol (ACP) set_mode interface. This enhancement provides greater flexibility in how users interact with the agent, allowing them to switch between different approval strategies (e.g., default, auto-edit, YOLO, plan) without restarting the session.

Highlights

  • ACP set_mode Interface Support: Implemented the set_mode interface from the Agent Client Protocol (ACP) to allow dynamic changes to an agent's approval mode during a session.
  • Dynamic Approval Mode Changes: Introduced new methods setSessionMode in GeminiAgent and setMode in Session to handle mode changes and validation, enabling runtime adjustment of approval modes.
  • Enhanced Session Responses: Enhanced session creation and continuation responses to include available approval modes and the current active mode, providing clients with up-to-date session status.
  • Dynamic Mode Listing: Added a buildAvailableModes utility function to dynamically determine and list available approval modes based on feature flags, such as isPlanEnabled.
Changelog
  • packages/cli/src/zed-integration/zedIntegration.test.ts
    • Added mocks for getApprovalMode and isPlanEnabled in the test setup.
    • Introduced new tests to verify that session creation returns correct available and current modes, depending on whether the 'plan' mode is enabled.
    • Added tests for the setSessionMode functionality, including successful mode delegation and error handling for non-existent sessions or invalid modes.
  • packages/cli/src/zed-integration/zedIntegration.ts
    • Imported ApprovalMode enum.
    • Modified newSession and continueSession methods in GeminiAgent to include modes (available and current) in their responses.
    • Implemented setSessionMode in GeminiAgent to delegate mode changes to the specific session.
    • Added setMode method to the Session class, which validates the requested mode and updates the configuration.
    • Created a new helper function buildAvailableModes to construct the list of available session modes dynamically.
Activity
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 support for the ACP set_mode interface, allowing clients to change the approval mode at runtime. The changes include new methods in GeminiAgent and Session to handle this, along with corresponding tests. The implementation is mostly correct, but I've found one issue regarding validation in Session.setMode that should be addressed to make the implementation more robust.

@gemini-cli gemini-cli bot added area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality area/platform Issues related to Build infra, Release mgmt, Testing, Eval infra, Capacity, Quota mgmt labels Feb 12, 2026
@sripasg
Copy link
Contributor

sripasg commented Feb 13, 2026

@Mervap - can you please check the test failures ? Thanks !

@Mervap
Copy link
Contributor Author

Mervap commented Feb 16, 2026

@sripasg Should be fixed now

@sripasg
Copy link
Contributor

sripasg commented Feb 19, 2026

There seems to minor test expectation issue and a lint issue. Please fix these .. otherwise LGTM ! One of us will approve as soon as the tests pass.

@Mervap
Copy link
Contributor Author

Mervap commented Feb 19, 2026

One more try 😶

@skeshive skeshive enabled auto-merge February 19, 2026 15:51
@skeshive skeshive disabled auto-merge February 19, 2026 16:03
@skeshive skeshive merged commit 966eef1 into google-gemini:main Feb 19, 2026
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality area/platform Issues related to Build infra, Release mgmt, Testing, Eval infra, Capacity, Quota mgmt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Acp/ZedIntegration Set Approval Mode (set_mode)

3 participants