Skip to content

thinkingLevel is silently dropped for models registered via registerProvider() #446

Description

@steven4354

Describe the Bug

When an app forwards a thinkingLevel for a model registered via registerProvider() whose id is not in pi-ai's catalog (gateway presets, OpenRouter @preset/... ids), the level is silently dropped. The resolved model hydrates with reasoning: false, the registration API offers no way to override it, and pi-ai skips thinking emission for non-reasoning models — so the outgoing request carries no reasoning field and the model answers without thinking. No error is raised anywhere. Catalog models are unaffected; this hits exactly the gateway and preset ids that registerProvider() exists for. Sibling of #418, which is the same missing override for input.

Expected Behavior

A registration can declare a model as reasoning-capable, mirroring the existing contextWindow/maxTokens overrides at registration and per-model level, so that a forwarded thinkingLevel reaches the wire (e.g. OpenRouter's reasoning: { effort }).

Steps to Reproduce

  1. Register a provider with a reasoning-capable model id the catalog doesn't know (e.g. an OpenRouter @preset/... id)
  2. Resolve the model and observe reasoning is false, with no registration option to change it
  3. Prompt with thinkingLevel: 'high' and capture the outgoing request: it contains no reasoning field, and the model responds without thinking

Tested patch (registration-level + per-model reasoning override, mirroring the contextWindow/maxTokens layering; full runtime suite and tsc --noEmit green): steven4354@3bc9fed

🤖 Filed with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    fix pendingFixed on a development branch; lands with the next release

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions