Skip to content

[Feature] Make reasoning defaults and model capacity metadata explicit #5

Description

@LIghtJUNction

Problem

The plugin currently registers LMM models with reasoning, thinking-level mappings, contextWindow, and maxTokens copied from Pi\x27s built-in @earendil-works/pi-ai catalog. The LMM catalog itself does not advertise these capability fields.

This makes the effective behavior difficult to discover and can become stale when an upstream model changes. Pi\x27s global default thinking level is medium, but a model-specific thinkingLevelMap can mark medium as unsupported and cause Pi to clamp to another level. For example, deepseek-v4-pro is currently represented as 1,000,000 context tokens, 384,000 max output tokens, with only off/high/max available; users may reasonably assume the configured medium default is being sent when the effective level is high.

The plugin also does not clearly expose how contextWindow, maxTokens, reasoning, and thinkingLevelMap were selected or how the effective output limit is reduced by the current prompt, tools, conversation history, and safety reserve.

Proposed scope

  • Document the source and precedence of reasoning, thinkingLevelMap, contextWindow, and maxTokens.
  • Show the effective thinking level and verified capacity in a user-readable diagnostic or model information command.
  • Decide whether the LMM OAuth catalog should publish capability metadata, or define a versioned, reviewable capability override contract when server metadata is unavailable.
  • Keep model registration fail-closed when capability metadata is missing or ambiguous.
  • Add tests covering unsupported default levels, clamping, context-window output clamping, and stale/mismatched capability metadata.
  • Document that cache compatibility flags such as supportsLongCacheRetention and sendSessionAffinityHeaders do not control thinking strength.

Acceptance criteria

  • A user can determine the effective thinking level for the selected LMM model without inspecting source code.
  • A user can determine the verified context window and maximum output tokens for the selected model.
  • The implementation clearly distinguishes Pi\x27s global default from a model\x27s supported levels and the provider adapter\x27s wire representation.
  • Capability mismatches do not silently advertise an unsafe or incorrect model limit.
  • Tests cover at least the deepseek-v4-pro style mapping where medium is unsupported and high is the effective fallback.

Related source paths: src/capabilities.ts, src/catalog.ts, src/stream.ts.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions