* fix(usage): support OpenCode v2 usageSession, session scopes, and Codex opencode.db logins
- Implement usageSession() on OpenCodeV2Session with provider "opencode",
authoritative model tracking (info.model falling back to config.model),
effective provider + launch harness environment, and a stable sessionKey.
- Read active and migrated OpenAI OAuth logins from OpenCode v2's opencode.db
in codex-usage-source (honoring absolute/relative OPENCODE_DB, active=1 or
migrated active IS NULL, falling back to v1 auth.json, and normalizing
provider to "opencode").
- Add OpenCode session-scope discovery to built-in usage sources OpenCode
serves (opencode-go, minimax, zai, kimi, grok, copilot, openrouter-host).
Co-authored-by: Jiayang Wu <651475459@qq.com>
* fix(usage): keep Copilot/Kimi default visibility hints and deduplicate session discovery helpers
---------
Co-authored-by: Jiayang Wu <651475459@qq.com>
* fix(usage): keep existing logins visible and explain unavailable quota
Credential discovery must preserve accounts whose login exists even when it has expired. Keep vendor failures on the discovered account and isolate discovery failures without inventing provider cards.
* test(usage): align credential route tests with account discovery
* fix(app): hide the sidebar Usage item while it has no summary
Without a summary window with data, the item fell back to a plain "Usage"
row that duplicated the footer's Usage icon. It now renders nothing, and the
footer rows leave it out so an otherwise empty rows block and its separator
disappear with it.
* fix(desktop): restore built-in usage in packaged apps
The external plugin compiler cannot traverse app.asar, and dependency packaging drops declarations needed by import validation. Ship complete built-in resources beside the archive and verify registration in the packaged desktop smoke check.
* fix(usage): restore login discovery across harnesses
Discover subscription accounts independently of agent sessions and retain each account’s logins in preference order so an unusable credential can fall back to another login for the same account.