From af19cad43b63bfb5885ee7c40697aafb2302a65c Mon Sep 17 00:00:00 2001 From: Gagan Date: Tue, 21 Jul 2026 15:33:35 +0530 Subject: [PATCH] fix(x): chat model-call field opens as 'Same as above' unless it differs A chat override equal to the global limit is behaviorally identical to no override, so persist it as absent and collapse it on load. Stepping the empty chat field (which lands on the global value) no longer pins a redundant override that makes the field open with a number forever. --- .../apps/renderer/src/components/settings-dialog.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/x/apps/renderer/src/components/settings-dialog.tsx b/apps/x/apps/renderer/src/components/settings-dialog.tsx index 3efa566f..eecd140e 100644 --- a/apps/x/apps/renderer/src/components/settings-dialog.tsx +++ b/apps/x/apps/renderer/src/components/settings-dialog.tsx @@ -2732,7 +2732,13 @@ function AdvancedSettings({ dialogOpen }: { dialogOpen: boolean }) { .then((settings) => { if (cancelled) return setGlobalLimit(String(settings.maxModelCalls)) - setChatLimit(settings.chatMaxModelCalls !== undefined ? String(settings.chatMaxModelCalls) : "") + // A chat override equal to the global limit is no override — show + // "Same as above" (legacy files; saves already collapse this). + setChatLimit( + settings.chatMaxModelCalls !== undefined && settings.chatMaxModelCalls !== settings.maxModelCalls + ? String(settings.chatMaxModelCalls) + : "" + ) setLoaded(true) }) .catch(() => { @@ -2758,6 +2764,9 @@ function AdvancedSettings({ dialogOpen }: { dialogOpen: boolean }) { } chat = parsed } + // An override equal to the global limit is meaningless — persist it as + // "use the global limit" so the field reopens as "Same as above". + if (chat === global) chat = undefined try { await window.ipc.invoke("turnLimits:setSettings", { maxModelCalls: global,