Repository navigation
v0.5.0
Sticky-balanced routing
A new sticky-balanced routing mode decides a session's account once, at cold start, and then stops deciding. Placement picks the account with the least projected pressure — sustainable spend rate rather than raw remaining percent — so an account resetting in twenty minutes outranks one with more headroom but days to go. Capacity is the minimum across present windows.
A placed session moves only on confirmed exhaustion or permanent auth failure, never for load. This exists because moving a large session mid-conversation re-uploads its whole context at write price.
Concurrent OpenCode processes converge without coordination beyond the sidebar state they already share. Session pins are stored as SHA-256 hashes with a seven-day TTL and a 256-entry cap.
main-first and fallback-first are unchanged.
Admission-time quota skipping
Before spending a request, routing now consults the freshest quota it knows — the in-process cache or the shared sidebar file written by other OpenCode processes on the machine — and skips an account already known to be at 100%. A fresh process no longer burns a doomed probe on an exhausted account.
Filtering can never remove the last path: if it would, the original probe order is restored and the wire stays authoritative. Quota rows are bound to the ChatGPT identity they were captured under, so a re-login is never judged by the previous account's exhaustion.
Background quota freshness
Idle accounts no longer go stale. A background poll refreshes quota on an interval, serialized across processes by a renewable cross-process lock so a fleet of accounts is fetched once rather than once per process. Sidebar quota now merges per window, so a newer secondary from one process and a newer primary from another both survive.
RPC state no longer accumulates
The RPC server sweeps stale state at startup: port files whose process is gone, corrupt files, and the empty project directories left behind. Directories are now named openai-auth-<hash> and created 0700. Previously every project ever opened left a directory behind permanently.
Also
/openai-routing resetclears the current session's pin and nothing else./openai-cachekeep sustain on|offkeeps main-agent sessions warm past the idle cap. Subagent bounds are unchanged.- The killswitch is enforced on every routing mode, including sticky-balanced.
- Dependency updates: TypeScript 7.0.2, Biome 2.5.6,
@opencode-ai/plugin1.18.11,ai7.0.48.
Thanks to @iceteaSA for the routing, quota, and RPC work in this release.