Skip to content

strip prefix check for openai reasoning models check (to accmodate mantle) - #5867

Merged
akshaydeo merged 1 commit into
devfrom
08-05-strip_prefix_check_for_openai_reasoning_models_check_to_accmodate_mantle_
Aug 5, 2026
Merged

strip prefix check for openai reasoning models check (to accmodate mantle)#5867
akshaydeo merged 1 commit into
devfrom
08-05-strip_prefix_check_for_openai_reasoning_models_check_to_accmodate_mantle_

Conversation

@akshaydeo

@akshaydeo akshaydeo commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes detection of GPT-5 series models so that reasoning effort support is correctly identified regardless of where "gpt-5" appears in the model name string (e.g., fine-tuned or versioned variants like ft:gpt-5-...).

Changes

  • Replaced strings.HasPrefix with strings.Contains when checking if a model belongs to the GPT-5 series, allowing model names that include "gpt-5" in positions other than the start to be correctly recognized as reasoning models.

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

go test ./core/providers/openai/...

Verify that model names such as ft:gpt-5-mini or other variants containing "gpt-5" not at the start of the string are correctly identified as reasoning models and have reasoning.effort applied.

Breaking changes

  • Yes
  • No

Related issues

Security considerations

None.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved detection of GPT-5 reasoning models when the model name includes “gpt-5” in a non-prefix position.

Walkthrough

Changes

OpenAI model detection

Layer / File(s) Summary
GPT-5 substring detection
core/providers/openai/utils.go
The GPT-5 reasoning-model check now recognizes gpt-5 anywhere in the normalized model name.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: tejasghatte

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR changes GPT-5 model detection but does not implement the linked issue's File APIs for OpenAI or Anthropic [#123]. Implement the required File APIs, including file upload support for fine-tuning, RAG, or larger context storage, or link the correct issue.
Out of Scope Changes check ⚠️ Warning The GPT-5 reasoning-model detection change is unrelated to the linked File APIs objective [#123]. Move the GPT-5 detection change to a related PR, or update the linked issues to include its model-detection objective.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly describes removing the prefix requirement for OpenAI reasoning-model detection to support additional model name formats.
Description check ✅ Passed The description explains the bug, changes, affected areas, testing command, and breaking-change status; optional checklist items remain unchecked.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 08-05-strip_prefix_check_for_openai_reasoning_models_check_to_accmodate_mantle_

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@akshaydeo
akshaydeo marked this pull request as ready for review August 5, 2026 13:40
@coderabbitai
coderabbitai Bot requested a review from TejasGhatte August 5, 2026 13:42

akshaydeo commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Aug 5, 2:13 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Aug 5, 2:14 PM UTC: @akshaydeo merged this pull request with Graphite.

@akshaydeo
akshaydeo merged commit ac9b4a1 into dev Aug 5, 2026
15 checks passed
@akshaydeo
akshaydeo deleted the 08-05-strip_prefix_check_for_openai_reasoning_models_check_to_accmodate_mantle_ branch August 5, 2026 14:14
akshaydeo added a commit that referenced this pull request Aug 7, 2026
…ntle) (#5867)

## Summary

Fixes detection of GPT-5 series models so that reasoning effort support is correctly identified regardless of where "gpt-5" appears in the model name string (e.g., fine-tuned or versioned variants like `ft:gpt-5-...`).

## Changes

- Replaced `strings.HasPrefix` with `strings.Contains` when checking if a model belongs to the GPT-5 series, allowing model names that include "gpt-5" in positions other than the start to be correctly recognized as reasoning models.

## Type of change

- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [x] Core (Go)
- [ ] Transports (HTTP)
- [x] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

```sh
go test ./core/providers/openai/...
```

Verify that model names such as `ft:gpt-5-mini` or other variants containing "gpt-5" not at the start of the string are correctly identified as reasoning models and have `reasoning.effort` applied.

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

## Security considerations

None.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
@akshaydeo akshaydeo mentioned this pull request Aug 7, 2026
18 tasks
atharvamhaske pushed a commit to atharvamhaske/bifrost that referenced this pull request Aug 13, 2026
…ntle) (maximhq#5867)

## Summary

Fixes detection of GPT-5 series models so that reasoning effort support is correctly identified regardless of where "gpt-5" appears in the model name string (e.g., fine-tuned or versioned variants like `ft:gpt-5-...`).

## Changes

- Replaced `strings.HasPrefix` with `strings.Contains` when checking if a model belongs to the GPT-5 series, allowing model names that include "gpt-5" in positions other than the start to be correctly recognized as reasoning models.

## Type of change

- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [x] Core (Go)
- [ ] Transports (HTTP)
- [x] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [ ] Docs

## How to test

```sh
go test ./core/providers/openai/...
```

Verify that model names such as `ft:gpt-5-mini` or other variants containing "gpt-5" not at the start of the string are correctly identified as reasoning models and have `reasoning.effort` applied.

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

## Security considerations

None.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
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.

2 participants