diff options
| author | Adam Malczewski <[email protected]> | 2026-06-02 13:18:57 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-02 13:18:57 +0900 |
| commit | 3671b82cc624117476e30b95eaf7d2bc3b34ae28 (patch) | |
| tree | e0a8976ae129e64b8b7033bad8df6d6ab1293ce9 | |
| parent | 2503eba38b7885ab92a9c0e4f082323d1b3a8679 (diff) | |
| download | dispatch-3671b82cc624117476e30b95eaf7d2bc3b34ae28.tar.gz dispatch-3671b82cc624117476e30b95eaf7d2bc3b34ae28.zip | |
fix(frontend): honest effort display in agent UI (gemini review)
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.
| -rw-r--r-- | packages/frontend/src/lib/components/AgentBuilder.svelte | 19 | ||||
| -rw-r--r-- | packages/frontend/src/lib/components/ModelSelector.svelte | 12 |
2 files changed, 23 insertions, 8 deletions
diff --git a/packages/frontend/src/lib/components/AgentBuilder.svelte b/packages/frontend/src/lib/components/AgentBuilder.svelte index bbdb83c..f1c9cdf 100644 --- a/packages/frontend/src/lib/components/AgentBuilder.svelte +++ b/packages/frontend/src/lib/components/AgentBuilder.svelte @@ -180,7 +180,17 @@ const modelCache = new Map(); } function setEffortEntry(i: number, effort: string) { - formModels = formModels.map((m, idx) => (idx === i ? { ...m, effort } : m)); + formModels = formModels.map((m, idx) => { + if (idx !== i) return m; + // Empty string = "inherit" (no per-model override). Strip the key so + // the saved TOML omits `effort` and the call site falls back to the + // per-tab selector / default. + if (!effort) { + const { effort: _dropped, ...rest } = m; + return rest; + } + return { ...m, effort }; + }); } async function openKeyModal(i: number) { @@ -557,11 +567,12 @@ const modelCache = new Map(); {entry.model_id || "Select Model"} </button> <select - class="select select-bordered select-sm shrink-0 w-28" - title="Reasoning effort for this model" - value={entry.effort ?? DEFAULT_REASONING_EFFORT} + class="select select-bordered select-sm shrink-0 w-36" + title="Reasoning effort for this model. 'Inherit' uses the per-tab selector / default." + value={entry.effort ?? ""} onchange={(e) => setEffortEntry(i, e.currentTarget.value)} > + <option value="">Inherit ({REASONING_EFFORT_LABELS[DEFAULT_REASONING_EFFORT]})</option> {#each REASONING_EFFORTS as effort} <option value={effort}>{REASONING_EFFORT_LABELS[effort]}</option> {/each} 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 { |
