From e2521752a4d811eff3d5099e06f820cb8a998954 Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Sat, 4 Jul 2026 15:13:35 -0700 Subject: [PATCH] Use official OpenCode SVG icon instead of remote favicon Replaces the remote favicon loading for OpenCode with a local SVG icon. This avoids flaky external network requests and ensures the icon renders properly across light and dark themes using theme-aware currentColor. --- .../components/agent/AgentCombobox.test.tsx | 10 ++++++++++ src/renderer/src/lib/agent-catalog.tsx | 5 ++++- src/renderer/src/lib/agent-icon-glyphs.tsx | 20 +++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/components/agent/AgentCombobox.test.tsx b/src/renderer/src/components/agent/AgentCombobox.test.tsx index f1b44096213..8698d4b0295 100644 --- a/src/renderer/src/components/agent/AgentCombobox.test.tsx +++ b/src/renderer/src/components/agent/AgentCombobox.test.tsx @@ -27,4 +27,14 @@ describe('AgentCombobox', () => { expect(markup).not.toContain('https://github.com/Gitlawb.png') expect(markup).not.toContain(' { + const markup = renderToStaticMarkup() + + expect(markup).toContain(' id: 'opencode', label: translate('auto.lib.agent.catalog.e7a4ca5103', 'OpenCode'), cmd: 'opencode', - faviconDomain: 'opencode.ai', homepageUrl: 'https://opencode.ai/docs/cli/' }, { @@ -336,6 +336,9 @@ export function AgentIcon({ if (agent === 'copilot') { return } + if (agent === 'opencode') { + return + } const catalogEntry = getAgentCatalog().find((a) => a.id === agent) if (catalogEntry?.iconUrl) { return ( diff --git a/src/renderer/src/lib/agent-icon-glyphs.tsx b/src/renderer/src/lib/agent-icon-glyphs.tsx index 1bf69207005..420c34f80fa 100644 --- a/src/renderer/src/lib/agent-icon-glyphs.tsx +++ b/src/renderer/src/lib/agent-icon-glyphs.tsx @@ -112,6 +112,26 @@ export function CopilotIcon({ size = 14 }: { size?: number }): React.JSX.Element ) } +export function OpenCodeIcon({ size = 14 }: { size?: number }): React.JSX.Element { + // SVG geometry sourced from opencode.ai/brand's official logo asset. + // Why: the branded fills are adapted to currentColor so the mark is visible + // in both Orca themes and avoids the flaky favicon proxy. + return ( + + + + + ) +} + export function AgentLetterIcon({ letter, size = 14