Skip to content

fix: max reasoning effort in openai - #5130

Merged
Pratham-Mishra04 merged 1 commit into
devfrom
07-13-fix_max_reasoning_effort_in_openai
Jul 13, 2026
Merged

fix: max reasoning effort in openai#5130
Pratham-Mishra04 merged 1 commit into
devfrom
07-13-fix_max_reasoning_effort_in_openai

Conversation

@TejasGhatte

@TejasGhatte TejasGhatte commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds support for context and mode fields in the ResponsesParametersReasoning schema, and extends the reasoning effort normalization logic to treat gpt-5.6 as a model that natively supports "max" effort (and "xhigh"), bypassing the downgrade path applied to earlier GPT-5.x models.

Changes

  • Added Context and Mode fields to ResponsesParametersReasoning, allowing callers to specify which reasoning items are rendered back to the model on later turns (context) and the reasoning execution mode (mode).
  • Propagated Context and Mode through MarshalJSON on OpenAIResponsesRequest so they are included in the serialized output alongside the existing Effort, GenerateSummary, and Summary fields.
  • Added gpt-5.6 to supportsXHighReasoningEffort and supportsMaxReasoningEffort, so that "max" and "xhigh" efforts are passed through without downgrade for that model family.
  • Added TestNormalizeOpenAIReasoningEffort to cover the effort normalization logic across multiple model prefixes and effort values.
  • Extended the existing MarshalJSON test to assert that reasoning.context and reasoning.mode are preserved in the JSON output.

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/... ./core/schemas/...
  • Verify TestNormalizeOpenAIReasoningEffort passes and covers gpt-5.6 keeping "max" and "xhigh" without downgrade.
  • Verify the MarshalJSON test case "reasoning context and mode are preserved while max_tokens is dropped" passes, confirming context and mode appear in the serialized JSON while max_tokens is omitted.

Breaking changes

  • Yes
  • No

Related issues

Security considerations

No security implications. These are additive schema fields passed through to the OpenAI Responses API.

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 Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

OpenAI reasoning parameters now support optional context and mode fields, preserve them during response request marshaling, omit max_tokens, and recognize additional models for xhigh and max reasoning-effort normalization. Tests cover serialization and normalization cases.

Changes

OpenAI reasoning configuration

Layer / File(s) Summary
Reasoning fields and serialization
core/schemas/responses.go, core/providers/openai/types.go, core/providers/openai/responses_marshal_test.go
Reasoning parameters add optional context and mode; OpenAI marshaling preserves these fields while omitting max_tokens, with corresponding JSON assertions.
Reasoning-effort model classification
core/providers/openai/utils.go, core/providers/openai/responses_marshal_test.go
Reasoning-effort support includes gpt-5.5 and gpt-5.6, and normalization tests cover model-specific effort mappings.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • maximhq/bifrost#4467: Updates OpenAI reasoning-effort model handling and tests for preserving max.

Suggested reviewers: akshaydeo, danpiths

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR changes reasoning-effort handling, not the requested Files API support in issue #123. Implement the Files API support requested in #123 or retarget this PR to the correct linked issue.
Out of Scope Changes check ⚠️ Warning All code changes are unrelated to the linked Files API objective and appear out of scope for #123. Remove the reasoning-effort changes or split them into a separate PR tied to the correct issue.
✅ 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 accurately summarizes the main change: OpenAI reasoning-effort handling, including max effort support.
Description check ✅ Passed The description covers the required sections, with summary, changes, testing, and status details filled in adequately.
✨ 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 07-13-fix_max_reasoning_effort_in_openai

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

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


tejas ghatte seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@TejasGhatte
TejasGhatte marked this pull request as ready for review July 13, 2026 06:51

Copy link
Copy Markdown
Collaborator Author

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

@coderabbitai
coderabbitai Bot requested review from akshaydeo and danpiths July 13, 2026 06:52
@greptile-apps

greptile-apps Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5

The changed OpenAI Responses serialization path needs fixes before merging.

  • Compatible-provider Responses requests can now receive new reasoning keys they may not accept.
  • Context-only or mode-only reasoning requests can serialize effort as null.
  • The GPT-5.6 effort normalization change is small and covered by direct tests.

core/providers/openai/types.go

Important Files Changed

Filename Overview
core/providers/openai/types.go The Responses marshaler now forwards reasoning.context and reasoning.mode, which can affect compatible-provider payloads and context-only reasoning requests.
core/providers/openai/utils.go Reasoning effort normalization now keeps max and xhigh for GPT-5.6 models.
core/schemas/responses.go The shared Responses reasoning schema now includes optional context and mode fields and documents wider effort values.
core/providers/openai/responses_marshal_test.go Tests now cover context/mode preservation and GPT-5.6 reasoning effort normalization.

Reviews (1): Last reviewed commit: "fix: max reasoning effort in openai" | Re-trigger Greptile

Comment thread core/providers/openai/types.go
Comment thread core/providers/openai/types.go

Pratham-Mishra04 commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Merge activity

  • Jul 13, 9:03 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 13, 9:04 AM UTC: @Pratham-Mishra04 merged this pull request with Graphite.

@Pratham-Mishra04
Pratham-Mishra04 merged commit 344d2ea into dev Jul 13, 2026
15 of 16 checks passed
@Pratham-Mishra04
Pratham-Mishra04 deleted the 07-13-fix_max_reasoning_effort_in_openai branch July 13, 2026 09:04
tcx4c70 added a commit to tcx4c70/bifrost that referenced this pull request Jul 13, 2026
* origin/dev: (79 commits)
  chore: add `helm-update` Claude skill for syncing Helm chart with `config.schema.json` (maximhq#5144)
  fix: web search options to google search mapping in gemini api (maximhq#5139)
  feat: add `postgresql.external.port` string support and `bifrost.mcp.toolGroups[*].id` to Helm chart (maximhq#5143)
  fix: parse `SecretVar` JSON with `ref`/`env_var` fields even when `value` is absent (maximhq#5146)
  Revert "fix: less strict unmarshalling for secret var (maximhq#4723)" (maximhq#5145)
  fix: max reasoning effort in openai (maximhq#5130)
  chore: replace manual `helm registry login` steps with `step-security/docker-login-action` (maximhq#5132)
  fix: support GA transcription-type sessions in POST /v1/realtime/client_secrets (maximhq#5092)
  community: add Xquik to MCP library (maximhq#5069)
  fix: warn callers not to truncate the #t= temp-token fragment on MCP inline-auth links (maximhq#5104)
  chore: build fix in core (maximhq#5129)
  fix: never persist masked provider key previews (maximhq#5106)
  Filter out provider-level keys from selector in prompt manager (maximhq#5018)
  fix: show user popover when `userInfo` exists and include `preferred_username` as display name fallback (maximhq#5098)
  fix: use `AutoMigrate` and add `runner_id`/`created_by_user_id` columns to sidekiq table migration (maximhq#5085)
  dds new harness skill and updates based on merged PRs (maximhq#5126)
  dds new harness skill and updates based on merged PRs (maximhq#5123)
  Add Trendshift badge to README (maximhq#5124)
  fix: make tracing span lookup nil-safe to prevent panic on streaming errors (maximhq#4896)
  Revert "fix: synthesize per-query rerank usage for Bedrock and Vertex (maximhq#4322)" (maximhq#5122)
  ...
@TejasGhatte TejasGhatte mentioned this pull request Jul 13, 2026
17 tasks
Pratham-Mishra04 pushed a commit that referenced this pull request Jul 13, 2026
## Summary

Adds E2E harness test coverage for two recently merged PRs: Gemini `web_search_options` → `googleSearch` tool mapping with `url_citation` annotation passback (PR #5139), and OpenAI Responses API `reasoning.effort` normalization for `max`/`xhigh` values across GPT-5.x model variants (PR #5130). The backlog item for `web_search_options` is also marked as complete.

## Changes

- Marks `web_search_options` as covered in `HARNESS_COVERAGE_BACKLOG.md`
- Adds harness collection group **22** covering Gemini `web_search_options` → `googleSearch` translation, asserting that `url_citation` annotations are present in both non-streaming and SSE streaming responses (previously the option was silently dropped and no annotations were returned)
- Adds harness collection group **23** covering `normalizeOpenAIReasoningEffort` behavior:
  - `gpt-5.6` passes `effort: "max"` through unchanged and the response echoes it back as `"max"`
  - `gpt-5` downgrades `effort: "max"` to `"high"` so the upstream does not return a 400
  - `gpt-5.6` accepts and echoes `reasoning.context` and `reasoning.mode` fields that were previously stripped before serialization

## Type of change

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

## Affected areas

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

## How to test

Import `tests/e2e/api/collections/provider-harness.json` into Postman or Newman and run groups 22 and 23 against a live environment with valid API keys for Gemini and OpenAI.

```sh
newman run tests/e2e/api/collections/provider-harness.json \
  --env-var baseUrl=<your-proxy-url> \
  --folder "22. Gemini web_search_options → googleSearch (PR #5139)" \
  --folder "23. OpenAI Responses reasoning.effort max normalization (PR #5130)"
```

Each test skips gracefully on 401/403/429/5xx so transient upstream errors do not cause false failures. A passing run confirms annotations are present for Gemini grounding responses and that `reasoning.effort` values are correctly normalized or passed through depending on the model.

## Screenshots/Recordings

N/A

## Breaking changes

- [x] No

## Related issues

Closes coverage tracking for PR #5139 and PR #5130.

## Security considerations

None. Tests only assert on response shape; no credentials are stored in the collection.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
akshaydeo pushed a commit that referenced this pull request Jul 14, 2026
## Summary

Adds support for `context` and `mode` fields in the `ResponsesParametersReasoning` schema, and extends the reasoning effort normalization logic to treat `gpt-5.6` as a model that natively supports `"max"` effort (and `"xhigh"`), bypassing the downgrade path applied to earlier GPT-5.x models.

## Changes

- Added `Context` and `Mode` fields to `ResponsesParametersReasoning`, allowing callers to specify which reasoning items are rendered back to the model on later turns (`context`) and the reasoning execution mode (`mode`).
- Propagated `Context` and `Mode` through `MarshalJSON` on `OpenAIResponsesRequest` so they are included in the serialized output alongside the existing `Effort`, `GenerateSummary`, and `Summary` fields.
- Added `gpt-5.6` to `supportsXHighReasoningEffort` and `supportsMaxReasoningEffort`, so that `"max"` and `"xhigh"` efforts are passed through without downgrade for that model family.
- Added `TestNormalizeOpenAIReasoningEffort` to cover the effort normalization logic across multiple model prefixes and effort values.
- Extended the existing `MarshalJSON` test to assert that `reasoning.context` and `reasoning.mode` are preserved in the JSON output.

## Type of change

- [ ] Bug fix
- [x] 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/... ./core/schemas/...
```

- Verify `TestNormalizeOpenAIReasoningEffort` passes and covers `gpt-5.6` keeping `"max"` and `"xhigh"` without downgrade.
- Verify the `MarshalJSON` test case `"reasoning context and mode are preserved while max_tokens is dropped"` passes, confirming `context` and `mode` appear in the serialized JSON while `max_tokens` is omitted.

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

## Security considerations

No security implications. These are additive schema fields passed through to the OpenAI Responses API.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [x] 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 pushed a commit that referenced this pull request Jul 14, 2026
## Summary

Adds E2E harness test coverage for two recently merged PRs: Gemini `web_search_options` → `googleSearch` tool mapping with `url_citation` annotation passback (PR #5139), and OpenAI Responses API `reasoning.effort` normalization for `max`/`xhigh` values across GPT-5.x model variants (PR #5130). The backlog item for `web_search_options` is also marked as complete.

## Changes

- Marks `web_search_options` as covered in `HARNESS_COVERAGE_BACKLOG.md`
- Adds harness collection group **22** covering Gemini `web_search_options` → `googleSearch` translation, asserting that `url_citation` annotations are present in both non-streaming and SSE streaming responses (previously the option was silently dropped and no annotations were returned)
- Adds harness collection group **23** covering `normalizeOpenAIReasoningEffort` behavior:
  - `gpt-5.6` passes `effort: "max"` through unchanged and the response echoes it back as `"max"`
  - `gpt-5` downgrades `effort: "max"` to `"high"` so the upstream does not return a 400
  - `gpt-5.6` accepts and echoes `reasoning.context` and `reasoning.mode` fields that were previously stripped before serialization

## Type of change

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

## Affected areas

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

## How to test

Import `tests/e2e/api/collections/provider-harness.json` into Postman or Newman and run groups 22 and 23 against a live environment with valid API keys for Gemini and OpenAI.

```sh
newman run tests/e2e/api/collections/provider-harness.json \
  --env-var baseUrl=<your-proxy-url> \
  --folder "22. Gemini web_search_options → googleSearch (PR #5139)" \
  --folder "23. OpenAI Responses reasoning.effort max normalization (PR #5130)"
```

Each test skips gracefully on 401/403/429/5xx so transient upstream errors do not cause false failures. A passing run confirms annotations are present for Gemini grounding responses and that `reasoning.effort` values are correctly normalized or passed through depending on the model.

## Screenshots/Recordings

N/A

## Breaking changes

- [x] No

## Related issues

Closes coverage tracking for PR #5139 and PR #5130.

## Security considerations

None. Tests only assert on response shape; no credentials are stored in the collection.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
akhsaul pushed a commit to akhsaul/bifrost that referenced this pull request Aug 27, 2026
## Summary

Adds support for `context` and `mode` fields in the `ResponsesParametersReasoning` schema, and extends the reasoning effort normalization logic to treat `gpt-5.6` as a model that natively supports `"max"` effort (and `"xhigh"`), bypassing the downgrade path applied to earlier GPT-5.x models.

## Changes

- Added `Context` and `Mode` fields to `ResponsesParametersReasoning`, allowing callers to specify which reasoning items are rendered back to the model on later turns (`context`) and the reasoning execution mode (`mode`).
- Propagated `Context` and `Mode` through `MarshalJSON` on `OpenAIResponsesRequest` so they are included in the serialized output alongside the existing `Effort`, `GenerateSummary`, and `Summary` fields.
- Added `gpt-5.6` to `supportsXHighReasoningEffort` and `supportsMaxReasoningEffort`, so that `"max"` and `"xhigh"` efforts are passed through without downgrade for that model family.
- Added `TestNormalizeOpenAIReasoningEffort` to cover the effort normalization logic across multiple model prefixes and effort values.
- Extended the existing `MarshalJSON` test to assert that `reasoning.context` and `reasoning.mode` are preserved in the JSON output.

## Type of change

- [ ] Bug fix
- [x] 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/... ./core/schemas/...
```

- Verify `TestNormalizeOpenAIReasoningEffort` passes and covers `gpt-5.6` keeping `"max"` and `"xhigh"` without downgrade.
- Verify the `MarshalJSON` test case `"reasoning context and mode are preserved while max_tokens is dropped"` passes, confirming `context` and `mode` appear in the serialized JSON while `max_tokens` is omitted.

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

## Security considerations

No security implications. These are additive schema fields passed through to the OpenAI Responses API.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [x] 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
akhsaul pushed a commit to akhsaul/bifrost that referenced this pull request Aug 27, 2026
## Summary

Adds E2E harness test coverage for two recently merged PRs: Gemini `web_search_options` → `googleSearch` tool mapping with `url_citation` annotation passback (PR maximhq#5139), and OpenAI Responses API `reasoning.effort` normalization for `max`/`xhigh` values across GPT-5.x model variants (PR maximhq#5130). The backlog item for `web_search_options` is also marked as complete.

## Changes

- Marks `web_search_options` as covered in `HARNESS_COVERAGE_BACKLOG.md`
- Adds harness collection group **22** covering Gemini `web_search_options` → `googleSearch` translation, asserting that `url_citation` annotations are present in both non-streaming and SSE streaming responses (previously the option was silently dropped and no annotations were returned)
- Adds harness collection group **23** covering `normalizeOpenAIReasoningEffort` behavior:
  - `gpt-5.6` passes `effort: "max"` through unchanged and the response echoes it back as `"max"`
  - `gpt-5` downgrades `effort: "max"` to `"high"` so the upstream does not return a 400
  - `gpt-5.6` accepts and echoes `reasoning.context` and `reasoning.mode` fields that were previously stripped before serialization

## Type of change

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

## Affected areas

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

## How to test

Import `tests/e2e/api/collections/provider-harness.json` into Postman or Newman and run groups 22 and 23 against a live environment with valid API keys for Gemini and OpenAI.

```sh
newman run tests/e2e/api/collections/provider-harness.json \
  --env-var baseUrl=<your-proxy-url> \
  --folder "22. Gemini web_search_options → googleSearch (PR maximhq#5139)" \
  --folder "23. OpenAI Responses reasoning.effort max normalization (PR maximhq#5130)"
```

Each test skips gracefully on 401/403/429/5xx so transient upstream errors do not cause false failures. A passing run confirms annotations are present for Gemini grounding responses and that `reasoning.effort` values are correctly normalized or passed through depending on the model.

## Screenshots/Recordings

N/A

## Breaking changes

- [x] No

## Related issues

Closes coverage tracking for PR maximhq#5139 and PR maximhq#5130.

## Security considerations

None. Tests only assert on response shape; no credentials are stored in the collection.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [x] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
occcat pushed a commit to occcat/bifrost that referenced this pull request Sep 2, 2026
## Summary

Adds support for `context` and `mode` fields in the `ResponsesParametersReasoning` schema, and extends the reasoning effort normalization logic to treat `gpt-5.6` as a model that natively supports `"max"` effort (and `"xhigh"`), bypassing the downgrade path applied to earlier GPT-5.x models.

## Changes

- Added `Context` and `Mode` fields to `ResponsesParametersReasoning`, allowing callers to specify which reasoning items are rendered back to the model on later turns (`context`) and the reasoning execution mode (`mode`).
- Propagated `Context` and `Mode` through `MarshalJSON` on `OpenAIResponsesRequest` so they are included in the serialized output alongside the existing `Effort`, `GenerateSummary`, and `Summary` fields.
- Added `gpt-5.6` to `supportsXHighReasoningEffort` and `supportsMaxReasoningEffort`, so that `"max"` and `"xhigh"` efforts are passed through without downgrade for that model family.
- Added `TestNormalizeOpenAIReasoningEffort` to cover the effort normalization logic across multiple model prefixes and effort values.
- Extended the existing `MarshalJSON` test to assert that `reasoning.context` and `reasoning.mode` are preserved in the JSON output.

## Type of change

- [ ] Bug fix
- [x] 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/... ./core/schemas/...
```

- Verify `TestNormalizeOpenAIReasoningEffort` passes and covers `gpt-5.6` keeping `"max"` and `"xhigh"` without downgrade.
- Verify the `MarshalJSON` test case `"reasoning context and mode are preserved while max_tokens is dropped"` passes, confirming `context` and `mode` appear in the serialized JSON while `max_tokens` is omitted.

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

## Security considerations

No security implications. These are additive schema fields passed through to the OpenAI Responses API.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [x] 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
occcat pushed a commit to occcat/bifrost that referenced this pull request Sep 2, 2026
## Summary

Adds E2E harness test coverage for two recently merged PRs: Gemini `web_search_options` → `googleSearch` tool mapping with `url_citation` annotation passback (PR maximhq#5139), and OpenAI Responses API `reasoning.effort` normalization for `max`/`xhigh` values across GPT-5.x model variants (PR maximhq#5130). The backlog item for `web_search_options` is also marked as complete.

## Changes

- Marks `web_search_options` as covered in `HARNESS_COVERAGE_BACKLOG.md`
- Adds harness collection group **22** covering Gemini `web_search_options` → `googleSearch` translation, asserting that `url_citation` annotations are present in both non-streaming and SSE streaming responses (previously the option was silently dropped and no annotations were returned)
- Adds harness collection group **23** covering `normalizeOpenAIReasoningEffort` behavior:
  - `gpt-5.6` passes `effort: "max"` through unchanged and the response echoes it back as `"max"`
  - `gpt-5` downgrades `effort: "max"` to `"high"` so the upstream does not return a 400
  - `gpt-5.6` accepts and echoes `reasoning.context` and `reasoning.mode` fields that were previously stripped before serialization

## Type of change

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

## Affected areas

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

## How to test

Import `tests/e2e/api/collections/provider-harness.json` into Postman or Newman and run groups 22 and 23 against a live environment with valid API keys for Gemini and OpenAI.

```sh
newman run tests/e2e/api/collections/provider-harness.json \
  --env-var baseUrl=<your-proxy-url> \
  --folder "22. Gemini web_search_options → googleSearch (PR maximhq#5139)" \
  --folder "23. OpenAI Responses reasoning.effort max normalization (PR maximhq#5130)"
```

Each test skips gracefully on 401/403/429/5xx so transient upstream errors do not cause false failures. A passing run confirms annotations are present for Gemini grounding responses and that `reasoning.effort` values are correctly normalized or passed through depending on the model.

## Screenshots/Recordings

N/A

## Breaking changes

- [x] No

## Related issues

Closes coverage tracking for PR maximhq#5139 and PR maximhq#5130.

## Security considerations

None. Tests only assert on response shape; no credentials are stored in the collection.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [x] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [x] 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.

3 participants