pi-opencode-go-limits
v0.1.0
Published
Pi extension that shows the OpenCode Go monthly usage limit for the selected model in the footer status line
Maintainers
Readme
pi-opencode-go-limits
A Pi extension that shows the OpenCode Go monthly usage limit for the currently selected model in the footer status line — right next to the model name and token/cost stats:
~ (main) • my-session
↑123k ↓45k R678k CH88.5% $0.123 45%/1M (opencode-go) deepseek-v4-flash • high
◈ $60/moThe ◈ $60/mo bit (accent-colored diamond + monthly dollar limit) is added by
this extension. It tells you how much usage is included with the selected
model per month before OpenCode Go blocks requests:
- Most models: $60/month included
- Newer/higher-cost models (Grok 4.5, GLM-5.3, Kimi K3, DeepSeek V4 Pro, GPT 5.6 Luna, Qwen3.8 Max, MiMo V2.5 Pro): $15/month included
Install
pi install /path/to/pi-opencode-go-limits
# or, once published:
pi install npm:pi-opencode-go-limitsRestart Pi (or start a new session) and pick an OpenCode Go model with
/model. The limit appears in the footer.
How it works
Limits are taken from the official docs page
https://opencode.ai/docs/go/ (source:
packages/web/src/content/docs/go.mdx in the
anomalyco/opencode repository). The
extension parses the docs' two markdown tables:
Model | requests per 5 hour | requests per week | requests per monthModel | Input | Output | Cached Read | Cached Write | Usage— the monthly usage included per model.
Because display names are inconsistent between the tables (e.g. MiMo-V2.5
vs MiMo V2.5) and pi's catalog (e.g. DeepSeek V4 Flash (2x usage)), model
names are normalized (lowercase, non-alphanumerics stripped, parentheticals
removed) and matched against the embedded doc-name index first, then pi's own
model catalog so newly added models are picked up automatically.
Caching & refresh
The docs are updated from time to time, so the extension does not rely on hardcoded values:
- A small embedded baseline table (last captured 2026-08-15) is used instantly, so the status shows up even before any network call completes.
- At session start a cached copy is applied synchronously if one exists (accurate even offline).
- In the background, the live
go.mdxis fetched when the cache is stale (TTL: 24 hours) or missing, parsed, merged into the store and written back to the cache. - If the fetch fails, the last-known cached values are kept.
Cache and settings live under <pi agent dir>/opencode-go-limits/
(~/.pi/agent/opencode-go-limits/ by default):
cache.json— parsed limits +fetchedAttimestampsettings.json— status display settings
Configure
Use /go-status to toggle the monthly limit display (interactive dialog), or
set it directly:
/go-status monthly true|false
/go-status resetDevelopment
npm install
npm run typecheck # type-check the extension
npm run format # format with prettier
npm run check:parse # fetch the live go.mdx and print the parsed limits tableLicense
MIT
