From eefc5ef4f24c2388002c4a5cb77539793e4da4cb Mon Sep 17 00:00:00 2001 From: viettranx Date: Wed, 11 Mar 2026 17:39:19 +0700 Subject: [PATCH] fix(ui): preserve byProvider in tools_config whitelist on save The PR #153 whitelist stripped byProvider on agent config save, but byProvider is actively used in policy.go for per-provider tool overrides. Add it to the whitelist and ToolPolicyConfig type. --- ui/web/src/pages/agents/agent-detail/agent-config-tab.tsx | 2 +- ui/web/src/types/agent.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/web/src/pages/agents/agent-detail/agent-config-tab.tsx b/ui/web/src/pages/agents/agent-detail/agent-config-tab.tsx index 15c3b4e7..37a8aca6 100644 --- a/ui/web/src/pages/agents/agent-detail/agent-config-tab.tsx +++ b/ui/web/src/pages/agents/agent-detail/agent-config-tab.tsx @@ -78,7 +78,7 @@ export function AgentConfigTab({ agent, onUpdate }: AgentConfigTabProps) { const updates: Record = { subagents_config: subEnabled ? sub : null, tools_config: toolsEnabled - ? { profile: tools.profile, allow: tools.allow, deny: tools.deny, alsoAllow: tools.alsoAllow } + ? { profile: tools.profile, allow: tools.allow, deny: tools.deny, alsoAllow: tools.alsoAllow, byProvider: tools.byProvider } : {}, compaction_config: comp, context_pruning: pruneEnabled ? prune : null, diff --git a/ui/web/src/types/agent.ts b/ui/web/src/types/agent.ts index 6c2ca070..56f3125a 100644 --- a/ui/web/src/types/agent.ts +++ b/ui/web/src/types/agent.ts @@ -7,6 +7,7 @@ export interface ToolPolicyConfig { allow?: string[]; deny?: string[]; alsoAllow?: string[]; + byProvider?: Record; } export interface SubagentsConfig {