mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-14 03:50:49 -07:00
Disallow and suppress unsafe assignment (#19736)
This commit is contained in:
committed by
GitHub
parent
3e786a161e
commit
981e9a978e
@@ -27,6 +27,7 @@ export class AcknowledgedAgentsService {
|
||||
const filePath = Storage.getAcknowledgedAgentsPath();
|
||||
try {
|
||||
const content = await fs.readFile(filePath, 'utf-8');
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
this.acknowledgedAgents = JSON.parse(content);
|
||||
} catch (error: unknown) {
|
||||
if (!isNodeError(error) || error.code !== 'ENOENT') {
|
||||
|
||||
@@ -54,6 +54,7 @@ export async function scheduleAgentTools(
|
||||
} = options;
|
||||
|
||||
// Create a proxy/override of the config to provide the agent-specific tool registry.
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const agentConfig: Config = Object.create(config);
|
||||
agentConfig.getToolRegistry = () => toolRegistry;
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ import {
|
||||
AgentStartEvent,
|
||||
AgentFinishEvent,
|
||||
RecoveryAttemptEvent,
|
||||
LlmRole,
|
||||
} from '../telemetry/types.js';
|
||||
import type {
|
||||
LocalAgentDefinition,
|
||||
@@ -59,7 +60,6 @@ import { getVersion } from '../utils/version.js';
|
||||
import { getToolCallContext } from '../utils/toolCallContext.js';
|
||||
import { scheduleAgentTools } from './agent-scheduler.js';
|
||||
import { DeadlineTimer } from '../utils/deadlineTimer.js';
|
||||
import { LlmRole } from '../telemetry/types.js';
|
||||
import { formatUserHintsForModel } from '../utils/fastAckHelper.js';
|
||||
|
||||
/** A callback function to report on agent activity. */
|
||||
@@ -925,6 +925,7 @@ export class LocalAgentExecutor<TOutput extends z.ZodTypeAny> {
|
||||
continue;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const validatedOutput = validationResult.data;
|
||||
if (this.definition.processOutput) {
|
||||
submittedOutput = this.definition.processOutput(validatedOutput);
|
||||
|
||||
@@ -394,6 +394,7 @@ export class AgentRegistry {
|
||||
}
|
||||
|
||||
// Use Object.create to preserve lazy getters on the definition object
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const merged: LocalAgentDefinition<TOutput> = Object.create(definition);
|
||||
|
||||
if (overrides.runConfig) {
|
||||
|
||||
Reference in New Issue
Block a user