KeygraphHQ/shannon · error · Error

Model not found in pi registry: provider="${providerId}" mod

Error message

Model not found in pi registry: provider="${providerId}" model="${modelId}". Browse valid providers and models at ${PI_CATALOG_URL}.

What it means

resolveModelSelection rejects when resolveModel returns undefined: the named model id is not in pi's offline registry for that provider AND no SHANNON_AI_BASE_URL gateway is configured to pass unknown ids through. The browsable catalogue at pi.dev/models is the source of valid ids; allowModelNetwork is false so the registry is never refreshed at runtime.

Source

Thrown at apps/worker/src/ai/models.ts:331

    );
  }
  return configured;
}

/**
 * Resolve SHANNON_AI_MODEL, build a ModelRuntime primed with the provider's
 * credential, and look the model up in it.
 */
export async function resolveModelSelection(): Promise<ModelSelection> {
  const { providerId, modelId } = resolveModelSpec();
  const credentials = resolveProviderCredentials(providerId);
  const format = resolveGatewayFormat(providerId, credentials.baseUrl);

  const modelRuntime = await createModelRuntime(providerId, credentials.apiKey);

  const model = resolveModel(modelRuntime, providerId, modelId, credentials.baseUrl, format);
  if (!model) {
    throw new Error(
      `Model not found in pi registry: provider="${providerId}" model="${modelId}". Browse valid providers and models at ${PI_CATALOG_URL}.`,
    );
  }

  return {
    model,
    modelRuntime,
    modelId,
    providerId,
  };
}

View on GitHub (pinned to 1ae0a142f8)

Solutions

  1. Verify the exact id at https://pi.dev/models and correct the typo.
  2. If the model exists only behind a custom endpoint, set SHANNON_AI_BASE_URL so the id passes through (cost/context figures will be approximate).
  3. Upgrade @earendil-works/pi-coding-agent (and rebuild) so the bundled catalogue lists the model.

Example fix

# before
export SHANNON_AI_MODEL=anthropic:claude-sonet-4-6   # typo

# after
export SHANNON_AI_MODEL=anthropic:claude-sonnet-4-6
Defensive patterns

Strategy: try-catch

Validate before calling

import { resolveModelSpec } from './models';
const { providerId, modelId } = resolveModelSpec();
console.log(`Resolving provider="${providerId}" model="${modelId}". Verify at https://pi.dev/models before launch.`);

Try / catch

try {
  const selection = await resolveModelSelection();
} catch (error) {
  if (error instanceof Error && error.message.startsWith('Model not found in pi registry')) {
    // surface the catalogue URL from the message, then exit non-zero
    console.error(error.message);
    process.exit(2);
  }
  throw error;
}

Prevention

When it happens

Trigger: SHANNON_AI_MODEL='provider:model' where 'model' is unknown to pi's bundled catalogue and SHANNON_AI_BASE_URL is unset; or a provider pi carries no models for at all. Also triggered by a typo in the model id.

Common situations: Typo ('claude-sonet-4-6'); a model renamed/removed after a pi upgrade; using a vendor's own id instead of pi's; referencing a brand-new model before bumping pi.

Related errors


AI-assisted analysis of KeygraphHQ/shannon@1ae0a142f8 (2026-08-12). Data as JSON: /api/errors/d55b853033d3d9ad. Report an issue: GitHub.