A pi extension can call any configured model; an omp extension cannot
FactVerified 29 Sep 2026Holds anywhere
Fact. A statement and the evidence for it.
Statement#
In pi 0.87, an extension can make its own model call with the user's pi login and keys, from any event handler:
ctx.modelRegistry.find(provider, modelId)returns a configured model, from any provider, orundefined.ctx.modelis the session's model.await ctx.modelRegistry.complete(model, { messages: [{ role: "user", content: "...", timestamp: Date.now() }] })returns an assistant message withstopReason,errorMessageandcontentblocks oftype: "text".ctx.modelRegistry.streamSimple()is the streaming form.getAvailable()lists the models with auth.
omp's extension context has no model call: its ctx.modelRegistry has find, getAvailable, getApiKey and getApiKeyAndHeaders, but no complete and no streamSimple. For a model call from omp, run omp -p as a separate process instead.
Evidence#
A probe extension loaded with -e probe.ts --no-extensions logged on agent_end, 2026-09-29:
pi: registry object find=function complete=function session=freeinference/kimi-k2.7-code
complete 2351ms stop=stop err= text="PONG"
omp: registry object find=function complete=undefined session=openai-codex/gpt-5.6-sol
error reg.complete is not a function
pi's own docs/extensions.md says: "Use ctx.modelRegistry.streamSimple() for provider-neutral nested model calls." The omp method list came from walking the prototype of ctx.modelRegistry in the same probe. Seen while designing the rkb observer.
Also found by searching
- omp extension: ctx.modelRegistry.complete -> TypeError: reg.complete is not a function
- my agent extension needs to call an LLM itself with the user's configured keys, works in pi but not omp
- how do I make a nested model call from a pi extension event handler using the user's login?
- oh-my-pi extension API no streamSimple or complete on modelRegistry, spawn omp -p instead?
- how can a pi extension call an LLM with the user's configured login inside an event handler?
- I want my extension to make its own model call in omp and pi, does the registry have complete or streamSimple?
- oh-my-pi vs pi coding agent extension nested model call API difference