mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-25 04:24:51 -07:00
Disallow floating promises. (#14605)
This commit is contained in:
committed by
GitHub
parent
3cf44acc08
commit
025e450ac2
@@ -160,6 +160,7 @@ export class McpClientManager {
|
||||
}
|
||||
|
||||
const currentDiscoveryPromise = new Promise<void>((resolve, _reject) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
(async () => {
|
||||
try {
|
||||
if (existing) {
|
||||
@@ -228,6 +229,7 @@ export class McpClientManager {
|
||||
}
|
||||
this.eventEmitter?.emit('mcp-client-update', this.clients);
|
||||
const currentPromise = this.discoveryPromise;
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
currentPromise.then((_) => {
|
||||
// If we are the last recorded discoveryPromise, then we are done, reset
|
||||
// the world.
|
||||
|
||||
@@ -739,6 +739,7 @@ export async function connectAndDiscover(
|
||||
toolRegistry.sortTools();
|
||||
} catch (error) {
|
||||
if (mcpClient) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
mcpClient.close();
|
||||
}
|
||||
coreEvents.emitFeedback(
|
||||
|
||||
@@ -131,6 +131,7 @@ export abstract class BaseToolInvocation<
|
||||
onConfirm: async (outcome: ToolConfirmationOutcome) => {
|
||||
if (outcome === ToolConfirmationOutcome.ProceedAlways) {
|
||||
if (this.messageBus && this._toolName) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
this.messageBus.publish({
|
||||
type: MessageBusType.UPDATE_POLICY,
|
||||
toolName: this._toolName,
|
||||
@@ -220,6 +221,7 @@ export abstract class BaseToolInvocation<
|
||||
};
|
||||
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
this.messageBus.publish(request);
|
||||
} catch (_error) {
|
||||
cleanup();
|
||||
|
||||
Reference in New Issue
Block a user