diff --git a/desktop/src/features/agents/ui/AgentModelProviderFields.tsx b/desktop/src/features/agents/ui/AgentModelProviderFields.tsx index 9f3249800..2aaa79821 100644 --- a/desktop/src/features/agents/ui/AgentModelProviderFields.tsx +++ b/desktop/src/features/agents/ui/AgentModelProviderFields.tsx @@ -124,6 +124,9 @@ export function AgentModelProviderFields({ : trimmedProvider || AUTO_PROVIDER_DROPDOWN_VALUE; const providerDropdownOptions: PersonaDropdownOption[] = [ ...providerOptions.map((option) => ({ + // The "Default" option means "no explicit provider" — render it faded + // in the trigger, like placeholder text. + isPlaceholder: option.id === "", label: option.label, value: option.id || AUTO_PROVIDER_DROPDOWN_VALUE, })), @@ -131,6 +134,8 @@ export function AgentModelProviderFields({ ]; const modelDropdownOptions: PersonaDropdownOption[] = [ ...modelOptions.map((option) => ({ + // Same treatment for "Default model" — it's the absence of a choice. + isPlaceholder: option.id === "", label: option.label, value: option.id || AUTO_MODEL_DROPDOWN_VALUE, })), diff --git a/desktop/src/features/agents/ui/CreateAgentDialog.tsx b/desktop/src/features/agents/ui/CreateAgentDialog.tsx index ba8200fb4..a84188360 100644 --- a/desktop/src/features/agents/ui/CreateAgentDialog.tsx +++ b/desktop/src/features/agents/ui/CreateAgentDialog.tsx @@ -40,6 +40,7 @@ import { ProviderConfigFields, } from "./ProviderConfigFields"; import { CreateAgentRespondToField } from "./RespondToField"; +import { PersonaDropdownField } from "./PersonaDropdownField"; import { RelayMeshAgentSection } from "@/features/mesh-compute/ui/RelayMeshAgentSection"; import { meshPrepareRelayMeshClient } from "@/shared/api/tauriMesh"; import type { MeshServeTarget } from "@/shared/api/tauriMesh"; @@ -501,8 +502,12 @@ export function CreateAgentDialog({
{draft?.title ?? "Create agent"} - - {draft?.description ?? + {/* A draft with intentionally-blank description keeps the line + for screen readers only. */} + + {draft?.description || "Set up a new agent and start it in this workspace."} @@ -588,19 +593,19 @@ export function CreateAgentDialog({ > Run on - + />
) : null} diff --git a/desktop/src/features/agents/ui/CreateAgentDialogSections.tsx b/desktop/src/features/agents/ui/CreateAgentDialogSections.tsx index eb5c7812b..adc3207f9 100644 --- a/desktop/src/features/agents/ui/CreateAgentDialogSections.tsx +++ b/desktop/src/features/agents/ui/CreateAgentDialogSections.tsx @@ -2,6 +2,7 @@ import type { AcpRuntime, ManagedAgentPrereqs } from "@/shared/api/types"; import { cn } from "@/shared/lib/cn"; import { Input } from "@/shared/ui/input"; import { describeResolvedCommand } from "./agentUi"; +import { PersonaDropdownField } from "./PersonaDropdownField"; export function CreateAgentBasicsFields({ name, @@ -55,19 +56,19 @@ export function CreateAgentRuntimeField({ - + /> {selectedRuntime ? (

Detected via{" "} diff --git a/desktop/src/features/agents/ui/PersonaDropdownField.tsx b/desktop/src/features/agents/ui/PersonaDropdownField.tsx index 90aa3fc06..df7522ba4 100644 --- a/desktop/src/features/agents/ui/PersonaDropdownField.tsx +++ b/desktop/src/features/agents/ui/PersonaDropdownField.tsx @@ -34,6 +34,7 @@ export function PersonaDropdownField({ }) { const [open, setOpen] = React.useState(false); const selectedOption = options.find((option) => option.value === value); + const showAsPlaceholder = !selectedOption || selectedOption.isPlaceholder; return (

@@ -52,7 +53,7 @@ export function PersonaDropdownField({ {selectedOption?.label ?? placeholder} diff --git a/desktop/src/features/agents/ui/RespondToField.tsx b/desktop/src/features/agents/ui/RespondToField.tsx index dd36c52c6..8e0b180cc 100644 --- a/desktop/src/features/agents/ui/RespondToField.tsx +++ b/desktop/src/features/agents/ui/RespondToField.tsx @@ -12,6 +12,7 @@ import { cn } from "@/shared/lib/cn"; import { Input } from "@/shared/ui/input"; import { Textarea } from "@/shared/ui/textarea"; import { UserAvatar } from "@/shared/ui/UserAvatar"; +import { PersonaDropdownField } from "./PersonaDropdownField"; /** * Inbound author gate UI for create/edit agent dialogs. @@ -30,6 +31,12 @@ import { UserAvatar } from "@/shared/ui/UserAvatar"; * `desktop/src-tauri/src/managed_agents/types.rs`. */ +const RESPOND_TO_OPTIONS = [ + { label: "Owner only (default)", value: "owner-only" }, + { label: "Anyone", value: "anyone" }, + { label: "Allowlist", value: "allowlist" }, +] as const; + function formatSearchUserName(user: UserSearchResult) { return ( user.displayName?.trim() || @@ -118,18 +125,14 @@ export function CreateAgentRespondToField({ - + />

Controls which Nostr authors the agent listens to (@mentions, DMs, thread replies). The agent's owner can always shut it down with diff --git a/desktop/src/features/agents/ui/personaDialogPickers.tsx b/desktop/src/features/agents/ui/personaDialogPickers.tsx index e3b51cfcb..03f68b593 100644 --- a/desktop/src/features/agents/ui/personaDialogPickers.tsx +++ b/desktop/src/features/agents/ui/personaDialogPickers.tsx @@ -30,6 +30,12 @@ export type PersonaModelOption = { export type PersonaDropdownOption = { disabled?: boolean; + /** + * Marks an "auto"/default option that stands in for "no explicit choice". + * The trigger renders it faded, like placeholder text, so it reads as + * helper copy rather than an actively selected value. + */ + isPlaceholder?: boolean; label: string; value: string; }; diff --git a/desktop/tests/e2e/persona-env-vars.spec.ts b/desktop/tests/e2e/persona-env-vars.spec.ts index 7098a7f0e..dd90ab946 100644 --- a/desktop/tests/e2e/persona-env-vars.spec.ts +++ b/desktop/tests/e2e/persona-env-vars.spec.ts @@ -320,7 +320,7 @@ test("agent model options follow the selected LLM provider", async ({ const runtime = page.locator("#agent-runtime"); const llmProvider = page.locator("#agent-llm-provider"); const model = page.locator("#persona-model"); - await expect(runtime).toHaveValue("buzz-agent"); + await expect(runtime).toContainText("Buzz Agent"); await expect(llmProvider).toBeVisible(); await expect(model).toBeVisible(); // Without live discovery, the only static option is "Default model".