= {
compaction_config: comp,
context_pruning: pruneEnabled
- ? (Object.keys(prune).length > 0 ? prune : null)
+ ? { mode: "cache-ttl", ...prune }
: { mode: "off" },
sandbox_config: sbEnabled ? sb : null,
...routingPayload,
diff --git a/ui/web/src/pages/agents/agent-detail/config-sections/context-pruning-section.tsx b/ui/web/src/pages/agents/agent-detail/config-sections/context-pruning-section.tsx
index 3b846063..5476fb03 100644
--- a/ui/web/src/pages/agents/agent-detail/config-sections/context-pruning-section.tsx
+++ b/ui/web/src/pages/agents/agent-detail/config-sections/context-pruning-section.tsx
@@ -38,6 +38,19 @@ export function ContextPruningSection({ enabled, value, onToggle, onChange }: Co
/>
+ {/* Cache TTL — always shown when pruning is enabled (opt-in requires cache-ttl mode) */}
+ {enabled && (
+
+ {t(`${s}.cacheTtl`, "Cache TTL")}
+ onChange({ ...value, ttl: e.target.value || undefined })}
+ />
+
+ )}
+
{/* Advanced toggle */}