CLI for SidePulse
Python
Resolve OpenCode icon through LaunchServices
Peter Kuharbd1f78bceb87
diff --git a/src/sidepulse/status_bar.py b/src/sidepulse/status_bar.pyindex eb3853b..fd01b53 100644--- a/src/sidepulse/status_bar.py+++ b/src/sidepulse/status_bar.py@@ -4095,11 +4095,6 @@ def provider_icon_for_provider(provider: str):elif provider == "grok":image = app_icon("/Applications/Grok.app")image = image or grok_badge_icon()- elif provider == "opencode":- image = app_icon("/Applications/OpenCode.app")- image = image or image_for_symbol(- "chevron.left.forwardslash.chevron.right", "opencode"- )else:# Any other provider resolves its own app by name, so a new agent needs no branch# here. Only providers with an alias or a custom glyph need one.diff --git a/tests/test_status_bar_ui.py b/tests/test_status_bar_ui.pyindex 0e7a19f..6c632cc 100644--- a/tests/test_status_bar_ui.py+++ b/tests/test_status_bar_ui.py@@ -419,6 +419,16 @@ class IconTests(StatusBarTestCase):sb.provider_icon_for_provider(provider)self.assertIn(bundle, looked_up)+ def test_opencode_uses_generic_app_resolution(self):+ """OpenCode may be registered outside the system Applications directory."""+ expected = NSImage.alloc().initWithSize_((18, 18))+ sb._provider_icon_cache.pop("opencode", None)+ self.addCleanup(sb._provider_icon_cache.pop, "opencode", None)+ with patch.object(sb, "provider_app_icon", return_value=expected) as resolve:+ image = sb.provider_icon_for_provider("opencode")+ resolve.assert_called_once_with("opencode")+ self.assertIs(image, expected)+def test_unmapped_provider_tries_its_own_app_before_the_glyph(self):"""The terminal glyph always returns an image, so it hides a missing lookup.