opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat: Add agent color config

Open 0xrin1 opened this issue 2 months ago • 1 comments

This PR adds the ability to customize agent colors in the opencode configuration.

You can specify custom colors for agents in your opencode.json:

{
  $schema: https://opencode.ai/config.json,
  agent: {
    glm-4.6: {
      model: openrouter/zhipuai/glm-4-plus,
      color: #3B82F6,
      ...
    },
    chkn: { 
      model: openrouter/gpt-5-high,
      color: #DC2626,
      ...
    },
    plan: { 
      model: openrouter/gpt-5-high,
      mode: primary,
      color: #A855F7,
      ...
    },
    claude: { 
      model: anthropic/claude-sonnet-4-5-20250929,
      color: #D97706,
      ...
    }
  }
}

The colors are specified as hex color codes and will be applied to agent indicators in the CLI/TUI output, making it easier to distinguish between different agent types at a glance.

image image image image

0xrin1 avatar Nov 03 '25 10:11 0xrin1

Relates to issue https://github.com/sst/opencode/issues/1973

0xrin1 avatar Nov 03 '25 10:11 0xrin1

@0xrin1 can u resolve the conflicts?

rekram1-node avatar Nov 10 '25 02:11 rekram1-node

@rekram1-node done. thanks. the tests too i suppose?

0xrin1 avatar Nov 10 '25 07:11 0xrin1

@0xrin1 I was about to merge but then I realized, how are people gonna define colors in an agent.md definition?

rekram1-node avatar Nov 11 '25 06:11 rekram1-node

@0xrin1 I was about to merge but then I realized, how are people gonna define colors in an agent.md definition?

Not exactly sure what you mean.

Do you mean that we should be supporting a way to specify agent color in agent.md?

I'm not sure what that would look like tbh is that something ppl would do?

0xrin1 avatar Nov 11 '25 11:11 0xrin1

i mean u can define agents in your opencode.json right

but u can also define them in .opencode/agent/.md

Using the frontmatter

oh I guess it works if you wrap it in quotes so this is fine

rekram1-node avatar Nov 11 '25 15:11 rekram1-node

Thanks for having patience with me on this one! A lot of people wanted this

rekram1-node avatar Nov 11 '25 17:11 rekram1-node

@rekram1-node thank you too 🫡

0xrin1 avatar Nov 11 '25 19:11 0xrin1

I'm not seeing this in the dev branch, not sure what's happened. d0ead04 also shows me this label:

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Any ideas?

Very keen to use this feature, nice work folks :)

jknlsn avatar Nov 12 '25 00:11 jknlsn

there is a chance that it was merged right when a deploy script went off and it killed the commit ill recover it and merge it in again thansk for pointing it out

rekram1-node avatar Nov 12 '25 00:11 rekram1-node

it's backkkk: 0b86adbe997320c1a13e91899cace1ddd956a39a

rekram1-node avatar Nov 12 '25 00:11 rekram1-node