Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ All notable changes to the **OpenCode Go BYOK Provider** extension are documente

## [Unreleased]

### Fixed
### Added

- **`[Usage]` Per-profile Go usage tracking for multi-account setups (issue #63).** Users can now add multiple OpenCode Go entries in the Manage Language Models panel, each with its own API key. The extension automatically creates a "Profile 1", "Profile 2", etc. on the first request sent with each key. Profiles have isolated storage and the active profile auto-switches to the most recently used model. The SVG hover card and status bar show the active profile label. Click the status bar to open the QuickPick with profile switch options. Commands: `Rename Active Profile` and `Delete Active Profile`. In single-key mode the extension behaves exactly as before; the feature only activates when a second key is detected. No SQLite consultation in multi-key mode (opencode.db is shared per-machine and cannot be attributed to a specific key).

- **`[Usage]` Monthly cost aggregation now respects the subscription anchor.** The monthly window was using calendar month after a regression, but OpenCode Go billing is anchor-based (subscription day/hour). The tracker now derives the window from three tiers: (1) user-configured anchor via "Set spent targets", (2) auto-anchor from the earliest SQLite row (matching actual billing start), (3) calendar month fallback. Also fixes `setManualSpentTargets` which previously computed the monthly cost for the old window before storing the anchor, causing tracked+baseline to mismatch the target. Now reads SQLite costs directly using the prospective window (with the new anchor).

## [0.3.7] — 2026-07-09

Expand All @@ -18,6 +19,10 @@ All notable changes to the **OpenCode Go BYOK Provider** extension are documente

- **`[Streaming]` `[stream-summary]` log now reports total reasoning characters accurately.** Previously, `reasoningChars` in the log reflected only the remaining `reasoningContent` string, which is cleared by `flushToolCalls` (for tool-call replication) and `flushReasoningFallback` — so the metric showed `0` even when reasoning was streamed. Now tracks a monotonic `totalReasoningChars` counter that survives clears, giving accurate per-response reasoning metrics for debugging.

### Fixed

- **`[Usage]` Monthly cost aggregation now respects the subscription anchor.** The monthly window was using calendar month after a regression, but OpenCode Go billing is anchor-based (subscription day/hour). The tracker now derives the window from three tiers: (1) user-configured anchor via "Set spent targets", (2) auto-anchor from the earliest SQLite row (matching actual billing start), (3) calendar month fallback. Also fixes `setManualSpentTargets` which previously computed the monthly cost for the old window before storing the anchor, causing tracked+baseline to mismatch the target. Now reads SQLite costs directly using the prospective window (with the new anchor).

## [0.3.6] — 2026-07-08

### Fixed
Expand Down
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,32 @@ Per-model reasoning configuration, dynamically enhanced with `reasoning_options`
- **Response usage bar** — latest prompt/output/total/cache summary after each response.
- **Normalized usage DataPart** — emits `usage` MIME so Copilot Chat's context widget shows accurate token counts.

#### Multiple Go accounts

You can use more than one OpenCode Go account in the same VS Code window.
When a **second** Go API key is added via the Manage Language Models panel,
the extension creates a new usage profile ("Profile 1", "Profile 2", etc.)
on the first request made with each key.

- **Auto-switch** — the status bar and SVG hover card follow the model you
last used. If you chat with a model from a different account, the panel
switches automatically.
- **QuickPick** — click the status bar to see which profile is active and
switch to another profile.
- **Commands** — `OpenCode Go: Rename Active Profile` and `OpenCode Go:
Delete Active Profile` help you manage your profiles. The label you give
a profile appears in the status bar and SVG title.
- **Storage isolation** — each profile has its own `globalState` storage
namespace (`opencodego.usageLog.v1.<fingerprint>`) so data never mixes.
- **SQLite** — when 2+ profiles exist, the extension does not consult the
shared `opencode.db` (which is per-machine and cannot be attributed to a
specific API key). Accuracy falls back to in-memory entries for
multi-account setups.

> **Upgrading from a single-account install?** Your existing usage data
> is migrated into Profile 1 the first time a second profile is created.
> Your original stats are preserved — nothing is lost.

### 🪟 Agents Window (Copilot CLI) Support

OpenCode models appear in the VS Code **Agents window** model picker when starting a Copilot CLI / Background agent session — not just the regular Chat view. Two sets of models are available:
Expand Down
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@
{
"command": "opencodego.showUsageQuickPick",
"title": "OpenCode Go: Show Usage Quick Pick"
},
{
"command": "opencodego.renameActiveProfile",
"title": "OpenCode Go: Rename Active Profile"
},
{
"command": "opencodego.deleteProfile",
"title": "OpenCode Go: Delete Profile"
}
],
"configuration": {
Expand Down
Loading
Loading