Skip to content

fix(cli): start auto memory in ACP sessions#25626

Open
jasonmatthewsuhari wants to merge 1 commit intogoogle-gemini:mainfrom
jasonmatthewsuhari:issue/25624-auto-memory-acp-startup
Open

fix(cli): start auto memory in ACP sessions#25626
jasonmatthewsuhari wants to merge 1 commit intogoogle-gemini:mainfrom
jasonmatthewsuhari:issue/25624-auto-memory-acp-startup

Conversation

@jasonmatthewsuhari
Copy link
Copy Markdown
Contributor

Fixes #25624

Summary

Start Auto Memory during ACP session boot so ACP and TUI sessions behave consistently when experimental.autoMemory is enabled.

What changed

  • Extract Auto Memory startup into a shared CLI helper.
  • Call that helper from ACP newSession and loadSession boot paths.
  • Switch the TUI AppContainer boot path to the same helper to keep the behavior consistent across surfaces.
  • Add ACP tests covering both enabled and disabled Auto Memory startup.

Why

Auto Memory is documented as a session-start background feature, but ACP sessions did not start the memory service even when the setting was enabled. This patch wires ACP boot into the same startup behavior the TUI already had.

Testing

  • node scripts/generate-git-commit-info.js
  • C:\Users\Jason\Documents\GitHub\gemini-cli\node_modules\.bin\vitest.cmd run src/acp/acpClient.test.ts --coverage.enabled=false
  • C:\Users\Jason\Documents\GitHub\gemini-cli\node_modules\.bin\vitest.cmd run src/ui/AppContainer.test.tsx --coverage.enabled=false
  • C:\Users\Jason\Documents\GitHub\gemini-cli\node_modules\.bin\vitest.cmd run src/ui/commands/memoryCommand.test.ts --coverage.enabled=false

@jasonmatthewsuhari jasonmatthewsuhari requested a review from a team as a code owner April 18, 2026 14:49
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 standardizes the startup behavior of the Auto Memory feature across the CLI. By centralizing the initialization logic into a shared utility, it ensures that both ACP and TUI sessions consistently respect the experimental.autoMemory configuration setting. This change addresses an inconsistency where ACP sessions previously failed to trigger the background memory service, while also cleaning up redundant code in the TUI layer.

Highlights

  • Centralized Auto Memory Startup: Extracted the Auto Memory initialization logic into a new shared utility function, startAutoMemoryIfEnabled, to ensure consistent behavior across different session types.
  • ACP Session Integration: Updated ACP session boot paths (newSession and loadSession) to invoke the new Auto Memory startup helper, ensuring the feature functions correctly when enabled.
  • TUI Refactoring: Refactored the TUI AppContainer to utilize the same shared helper, simplifying the codebase and maintaining parity with ACP sessions.
  • Enhanced Test Coverage: Added new test cases to acpClient.test.ts to verify that Auto Memory correctly starts or remains inactive based on the user's configuration settings.
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.

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
Copy Markdown
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 introduces a new utility function, startAutoMemoryIfEnabled, to centralize the logic for starting the auto-memory service. The change refactors GeminiAgent and AppContainer to use this utility, ensuring consistent behavior across different session initialization paths. Additionally, unit tests have been added to verify that the memory service is conditionally started based on the user's configuration. I have no feedback to provide as there were no review comments to evaluate.

@gemini-cli gemini-cli bot added the area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality label Apr 18, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto Memory does not start in ACP sessions even when experimental.autoMemory is enabled

1 participant