fix(core): resolve context initialization mismatch and ensure spread-safety

- Added unit tests to verify AgentLoopContext spread-safety in Config.
- Restored AgentLoopContext abstraction in ShellTool, WebFetchTool, and WebSearchTool constructors.
- Removed redundant defensive optional chaining on config properties in UI and policy logic.
- Updated PR title to follow Conventional Commits.
This commit is contained in:
mkorwel
2026-03-19 20:49:59 -07:00
parent 261fdf7b15
commit a8bfa180dd
6 changed files with 88 additions and 78 deletions
@@ -88,14 +88,13 @@ export const ToolConfirmationMessage: React.FC<
const settings = useSettings();
const allowPermanentApproval =
settings.merged.security.enablePermanentToolApproval &&
(config?.getDisableAlwaysAllow ? !config.getDisableAlwaysAllow() : true);
!config.getDisableAlwaysAllow();
const handlesOwnUI =
confirmationDetails.type === 'ask_user' ||
confirmationDetails.type === 'exit_plan_mode';
const isTrustedFolder =
config?.isTrustedFolder?.() &&
(config?.getDisableAlwaysAllow ? !config.getDisableAlwaysAllow() : true);
config.isTrustedFolder() && !config.getDisableAlwaysAllow();
const handleConfirm = useCallback(
(outcome: ToolConfirmationOutcome, payload?: ToolConfirmationPayload) => {