mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-26 21:14:35 -07:00
feat(mcp): add progress bar, throttling, and input validation for MCP tool progress (#19772)
This commit is contained in:
@@ -13,6 +13,7 @@ import type {
|
||||
TokenStorageInitializationEvent,
|
||||
KeychainAvailabilityEvent,
|
||||
} from '../telemetry/types.js';
|
||||
import { debugLogger } from './debugLogger.js';
|
||||
|
||||
/**
|
||||
* Defines the severity level for user-facing feedback.
|
||||
@@ -353,6 +354,10 @@ export class CoreEventEmitter extends EventEmitter<CoreEvents> {
|
||||
* Notifies subscribers that progress has been made on an MCP tool call.
|
||||
*/
|
||||
emitMcpProgress(payload: McpProgressPayload): void {
|
||||
if (!Number.isFinite(payload.progress) || payload.progress < 0) {
|
||||
debugLogger.log(`Invalid progress value: ${payload.progress}`);
|
||||
return;
|
||||
}
|
||||
this.emit(CoreEvent.McpProgress, payload);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user