Skip to content

feat(v2): unify reasoning options and OpenAI pro mode #36769

Closed

Description

@opencode-agent

Problem

The dev → V2 merge exposed two related gaps that should be handled as a focused V2 follow-up rather than expanded inside the merge PR.

1. Carry robust reasoning_options behavior into V2

V2 already derives variants while normalizing models.dev metadata, but dev's current implementation covers a broader provider matrix and stronger semantics:

  • effort, toggle, and budget controls
  • explicit empty options versus missing metadata
  • output-limit-aware budget clamping
  • provider-specific settings for Alibaba, Cohere, Bedrock, Gateway, Copilot, SAP, xAI, Mistral, Groq, Cerebras, DeepInfra, TogetherAI, Venice, and others

Port those semantics into V2's normalized catalog pipeline without restoring the legacy raw Provider / Model architecture or introducing a V1 dependency.

2. Support OpenAI pro reasoning mode end-to-end

Use one canonical option shape across AI SDK and native LLM execution, e.g. reasoningMode: "pro":

  • models.dev mode metadata projects to the canonical option
  • packages/llm exposes and validates the option
  • OpenAI Responses lowers it to reasoning: { mode: "pro" }
  • Codex behavior consumes the same canonical option
  • AI SDK and native LLM routes behave consistently

Acceptance criteria

  • V2 reasoning variants cover the provider cases currently handled in dev.
  • Explicit empty reasoning options remain distinct from absent metadata.
  • Budget variants respect model and package output limits.
  • V2 catalog normalization remains the owning architecture.
  • OpenAI Responses native request preparation emits reasoning.mode for pro mode.
  • Focused tests cover catalog normalization, provider/package mapping, OpenAI Responses lowering, and Codex behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions