Repository navigation
[Bug]: Pi text generation fails for models that a Pi extension adds, even though the model picker offers them #19053
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
-
Create a Pi extension that adds a provider, for example
~/.pi/agent/extensions/demo-provider.ts:import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; export default function (pi: ExtensionAPI) { pi.registerProvider("demo", { baseUrl: "http://127.0.0.1:9/v1", apiKey: "unused", api: "openai-completions", models: [{ id: "demo-model", name: "Demo Model", reasoning: false, input: ["text"], cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, contextWindow: 128000, maxTokens: 4096, }], }); }
Real setups do the same through provider packages listed in
settings.jsonpackages. -
In T3 Code, open Settings and set the text generation model to Pi →
demo/demo-model. The picker lists it because model discovery runs Pi with extensions loaded. -
Start a new Pi thread and send a message.
The Pi step alone reproduces it, outside T3:
cd "$(mktemp -d)"
echo '{"id":"1","type":"set_model","provider":"demo","modelId":"demo-model"}' \
| pi --mode rpc --no-session # success: true
echo '{"id":"1","type":"set_model","provider":"demo","modelId":"demo-model"}' \
| pi --mode rpc --no-session --no-extensions --no-tools # Model not found: demo/demo-modelExpected behavior
The text generation model setting and the Pi process that text generation launches agree on which models exist. Either text generation can use a model the picker offers, or the picker does not offer models that text generation cannot load and says why.
Actual behavior
Every Pi text generation request fails at set_model. That includes thread titles, commit messages, PR content and branch names. The thread keeps its truncated first-message title.
Cause, on main @ 6524a8d:
- Model discovery,
packages/provider-pi/src/server/status.tsmakePiDiscoveryConnection, callsbuildPiRpcLaunchwithoutdisableExtensions. Extension-registered providers load and their models are listed. - Text generation,
packages/provider-pi/src/server/textGeneration.ts, passesdisableExtensions: true, so Pi starts with--no-extensions --no-tools.--no-extensionsalso skips the provider packages in Pi'ssettings.json, so the provider does not exist andset_modelfails. The comment there says "User model config and auth still apply", which holds formodels.jsonproviders but not for extension-registered ones.
The disableExtensions: true choice itself makes sense, because no user is present to answer an extension dialog. The two launches just disagree about the model catalog.
Verified: the Pi RPC repro above on Pi 1.1.0, and the matching server log line on the nightly. Not verified: the full T3 UI flow with the demo extension; I observed it with a real extension-registered provider.
Impact
Major degradation or frequent failure
Version or commit
t3 0.0.46-nightly.20261012.3010; code paths unchanged on main @ 6524a8d
Environment
Linux x64, t3 server mode, Pi 1.1.0, text generation provider: Pi with an extension-registered provider
Logs or stack traces
Thread title generation failed
TextGenerationError generateThreadTitle: Pi text generation failed.
PiRpcError set_model: Model not found: <provider>/<model>Screenshots, recordings, or supporting files
No response
Workaround
No response
Activity
juliusmarminge commentedon Oct 13, 2026
Note
Grok responding on behalf of Julius.
Thanks. I checked both code paths on
main, and they match your description.makePiDiscoveryConnection(packages/provider-pi/src/server/status.ts) callsbuildPiRpcLaunchwithoutdisableExtensions, so models from extension-registered providers show up in the catalog.textGeneration.tspassesdisableExtensions: trueanddisableTools: true.Disabling extensions is intentional, because no user is around to answer an extension dialog during background generation, and we're keeping it. The bug is that the picker offers text-generation models that this launch can't load. The comment there ("User model config and auth still apply") only holds for
models.jsonproviders.Workaround: under Settings → text generation model, pick a built-in Pi model, a provider defined in
~/.pi/agent/models.json, or a different provider (Codex or Claude).Likely fix: don't offer extension-registered models for Pi text generation. That means tagging the discovered models by where they came from, or running a second discovery with
--no-extensions, and then showing a clear error explaining why. We wouldn't re-enable extensions here.This is separate from #17895 (extension dialogs) and #15529 (discovery timeout).
fix(t3code): run Pi text generation on a models.json provider (#1811)
fix(pi): say why text generation cannot load a model
t3dotgg commentedon Oct 21, 2026
Note
🤖 Claude Opus 5.5 responding on behalf of Theo
Thanks for the report. One part of this is fixed on main in #19070. Please test on the nightly built from main on 2026-10-21, or on the next stable release. One part is still open: the picker still offers extension-only models and generation still fails. If that part still matters to you, please open a new issue for that part only.