feat(prompts): implement Topic-Action-Summary model for verbosity reduction#21503
feat(prompts): implement Topic-Action-Summary model for verbosity reduction#21503Abhijit-2592 merged 3 commits intomainfrom
Conversation
Summary of ChangesHello, 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 "Topic-Action-Summary" communication model within the system instructions to significantly reduce verbose output and improve clarity during multi-turn tasks. The change aims to streamline the interaction by mandating a concise plan summary at the start of each phase, followed by silent tool execution, and clear signaling of strategic pivots, ultimately addressing the problem of excessive scrolling and enhancing user experience. Highlights
Changelog
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
The pull request introduces a new "Topic-Action-Summary" communication model. However, a critical vulnerability has been identified: the "absolute silence" mandate for the Action phase directly conflicts with the mandatory safety rule requiring explanations for critical shell commands. This weakens a key safety control, potentially leading to unpredictable model behavior and compromising user understanding of dangerous commands. An explicit exception for safety-critical explanations from the silence mandate is recommended to resolve this conflict, aligning with the principle of explicit safety instructions for agent deviations.
|
Size Change: +3.46 kB (+0.01%) Total Size: 26.1 MB
ℹ️ View Unchanged
|
9b14afb to
32b05f6
Compare
0942e07 to
1efa099
Compare
1efa099 to
423f4e6
Compare
423f4e6 to
933d726
Compare
- Add 'topicUpdateNarration' to experimental settings schema and core Config. - Update PromptProvider to pass the setting to system prompt snippets. - Refactor workflowStepStrategy to suppress strategy summaries when narration is enabled. - Fix syntax error in snippets.ts (escaped backtick) and broken nesting in settingsSchema.ts. - Regenerate settings JSON schema and documentation. - Update core and prompt provider tests to mock the new config property and refresh snapshots.
- Refactor 'Topic & Update Narration' into a streamlined 'Topic Model'. - Remove the periodic 'Update' heartbeat to further reduce model verbosity. - Enforce a strict 'Topic: <Phase> : <Summary>' header format for broad logical transitions. - Mandate complete silence for all tool executions between phase changes. - Update Operational Guidelines and examples to reflect the name and format changes.
933d726 to
a8ce070
Compare
- Fix spelling of 'beginning' in the Topic Initialization section. - Explicitly require the use of 'internal thought blocks' instead of generic 'thoughts' to ensure reasoning remains hidden from the user interface. - Add an 'IMPORTANT' clarification section distinguishing between standard text output for Topic headers and internal thought blocks.
Summary
This PR implements the Topic Model (refined from the experimental Topic & Update model) and introduces a new experimental setting,
topicUpdateNarration, to control it. This model significantly reduces terminal noise and 'excessive scrolling' during multi-turn tasks by suppressing repetitive tool-call narration and focusing on broad logical phases.Details
The current 'Explain Before Acting' mandate forced the model to narrate every tool call, creating massive scroll noise when combined with high-volume output. This refactor:
Topic: <Phase> : <Summary>.Configuration & Implementation
experimental.topicUpdateNarrationto the settings schema (packages/cli/src/config/settingsSchema.ts).ConfigandloadCliConfigto support and map this new setting.PromptProviderandsnippets.tsto dynamically adjust system instructions based on the setting.snippets.ts(escaped backtick) and corrected broken nesting insettingsSchema.ts.Related Issues
Fixes #21304 (Context Verbosity Epic - Phase 1)
How to Validate
"topicUpdateNarration": trueto your.gemini/settings.jsonunder theexperimentalblock.DEBUG=gemini-cli:promptsor checkconfig listto ensure the setting is active.Topic: <Research> : Analyzing code patternsfollowed by tools.Recommended Test Prompts
packages/core/src/routingare failing, fix the underlying issue, and verify the fix by running the tests again."vi.stubEnv. Once found, pick one test file inpackages/coreand refactor it to use a custom test helper instead, then confirm the tests still pass."packages/cliandpackages/core. Then, plan the change and implement the new setting in both packages."packages/core/src/prompts/promptProvider.ts. Remove them, and then check if the package still builds correctly."Pre-Merge Checklist