Repository navigation
Releases
Releases · felipesotero/opencode-hard-limit
v0.19.2
Fixed
- OpenAI quota stayed
unavailableon OpenCode V2 even after signing in again.
V2 keeps credentials in its own database and no longer updatesauth.json,
so the reader kept using a stale token. The server plugin now asks OpenCode
for the active OpenAI credential (ctx.integration.connection), and the
sidebar reads it fromclient.credential.list().auth.jsonremains the
fallback. Credentials owned by OpenCode are never refreshed or rewritten by
this plugin, so OpenCode's own refresh token is not invalidated.
Full Changelog: v0.19.0...v0.19.2
v0.19.0
Added
- OpenCode 2.x support. The default export is now a plugin definition with
idandsetup(ctx); the quota gate runs on thecontext,compactionand
generatesession hooks, and idle refresh usessession.idleevents. opencode-hard-limit/tuiexport: the sidebar as a 2.x TUI plugin
(sidebar.contentslot), loaded from the samepluginsentry as the server
part. Nothing is copied into the config dir on 2.x.- The 1.x entry point stays available through
server()on the same default
export, so one package works on both major versions.
Changed
- The programmatic 1.x factory is now
QuotaHardStopPlugin.server({ directory, client }).
The namedQuotaHardStopPluginexport is gone; the default export is an object. - OpenCode 1.x needs 1.18.29 or newer, the first version that accepts an object
as a plugin's default export. opencode-hard-limit installdetects the OpenCode major version
(opencode --version). On 2.x it adds the package to thepluginskey of
opencode.json, drops our oldpluginentry, and removes the sidebar copy
and itstui.json/cli.jsonentries left by 1.x installs. On 1.x, or when the
version cannot be detected, it keeps the previous behavior.opencode-hard-limit uninstallclears both thepluginandpluginskeys
and the sidebar entries intui.jsonandcli.json.
Full Changelog: v0.18.1...v0.19.0
v0.18.1: Multi-account documentation
Documentation
- README: guide for single vs. multi-account usage, a settings table, and a
"what's new in 0.18.0" section. No code changes.
Full Changelog: v0.18.0...v0.18.1
v0.18.0: Multi-account quota, 429 handling and warm
With a single account nothing changes: no new setup, same threshold.
Added
- Multi-account quota: named Claude profiles and OpenAI/Codex account stores are
read per account, the gate checks the account that serves each request, and
the sidebar shows one row per account. warmandwarm --watchcommands that keep idle Claude profiles logged in
by refreshing their OAuth tokens. Opt-in: they never run unless called.
warmrefreshes only expired profiles, with per-account backoff, and runs
its child process with isolated args, a clean environment and group kill.
Changed
- A server-sent
Retry-Afteron a 429 is capped (maxRateLimitBackoffMs,
10 min;noBaselineRateLimitBackoffMs, 1 min when there is no earlier
reading), and good data keeps being served through the blip. - A transient error (timeout, 5xx, malformed response) no longer blocks on its
own. The gate keeps using the last good reading and blocks only when that
reading is below the threshold, or is too old and close to it
(staleBlockMarginPct). - A named Claude profile whose OAuth token has expired is allowed through with
a warning, so the call itself can renew the token. ~/.claudeis no longer treated as an extra account beside named profiles.- Quota account resolution is unified between the gate and the library.
Full Changelog: v0.17.0...v0.18.0
v0.17.0: Star prompt, Anthropic multi-account credentials and packaging fix
Added
initandinstallask once, on an interactive terminal, whether to star the
repo on GitHub. Starring needs an explicit yes and goes through your own
authenticatedgh; the plugin handles no GitHub token. Skip it with
--no-star,OPENCODE_QUOTA_NO_STAR=1orCI.- Tiered Anthropic credential resolution for
opencode-anthropic-multi-account:
reads itsaccounts.jsonfirst, falls back to OpenCode'sauth.json, and
keeps the legacyclaudeCLI/keychain path for single-account users. Cache
entries are stamped with an account key, so switching accounts forces a fresh
read. New config:anthropicAccountsFile,anthropicCredentialSource.
Fixed
- The published CLI crashed with
ERR_MODULE_NOT_FOUNDbecauselib/star.js
was missing from thefilesallowlist of the tarball. - The star prompt no longer appears on
set, only oninitandinstall.
Tests
test/package-files.test.jschecks that every relative import reachable from
bin/cli.jsandquota-hard-stop.jsis listed infiles.
What's Changed
- Ask once, on install, whether to star the repo on GitHub by @roalhadeff in #2
New Contributors
- @roalhadeff made their first contribution in #2
Full Changelog: v0.15.0...v0.17.0
v0.15.0: Global CLI install on startup
Added
- When the server plugin starts, it installs the matching published package
globally in the background, soopencode-hard-limitis available in OpenCode
shell mode (for exampleopencode-hard-limit postpone 30).
Full Changelog: v0.14.3...v0.15.0
v0.14.3 — Fail-postpone mode
Fail-postpone mode (new, opt-in)
A third quota-block failure mode alongside fail-closed/fail-open: manually
and temporarily bypass an otherwise-legitimate block when you've decided to
accept the risk of running over quota for a while.
- New
allowPostponeconfig flag (--allow-postpone,OPENCODE_QUOTA_ALLOW_POSTPONE), disabled by default. - New CLI:
opencode-hard-limit postpone [minutes](default 30, clamped 1-240) andopencode-hard-limit postpone --clear. - Runs entirely via OpenCode's native shell-escape (
!command) — no LLM call, no token cost. - When enabled, a block's error message and the sidebar widget both surface a hint on how to postpone.
opencode-hard-limit getshows whether a postpone is currently active and how much time is left.
Fixes
- Sidebar widget crashed entirely on OpenCode restart because the deploy step
didn't shiplib/postpone.jsalongside the sidebar plugin — fixed. - Simplified the quota-block error message; removed AI-directed instruction
text that had no effect (a blocked subagent'schat.paramsthrow happens
before any model text is generated, so OpenCode'stasktool has nothing
to relay to the parent — documented as a known upstream limitation in the
README instead of working around it with unreliable message text). - Clarified that OpenCode's shell mode only triggers when
!is the first
character typed into an empty prompt — pasting the whole
!opencode-hard-limit postpone 30line at once does not switch modes.
The block message, sidebar hint, and README now instruct: type!first,
then paste justopencode-hard-limit postpone 30(without the!).
Docs
- New README "Fail-postpone mode" section: how to enable, the shell-escape
mechanism, the type-then-paste caveat, and the subagent limitation.
Full diff: v0.12.2...v0.14.3