r/opencode • • 14h ago

The "free limit reached" card in OpenCode Desktop replaces your composer — I patched it out (2 commands, MIT)

The "You've reached your free limit" card doesn't just tell you the quota is gone — it **replaces the composer**. You can't type, can't switch model, and the chat you were reading is half covered. And it comes back after every app update.

I got tired of it and patched the renderer bundle inside the installed app. No fork, no reinstall, no binaries:

```bash
git clone https://github.com/nikitaggddss12-hub/opencode-free-limit.git
cd opencode-free-limit
node scripts/remove-free-limit.cjs
node scripts/disable-autoupdate.cjs
```

Restart OpenCode → normal composer, no card.

**What it actually changes** (boring details, since this means patching a bundle the app checks):

- `app.asar` → `out/renderer/assets/route-*.js`: the card's gate `active:()=>{...}` becomes `active:()=>!1`
- byte-length preserving replace, the SHA-256 in the asar header is recomputed, archive size stays the same
- the second script drops `await x.checkForUpdates()` from the updater, so an update can't overwrite the patch
- 14 tests + CI on Windows/Linux, Node 22/24; `--dry-run` prints the diff without writing anything

**What it does NOT do:** give you quota back. The limit is server-side — after it's hit, sending still fails (you get the provider error instead of the card). This only stops the banner from hijacking your UI.

**Caveats:** built for 2.4.1 (chunk names are version-specific); you lose auto-updates, so upgrade manually; rollback = reinstall. MIT, no telemetry, ~200 readable lines — read them before running anything.

Repo: https://github.com/nikitaggddss12-hub/opencode-free-limit
0 Upvotes

3 comments sorted by

1

u/Key_Eye_2871 14h ago
Details people always ask:

  • **Why not a config flag?** There isn't one. The card is rendered by the client bundle — no setting, no env var, no config option.
  • **Integrity check?** Electron verifies the asar header hashes, so the script rewrites the hash too — otherwise the app refuses to boot. That's why the patch is byte-for-byte the same length.
  • **Will an update break it?** Auto-update is off after the second script, so no. A manual reinstall does — rerun the two scripts.
  • **New version with different chunk names?** `scripts/scan.mjs` finds the component; send a PR with the new names and I'll merge.
  • **Tested on:** Windows 11, OpenCode 2.4.1.

1

u/mwilson_9309 9h ago

Has the scanner been checked on macOS too, or is support currently limited to Windows/Linux?

1

u/Key_Eye_2871 8h ago

Right now it’s only tested and supported on Windows. I haven't had a chance to check it on Linux or macOS yet.