r/PiCodingAgent • • 15d 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.

3 Upvotes

7 comments sorted by

3

u/reini_urban 15d ago

Pi can do this automatically already in config.yaml An array of fallback models

1

u/Hacklone 15d ago

There’s some overlap with a fallback list, but Adaptive adds many things beyond switching models when one fails:
- Returns to your preferred model once it recovers, without interrupting ongoing work.
- Waits when everything’s unavailable and resumes later; that wait survives restarting Pi.
- Separates quick/standard/advanced work, so hitting a rate limit doesn’t change the capability level.
- Explains its decisions and offers an Observe mode to preview things before enabling automatic switching.

And many more 🙂

1

u/PerfectReflection155 15d ago

Thanks for sharing, just trying to figure out how to configure it now.

1

u/Hacklone 14d ago

Just run the /adaptive command and you can configure setting right in pi, no config file editing needed. Let me know if you have a question on a specific feature.

1

u/PerfectReflection155 14d ago

Hey There, I actually found its crashing Pi chamber. I tried twice uninstalling and reinstalling and it did it both times.

1

u/Hacklone 14d ago

Oh, that's bad news. It works perfectly on my setup.

Can you send me the error? (You can find it in the session logs: ~/.pi/agent/sessions/*/*.jsonl)