gemini-cli - ✅(Solved) Fix [BUG] update_topic tool inflates confirmation queue count [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
google-gemini/gemini-cli#24944Fetched 2026-04-09 08:17:01
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×3cross-referenced ×1

Fix Action

Fixed

PR fix notes

PR #24945: fix(cli): exclude update_topic from confirmation queue count

Description (problem / solution / changelog)

Summary

This PR centralizes tool visibility logic to fix UI inconsistencies, such as the update_topic tool inflating the confirmation queue count ("X of Y").

Details

The logic that dictates whether a tool call should be visible in the chat history, the active tool group, or the confirmation queue was previously fragmented across the codebase (ToolGroupMessage.tsx, confirmingTool.ts, useGeminiStream.ts).

Specifically, the update_topic tool is an auto-executing background operation that does not require user interaction. Because it was included in the calculation of the tool confirmation queue size in confirmingTool.ts, the UI showed misleading counts (e.g., "1 of 2") when only one actionable tool was actually pending.

This PR introduces a unified tool-visibility utility in the core package that exposes three semantic methods:

  • isRenderedInHistory
  • requiresUserConfirmation
  • isVisibleInToolGroup

This cleanly resolves UI inconsistencies by providing a single source of truth for tool visibility state, removing the need for the UI to manually check against specific tool names like update_topic.

examples

Before

Queue count shows "1 of 2" when an update_topic tool is executing alongside another actionable tool.

After

Queue count accurately shows "1 of 1", excluding background narrative updates.

Related Issues

Fixes #24944

How to Validate

  1. Run npm test -w @google/gemini-cli-core -- src/utils/tool-visibility.test.ts to ensure the core rules are functioning correctly.
  2. Run npm test -w @google/gemini-cli to ensure existing UI tests pass.
  3. Manually verify by triggering a turn with update_topic and another tool; the count should only reflect actionable tools.

Pre-Merge Checklist

[ ] Updated relevant documentation and README (if needed) [x] Added/updated tests (if needed) [ ] Noted breaking changes (if any) [x] Validated on required platforms/methods: [x] MacOS [x] npm run

Changed files

  • packages/cli/src/ui/components/messages/ToolGroupMessage.tsx (modified, +14/-34)
  • packages/cli/src/ui/hooks/useGeminiStream.ts (modified, +6/-4)
  • packages/cli/src/ui/utils/confirmingTool.ts (modified, +18/-3)
  • packages/cli/src/ui/utils/historyUtils.ts (modified, +13/-1)
  • packages/core/src/index.ts (modified, +1/-0)
  • packages/core/src/utils/tool-utils.test.ts (modified, +2/-105)
  • packages/core/src/utils/tool-utils.ts (modified, +1/-66)
  • packages/core/src/utils/tool-visibility.test.ts (added, +159/-0)
  • packages/core/src/utils/tool-visibility.ts (added, +119/-0)
RAW_BUFFERClick to expand / collapse

name: Bug report about: Create a report to help us improve title: "[BUG] update_topic tool inflates confirmation queue count" labels: ["🔒 maintainer only", "bug"] assignees: []


Describe the bug The update_topic tool is an auto-executing background operation that does not require user interaction. However, it is currently included in the calculation of the tool confirmation queue size. This causes the UI to show misleading counts (e.g., "1 of 2") when only one actionable tool (like a shell command) is actually pending.

To Reproduce

  1. Trigger a turn that includes both an update_topic call and a tool requiring approval (e.g., run_shell_command).
  2. Observe the tool confirmation dialogue.
  3. The dialogue shows "1 of 2" instead of "1 of 1".

Expected behavior Background tools like update_topic should be excluded from the confirmation queue count.

Screenshots (Provided by user)

Desktop (please complete the following information):

  • OS: darwin
  • Version: 0.36.0-nightly

extent analysis

TL;DR

Exclude the update_topic tool from the calculation of the tool confirmation queue size to fix the inflated count issue.

Guidance

  • Identify the code responsible for calculating the tool confirmation queue size and modify it to exclude background operations like update_topic.
  • Verify that the update_topic tool is correctly categorized as a background operation that does not require user interaction.
  • Review the logic for displaying the confirmation queue count in the UI to ensure it accurately reflects the number of actionable tools pending approval.
  • Test the fix by reproducing the scenario described in the issue and confirming that the UI shows the correct count.

Example

No code snippet is provided as the issue does not include specific code details.

Notes

The fix assumes that the update_topic tool is correctly identified as a background operation and that the calculation of the tool confirmation queue size can be modified to exclude such operations.

Recommendation

Apply a workaround to exclude the update_topic tool from the confirmation queue count calculation, as the issue implies a need for a targeted fix rather than a version upgrade.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING