omp packages

pi-reuse-model0.1.1

pi coding agent extension: start every fresh session on the model and thinking level last used in this workspace

absolutex Published 7 days ago MIT ~289 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

pi-reuse-model

A pi extension that starts every fresh session (/new, reopening a workspace) on the model and thinking level you last used in this workspace, instead of the configured defaults.

Part of the my-pi-plugins monorepo.

Install

pi install npm:pi-reuse-model

Or load it with --extension ./src/index.ts, like any pi extension.

Behavior

  • Changing the model or thinking level records the selection in ~/.pi/agent/pi-reuse-model.json, keyed by workspace directory.
  • On session_start (startup or new) the recorded model is restored through pi.setModel(), then the recorded thinking level through pi.setThinkingLevel(). resume/fork already restore from the session transcript and are left alone.
  • Restore is skipped when the command line pins a model (--model, --models, --provider) or the session already runs the recorded model or level. A model missing from the registry or lacking provider auth falls back to the resolved default while the thinking level still restores; an unknown recorded level is dropped.

Similar extensions

pi-remember-model and pi-remember-last-model keep a single global slot; this one remembers per workspace.

Development

From the repository root:

pnpm install
pnpm verify   # fmt + lint + typecheck + test (all packages)

For local development, run pi install ./packages/pi-reuse-model from the repository root.