Skip to content

v2.1.0

Choose a tag to compare

@github-actions github-actions released this 20 Oct 09:09
· 251 commits to main since this release

Windows works

2.0.3 did not work on Windows: setup, sign-in and every request stopped with Native custody refused: invalid-token. 2.1.0 fixes this (#397, #398).

  • The plugin finds its Windows library. The OpenCode package bundled the library that protects your login files without that library's Windows binary, so every file check refused. The package now installs that library and the other Core runtime packages as normal dependencies and loads them from there, binary included (#397).
  • Owner-only checks use Windows permissions. Several checks read Unix-style permission bits, which Windows always reports as readable by everyone. That caused "Anthropic runtime file is not owner-only regular storage" and "Anthropic account migration journal is invalid". On Windows these checks now read the file's Windows access-control list, and new private files and folders are created with owner-only permissions from the start. macOS and Linux keep their exact previous checks (#398).
  • Saves no longer time out. On Windows, saving a settings file could fail with "Publication deadline expired" before the first attempt was even made. That is fixed. Saves on Windows also retry for up to half a second when another program, such as antivirus or a file indexer, briefly holds the file (#398).
  • Sign-in URL on its own line. setup --login printed the sign-in URL inside a text box, so it could not be clicked or copied cleanly. It is now printed on its own line (#398).
  • The refusal reason is logged. When the vault-enrollment check refuses, the plugin log now records where it failed and the error code, for example safe-parent and unsupported-filesystem, without paths or secrets. The on-screen message is unchanged. If setup cannot save its own error log, it now also prints the error codes on screen.
  • Tested on Windows before every release. Each release is now packed once, installed in a fresh profile on GitHub's Windows runners (Windows Server 2022, the current Windows Server and Windows 11 on ARM) and run through setup. Publishing waits for that check to pass. The check runs a local (non-vault) OpenCode setup.

What's new

  • Claude Code 2.1.302 identity. Requests now present as Claude Code 2.1.302 instead of 2.1.280, matched against a captured 2.1.302 session: user agent, billing block, request headers and beta lists. Beta lists now follow the kind of request (a conversation turn, a quota check, or a title or summary) the way Claude Code chooses them. After upgrading, each ongoing session rewrites its prompt cache once, on its next request; after that the cache works as before.
  • Compressed requests. Like Claude Code 2.1.302, requests of 4,096 characters or more sent directly to api.anthropic.com are now gzipped. Requests through a proxy, a custom CA or client certificates, API-key routes and relays stay uncompressed. If something along the way rejects a compressed request, OpenCode 1 and Pi resend it once uncompressed and stop compressing; after a proxy rejection this lasts seven days. OpenCode 2 cannot resend, so that one request fails and the next goes out uncompressed. Set CLAUDE_CODE_GZIP_REQUEST_BODIES=0 to turn compression off. See transports.
  • Vault outages keep serving. If the vault cannot be reached, vault accounts keep working with the last credential they received, as long as it has more than a minute left. That credential is held in memory only, never written to disk. Once the vault is known to be down, requests use it right away instead of waiting on the vault, and the plugin checks in the background for the vault to come back. A slow or restarting vault also no longer holds up a request: connecting to it gives up after 2 seconds.
  • Refusal recovery backs off. When Claude refuses on the model you picked, OpenCode 1 answers with Opus 4.8 and then tries your model again. It now waits longer each time your model refuses again: 10 Opus 4.8 responses after the first refusal, 20 after the next, then 40 after every refusal after that. It always goes back to the model you picked and never stays on Opus. Ten successful responses in a row on your model reset the wait to 10. Picking another model or ending the session clears it; restarting OpenCode does too. Recovery also no longer sends a cache-warming request to your model after each Opus response. Those requests could not reuse the cache and mostly failed. The same rules apply in legacy fallback mode.
  • Vault account changes arrive as notices. OpenCode 1, OpenCode 2 and Pi now follow account changes from vault notices and check the vault's account list only every 5 minutes while notices work. With an older vault they keep today's pace.
  • Vault quota from insula. In vault mode, quota readings now come from insula, the quota monitor the CortexKit vault runs for all plugins, instead of each plugin asking Anthropic separately. If insula has no current reading for an account, the plugin asks Anthropic for that account as before.
  • Setup shown as npx. Setup help, docs and every remedy message now say npx @cortexkit/opencode-anthropic-auth setup. bunx still works.

What's fixed

  • Vault setup with no usable Claude account. Setup said "The vault has no verified default Claude account" even when the account existed but the host's read grant reached none of your Claude logins. Setup now says which: with no read grant for the host, it prints the ck auth grant command that adds one; with a grant that reaches no Claude login, it suggests ck auth reclassify --from-registry and checking your logins with ck auth status. Older vaults that don't report what a grant reaches keep the previous message (#354).
  • Setup failure after vault enrollment. When setup fails after vault enrollment began, it now prints one line per host: connected to the vault, not connected, or unknown (check with ck auth status). A host left connected also gets the steps to disconnect or finish. A failure before enrollment began no longer reports a host connected by an earlier run.
  • Collapsed sidebar quota line. The collapsed OpenCode sidebar now draws quota with the same short line as the other CortexKit plugins. A 5-hour or 7-day window without a reading is left out instead of shown as a dash: 5h 87% · 7d — left becomes 5h 87% left. An account with no reading at all still shows a muted —, and old readings are still dimmed.
  • Vault default account shown once. When the vault's default account needed a new sign-in, the sidebar showed it twice: as main and again as a fallback. It now shows once, as main, with "needs sign-in in the vault" (#392).
  • Collapsed sidebar no longer flickers. Every sidebar update rebuilt each account row, which briefly drew at the wrong width. Rows are now kept and only their text changes (#379).
  • Credit amounts are back. 2.0.3 showed only a percentage for extra-usage credits. /claude and the expanded sidebar show the amounts again after it, for example credits 75% left · $25.00/$100.00. The collapsed one-line view still shows the percentage (#390).
  • Why a cache keepalive failed. A failed CacheKeep request now records a short error summary (status and error type) in the request dump and log, without any prompt text or provider message. Before, only the HTTP status was kept.

Compatibility

  • Shared CortexKit libraries move to @cortexkit/common-auth 0.21.1, @cortexkit/claustrum-client 0.12.0 and @cortexkit/subc-client 0.22. These are internal; nothing to change on your side.
  • The OpenCode package now installs Core and its runtime packages as regular dependencies instead of bundling them.
  • Tested with the OpenCode plugin SDK 1.19.0 and the Pi SDK 1.2.0. Supported OpenCode and Pi versions are unchanged: Pi 0.86 and Pi 1.x remain supported, and the OpenCode sidebar is built for OpenTUI 0.6.

Upgrading

From 2.0.x, update the plugin and restart OpenCode or Pi. No setup step is needed. Setup records the plugin with the version it ran, for example @cortexkit/opencode-anthropic-auth@2.0.3 in your OpenCode config; change that to @2.1.0.

From 1.x, follow the 2.0.0 upgrade steps: quit every OpenCode, LiteCode and Pi process, then run npx @cortexkit/opencode-anthropic-auth@2.1.0 setup.