Skip to content

Conversation

@seratch
Copy link
Member

@seratch seratch commented Sep 26, 2025

This pull request adds type-safe reasoning.effort/summary and text.verbosity to ModelSettings. See the updated examples for how they can be used.

@changeset-bot
Copy link

changeset-bot bot commented Sep 26, 2025

🦋 Changeset detected

Latest commit: 7fcb874

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@openai/agents-openai Patch
@openai/agents-core Patch
@openai/agents Patch
@openai/agents-realtime Patch

Not sure what this means? Click here to learn what changesets are.

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

model: aisdk(openai('gpt-5-mini')),
modelSettings: {
providerData: {
providerOptions: {
Copy link
Member Author

Choose a reason for hiding this comment

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

Just to clarify: I didn't make any changes to ai-sdk integration; Passing these options is the standard way for ai-sdk provider for OAI, so I added example code.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

Comment on lines +301 to +312
const providerData = request.modelSettings.providerData ?? {};
if (
request.modelSettings.reasoning &&
request.modelSettings.reasoning.effort
) {
// merge the top-level reasoning.effort into provider data
providerData.reasoning_effort = request.modelSettings.reasoning.effort;
}
if (request.modelSettings.text && request.modelSettings.text.verbosity) {
// merge the top-level text.verbosity into provider data
providerData.verbosity = request.modelSettings.text.verbosity;
}

Choose a reason for hiding this comment

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

P1 Badge Strip GPT-5-only settings before forwarding to non-GPT-5 models

The new modelSettings.reasoning and .text fields are always translated into reasoning_effort and verbosity when building the chat-completions request. However, the existing compatibility shim that removes GPT‑5-only parameters when a run resolves to a non‑GPT‑5 model still only inspects providerData. If an agent uses the new typed fields and the runtime swaps to a non‑GPT‑5 model (e.g. the runner chooses gpt-4o), these lines will still populate reasoning_effort/verbosity and the OpenAI API rejects the request. The filter needs to include the new top-level fields or these assignments should be gated by model capabilities.

Useful? React with 👍 / 👎.

Copy link
Member Author

Choose a reason for hiding this comment

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

@codex can you suggest potential improvements for it?

Choose a reason for hiding this comment

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

Summary

Testing

  • ⚠️ pnpm test (not run; only provided review feedback)

View task →

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks, this is helpful. i will make the non-gpt-5 filter more robust

seratch added a commit that referenced this pull request Sep 26, 2025
@seratch seratch merged commit 3115177 into main Sep 26, 2025
5 checks passed
@seratch seratch deleted the model-settings branch September 26, 2025 01:29
seratch added a commit that referenced this pull request Sep 26, 2025
seratch added a commit that referenced this pull request Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants