Skip to content

fix: exclude chat/search variants from reasoning-model detection (#902)#1520

Open
rochmanofenna wants to merge 1 commit into
getzep:mainfrom
rochmanofenna:fix/reasoning-model-detection-chat-variants
Open

fix: exclude chat/search variants from reasoning-model detection (#902)#1520
rochmanofenna wants to merge 1 commit into
getzep:mainfrom
rochmanofenna:fix/reasoning-model-detection-chat-variants

Conversation

@rochmanofenna

Copy link
Copy Markdown

Summary

Fixes #902.

OpenAIClient decides whether to send reasoning.effort via model.startswith(('gpt-5','o1','o3')). That also matches non-reasoning variants i.e. gpt-5-chat-latest, gpt-5.3-chat-latest, gpt-5-search-api, which reject the parameter and return:
400 - Unsupported parameter: 'reasoning.effort' is not supported with this model.

This is the failure reported in #902.

Type of Change

  • Bug fix
  • New feature
  • Performance improvement
  • Documentation/Tests

Objective

Extract the detection into a shared _is_reasoning_model() helper used by both completion paths (the predicate was duplicated), and exclude -chat/-search variants so they route through the normal path without the reasoning param.

Distinct from #1378/#1395, which change the effort value (minimallow). For chat/search variants no value works, the parameter itself is unsupported. gpt-5-mini and other true reasoning models remain correctly classified.

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • All existing tests pass

Added tests/llm_client/test_openai_reasoning_detection.py (parametrized: reasoning models → True, chat/search variants → False, gpt-4o/4.1 → False). make format, make lint, make pyright all clean.

Breaking Changes

  • This PR contains breaking changes

Checklist

  • Code follows project style guidelines (make lint passes)
  • Self-review completed
  • Documentation updated where necessary
  • No secrets or sensitive information committed

Related Issues

Closes #902

Open question for maintainers

The same prefix check is mirrored in mcp_server/src/services/factories.py. I scoped this PR to graphiti_core (self-contained, benefits all consumers). Happy to extend to the MCP factory here or in a follow-up.

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.

[BUG] OpenAI internal call broken

1 participant