feat(mcp): add progress bar, throttling, and input validation for MCP tool progress (#19772)

This commit is contained in:
Jasmeet Bhatia
2026-02-24 09:13:51 -08:00
committed by GitHub
parent 4efdbe9089
commit c0b76af442
16 changed files with 647 additions and 46 deletions

View File

@@ -13,6 +13,7 @@ import {
ToolStatusIndicator,
ToolInfo,
TrailingIndicator,
McpProgressIndicator,
type TextEmphasis,
STATUS_INDICATOR_WIDTH,
isThisShellFocusable as checkIsShellFocusable,
@@ -20,7 +21,7 @@ import {
useFocusHint,
FocusHint,
} from './ToolShared.js';
import { type Config } from '@google/gemini-cli-core';
import { type Config, CoreToolCallStatus } from '@google/gemini-cli-core';
import { ShellInputPrompt } from '../ShellInputPrompt.js';
export type { TextEmphasis };
@@ -56,8 +57,9 @@ export const ToolMessage: React.FC<ToolMessageProps> = ({
ptyId,
config,
progressMessage,
progressPercent,
originalRequestName,
progress,
progressTotal,
}) => {
const isThisShellFocused = checkIsShellFocused(
name,
@@ -92,8 +94,6 @@ export const ToolMessage: React.FC<ToolMessageProps> = ({
status={status}
description={description}
emphasis={emphasis}
progressMessage={progressMessage}
progressPercent={progressPercent}
originalRequestName={originalRequestName}
/>
<FocusHint
@@ -114,6 +114,14 @@ export const ToolMessage: React.FC<ToolMessageProps> = ({
paddingX={1}
flexDirection="column"
>
{status === CoreToolCallStatus.Executing && progress !== undefined && (
<McpProgressIndicator
progress={progress}
total={progressTotal}
message={progressMessage}
barWidth={20}
/>
)}
<ToolResultDisplay
resultDisplay={resultDisplay}
availableTerminalHeight={availableTerminalHeight}