Skip to content

feat(core): experimental in-progress steering hints (2 of 2)#19307

Merged
joshualitt merged 2 commits into
mainfrom
jl/model-steering-2
Feb 18, 2026
Merged

feat(core): experimental in-progress steering hints (2 of 2)#19307
joshualitt merged 2 commits into
mainfrom
jl/model-steering-2

Conversation

@joshualitt

Copy link
Copy Markdown
Contributor

This is a rebase / refactor of: #18783

Part of a series to address issue #18782

@gemini-cli

gemini-cli Bot commented Feb 17, 2026

Copy link
Copy Markdown
Contributor

Hi @joshualitt, 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!

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @joshualitt, 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 significantly enhances the interactive capabilities of the Gemini CLI by introducing a robust system for in-progress model steering. Users can now provide real-time hints to guide the model's actions, allowing for more flexible and responsive interactions. The changes span UI, core logic, and system prompts, ensuring a cohesive and functional implementation of this new feature.

Highlights

  • Model Steering Hints: Introduced experimental in-progress steering hints, allowing users to provide real-time guidance to the model during its execution. This enables dynamic course corrections and enhances interactivity.
  • UI Integration: Implemented UI components and logic to capture and display user hints, including a new HintMessage component and updates to AppContainer for processing and submitting hints.
  • Core Logic Updates: Modified the core agent execution and configuration to store, retrieve, and incorporate user hints into the model's prompts, ensuring the model can react to mid-stream guidance.
  • Testing and Evals: Added new behavioral evaluation tests and integration tests to verify that the model correctly processes and responds to both corrective and suggestive steering hints.
  • System Prompt Enhancement: Updated the system prompts to include explicit mandates for the model on how to interpret and act upon user hints, emphasizing scope preservation and minimal plan changes.
Changelog
  • evals/model_steering.eval.ts
    • Added new behavioral evaluation tests for model steering, covering corrective and suggestive hint scenarios.
  • packages/cli/src/integration-tests/modelSteering.test.tsx
    • Added a new integration test to verify model steering functionality during tool turns.
  • packages/cli/src/test-utils/AppRig.test.tsx
    • Updated AppRig tests to include a new test case for deterministic tool turns with breakpoints and hints.
    • Imported debugLogger for enhanced test debugging.
  • packages/cli/src/test-utils/AppRig.tsx
    • Imported startupProfiler for performance monitoring.
    • Enabled addUserHint functionality to allow injecting hints.
    • Added startupProfiler.clear() to the unmount method for proper test cleanup.
  • packages/cli/src/test-utils/fixtures/steering.responses
    • Added a new fixture file containing mock responses for model steering integration tests.
  • packages/cli/src/test-utils/render.tsx
    • Updated mock AppState and UIActions to include hintMode, hintBuffer, and related hint handling functions.
  • packages/cli/src/ui/AppContainer.tsx
    • Imported generateSteeringAckMessage and buildUserSteeringHintPrompt for hint processing.
    • Implemented consumePendingHints and handleHintSubmit callbacks for managing user hints.
    • Integrated hint processing into the useGeminiStream hook and handleFinalSubmit logic.
  • packages/cli/src/ui/components/DialogManager.tsx
    • Added a minor formatting change.
  • packages/cli/src/ui/components/Footer.tsx
    • Modified showDebugProfiler logic to depend on settings.merged.general.devtools in development environments.
  • packages/cli/src/ui/components/Header.test.tsx
    • Updated header test to include hintMode in background theme.
  • packages/cli/src/ui/components/HistoryItemDisplay.test.tsx
    • Added a test case for rendering HintMessage for 'hint' type history items.
  • packages/cli/src/ui/components/HistoryItemDisplay.tsx
    • Imported HintMessage component.
    • Added conditional rendering for HistoryItemHint type.
    • Added marginBottom prop to InfoMessage component.
  • packages/cli/src/ui/components/InputPrompt.tsx
    • Updated useShellHistory to pass config.storage for history management.
  • packages/cli/src/ui/components/messages/HintMessage.tsx
    • Added a new component HintMessage to display user steering hints with a distinct visual style.
  • packages/cli/src/ui/components/messages/InfoMessage.tsx
    • Added marginBottom prop to the InfoMessage component for spacing control.
  • packages/cli/src/ui/contexts/UIActionsContext.tsx
    • Added new actions (onHintInput, onHintBackspace, onHintClear, onHintSubmit) to the UIActions interface for hint management.
  • packages/cli/src/ui/contexts/UIStateContext.tsx
    • Added hintMode and hintBuffer to the UIState interface to manage hint input state.
  • packages/cli/src/ui/hooks/useGeminiStream.test.tsx
    • Updated mock GeminiClientClass and Config to include generateContent and getBaseLlmClient mocks.
    • Added a test for injecting steering hints into the model's continuation prompts.
  • packages/cli/src/ui/hooks/useGeminiStream.ts
    • Imported buildUserSteeringHintPrompt, generateSteeringAckMessage, and theme.
    • Modified useGeminiStream to accept consumeUserHint and inject hints into the model's responses.
  • packages/cli/src/ui/hooks/useShellHistory.ts
    • Modified useShellHistory to handle potential errors during history loading and ensure isMounted checks.
  • packages/cli/src/ui/themes/no-color.ts
    • Added hintMode to background in noColorSemanticColors for theme consistency.
  • packages/cli/src/ui/themes/semantic-tokens.ts
    • Added hintMode to the background interface and defined default colors for light and dark themes.
  • packages/cli/src/ui/themes/solarized-dark.ts
    • Added hintMode color to semanticColors for the Solarized Dark theme.
  • packages/cli/src/ui/themes/solarized-light.ts
    • Added hintMode color to semanticColors for the Solarized Light theme.
  • packages/cli/src/ui/themes/theme.ts
    • Added hintMode color to background in the Theme class and createCustomTheme function.
  • packages/cli/src/ui/types.ts
    • Added marginBottom to HistoryItemInfo.
    • Defined a new HistoryItemHint type and integrated it into HistoryItemWithoutId and MessageType.
  • packages/core/src/agents/local-executor.ts
    • Imported formatUserHintsForModel for hint formatting.
    • Modified LocalAgentExecutor to include initial and new user hints in the model's content for steering.
  • packages/core/src/agents/subagent-tool.ts
    • Imported formatUserHintsForModel.
    • Modified SubAgentInvocation to include user hints in sub-agent queries for consistent steering.
  • packages/core/src/config/config.test.ts
    • Added new tests for the Config class to verify user hint storage, indexing, and timestamp tracking.
  • packages/core/src/config/config.ts
    • Added userHints array and methods (addUserHint, getUserHints, getUserHintsAfter, getLatestHintIndex, getLastUserHintAt) to the Config class for managing user steering hints.
    • Removed experimentalZedIntegration from the interactive check.
  • packages/core/src/core/snapshots/prompts.test.ts.snap
    • Updated snapshots to include the new 'User Hints' mandate in the system prompt.
  • packages/core/src/core/prompts.test.ts
    • Updated prompt tests to assert the presence of the 'User Hints' mandate in the system prompt.
  • packages/core/src/prompts/snippets.legacy.ts
    • Added the 'User Hints' mandate to renderCoreMandates for legacy prompts.
  • packages/core/src/prompts/snippets.ts
    • Added the 'User Hints' mandate to renderCoreMandates for current prompts.
  • packages/core/src/telemetry/startupProfiler.ts
    • Added a clear() method to StartupProfiler for resetting its state in tests.
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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 implements the second part of the experimental in-progress steering hints feature, allowing users to guide the AI model mid-task. The changes are comprehensive, spanning the UI, core logic, and testing infrastructure.

Key changes include:

  • A new mechanism in the UI to capture user input as 'hints' while the agent is active.
  • Updates to the core agent execution logic to inject these hints into the model's context at appropriate times.
  • A new mandate in the system prompt to instruct the model on how to interpret and act on these steering hints.
  • New evaluation and integration tests to validate the correctness of corrective and suggestive hint scenarios.

I've reviewed the implementation for hint capture, storage, and injection, and the logic appears sound and well-integrated. The distinction in handling hints for local versus remote agents is logical. The new tests provide good coverage for this complex feature. I did not find any issues that meet the 'high' or 'critical' severity criteria. The code quality is high, and the feature seems well-implemented.

@github-actions

github-actions Bot commented Feb 18, 2026

Copy link
Copy Markdown

Size Change: +11 kB (+0.04%)

Total Size: 24.5 MB

Filename Size Change
./bundle/gemini.js 24.5 MB +11 kB (+0.05%)
ℹ️ View Unchanged
Filename Size
./bundle/sandbox-macos-permissive-open.sb 890 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB
./bundle/sandbox-macos-strict-open.sb 4.82 kB
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB

compressed-size-action

@joshualitt joshualitt force-pushed the jl/model-steering-2 branch 2 times, most recently from c8bb6e9 to bb01662 Compare February 18, 2026 00:32
@gemini-cli gemini-cli Bot added area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. labels Feb 18, 2026
@joshualitt joshualitt force-pushed the jl/model-steering-2 branch 4 times, most recently from 6dbd17f to 300d58d Compare February 18, 2026 01:30
Comment thread packages/core/src/config/config.ts
Comment thread packages/cli/src/ui/hooks/useShellHistory.ts Outdated
@joshualitt joshualitt force-pushed the jl/model-steering-2 branch 8 times, most recently from e63ebec to 40712b8 Compare February 18, 2026 04:35
@joshualitt joshualitt marked this pull request as ready for review February 18, 2026 16:57
@joshualitt joshualitt requested review from a team as code owners February 18, 2026 16:57
Comment thread packages/core/src/config/userHintService.ts Outdated
Comment thread packages/cli/src/ui/hooks/useGeminiStream.ts Outdated

@gundermanc gundermanc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This is a rebase / refactor of:

Part of a series to address issue #18782
@joshualitt joshualitt enabled auto-merge February 18, 2026 22:05
@joshualitt joshualitt added this pull request to the merge queue Feb 18, 2026
Merged via the queue into main with commit 87f5dd1 Feb 18, 2026
26 of 27 checks passed
@joshualitt joshualitt deleted the jl/model-steering-2 branch February 18, 2026 22:26
tripleyoung pushed a commit to tripleyoung/gemini-cli that referenced this pull request Feb 27, 2026
tripleyoung pushed a commit to tripleyoung/gemini-cli that referenced this pull request Feb 27, 2026
liamhelmer pushed a commit to badal-io/gemini-cli that referenced this pull request Mar 12, 2026
@sripasg sripasg added the size/xl An extra large PR label Jun 2, 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 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. size/xl An extra large PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants