Repository navigation
fix: show OpenCode Go accounts signed in with OpenCode Console OAuth - #62
Conversation
OpenCode stores a Console OAuth sign-in under the `opencode` integration with the `device` method instead of as an `opencode-go` API key, so Tally dropped the Account. Inventory now reads those rows as OpenCode Go Accounts and keeps excluding Console API keys, which alias Zen keys. The Go usage endpoint accepts the Console access token as a Bearer credential. Each stored credential records its OpenCode integration so Account switching queries the integration that owns the row. OpenCode session ID: ses_eaa9b13a4ffe3y8cnB5oTsHncf using model: anthropic/claude-opus-5-5
MaxAnderson95
left a comment
There was a problem hiding this comment.
Code Review by OpenCode using GPT-6 Astra
Pull Request Review
No actionable defects found in the reviewed SHA. Reviewed all five changed files, inventory filtering and identity reconciliation, credential expiry handling, Account activation, downstream Go collection and warm-up routing, and the added synthetic test coverage against the repository instructions, glossary, specification, and ADRs. No earlier review findings were present.
The Console integration/method and OAuth expiry representation match OpenCode v2.0.32. Its packages/console/app/src/lib/inference-proxy.ts also forwards the legacy Go usage and Responses routes to /go/v1/usage and /go/openai/v1/responses, preserving bearer authentication. The legacy warm-up URL alone therefore does not establish an endpoint defect.
Verification: git diff --check origin/main...6f4f2aad passed. I did not rerun Swift tests or make live credential, provider-message, or reset requests. Console warm-up behavior remains unverified at runtime; the author's reported test and live usage results are not independent verification by this review.
Confidence Score: 4/5
Originally created in OpenCode session ID: ses_eaa94669bffei7hctcbDYbTX3l using model: openai/gpt-6-astra
After removing OpenCode Go and reconnecting it through OpenCode's OAuth sign-in instead of an API key, the Account disappeared from Tally.
OpenCode stores that sign-in as an "OpenCode Console account":
integration_id = 'opencode', an OAuth value withmethodID: "device", and Console metadata (server,accountID,orgID,orgName). Tally only readopencode-goAPI-key rows, so it skipped the credential. Go's usage endpoint (https://opencode.ai/zen/go/v1/usage) accepts the Console access token as a Bearer credential: it returned the rolling, weekly, and monthly meters with the real token and HTTP 401 with no token or a bogus one.Changes
OpenCodeInventoryreadsopencodeOAuth rows with thedevicemethod asopencode-goAccounts. Console API keys underopencodestay excluded because they alias Zen keys. OAuth expiry is carried through, so an expired token waits for OpenCode to refresh it like the other OAuth providers.StoredCredentialrecords the OpenCode integration that owns the row.OpenCodeSelectionuses it forapi/integration/<id>, so switching to a Console Account queriesopencoderather thanopencode-go. The local OpenCode service lists the row under/api/integration/opencode.docs/SPEC.mdnames Console OAuth sign-ins as a Go usage source.Verification
SDKROOT=.../MacOSX26.sdk bash scripts/test-swift.sh --build-system native: 103 tests passed locally (Command Line Tools toolchain, not CI-equivalent).discoversReadOnlyGoInventorycovers an included Consoledevicerow and an excluded Console row with another method.accountSelectionUsesAuthenticatedOpenCodeAPIAndChecksDatabasecovers switching to a Console Account.opencode-goAccount and collected its Go usage windows. The test file was deleted.Not verified: warm-up message sends with a Console token. Model listing on
zen/go/v1/modelsworks with it, but OpenCode routes Console inference throughhttps://opencode.ai/inference/go/openai/v1, so warm-up may need that endpoint. A Console sign-in without a Go subscription will appear as a Go Account and is expected to report an entitlement error.Originally created in OpenCode session ID: ses_eaa9b13a4ffe3y8cnB5oTsHncf using model: anthropic/claude-opus-5-5