From 3671b82cc624117476e30b95eaf7d2bc3b34ae28 Mon Sep 17 00:00:00 2001
From: Adam Malczewski <github@tradam.dev>
Date: Tue, 2 Jun 2026 13:18:57 +0900
Subject: fix(frontend): honest effort display in agent UI (gemini review)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Address two UI-accuracy issues found in review:
- AgentBuilder: the per-model effort select no longer disguises an unset
  value as 'High'. Adds an explicit 'Inherit' option; choosing it strips
  the effort key so the saved TOML omits it (and the call site falls back
  to per-tab → default), matching displayed intent to persisted state.
- ModelSelector: effort badges for models without an explicit override now
  reflect the actual effective effort (per-tab selector → default) instead
  of always showing the default constant, mirroring backend resolution.
---
 packages/frontend/src/lib/components/ModelSelector.svelte | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

(limited to 'packages/frontend/src/lib/components/ModelSelector.svelte')

diff --git a/packages/frontend/src/lib/components/ModelSelector.svelte b/packages/frontend/src/lib/components/ModelSelector.svelte
index c328511..8601795 100644
--- a/packages/frontend/src/lib/components/ModelSelector.svelte
+++ b/packages/frontend/src/lib/components/ModelSelector.svelte
@@ -37,12 +37,16 @@ const modelCache = new Map<string, string[]>();
 	}
 
 	/**
-	 * Human-readable effort label for a (possibly-unset / arbitrary) effort
-	 * string. Falls back to the default level's label when unset/invalid so the
-	 * displayed badge always reflects what will actually be used.
+	 * Human-readable effort label for a (possibly-unset) per-model effort. When
+	 * the model has no explicit override, the badge reflects what will ACTUALLY
+	 * run: the per-tab selector if valid, else the system default. This mirrors
+	 * the backend resolution order (per-model → per-tab → default) so the UI
+	 * never misrepresents the effective effort.
 	 */
 	function effortLabel(effort: string | undefined): string {
-		return REASONING_EFFORT_LABELS[isReasoningEffort(effort) ? effort : DEFAULT_REASONING_EFFORT];
+		if (isReasoningEffort(effort)) return REASONING_EFFORT_LABELS[effort];
+		const tab = isReasoningEffort(reasoningEffort) ? reasoningEffort : DEFAULT_REASONING_EFFORT;
+		return REASONING_EFFORT_LABELS[tab];
 	}
 
 	const {
-- 
cgit v1.2.3

