Skip to content

fix: Fix reasoning_effort not being passed through to OpenAI Chat Completion API#753

Merged
mikehostetler merged 1 commit into
agentjido:mainfrom
green-david:dg-fix-chat-api-reasoning-effort
Jun 4, 2026
Merged

fix: Fix reasoning_effort not being passed through to OpenAI Chat Completion API#753
mikehostetler merged 1 commit into
agentjido:mainfrom
green-david:dg-fix-chat-api-reasoning-effort

Conversation

@green-david
Copy link
Copy Markdown
Contributor

@green-david green-david commented Jun 4, 2026

Description

This is in the same vein as #244. While testing Groq, I noticed that reasoning_effort was not getting passed through and sent to the Chat Completions API for GPT OSS models. The ChatAPI module was retrieving reasoning_effort from provider options, but it is a global common option that appears to be handled almost exclusively as a top-level option, not a provider option.

Type of Change

  • Bug fix (non-breaking change fixing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature causing existing functionality to change)
  • Documentation update

Breaking Changes

I don't think this is a breaking change as it didn't appear to work as documented in the first place.

Testing

  • Tests pass (mix test)
  • Quality checks pass (mix quality)

Checklist

  • My code follows the project's style guidelines
  • I have updated the documentation accordingly
  • I have added tests that prove my fix/feature works
  • All new and existing tests pass
  • My commits follow conventional commit format
  • I have NOT edited CHANGELOG.md (it is auto-generated by git_ops)

Related Issues

#244

@mikehostetler mikehostetler added the needs_work Changes requested before merge label Jun 4, 2026
@mikehostetler
Copy link
Copy Markdown
Contributor

Thanks for the contribution here. The implementation is directionally right, the PR is merge-clean, and CI is green.

I marked this needs_work because the exact bug fix needs a focused regression test: top-level reasoning_effort should make it into the OpenAI Chat Completions request body, not only when nested under provider_options. A small provider/unit test around ChatAPI.encode_body/1 or OpenAI.prepare_request/4 for a chat-compatible model should be enough. Once that coverage is in, this should be in good shape.

@green-david green-david force-pushed the dg-fix-chat-api-reasoning-effort branch from 755aa52 to 214fe82 Compare June 4, 2026 21:44
@green-david
Copy link
Copy Markdown
Contributor Author

@mikehostetler Thanks for taking a look. I force-pushed an update adding a test in test/providers/openai_test.exs. Let me know if this needs anything else!

@mikehostetler mikehostetler added ready_to_merge and removed needs_work Changes requested before merge labels Jun 4, 2026
@mikehostetler mikehostetler merged commit 91841d6 into agentjido:main Jun 4, 2026
17 checks passed
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.

2 participants