Skip to content

fix(OpenAI Node): Replace hardcoded models with RLC#28226

Merged
michael-radency merged 13 commits intomasterfrom
node-4791-openai-updates-for-ai-gateway
Apr 20, 2026
Merged

fix(OpenAI Node): Replace hardcoded models with RLC#28226
michael-radency merged 13 commits intomasterfrom
node-4791-openai-updates-for-ai-gateway

Conversation

@michael-radency
Copy link
Copy Markdown
Contributor

@michael-radency michael-radency commented Apr 9, 2026

Summary

PR replaces hardcoded models with RLC parameter, fixes bugs with gpt-image other then gpt-image-1

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/NODE-4791/openai-updates-for-ai-gateway

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with Backport to Beta, Backport to Stable, or Backport to v1 (if the PR is an urgent fix that needs to be backported)
  • I have seen this code, I have run this code, and I take responsibility for this code.

@michael-radency michael-radency added n8n team Authored by the n8n team node/issue Issue with a node labels Apr 9, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
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 6 files

Architecture diagram
sequenceDiagram
    participant UI as n8n UI (Client)
    participant Node as OpenAI Node (v2.2)
    participant Method as listSearch.ts
    participant API as OpenAI API
    participant Helper as Binary Helper

    Note over UI,API: Resource Selection (Design Time)
    UI->>Method: NEW: Request available image models
    Method->>API: GET /v1/models
    API-->>Method: Returns all model IDs
    Method->>Method: NEW: Filter for IDs including "dall-e" or "gpt-image"
    Method-->>UI: Return filtered list (RLC)

    Note over UI,API: Node Execution (Runtime)
    UI->>Node: Execute "Generate" action
    
    Node->>Node: Check NodeType version (>= 2.2)
    alt NEW: Node Version is 2.2+
        Node->>Node: Extract value from RLC model parameter
    else Legacy Version
        Node->>Node: Read static model parameter
    end

    Node->>Node: CHANGED: Check if model name starts with "gpt-image"
    
    alt Model is "gpt-image-*"
        Node->>Node: CHANGED: Disable response_format parameter
        Note right of Node: Fixes support for gpt-image-1-mini, etc.
    else Model is "dall-e-*"
        Node->>Node: Set response_format (url or b64_json)
    end

    Node->>Node: CHANGED: Map "dalleQuality" option to "quality" field
    
    Node->>API: POST /v1/images/generations (Body with model & prompt)
    API-->>Node: Image data (URL or Base64)

    alt NEW/CHANGED: Process gpt-image result (Binary only)
        Node->>Helper: prepareBinaryData(base64)
        Helper-->>Node: Binary property
    else Process dall-e result
        alt returnImageUrls is true
            Node->>Node: Return JSON with URL
        else Default
            Node->>Helper: prepareBinaryData(base64)
            Helper-->>Node: Binary property
        end
    end

    Node-->>UI: Output Execution Data (Binary or JSON)
Loading

filter?: string,
): Promise<INodeListSearchResult> {
return await getModelSearch(
(model) => model.id.includes('dall-e') || model.id.includes('gpt-image'),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

only other model I think we can add is chatgpt-image-latest

alexander-gekov
alexander-gekov previously approved these changes Apr 9, 2026
Copy link
Copy Markdown
Member

@alexander-gekov alexander-gekov left a comment

Choose a reason for hiding this comment

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

lgtm

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

Performance Comparison

Comparing currentlatest master14-day baseline

PR perf tests not yet enabled. Current = latest master run.

Idle baseline with Instance AI module loaded

Metric Current Latest Master Baseline (avg) vs Master vs Baseline Status
instance-ai-heap-used-baseline 186.88 MB 186.88 MB 186.42 MB (σ 0.27) +0.0% +0.2% ⚠️
instance-ai-rss-baseline 386.52 MB 386.52 MB 364.63 MB (σ 22.57) +0.0% +6.0%

docker-stats

Metric Current Latest Master Baseline (avg) vs Master vs Baseline Status
docker-image-size-n8n 1269.76 MB 1269.76 MB 1269.76 MB (σ 0.00) +0.0% +0.0%
docker-image-size-runners 386.00 MB 386.00 MB 390.33 MB (σ 9.21) +0.0% -1.1%

Memory consumption baseline with starter plan resources

Metric Current Latest Master Baseline (avg) vs Master vs Baseline Status
memory-rss-baseline 288.44 MB 288.44 MB 290.51 MB (σ 41.09) +0.0% -0.7%
memory-heap-used-baseline 114.39 MB 114.39 MB 114.37 MB (σ 0.40) +0.0% +0.0%
How to read this table
  • Current: This PR's value (or latest master if PR perf tests haven't run)
  • Latest Master: Most recent nightly master measurement
  • Baseline: Rolling 14-day average from master
  • vs Master: PR impact (current vs latest master)
  • vs Baseline: Drift from baseline (current vs rolling avg)
  • Status: ✅ within 1σ | ⚠️ 1-2σ | 🔴 >2σ regression

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Bundle Report

Changes will increase total bundle size by 148 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
editor-ui-esm 45.76MB 148 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: editor-ui-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/worker-*.js 3.15MB 3.17MB 17586.03% ⚠️
assets/worker-*.js -3.15MB 17.9kB -99.43%
assets/constants-*.js 148 bytes 3.14MB 0.0%

@michael-radency michael-radency added this pull request to the merge queue Apr 20, 2026
Merged via the queue into master with commit 4070930 Apr 20, 2026
56 checks passed
@michael-radency michael-radency deleted the node-4791-openai-updates-for-ai-gateway branch April 20, 2026 08:30
@n8n-assistant n8n-assistant Bot mentioned this pull request Apr 21, 2026
@n8n-assistant
Copy link
Copy Markdown
Contributor

n8n-assistant Bot commented Apr 21, 2026

Got released with n8n@2.18.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

n8n team Authored by the n8n team node/issue Issue with a node Released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants