summaryrefslogtreecommitdiffhomepage
path: root/packages/frontend/src/lib/components/ModelSelector.svelte
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-05-23 05:06:12 +0900
committerAdam Malczewski <[email protected]>2026-05-23 05:06:12 +0900
commit9287cccb29d135ea19f2612c26f3090c94820d8c (patch)
tree2d68e8cacf6d71786f305d5f4a512a68f19137c5 /packages/frontend/src/lib/components/ModelSelector.svelte
parentef427d3eae77fca716c203dd8bd84939710c518a (diff)
downloaddispatch-9287cccb29d135ea19f2612c26f3090c94820d8c.tar.gz
dispatch-9287cccb29d135ea19f2612c26f3090c94820d8c.zip
feat: add is_subagent flag to agents, fix all lint/type/test issues
- Add is_subagent checkbox to agent editor; subagents are hidden from Chat Settings - Add is_subagent field to AgentDefinition type, TOML serialization, and API route - Filter subagents from ModelSelector agent list - Fix all biome lint/format errors across codebase (useLiteralKeys, noNonNullAssertion, noExplicitAny, formatting, import sorting) - Fix svelte-check errors (type narrowing in SkillsBrowser, ToolPermissions, SidebarPanel) - Fix a11y warnings in App.svelte (label-control associations) - Fix test mocks missing BackgroundShellStore, BackgroundTranscriptStore, createWebSearchTool, createYoutubeTranscribeTool - Update stale 409 test to match current message-queuing behavior - Exclude packaging/ and release/ dirs from biome to avoid linting stale build artifacts
Diffstat (limited to 'packages/frontend/src/lib/components/ModelSelector.svelte')
-rw-r--r--packages/frontend/src/lib/components/ModelSelector.svelte10
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/frontend/src/lib/components/ModelSelector.svelte b/packages/frontend/src/lib/components/ModelSelector.svelte
index 5949e71..19ce818 100644
--- a/packages/frontend/src/lib/components/ModelSelector.svelte
+++ b/packages/frontend/src/lib/components/ModelSelector.svelte
@@ -16,6 +16,7 @@ const modelCache = new Map<string, string[]>();
tools: string[];
models: Array<{ key_id: string; model_id: string }>;
cwd?: string;
+ is_subagent?: boolean;
}
// Moves an element to document.body so modals escape the sidebar's
@@ -90,6 +91,7 @@ const modelCache = new Map<string, string[]>();
let modeOverride = $state<"manual" | "agent" | null>(null);
let mode = $derived(modeOverride ?? (activeAgentSlug ? "agent" : "manual"));
let agents = $state<AgentInfo[]>([]);
+ let visibleAgents = $derived(agents.filter((a) => !a.is_subagent));
let loadingAgents = $state(false);
$effect(() => {
@@ -206,8 +208,8 @@ const modelCache = new Map<string, string[]>();
modeOverride = "agent";
await fetchAgents();
// Re-apply the active agent's settings (including cwd)
- const current = agents.find(a => a.slug === activeAgentSlug);
- const agentToApply = current ?? agents[0] ?? null;
+ const current = visibleAgents.find(a => a.slug === activeAgentSlug);
+ const agentToApply = current ?? visibleAgents[0] ?? null;
if (agentToApply) {
onAgentChange(agentToApply);
// Force-update the input since the prop may not change (already set)
@@ -258,11 +260,11 @@ const modelCache = new Map<string, string[]>();
<span class="loading loading-spinner loading-xs"></span>
Loading agents...
</div>
- {:else if agents.length === 0}
+ {:else if visibleAgents.length === 0}
<p class="text-base-content/50 text-sm py-2">No agents configured.</p>
{:else}
<div class="flex flex-col gap-1.5">
- {#each agents as agent (agent.slug + ":" + agent.scope)}
+ {#each visibleAgents as agent (agent.slug + ":" + agent.scope)}
<button
class="w-full text-left rounded-lg px-3 py-2 transition-colors {activeAgentSlug === agent.slug ? 'bg-primary text-primary-content' : 'bg-base-300 hover:bg-base-200'}"
onclick={() => {