mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-06-11 03:46:49 -07:00
fix(core): Resolve context initialization mismatch in built-in tools
- Update ShellTool, WebFetchTool, and WebSearchTool to handle both Config and AgentLoopContext. - Add safety checks for config in ToolConfirmationMessage UI. - Add safety checks for context.config in policy update logic. - Fixes #23174
This commit is contained in:
@@ -88,13 +88,14 @@ export const ToolConfirmationMessage: React.FC<
|
||||
const settings = useSettings();
|
||||
const allowPermanentApproval =
|
||||
settings.merged.security.enablePermanentToolApproval &&
|
||||
!config.getDisableAlwaysAllow();
|
||||
(config?.getDisableAlwaysAllow ? !config.getDisableAlwaysAllow() : true);
|
||||
|
||||
const handlesOwnUI =
|
||||
confirmationDetails.type === 'ask_user' ||
|
||||
confirmationDetails.type === 'exit_plan_mode';
|
||||
const isTrustedFolder =
|
||||
config.isTrustedFolder() && !config.getDisableAlwaysAllow();
|
||||
config?.isTrustedFolder?.() &&
|
||||
(config?.getDisableAlwaysAllow ? !config.getDisableAlwaysAllow() : true);
|
||||
|
||||
const handleConfirm = useCallback(
|
||||
(outcome: ToolConfirmationOutcome, payload?: ToolConfirmationPayload) => {
|
||||
|
||||
Reference in New Issue
Block a user