From 96d0a6e62b6c459c39fb8bba145451a36624fe69 Mon Sep 17 00:00:00 2001 From: hugocasa Date: Wed, 30 Sep 2026 14:58:55 +0200 Subject: [PATCH] fix: the agent's settings report path errors, and hold nothing a reader can edit The path field reads its error back, so it shows it and keeps deploy blocked on it. Labels are shown rather than editable without write access. Evals wait for the load to know they can be opened, and the page layout builds no levels it never shows. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../flows/content/AgentEditorHost.svelte | 11 ++++++---- .../flows/content/AgentEditorModal.svelte | 21 +++++++++++-------- .../flows/content/AgentSettings.svelte | 13 +++++++++++- 3 files changed, 31 insertions(+), 14 deletions(-) diff --git a/frontend/src/lib/components/flows/content/AgentEditorHost.svelte b/frontend/src/lib/components/flows/content/AgentEditorHost.svelte index 63a247ccf7..9c2a57b43f 100644 --- a/frontend/src/lib/components/flows/content/AgentEditorHost.svelte +++ b/frontend/src/lib/components/flows/content/AgentEditorHost.svelte @@ -447,14 +447,17 @@ /** The path field's own verdict (a taken path, an invalid name), which the server would otherwise * only report after the request. The field lives with whoever shows it, which reports here. */ - let pathError = $state('') + let pathErrorValue = $state('') + export function pathError() { + return pathErrorValue + } export function setPathError(error: string | undefined) { - pathError = error ?? '' + pathErrorValue = error ?? '' } export function deploy(): Promise { - if (pathError) { - sendUserToast(`Cannot deploy the agent: ${pathError}`, true) + if (pathErrorValue) { + sendUserToast(`Cannot deploy the agent: ${pathErrorValue}`, true) return Promise.resolve(false) } return draft.deploy().then(async (written) => { diff --git a/frontend/src/lib/components/flows/content/AgentEditorModal.svelte b/frontend/src/lib/components/flows/content/AgentEditorModal.svelte index 642a2fa002..618c31dbaf 100644 --- a/frontend/src/lib/components/flows/content/AgentEditorModal.svelte +++ b/frontend/src/lib/components/flows/content/AgentEditorModal.svelte @@ -130,6 +130,12 @@ let inSettings = $derived(target?.view === 'settings' && !refused) let readOnly = $derived(draft ? !draft.canWrite : false) let draftOnly = $derived(draft?.noDeployed ?? false) + // Evals run against the deployed agent, and a draft-only one has none: the backend's + // `require_agent` would reject every run. Evaluating is authoring, so it is for those who can + // edit the agent. Unknown until the load answers, and warming the pane loads it. + let canEvaluate = $derived( + draft != undefined && !draft.loading && !draftOnly && !readOnly && !refused + ) // A never-deployed agent is stored at a minted `draft_` path, so it is named by the path // its first deploy will create, as the home list names it. let shownPath = $derived((draftOnly && draft?.state?.path) || target?.path) @@ -410,10 +416,7 @@ on:click={openSettings} /> {/if} - - {#if !draftOnly && !readOnly} + {#if canEvaluate}