anomalyco / anomalyco/opencode

Prototype-key agent names receive invalid colors

Open Beginner friendly
#49,913 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

The app color helper reads built-in agent colors from a plain object without checking own properties. Custom agents named constructor or toString therefore resolve inherited Object.prototype values instead of a generated palette color, leaving session headers and sidebar items with an invalid CSS color value.

Plugins

None

OpenCode version

1.18.31

Steps to reproduce
  1. Call agentColor("constructor").
  2. Call agentColor("toString").
  3. Inspect the returned values.

Expected: each unknown agent name receives a generated var(--...) palette color.

Actual: the helper returns the inherited Object constructor or toString function.

Screenshot and/or share link

Not applicable; a focused helper call reproduces the invalid return value directly.

Operating System

All

Terminal

All

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.

Research direction

Start at the agentColor helper entry point and reproduce the issue with the names "constructor" and "toString". Confirm that unknown names return generated var(--...) palette colors rather than inherited Object.prototype values, then run the focused helper tests or add coverage for both names.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.