Repository navigation
Releases
v4.0.1
Patch Changes
89bf7c3Thanks @shljsl75891! - Bump reported Claude Code version to 2.1.280. Opus 5.5 requests failed withclaude_code_version_too_oldbecause the reported version (2.1.258) was too old.
v3.0.8
Patch Changes
4948dc6Thanks @shljsl75891! - Bump reported Claude Code version to 2.1.280. Opus 5.5 requests failed withclaude_code_version_too_oldbecause the reported version (2.1.258) was too old.
v4.0.0
Major Changes
-
Port the plugin to the OpenCode v2 plugin API. OpenCode v2 removed the v1
authhook and providerfetchoverride this plugin relied on, so this is a breaking change — this release requires OpenCode v2 and is no longer loadable by OpenCode v1 (pin to a3.xrelease if you're still on OpenCode v1).- The package now exports a v2
Plugin.define({ id, setup })default export instead of the v1 namedAnthropicAuthPluginfunction. - Claude Pro/Max OAuth is now registered through
ctx.integration.transform, with token refresh wired into OpenCode v2's integration refresh lifecycle (still with a plugin-level single-flight guard against concurrent refreshes racing a rotating refresh token). - Anthropic request/response rewriting (OAuth headers, beta flags, body/tool-name transforms, hybrid prompt caching, server-side fallback,
ANTHROPIC_BASE_URL) now runs throughctx.session.hook('http.request' | 'http.response', ...), gated to native Anthropic requests using this plugin's OAuth connection. - The "Create an API Key" console OAuth method (which minted and stored an Anthropic API key) is dropped — OpenCode v2's plugin API doesn't support an OAuth flow that ends in a stored API key. Manual API key entry and
ANTHROPIC_API_KEYcontinue to work via OpenCode's built-in Anthropic integration. - Anthropic models billed through this plugin's OAuth connection go back to showing no API price, restored via
ctx.model.transform(OpenCode v2's registrations are disposable, unlike the v2 prerelease API this was previously blocked on). ANTHROPIC_INSECUREis not supported under OpenCode v2: request hooks can rewrite aRequestbut can't disable TLS verification for it. The plugin now logs a warning instead of silently leaving it unapplied.- The quota sidebar (
./tuiexport) is rewritten against OpenCode v2's TUI plugin API (ui.slot,data.on, the restructuredtheme.text.*tokens).
- The package now exports a v2
Patch Changes
-
035c555Thanks @shljsl75891! - Tighten prompt-cache prefix stability in two places.Parallel tool calls no longer shrink the cache bridge. Anthropic's
20-block cache lookback counts a run of consecutivetool_useblocks —
or of consecutivetool_resultblocks — as a single position. The bridge
anchor's distance math was counting every block, so a turn with many
parallel tool calls overflowed the window early and placed the bridge
nearer than necessary, leaving older cached prefix unreachable. Runs now
count as one position, matching the documented behaviour.Fixing that also surfaced an existing off-by-one in the same distance
math: the walk started one message before the latest anchor, so neither
the latest anchor's own blocks nor the candidate bridge's own anchor block
counted toward the 20-position limit. That let the bridge land outside
Anthropic's actual reachable window. Both anchors' own positions are now
included, matching Anthropic's documented rule that the lookback counts
the breakpoint itself as the first position.Tool definitions are sorted by name. A change anywhere in
tools[]
invalidates the entire cached prefix. MCP servers that attach after the
first turn could reorder the array between requests; sorting makes the
order deterministic regardless of attach timing.
v3.0.7
Patch Changes
-
035c555Thanks @shljsl75891! - Tighten prompt-cache prefix stability in two places.Parallel tool calls no longer shrink the cache bridge. Anthropic's
20-block cache lookback counts a run of consecutivetool_useblocks —
or of consecutivetool_resultblocks — as a single position. The bridge
anchor's distance math was counting every block, so a turn with many
parallel tool calls overflowed the window early and placed the bridge
nearer than necessary, leaving older cached prefix unreachable. Runs now
count as one position, matching the documented behaviour.Fixing that also surfaced an existing off-by-one in the same distance
math: the walk started one message before the latest anchor, so neither
the latest anchor's own blocks nor the candidate bridge's own anchor block
counted toward the 20-position limit. That let the bridge land outside
Anthropic's actual reachable window. Both anchors' own positions are now
included, matching Anthropic's documented rule that the lookback counts
the breakpoint itself as the first position.Tool definitions are sorted by name. A change anywhere in
tools[]
invalidates the entire cached prefix. MCP servers that attach after the
first turn could reorder the array between requests; sorting makes the
order deterministic regardless of attach timing.
v3.0.6
Patch Changes
-
7e3d236Thanks @shljsl75891! - Fix the quota sidebar freezing at its first-render values and never updating.OpenCode's Solid JSX transform skips files under
node_modules, which is
where npm-installed plugins load from (see
opencode#33884).
Without that transform, JSX props are evaluated once instead of compiled
into reactive getters, so the sidebar'screateSignal/createEffect/Show
usage rendered correctly on first paint and then never changed again.tui.tsxnow renders a fixed tree once and drives all updates — quota
percentages, bars, and the "resets in ..." countdown — from a plain
setIntervalwriting directly to the rendered nodes, plus the existing
message.updated/session.updatedevent refresh. This has no dependency
on Solid's reactive transform, so it works the same whether the plugin
loads fromnode_modulesor a local path.Also switched
usedPercentback toMath.roundfromMath.ceil(0.081
utilization now shows 8%, not 9%).
v3.0.5
Patch Changes
- Never fail a request over quota harvesting: a
resetheader that is finite but outside the rangeDatecan represent (e.g.1e308) madetoISOString()throw from outside the best-efforttry, surfacing as a failed API call. Reject unrepresentable dates and harvest entirely inside the guard. - Fail retryably instead of leaking a fallback block: when an SSE event exceeded the 1 MiB buffer with no delimiter, the server-side-fallback rewriter forwarded the partial buffer as if it were a whole event, so a half-parsed
fallbackblock passed through unrewritten. Raise the existing retryable stream error instead. - Keep the sidebar's "resets in ..." countdown ticking between requests, rather than freezing until new quota data arrives.
v3.0.4
Patch Changes
- Actually fix the TUI sidebar failing to load from npm: 3.0.3's
tsconfig.json-at-package-root fix didn't work either — Bun resolvesjsxImportSourcefor atsconfig.jsonrelative toprocess.cwd()at import time, not relative to the imported file's directory, so it's never consulted once the host process's cwd is the user's project directory instead of the plugin's own package dir. Replace thetsconfig.jsonapproach with a per-file/** @jsxImportSource @opentui/solid */pragma comment intui.tsx, which Bun honors regardless of cwd. Verified end-to-end against a realnpm packtarball imported from an unrelated working directory.
v3.0.3
Patch Changes
- Fix the TUI sidebar still silently failing to load from npm even after 3.0.1's
filesfix:tui.tsxneedsjsxImportSource: "@opentui/solid"to transpile, which Bun reads from atsconfig.jsonat the installed package's root (the directory containingpackage.json) — atsconfig.jsonnested undersrc/is not picked up oncenode_modules/package.jsonestablish that root. Without it, Bun defaults to the React JSX runtime and fails resolvingreact/jsx-dev-runtime, silently, with no log output. Ship the existing roottsconfig.jsonin the published package and added packaging-test coverage asserting it's present.
v3.0.2
Patch Changes
- Fix npm-installed plugin loading by exporting the OpenCode package-plugin module shape (
{ id, server }). The previous named-only export worked as a legacy file-drop plugin but was ignored for package installs, causing OpenCode to fall back to native Anthropic API-key auth.
v3.0.1
Patch Changes
- Fix the TUI sidebar silently failing to load when installed from npm: the published
fileslist includedsrc/tui.tsxbut not the sibling modules it imports at runtime (src/quota-format.ts,src/quota-headers.ts,src/quota-state.ts), so the import resolved nothing outside a local checkout. Added a packaging test that walks the relative-import graph fromsrc/tui.tsxand asserts every reachable file is included innpm pack's file list.