Skip to content

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

Merged
edelauna merged 2 commits into
Zoo-Code-Org:mainfrom
WebMad:feat/openai-codex-fast-backend
Jul 31, 2026
Merged

feat(openai-codex): persist and send Fast priority mode#1063
edelauna merged 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 with Standard and Fast options.
    • Fast mode is applied as a Priority service tier for streaming and non-streaming requests.
    • Provider preferences now retain the selected service tier.
  • Bug Fixes

    • Standard or unspecified settings no longer send an unnecessary tier value.
    • Fast mode is preserved when streaming falls back to an alternate delivery method.
    • Invalid service-tier values are rejected during validation.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

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

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. Omits 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 reviewers: navedmerchant, taltas, hannesrudolph

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly identifies the main change: persisting and sending OpenAI Codex Fast priority mode.
Description check ✅ Passed The description covers implementation, behavior, scope, dependencies, exclusions, and test evidence, but it omits the template headings and issue-link checklist.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
🧪 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

@edelauna edelauna left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 nit

Comment thread packages/types/src/model.ts
edelauna
edelauna previously approved these changes Jul 31, 2026
@edelauna
edelauna enabled auto-merge July 31, 2026 03:36
@edelauna
edelauna force-pushed the feat/openai-codex-fast-backend branch from 304677b to 2923349 Compare July 31, 2026 03:50
@edelauna
edelauna added this pull request to the merge queue Jul 31, 2026
Merged via the queue into Zoo-Code-Org:main with commit 5971caa Jul 31, 2026
26 checks passed
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.

2 participants