Revert "Added subagents to agents modal, non-selectable (#4460)"

This reverts commit 84bd53a679.
This commit is contained in:
Aiden Cline
2025-11-19 11:00:38 -06:00
parent 891ade0efb
commit 319a740ef1
2 changed files with 22 additions and 71 deletions
@@ -1,39 +1,21 @@
import { createMemo } from "solid-js"
import { useLocal } from "@tui/context/local"
import { useSync } from "@tui/context/sync"
import { DialogSelect } from "@tui/ui/dialog-select"
import { useDialog } from "@tui/ui/dialog"
import { useTheme } from "@tui/context/theme"
export function DialogAgent() {
const local = useLocal()
const sync = useSync()
const dialog = useDialog()
const { theme } = useTheme()
const options = createMemo(() => {
const allAgents = sync.data.agent
const primaryAgents = allAgents.filter((x) => x.mode !== "subagent")
const subagents = allAgents.filter((x) => x.mode === "subagent")
const primaryOptions = primaryAgents.map((item) => ({
value: item.name,
title: item.name,
description: item.builtIn ? "native" : item.description,
category: "Primary Agents",
}))
const subagentOptions = subagents.map((item) => ({
value: item.name,
title: item.name,
description: item.builtIn ? "native" : item.description,
category: "Subagents (non-selectable)",
disabled: true,
bg: theme.backgroundPanel,
}))
return [...primaryOptions, ...subagentOptions]
})
const options = createMemo(() =>
local.agent.list().map((item) => {
return {
value: item.name,
title: item.name,
description: item.builtIn ? "native" : item.description,
}
}),
)
return (
<DialogSelect
@@ -41,10 +23,8 @@ export function DialogAgent() {
current={local.agent.current().name}
options={options()}
onSelect={(option) => {
if (!option.disabled) {
local.agent.set(option.value)
dialog.clear()
}
local.agent.set(option.value)
dialog.clear()
}}
/>
)