Skip to content

feat(openai-codex): persist and send Fast priority mode - #1063

Open
WebMad wants to merge 2 commits into
Zoo-Code-Org:mainfrom
WebMad:feat/openai-codex-fast-backend
Open

feat(openai-codex): persist and send Fast priority mode#1063
WebMad wants to merge 2 commits into
Zoo-Code-Org:mainfrom
WebMad:feat/openai-codex-fast-backend

Conversation

@WebMad

@WebMad WebMad commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Responsibility and scope

Adds backend/configuration support for persisting the OpenAI Codex speed preference and mapping Fast mode to the provider request priority field. Tests travel with the behavior in this PR.

Behavior

  • Fast sends Priority in the OpenAI Codex request.
  • Missing and Default settings omit the priority field.
  • Flex is rejected for this provider path.
  • Persistence, validation, serialization, and request construction are covered at the backend layer.

Explicit non-goals

  • No webview-ui/ changes and no user-facing selector; that is the next stack PR.
  • No unrelated Task.throttle.test.ts fix.
  • No changeset.

Test evidence

  • Focused types tests: 23 passed.
  • Focused backend tests: 79 passed.
  • Scoped Prettier and ESLint checks passed.
  • Repository lint and type checks passed through Git hooks.

Stack dependency

  1. refactor(api): centralize service-tier primitives #1040 — shared service-tier primitives (merged).
  2. This PR — backend persistence and request behavior.
  3. feat(webview): add OpenAI Codex speed selector WebMad/Zoo-Code#3 — webview speed selector and translations.

Replaces WebMad#2, which targeted the fork repository.

Summary by CodeRabbit

  • New Features

    • Added OpenAI Codex service-tier preferences, supporting Standard and Fast via a Priority tier mapping.
    • Streaming and non-streaming Codex requests now conditionally include the configured service-tier setting.
    • Service-tier preferences are persisted when saving provider settings.
  • Bug Fixes

    • Default/unspecified tier no longer sends an unnecessary service-tier value in Codex requests.
    • Service-tier is preserved in the manual streaming SSE fallback when SDK streaming fails.
    • Provider setting validation now rejects unsupported service-tier values.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: bd15090a-9c7a-4755-8292-f236a46b6b8e

📥 Commits

Reviewing files that changed from the base of the PR and between ce11b1a and 2923349.

📒 Files selected for processing (4)
  • packages/types/src/model.ts
  • packages/types/src/provider-settings.ts
  • src/api/providers/__tests__/openai-codex.spec.ts
  • src/api/providers/openai-codex.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/api/providers/tests/openai-codex.spec.ts
  • src/api/providers/openai-codex.ts

📝 Walkthrough

Walkthrough

Adds OpenAI Codex service-tier types and provider schema support, persists tier settings, and conditionally propagates the priority tier to streaming, fallback SSE, and non-streaming Responses requests with corresponding tests.

Changes

OpenAI Codex service tier

Layer / File(s) Summary
Service-tier contracts and schema
packages/types/src/model.ts, packages/types/src/provider-settings.ts, packages/types/src/__tests__/provider-settings.test.ts
Defines default and priority Codex tiers, adds the optional schema field, and tests valid, omitted, and invalid values.
Provider profile persistence
src/core/config/__tests__/ProviderSettingsManager.spec.ts
Verifies that default and priority Codex tiers are stored in provider profiles.
Responses request propagation
src/api/providers/openai-codex.ts, src/api/providers/__tests__/openai-codex.spec.ts
Includes the priority tier in streaming, fallback SSE, and non-streaming request bodies while omitting it for absent or default preferences; tests each path.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ApiHandlerOptions
  participant OpenAiCodexHandler
  participant OpenAIResponsesAPI
  ApiHandlerOptions->>OpenAiCodexHandler: configured Codex service tier
  OpenAiCodexHandler->>OpenAiCodexHandler: map Priority to SERVICE_TIER_KEY
  OpenAiCodexHandler->>OpenAIResponsesAPI: streaming or non-streaming Responses request
Loading

Possibly related issues

Possibly related PRs

Suggested labels: awaiting-review

Suggested reviewers: navedmerchant, hannesrudolph

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers behavior and tests, but it does not follow the required template or include the linked issue, test procedure, or checklist. Add the required template sections, especially the linked issue, step-by-step test procedure, checklist items, and contact info.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: persisting and sending OpenAI Codex fast priority mode.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions github-actions Bot added the awaiting-review PR changes are ready and waiting for maintainer re-review label Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review PR changes are ready and waiting for maintainer re-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant