Repository navigation
Description
Description
A model provider registered by a pi extension (pi.registerProvider, e.g. @pgilad/pi-vertex-anthropic or pi-provider-litellm) is invisible to ThinkRail until some chat in the current process happens to load the extension, and it disappears again after every restart:
- The shared catalog never loads user extensions. It is built with
packages: "none"andnoExtensions: true(packages/server/src/agent/piRuntime.ts:139-151), andmodel.list,model.default, restore andprovider.statusall read it (agentSessionManager.ts:2993-3015). - Extension providers reach that catalog only as a side effect of a chat starting. Chats reuse the shared runtime; pi adds the queued provider registrations in the AgentSession constructor, after the chat's model has been chosen (pi
sdk.js:91-117,agent-session.js:2944). pi's own CLI registers them first viacreateAgentSessionServices, which ThinkRail skips. So a new chat gets "Select model", an explicit extension model is rejected asUnknown or unavailable model(agentSessionManager.ts:1471), and restore resolves the saved model too early (agentSessionManager.ts:2140-2155) — the remaining part of Restoring a chat fails with "saved model is unavailable" for extension-provided models (e.g. commandcode) #365. - Settings → Providers never lists them.
provider.statusshows only provider ids recorded when the runtime was created, pluscustom-*(packages/server/src/auth/providerStatus.ts:82-99), so an extension provider is never a row. For a user whose only model source is such an extension, the onboarding wizard keeps saying no provider is connected (apps/web/src/panels/useProviderStatus.ts:6-8,WelcomePanel.tsx:46-56).
This explains the reports in #996 (vertex-anthropic: "no model providers connected") and the LiteLLM-extension comment on #1039 ("no models"), and shares its root cause with #365.
Steps to reproduce
- Install a provider extension, e.g.
pi install npm:@pgilad/pi-vertex-anthropicand sign in with pi/login(or installpi-provider-litellmwith its key). - Start ThinkRail. Settings → Providers has no row for that provider; the model picker and Settings → Models list none of its models. If it is the only model source, onboarding says no provider is connected.
- Open any chat — it starts with "Select model". Open the model picker again: the extension's models now appear.
- Restart ThinkRail: the models are gone again, and a restored chat that used one of them opens as "Select model".
Expected behavior
Providers and models registered by installed pi extensions are available from startup — in the model picker, Settings → Models, new chats and restored chats — and the provider is shown in Settings → Providers (and counts as a model source for onboarding), as in pi's own CLI.
Actual behavior
They exist only after a chat has loaded the extension in the current process, are never listed in Settings → Providers, and vanish on restart or a JetBrains AI runtime rebuild.
Environment
- OS: any
- Bun version (
bun --version): 1.4.4 - Node version (
node --version): n/a - ThinkRail version / commit: main
52ae54782, pi 1.5.2 (reproduced with a test using the production runtime factory and boot order and a throwaway global extension callingpi.registerProvider)
Activity