Skip to content

Adding new GPT and Claude models #17999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 12, 2025
Merged

Adding new GPT and Claude models #17999

merged 6 commits into from
Aug 12, 2025

Conversation

GTFalcao
Copy link
Collaborator

@GTFalcao GTFalcao commented Aug 9, 2025

Adding support for the newly released GPT-5 and Claude Opus 4.1 models

I also moved the model constants in the OpenAI app to a separate file with just model constants, and moved some hard-coded arrays into constants for better maintainability

Summary by CodeRabbit

  • New Features

    • Added support for the new "Claude Opus 4.1" model.
    • Centralized OpenAI model options for chat, image generation, moderation, transcription, fine-tuning, and text-to-speech, improving consistency across actions.
  • Improvements

    • Updated default and available model selections for various OpenAI and Anthropic actions.
    • Enhanced model filtering and sorting logic for chat completions and assistants, including support for new model families.
    • Default chat completion model updated to "gpt-5-mini".
  • Bug Fixes

    • Ensured model option lists are consistent and dynamically maintained across actions.
  • Chores

    • Incremented version numbers for updated actions and packages.

Copy link

vercel bot commented Aug 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Aug 9, 2025 6:05pm
pipedream-docs ⬜️ Ignored (Inspect) Aug 9, 2025 6:05pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Aug 9, 2025 6:05pm

Copy link
Contributor

coderabbitai bot commented Aug 9, 2025

Walkthrough

This update centralizes OpenAI model option constants into a new shared module, updates imports across actions to use these shared constants, and modifies model selection/filtering logic in the OpenAI app, including extending support for new models. The Anthropic component receives a new model entry and version bump, while package versions are incremented accordingly.

Changes

Cohort / File(s) Change Summary
Anthropic Version & Model Update
components/anthropic/actions/chat/chat.mjs, components/anthropic/actions/common/constants.mjs, components/anthropic/package.json
Updated action and package versions from 0.1.0 to 0.2.0; added "Claude Opus 4.1" model to available models.
Centralization of OpenAI Model Constants
components/openai/common/constants.mjs, components/openai/common/models.mjs
Removed model option arrays from constants.mjs and introduced a new models.mjs module exporting all model-related constants for fine-tuning, TTS, image, moderation, assistants, and supported models for specific actions.
OpenAI Action Refactors to Use Centralized Models
components/openai/actions/chat-using-web-search/chat-using-web-search.mjs, components/openai/actions/create-image/create-image.mjs, components/openai/actions/create-moderation/create-moderation.mjs, components/openai/actions/create-transcription/create-transcription.mjs
Updated imports and usage of model option arrays in various actions to use the new shared constants from models.mjs. Incremented action version numbers.
OpenAI App Model Selection Logic & Defaults
components/openai/openai.app.mjs
Updated imports to use centralized model constants; changed default chat model to "gpt-5-mini"; updated model sorting to use creation timestamp; extended chat and assistants model filtering logic to support new models and use shared include/exclude lists.
OpenAI Assistants Model Fetching Logic
components/openai/actions/create-thread/create-thread.mjs
Changed assistants model options fetching to use a new API method (getAssistantsModels) instead of local filtering; incremented action version.
Version Bumps in Various OpenAI Actions and Sources
components/openai/actions/*, components/openai/sources/* (multiple files)
Incremented version numbers across many OpenAI actions and sources without other code or logic changes.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant OpenAI Action
    participant Models Module

    User->>OpenAI Action: Configure action (e.g., select model)
    OpenAI Action->>Models Module: Import model options (e.g., IMAGE_MODELS, TTS_MODELS)
    OpenAI Action-->>User: Present model options from Models Module
Loading
sequenceDiagram
    participant User
    participant OpenAI App
    participant OpenAI API
    participant Models Module

    User->>OpenAI App: Request models (e.g., for assistants)
    OpenAI App->>OpenAI API: Fetch available models
    OpenAI App->>Models Module: Import include/exclude lists
    OpenAI App->>OpenAI App: Filter models using include/exclude lists
    OpenAI App-->>User: Return filtered models
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15–20 minutes

Suggested reviewers

  • luancazarine

Poem

A bunny hopped through code so bright,
Gathering models left and right—
Constants now in one shared den,
No more searching, just ask again!
New versions bloom, fresh models sprout,
With every hop, less code to doubt.
🐇✨

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f35b215 and 0257bb6.

📒 Files selected for processing (1)
  • components/openai/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • components/openai/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
  • GitHub Check: pnpm publish
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch openai-model-updates

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🔭 Outside diff range comments (2)
components/openai/actions/create-image/create-image.mjs (2)

108-116: Bug: writing the same image for all files when N > 1

Inside the tmp branch, the loop always uses response.data[0].b64_json, so multiple files will contain identical content. Use the i-th image.

-        await fs.writeFileSync(outputFilePath, Buffer.from(response.data[0].b64_json.toString(), "base64"));
+        const img = response.data[i] ?? response.data[0];
+        const b64 = img?.b64_json;
+        if (!b64) {
+          throw new Error("Expected base64 image in response.data but none was found");
+        }
+        await fs.writeFileSync(outputFilePath, Buffer.from(b64, "base64"));

Also consider iterating up to Math.min(n || response.data.length, response.data.length) to avoid out-of-bounds indexing.


113-116: Harden output path handling to avoid path traversal outside the stash dir

Currently, if filename includes "tmp/", it’s used verbatim. A user-controlled filename like "../../tmp/evil" could still be problematic. Normalize and ensure the final path remains inside the stash directory.

-        const outputFilePath = filename.includes("tmp/")
-          ? filename
-          : `${process.env.STASH_DIR || "/tmp"}/${filename}`;
+        const baseDir = process.env.STASH_DIR || "/tmp";
+        const rawPath = filename.includes("tmp/") ? filename : `${baseDir}/${filename}`;
+        const path = await import("path");
+        const normalized = path.default.normalize(rawPath);
+        if (!normalized.startsWith(path.default.normalize(baseDir + "/"))) {
+          throw new Error("Invalid filename: must resolve inside the tmp directory");
+        }
+        const outputFilePath = normalized;
🧹 Nitpick comments (4)
components/anthropic/actions/common/constants.mjs (1)

3-6: Verify default bump to Claude Opus 4.1 and confirm model slug

The slug claude-opus-4-1-20250805 matches Anthropic’s official ID as of August 2025. Since MESSAGE_MODELS[0] drives the default in chat actions, inserting Opus 4.1 at index 0 changes the default model. Please confirm:

  • Opus 4.1 is generally available to all users (rollout readiness).
  • The default bump to Opus 4.1 is intentional and acceptable.

Consider adding an inline note to highlight that index 0 must hold the latest model:

 export default {
   MESSAGE_MODELS: [
+    // NOTE: Keep the latest generally-available Claude model at index 0.
+    // Chat actions default to MESSAGE_MODELS[0].value.
     {
       label: "Claude Opus 4.1",
       value: "claude-opus-4-1-20250805",
     },
components/openai/actions/create-transcription/create-transcription.mjs (1)

4-5: Looks consistent with refactor; small UX improvement suggestion

Import/use of TRANSCRIPTION_MODELS and version bump are good. Consider validating response_format based on model to fail fast (gpt-4o(-mini)-transcribe supports only json).

   async run({ $ }) {
+    // Guard: enforce response_format=json for 4o-transcribe models
+    if (
+      ["gpt-4o-transcribe", "gpt-4o-mini-transcribe"].includes(this.model) &&
+      this.response_format && this.response_format !== "json"
+    ) {
+      throw new Error("For gpt-4o-transcribe models, response_format must be 'json'.");
+    }

Also applies to: 10-10, 24-25, 70-75

components/openai/actions/create-thread/create-thread.mjs (1)

91-93: Optional: return label/value pairs for consistency

Other props often surface options as { label, value }. You can keep strings, but to be consistent and future-proof, consider:

-      return models.map(({ id }) => id);
+      return models.map(({ id }) => ({ label: id, value: id }));
components/openai/openai.app.mjs (1)

360-361: Chat completion filter updated to include GPT‑5 — good; consider centralizing

Regex covers 4o, o*, 4.1, and gpt-5. To avoid future drift with assistants filtering, consider consolidating chat filtering substrings/regex into the shared models module, similar to assistants.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5ce46c3 and 947cf23.

📒 Files selected for processing (11)
  • components/anthropic/actions/chat/chat.mjs (1 hunks)
  • components/anthropic/actions/common/constants.mjs (1 hunks)
  • components/anthropic/package.json (1 hunks)
  • components/openai/actions/chat-using-web-search/chat-using-web-search.mjs (2 hunks)
  • components/openai/actions/create-image/create-image.mjs (2 hunks)
  • components/openai/actions/create-moderation/create-moderation.mjs (2 hunks)
  • components/openai/actions/create-thread/create-thread.mjs (2 hunks)
  • components/openai/actions/create-transcription/create-transcription.mjs (2 hunks)
  • components/openai/common/constants.mjs (0 hunks)
  • components/openai/common/models.mjs (1 hunks)
  • components/openai/openai.app.mjs (5 hunks)
💤 Files with no reviewable changes (1)
  • components/openai/common/constants.mjs
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.

Applied to files:

  • components/anthropic/package.json
📚 Learning: 2025-05-27T01:47:08.604Z
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#16831
File: components/anthropic/actions/common/constants.mjs:3-10
Timestamp: 2025-05-27T01:47:08.604Z
Learning: The correct Claude 4 model identifiers in Anthropic's API are `claude-opus-4-20250514` for Claude Opus 4 and `claude-sonnet-4-20250514` for Claude Sonnet 4, as confirmed by official Anthropic documentation and direct consultation with Claude.

Applied to files:

  • components/anthropic/actions/common/constants.mjs
📚 Learning: 2025-07-01T17:01:46.327Z
Learnt from: js07
PR: PipedreamHQ/pipedream#17375
File: components/tinypng/actions/compress-image/compress-image.mjs:18-23
Timestamp: 2025-07-01T17:01:46.327Z
Learning: In TinyPNG compress-image action (components/tinypng/actions/compress-image/compress-image.mjs), the syncDir property uses accessMode: "read" because this action only reads input files and returns API responses without writing files to /tmp, unlike other TinyPNG actions that save processed files to disk.

Applied to files:

  • components/openai/actions/create-image/create-image.mjs
  • components/openai/actions/create-transcription/create-transcription.mjs
📚 Learning: 2024-10-30T15:24:39.294Z
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".

Applied to files:

  • components/openai/actions/create-image/create-image.mjs
  • components/openai/actions/create-transcription/create-transcription.mjs
🧬 Code Graph Analysis (6)
components/openai/actions/chat-using-web-search/chat-using-web-search.mjs (1)
components/openai/common/models.mjs (2)
  • WEB_SEARCH_CHAT_MODELS (64-67)
  • WEB_SEARCH_CHAT_MODELS (64-67)
components/openai/actions/create-moderation/create-moderation.mjs (1)
components/openai/common/models.mjs (2)
  • MODERATION_MODELS (42-45)
  • MODERATION_MODELS (42-45)
components/openai/actions/create-image/create-image.mjs (1)
components/openai/common/models.mjs (2)
  • IMAGE_MODELS (37-40)
  • IMAGE_MODELS (37-40)
components/openai/actions/create-transcription/create-transcription.mjs (1)
components/openai/common/models.mjs (2)
  • TRANSCRIPTION_MODELS (70-74)
  • TRANSCRIPTION_MODELS (70-74)
components/openai/actions/create-thread/create-thread.mjs (1)
components/openai/openai.app.mjs (6)
  • models (45-45)
  • models (350-353)
  • models (357-359)
  • models (363-365)
  • models (374-376)
  • models (385-387)
components/openai/openai.app.mjs (1)
components/openai/common/models.mjs (8)
  • TTS_MODELS (32-35)
  • TTS_MODELS (32-35)
  • FINE_TUNING_MODEL_OPTIONS (1-30)
  • FINE_TUNING_MODEL_OPTIONS (1-30)
  • ASSISTANTS_MODEL_INCLUDE_SUBSTRINGS (48-56)
  • ASSISTANTS_MODEL_INCLUDE_SUBSTRINGS (48-56)
  • ASSISTANTS_MODEL_EXCLUDED (59-61)
  • ASSISTANTS_MODEL_EXCLUDED (59-61)
🔇 Additional comments (14)
components/anthropic/package.json (1)

3-3: All Anthropic versions updated to 0.2.0

  • components/anthropic/package.json: version set to 0.2.0
  • components/anthropic/actions/chat/chat.mjs: version field matches 0.2.0
  • No remaining “0.1.0” references found under components/anthropic
components/anthropic/actions/chat/chat.mjs (1)

6-6: Version bump aligned; heads-up on implicit default model change.

Bumping to 0.2.0 looks good. Since the default model relies on constants.MESSAGE_MODELS[0], adding Opus 4.1 at index 0 changes the default model for this action. Confirm that this implicit default switch is intentional and that tenants have access to 4.1 to avoid failures.

components/openai/common/models.mjs (3)

63-67: Centralization looks good

WEB_SEARCH_CHAT_MODELS centralization is consistent with the refactor and improves maintainability.


70-74: Transcription models list LGTM

Matches usage constraints referenced in the action docs. No issues spotted.


19-29: Confirm GPT-4.1 date-stamped models support fine-tuning

The entries

  • gpt-4.1-2025-04-14
  • gpt-4.1-mini-2025-04-14

correspond to the April 14 2025 releases of GPT-4.1 and its mini variant, both of which are supported for fine-tuning as of August 2025. No changes are needed here—those IDs are valid for your fine-tuning workflows.

components/openai/actions/create-moderation/create-moderation.mjs (1)

2-2: Import swap and version bump are correct

Using MODERATION_MODELS from models.mjs aligns with the refactor; version bump is appropriate.

Also applies to: 8-8, 21-21

components/openai/actions/create-image/create-image.mjs (1)

4-4: Model options centralization looks good

Importing IMAGE_MODELS and wiring it to the model prop is consistent with the refactor; version bump is appropriate.

Also applies to: 8-8, 18-19

components/openai/actions/chat-using-web-search/chat-using-web-search.mjs (1)

4-5: Model list centralization + default selection LGTM

Using WEB_SEARCH_CHAT_MODELS and defaulting to its first entry reduces drift across the codebase. Version bump is appropriate.

Also applies to: 9-10, 19-21

components/openai/actions/create-thread/create-thread.mjs (2)

9-9: Version bump looks good

No issues with the version increment to 0.0.16.


91-93: Good move to centralized assistants model source

Switching to this.openai.getAssistantsModels({}) aligns this action with the new shared filtering logic and reduces local duplication.

components/openai/openai.app.mjs (4)

3-7: Centralized model constants import — LGTM

Importing from ./common/models.mjs removes hard-coded arrays from constants and improves maintainability.


276-277: Switch to shared TTS and fine-tuning options — LGTM

Using TTS_MODELS and FINE_TUNING_MODEL_OPTIONS from the centralized models module is consistent and reduces drift. Shapes (string[] vs {label,value}[]) match prop expectations.

Also applies to: 282-283


388-391: Assistants model filter via include/exclude lists — LGTM

Filtering by ASSISTANTS_MODEL_INCLUDE_SUBSTRINGS with explicit exclusions is clear and maintainable. Nice improvement over scattered substring checks.


29-29: Default model “gpt-5-mini” availability verified
OpenAI’s documentation confirms that “gpt-5-mini” is generally available to all API users, so keeping it as the default poses no access issues.

Comment on lines +19 to 21
default: WEB_SEARCH_CHAT_MODELS[0],
options: WEB_SEARCH_CHAT_MODELS,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Optional: verify supported models for the web search tool

If OpenAI adjusts tool support per model, this list may drift. Consider verifying tool compatibility during CI.


🌐 Web query:

Which OpenAI models currently support the "web_search_preview" tool for the Responses API?

💡 Result:

The "web_search_preview" tool for the OpenAI Responses API is currently supported by the following models:

  • GPT-4o and GPT-4o-mini are both fully supported and officially documented as compatible with the "web_search_preview" tool when using the Responses API[3][5][7].
  • GPT-4.1 and GPT-4.1-mini are also supported, but with some limitations (such as context window size and excluding specific variants—see below)[1][9].

Key limitations and additional notes:

  • GPT-4.1-nano does not support the web_search_preview tool[1].
  • The tool is not available for o3-mini and, in some contexts, other smaller or non-primary variants[10].
  • The web_search functionality in the API provides responses with inline citations from web sources and can be paired with other tools for agentic applications[3][7].
  • Chat Completions API uses dedicated search models (gpt-4o-search-preview, gpt-4o-mini-search-preview), which have different support parameters—refer to individual model documentation for details[1][3][10].

Summary Table:

Model name Supports "web_search_preview" (Responses API) Notes
gpt-4o Full support, recommended
gpt-4o-mini Full support
gpt-4.1 Full support, but context window capped at 128,000 tokens
gpt-4.1-mini Full support, same context window cap
gpt-4.1-nano Not supported

For the most robust and up-to-date web search capability via the Responses API, use gpt-4o or gpt-4o-mini[3][5][7].

Citations:


Ensure only supported models are listed for web_search_preview and automate compatibility checks

Based on the latest OpenAI docs, only the following models support the web_search_preview tool in the Responses API (excluding gpt-4.1-nano and other non-primary variants):

  • gpt-4o
  • gpt-4o-mini
  • gpt-4.1
  • gpt-4.1-mini

Please:

  • Update WEB_SEARCH_CHAT_MODELS in
    components/openai/actions/chat-using-web-search/chat-using-web-search.mjs
    to exactly these four supported model names.
  • Add a CI step (e.g., a simple script against https://api.openai.com/v1/tools) that verifies web_search_preview support hasn’t drifted whenever this list is changed.
🤖 Prompt for AI Agents
In components/openai/actions/chat-using-web-search/chat-using-web-search.mjs
around lines 19 to 21, update the WEB_SEARCH_CHAT_MODELS array to include only
the four supported models: gpt-4o, gpt-4o-mini, gpt-4.1, and gpt-4.1-mini,
removing any others like gpt-4.1-nano. Additionally, create a new CI script that
queries the OpenAI tools API endpoint to verify that these models still support
the web_search_preview tool, ensuring the list remains accurate over time.

Comment on lines +48 to +56
export const ASSISTANTS_MODEL_INCLUDE_SUBSTRINGS = [
"gpt-3.5-turbo",
"gpt-4-turbo",
"gpt-4o",
"gpt-4.1",
"gpt-5",
"gpt-5-mini",
"gpt-5-nano",
];
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Prevent accidental inclusion of non-Assistants-safe models

Filtering by substrings can pull in models like transcribe/realtime variants (e.g., "gpt-4o-transcribe") into Assistants model options. Add explicit exclusions to the excluded list to be safe.

 export const ASSISTANTS_MODEL_EXCLUDED = [
   "gpt-3.5-turbo-0301",
+  // Not valid for Assistants model selection
+  "gpt-4o-transcribe",
+  "gpt-4o-mini-transcribe",
+  // Common non-chat families you may want to exclude proactively if surfaced elsewhere
+  "gpt-4o-realtime-preview", // example; adjust to actual IDs if present
 ];

If filtering logic exists in openai.app.mjs, consider enforcing a predicate that excludes IDs ending with "-transcribe" and "-realtime" instead of maintaining a manual list. Want me to propose that change?

Also applies to: 59-61

🤖 Prompt for AI Agents
In components/openai/common/models.mjs around lines 48 to 56 and 59 to 61, the
current substring filtering for Assistants models may unintentionally include
models with suffixes like "-transcribe" or "-realtime". To fix this, update the
filtering logic to explicitly exclude model IDs ending with these suffixes by
adding a predicate that filters out any model strings ending with "-transcribe"
or "-realtime" instead of relying solely on substring inclusion. This will
prevent accidental inclusion of non-Assistants-safe models.

Comment on lines +354 to 355
return models.sort((a, b) => b?.created - a?.created);
},
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Handle undefined creation timestamps in sort comparator

Some model objects may not expose created. A NaN comparator can lead to unstable ordering. Add a fallback and a stable tie-breaker:

-      return models.sort((a, b) => b?.created - a?.created);
+      return models.sort((a, b) => {
+        const bc = typeof b?.created === "number" ? b.created : -Infinity;
+        const ac = typeof a?.created === "number" ? a.created : -Infinity;
+        if (bc !== ac) return bc - ac; // newer first
+        return String(a?.id).localeCompare(String(b?.id)); // stable tie-break
+      });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
return models.sort((a, b) => b?.created - a?.created);
},
return models.sort((a, b) => {
const bc = typeof b?.created === "number" ? b.created : -Infinity;
const ac = typeof a?.created === "number" ? a.created : -Infinity;
if (bc !== ac) return bc - ac; // newer first
return String(a?.id).localeCompare(String(b?.id)); // stable tie-break
});
🤖 Prompt for AI Agents
In components/openai/openai.app.mjs around lines 354 to 355, the sort comparator
does not handle cases where the created timestamp is undefined, which can cause
NaN results and unstable sorting. Update the comparator to provide a fallback
value (e.g., 0) for undefined created timestamps and add a stable tie-breaker
such as comparing model IDs or names to ensure consistent ordering.

Copy link
Collaborator

@luancazarine luancazarine left a comment

Choose a reason for hiding this comment

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

Hi @GTFalcao, LGTM! Ready for QA!

@luancazarine luancazarine moved this from Ready for PR Review to Ready for QA in Component (Source and Action) Backlog Aug 11, 2025
@vunguyenhung vunguyenhung moved this from Ready for QA to In QA in Component (Source and Action) Backlog Aug 12, 2025
@vunguyenhung vunguyenhung moved this from In QA to Ready for Release in Component (Source and Action) Backlog Aug 12, 2025
@vunguyenhung
Copy link
Collaborator

Hi everyone, all test cases are passed! Ready for release!

Test report
https://vunguyenhung.notion.site/Adding-new-GPT-and-Claude-models-24cbf548bb5e8191aed8e6cb6fa365e9

@vunguyenhung vunguyenhung merged commit b80a5aa into master Aug 12, 2025
11 checks passed
@vunguyenhung vunguyenhung deleted the openai-model-updates branch August 12, 2025 02:16
@github-project-automation github-project-automation bot moved this from Ready for Release to Done in Component (Source and Action) Backlog Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants