fix: send empty objects instead of null for tools_config and other_config when disabled or empty.

This commit is contained in:
viettranx committed 2026-02-27 12:31:13 +07:00
1 parent a4325e2abe
commit 99c0d7e445
1 file changed
+2 -2
@@ -73,7 +73,7 @@ export function AgentConfigTab({ agent, onUpdate }: AgentConfigTabProps) {
try {
const updates: Record<string, unknown> = {
subagents_config: subEnabled ? sub : null,
tools_config: toolsEnabled ? tools : null,
tools_config: toolsEnabled ? tools : {},
compaction_config: compEnabled ? comp : null,
context_pruning: pruneEnabled ? prune : null,
sandbox_config: sbEnabled ? sb : null,
@@ -87,7 +87,7 @@ export function AgentConfigTab({ agent, onUpdate }: AgentConfigTabProps) {
if (qgEnabled && qualityGates.length > 0) {
otherBase.quality_gates = qualityGates;
}
updates.other_config = Object.keys(otherBase).length > 0 ? otherBase : null;
updates.other_config = Object.keys(otherBase).length > 0 ? otherBase : {};
await onUpdate(updates);
setSaved(true);
setTimeout(() => setSaved(false), 3000);