Repository navigation
prototype: one OpenCode row in /connect - #57918
Draft
kitlangton wants to merge 4 commits into
Draft
kitlangton wants to merge 4 commits into
kitlangton wants to merge 4 commits into
Conversation
…tion active marker, scope Go key to key attempts, e2e coverage)
…rst-connection step shows
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prototype for Dax's decision (D-1 "One OpenCode Row"). Draft only; not for merge as-is. Related: #57155 (offers OpenCode account sign-in on the Go row and reorders the rows). This is built on
dev, not on #57155.What it shows
/connectlists one OpenCode row instead of separate OpenCode Go and OpenCode Console rows. Go is an OpenCode account with a subscription, so picking OpenCode offers:Recordings are the real app: the TUI from a hermetic dev build (fresh data dir, private server), Desktop from a production build of
packages/appagainst the e2e fixture server. No real accounts.How
dialog-integration.tsx,dialog-select.tsx, +54/−10):foldOpenCodemergesopencode-gointo theopencoderow ("OpenCode"), relabels its methods, appends Go's key method, and folds in Go's saved credentials so they stay manageable from the one row. AWeakMaproutes the Go key method to theopencode-gointegration, so a Go key is still stored underopencode-goexactly as today. Each integration in the row keeps its own active-account marker (a new optional per-optioncurrentonDialogSelect).connect/dialog.tsx,accounts.ts,en.ts, +69/−31): the picker hidesopencode-gounless a Go API key is already saved (that row is where the key is managed today), names the row "OpenCode", and the Console intro offers Zen and Go API keys. The Go key goes toopencode-gothrough the existingkeyProviderhook, and only while a key attempt is in progress.Size
Real code +123/−41 (TUI +54/−10, Desktop +69/−31). Tests +374/−8.
Tests
packages/tui:integration-options.test.ts,dialog-integration.test.tsx,dialog-select.test.tsx(55 pass): one OpenCode row, method order, Go key posts to/api/integration/opencode-go/connect/key, hovering the Go key method picks Go, and the Console and Go active markers stay independent. The two new regression tests fail on the previous commit.packages/app:settings/providers/accounts.test.ts(2 pass): picker folds Go unless a Go key is saved.e2e/regression/settings.spec.ts: the 5 changed/new tests pass in one hermetic run (static build + fixture server): new copy, Zen key →opencodeand Go key →opencode-go, a provider with no integration never joins the connection, and Go key → Back → sign in posts OAuth toopencodeand lists only the Console workspace's models.tsc -bclean inpackages/tuiandpackages/app;settings.spec.tstypechecks (other e2e files already failtypecheck:e2eon dev).Not done / open
enchanged.Review (Astra,
openai/gpt-6-astra#high): changes needed → addressed"key", so both highlighted and hovering Go then Enter picked Zen. Fixed: method options use their position as the value. Test: hover the Go method, Enter, the key posts toopencode-go.activeCredentialIDskeeps the first (active) credential per integration, shown through a per-optioncurrent. Tests: unit test, plus a dialog test that switches Go keys and keeps the Console marker.Re-review of 06d43f4: production fixes correct;
DialogSelectchange safe for other callers. One bug in the new e2e fixture: the Go and integration-less providers existed before connecting, and any listed provider with models counts as an existing connection, so the "Connected to" step never showed. Fixed: before connecting only the keylessopencodecatalog exists; the key submission or OAuth completion adds the Go, integration-less and workspace providers in the refresh that follows. The three new tests and the two edited Console-intro tests now pass (5/5).