anomalyco / anomalyco/opencode

Sub-Agent Color is not being applied

Open
#42,651 1 comment 0 reactions 1 assignee View on GitHub

@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
  1. Create a sub-agent Markdown file specifying color.
  2. Start OpenCode
  3. Trigger the use of the agent.
  4. The correct color isn't show in the TUI.
Screenshot and/or share link
Image
Operating System

macOSX 26.6.1

Terminal

Alacritty

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.