Skip to content

Commit 32b65f7

Browse files
feat: add footerShowSubagents config option for TUI agent display
Add a new TUI configuration option to control whether subagents are shown in the footer agent tab selector. When set to false (default), only primary agents are displayed, providing a cleaner workflow for users with many agents from plugins. When set to true, all non-hidden agents (including subagents) are displayed. This allows users with heavy multi-agent setups to restore the previous primary-only visibility while keeping the new subagent orchestration features for those who want full visibility. Fixes: anomalyco#12530, anomalyco#4764
1 parent ec8b981 commit 32b65f7

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

‎packages/opencode/src/cli/cmd/tui/context/local.tsx‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { createStore } from "solid-js/store"
22
import { batch, createEffect, createMemo } from "solid-js"
33
import { useSync } from "@tui/context/sync"
44
import { useTheme } from "@tui/context/theme"
5+
import { useTuiConfig } from "@tui/context/tui-config"
56
import { uniqueBy } from "remeda"
67
import path from "path"
78
import { Global } from "@/global"
@@ -35,7 +36,15 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
3536
}
3637

3738
const agent = iife(() => {
38-
const agents = createMemo(() => sync.data.agent.filter((x) => x.mode !== "subagent" && !x.hidden))
39+
const tuiConfig = useTuiConfig()
40+
const showSubagents = () => tuiConfig.footerShowSubagents ?? false
41+
const agents = createMemo(() =>
42+
sync.data.agent.filter((x) => {
43+
if (x.hidden) return false
44+
if (showSubagents()) return true
45+
return x.mode !== "subagent"
46+
})
47+
)
3948
const visibleAgents = createMemo(() => sync.data.agent.filter((x) => !x.hidden))
4049
const [agentStore, setAgentStore] = createStore<{
4150
current: string

‎packages/opencode/src/config/tui-schema.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ export const TuiOptions = z.object({
2323
.optional()
2424
.describe("Control diff rendering style: 'auto' adapts to terminal width, 'stacked' always shows single column"),
2525
mouse: z.boolean().optional().describe("Enable or disable mouse capture (default: true)"),
26+
footerShowSubagents: z
27+
.boolean()
28+
.optional()
29+
.describe("Show subagents in footer tab selector (default: false, only shows primary agents)"),
2630
})
2731

2832
export const TuiInfo = z

0 commit comments

Comments
 (0)