anomalyco / anomalyco/opencode
Sub-Agent Color is not being applied
Open
@kommander is already working on this.
Since Aug 14, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
When specify the color value in an agent configuration, it's not being applied in the TUI.
AI response, for what it's worth.
I found the bug. In packages/tui/src/context/local.tsx, the color() function uses visibleAgents() which explicitly excludes all subagents:
const visibleAgents = createMemo(() => sync.data.agent.filter((agent) => agent.mode !== "subagent" && !agent.hidden))
color(name: string) {
const index = visibleAgents().findIndex((x) => x.name === name) // ← BUG
if (index === -1) return colors()[0] // ← falls back to cycling color
const agent = visibleAgents()[index]
if (agent?.color) {
const color = agent.color
if (color.startsWith("#")) return RGBA.fromHex(color)
return theme[color as keyof typeof theme] as RGBA
}
return colors()[index % colors().length]
}
Your three agents (commit-message-generator, pr-status-monitor, sem-code-reviewer) are all mode: subagent. Since visibleAgents() filters them out, findIndex returns -1, and the function falls back to cycling colors.
The fix: change visibleAgents() to agents() inside color() so it can look up subagents by name.
We should either fix this or update the documentation to say this field doesn't work for sub-agents.
Plugins
No response
OpenCode version
1.18.15
Steps to reproduce
- Create a sub-agent Markdown file specifying color.
- Start OpenCode
- Trigger the use of the agent.
- The correct color isn't show in the TUI.
Screenshot and/or share link
Operating System
macOSX 26.6.1
Terminal
Alacritty
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.