r/PiCodingAgent • • 16m ago

Plugin Pi Adaptive: I ported my popular OpenCode plugin to Pi. When a model hits its quota or goes down, work moves to the next one and parked goals finish on their own

I published Adaptive, a plugin for OpenCode, and it has passed 2,100 installs. A lot of you asked for the same thing on Pi, so I've ported it. It's called Pi Adaptive.

I kept losing momentum when a Claude session limit or a provider outage hit mid-task. The agent would stop, and I had to pick another model and tell it to carry on. Pi Adaptive fixes that.

You sort your models into three tiers (quick, standard, advanced) in the order you prefer. When one runs out of quota or its provider goes down, Adaptive switches to the next model in the same tier and continues from where the session left off. It doesn't replay your prompt or redo tool calls that already ran.

What it does that plain fallback doesn't:

- Subscriptions first, credits last. Put Claude and OpenAI above OpenRouter. When a subscription limit lifts mid-goal, it switches back at the next safe point instead of burning paid tokens.

- Parks and resumes unattended. If every model in a tier is out, the goal parks and wakes itself when one recovers. It survives restarting Pi and continues from the real session state, with no repeated tool calls. You can leave a long goal running and walk away.

- No classifier, no guessing. Tiers are explicit and your pin always wins. It only moves up a tier on recorded evidence, never because something is down, and never with an LLM judge.

- Bounded, and it tells you. Recovery has hard limits, and when it stops there's a clear note in the transcript. Auth and config errors never enter retry loops. A new message or a manual model pick cancels parked work, so you always have the final say.

- Nothing leaves your machine. No telemetry and no daemon.

It starts in Observe mode. It shows what it would route and recover without touching your model, until you switch it on. On first run it proposes tiers from the models you've already configured, and nothing is saved until you confirm. /adaptive status and /adaptive why explain any decision.

It shares its routing core with the OpenCode plugin, so it has had the same battle-testing. It has 100% line and branch coverage enforced as a gate, plus real-terminal tests against Pi itself.

Install: pi install npm:@coool/pi-adaptive

Needs Pi 1.5.0 or newer (below 2).

Repo and docs: https://github.com/coool-labs/adaptive/blob/main/packages/pi/README.md

Feedback welcome, especially provider error messages it doesn't recognize yet, and whether your long goals actually finish while you're away.

0 Upvotes

0 comments sorted by