Skip to content

Providers registered by pi extensions are missing from Settings → Providers and the model list until a chat loads the extension #1351

Open

Description

@danyaberezun

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" and noExtensions: true (packages/server/src/agent/piRuntime.ts:139-151), and model.list, model.default, restore and provider.status all 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 via createAgentSessionServices, which ThinkRail skips. So a new chat gets "Select model", an explicit extension model is rejected as Unknown 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.status shows only provider ids recorded when the runtime was created, plus custom-* (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

  1. Install a provider extension, e.g. pi install npm:@pgilad/pi-vertex-anthropic and sign in with pi /login (or install pi-provider-litellm with its key).
  2. 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.
  3. Open any chat — it starts with "Select model". Open the model picker again: the extension's models now appear.
  4. 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 calling pi.registerProvider)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions