Reproduction #
- Open
/loginand choose the OpenCode Go account row (signin:opencode-go). - Name a new profile.
- Paste an API key at the key prompt and press Enter.
Actual: setup fails with "Invalid endpoint or API key." Expected: save the key account using the default OpenCode Go endpoint and continue to model selection.
Cause #
signInDraft in cli/internal/tui/login_profile.go initializes the extension and protocol but leaves BaseURL empty. This account-row path reaches the API-key prompt without visiting the endpoint form. The daemon validates the key-account endpoint through the generic OpenAI profile validator, which rejects the empty endpoint before contacting the provider. The error therefore misleadingly suggests the API key may be invalid.
Local fix and verification #
A local, uncommitted patch makes sign-in drafts inherit the matching provider wizard default URL (https://opencode.ai/inference/go/v1 for OpenCode Go). A real-daemon Go E2E regression scenario was added in cli/test/e2e/tui_login_test.go.
The CLI was rebuilt successfully and the reporter confirmed that account setup now works. The automated regression and full gate have not run: ./test.sh stops because Nix is unavailable in this environment. No fix has been committed or pushed yet.
Fixed in e372d573: sign-in drafts (OpenCode Go and Mistral, which had the same gap) start from the wizard's default endpoint via one shared source of defaults; the daemon's put_key now says whether the endpoint is missing, the endpoint is invalid, or the key is invalid. Test: e2e TestTUILoginOpenCodeGoSignInRowSavesAKeyAccount.