anomalyco / anomalyco/opencode
Prototype-key agent names receive invalid colors
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
- Call
agentColor("constructor"). - Call
agentColor("toString"). - 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
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.
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