Repository navigation
Description
What happened
The text generation model picker (Settings → Text generation model → Pi) offers models that text generation can never load. When one is chosen, every thread title generation fails and the thread keeps its raw first prompt as the title. The thread and the sidebar show no error; the reason is only in the server trace.
In our case the model is a Pi virtual model (pi.registerVirtualModel, Pi 1.5): a routing extension registers auto/gpt-6-luna, which picks a backend per request. It is the second kind of extension model to hit this, after the provider-package models in #19053.
This is the follow-up @t3dotgg asked for when closing #19053: #19070 fixed the error text, and this issue covers only the part still open, the picker offering extension-only models.
Diagnosis
- Discovery (
makePiDiscoveryConnection,packages/provider-pi/src/server/status.ts) runs Pi with extensions loaded, and its own comment says Pi lists "extension, virtual and --api-key" models. The text generation picker builds its options from that catalog (getCustomModelOptionsByInstance,apps/web/src/modelSelection.ts), and its only filter is per provider (supportsTextGeneration), never per model. - Text generation (
packages/provider-pi/src/server/textGeneration.ts) runspi --mode rpc --no-session --no-extensions --no-tools, intentionally (@juliusmarminge in [Bug]: Pi text generation fails for models that a Pi extension adds, even though the model picker offers them #19053). Under--no-extensionsneither extension providers nor virtual models exist, soset_modelfails. - The trace shows each title attempt failing with fix(pi): say why text generation cannot load a model #19070's message:
Pi rejected model 'auto/gpt-6-luna': Model not found: auto/gpt-6-luna. If the model comes from a Pi extension or package, text generation cannot use it because it runs Pi with --no-extensions.The message is right, but it reaches only the trace.
Same code path on main 260297b55f.
Steps to reproduce
- Install any Pi extension that registers a provider or a virtual model (the
demo-provider.tsfrom [Bug]: Pi text generation fails for models that a Pi extension adds, even though the model picker offers them #19053 works). - In T3 Code, Settings → Text generation model: the extension's model is listed under Pi. Select it.
- Start a Pi thread and send a message. The title stays the raw first message, and no error shows in the UI.
The Pi step on its own:
cd "$(mktemp -d)"
echo '{"id":"1","type":"set_model","provider":"auto","modelId":"gpt-6-luna"}' | pi --mode rpc --no-session # success: true
echo '{"id":"1","type":"set_model","provider":"auto","modelId":"gpt-6-luna"}' | pi --mode rpc --no-session --no-extensions --no-tools # Model not foundVersion
T3 Code 0.1.6, built from main ac8dce0cc3 (code path unchanged on 260297b55f). Pi 1.5.0.
Environment
macOS (arm64) and Windows 11, four hosts, all affected.
Evidence
PiTextGeneration.generateThreadTitlespans inserver.trace.ndjson: three attempts per thread, each failing with thePi rejected modeldetail above.- The same
set_modelon T3's exact text-generation argv:auto/gpt-6-luna→Model not found; built-inopenai/gpt-6-luna→ success, and a title is returned.
Related issues
#19053 (extension provider models; closed, its picker part split off to here), #19070 (error text), #23726 (other silent title failures).
Fix applied or workaround
Workaround: pick a built-in or models.json model for text generation. After switching to openai/gpt-6-luna, Regenerate title worked on the first try.
A fix could do either of these:
- Have discovery mark models as unavailable to
--no-extensionslaunches (for example, a secondget_available_modelsfrom a--no-extensionsprobe), and have the picker hide or disable those models for text generation. - Reject the selection when saving the setting, with fix(pi): say why text generation cannot load a model #19070's message.
Filed by
@astarktc, with an AI agent (Claude, in Pi via T3 Code). Reproduced and verified by the agent on our hosts.
Activity