Skip to content

Fix GPT 5.4 reasoning input#1864

Open
victlue wants to merge 1 commit intomainfrom
victor/fix-gpt-5.4-reasoning-inputs
Open

Fix GPT 5.4 reasoning input#1864
victlue wants to merge 1 commit intomainfrom
victor/fix-gpt-5.4-reasoning-inputs

Conversation

@victlue
Copy link
Contributor

@victlue victlue commented Mar 20, 2026

Summary

GPT-5.4 doesn't support reasoningEffort: "minimal", causing API errors. Changed default from "minimal" to "low", which is supported by all GPT-5 variants.

@changeset-bot
Copy link

changeset-bot bot commented Mar 20, 2026

⚠️ No Changeset found

Latest commit: 3b8fd48

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.
Architecture diagram
sequenceDiagram
    participant App as Application / Eval Runner
    participant Client as AISdkClient / Wrapped
    participant SDK as AI SDK (generateObject)
    participant API as OpenAI API

    App->>Client: generateObject(options)
    
    Note over Client: Internal Model Identification
    Client->>Client: Check modelId (gpt-5, codex, etc.)

    Note over Client: NEW: Unified Reasoning Logic
    alt is GPT-5 model
        alt is Codex variant
            Client->>Client: Set reasoningEffort: "medium"
        else Standard GPT-5 (inc. 5.4)
            Client->>Client: CHANGED: Set reasoningEffort: "low"
        end
    end

    Client->>SDK: call generateObject with providerOptions
    
    SDK->>API: POST /v1/chat/completions
    Note right of API: Payload includes:<br/>openai.reasoning_effort
    
    alt API Success
        API-->>SDK: 200 OK (JSON Response)
        SDK-->>Client: Typed Object
        Client-->>App: result
    else API Error (e.g. Unsupported Option)
        API-->>SDK: 400 Bad Request
        SDK-->>Client: Error
        Client-->>App: throw Error
    end
Loading

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

@victlue victlue changed the title [CE-845] Fix GPT 5.4 reasoning input Fix GPT 5.4 reasoning input Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant