Add OpenCode AI client connect support and fix missing favicon#435
Conversation
|
Thanks for this — really clean PR. The test coverage is the most thorough we've seen for a Connect client (HTTP handler + service + CLI + frontend), and the round-trip preservation logic in Reviewed against four maintainer concerns and all four pass:
Blocker — Windows CI: Quickest fix is two func TestConnect_OpenCode_RequiresExistingConfigFile(t *testing.T) {
- svc, _ := testService(t)
+ svc, home := testService(t)
+ t.Setenv("LOCALAPPDATA", filepath.Join(home, "AppData", "Local"))
_, err := svc.Connect("opencode", "", false)Same Once Windows is green this is merge-ready — would like to land it ahead of our spec-046 stack (#433, #434) since it's a clean adapter addition. Let me know if you'd prefer to push the fix yourself or want me to do it. |
The Windows-only `Build Binaries (windows-latest, …)` job failed because
ConfigPath("opencode", homeDir) reads %LOCALAPPDATA% from the real
environment on Windows and only falls back to homeDir/AppData/Local when
the env is unset. On the CI runner LOCALAPPDATA points at the runner's
real profile, so the test that asserts "config does not exist" hit a
path outside the t.TempDir() and broke the isolation contract.
Fix is two-fold:
- internal/connect/connect_test.go: t.Setenv LOCALAPPDATA in both
testService and testServiceWithKey helpers so every test inherits the
pinned path automatically (and any future opencode test will too).
- internal/httpapi/connect_test.go: same t.Setenv pattern in the two
TestHandleConnectClient_OpenCode* tests that don't go through the
service helper.
No production code change. Verified locally on macOS:
go test ./internal/connect/... ./internal/httpapi/... — both PASS.
|
Merged — thanks again Jason. Squash-merged into main; landed ahead of the spec-046 stack as planned. |
|
@Dumbris Awesome, and thank you for the compliments, the fix and the awesome app! I had some more ideas of things that might be cool to add, but I will make some issues out of them first to check with you |
|
Description
This PR adds OpenCode as a first-class connect/disconnect client across backend, CLI, and web UI, and tightens related client UX.
What changed
Backend
opencodeto the connect client registry~/.config/opencode/opencode.jsonon macOS/Linuxmcpmcpsubtree onlyserver_nameAPI
400409CLI
Frontend
server_name?: stringto connect status typingserver_nameFavicon / browser tab icon
frontend/public/favicon.svgbased onassets/logo.svgfrontend/index.htmlto use the normal Vite public-asset favicon pathDocs
Verification
Ran and tested locally