Skip to content

[codex] Generalize service tier slash commands#21745

Merged
aibrahim-oai merged 4 commits into
mainfrom
codex/general-service-tier-slash-commands
May 8, 2026
Merged

[codex] Generalize service tier slash commands#21745
aibrahim-oai merged 4 commits into
mainfrom
codex/general-service-tier-slash-commands

Conversation

@aibrahim-oai
Copy link
Copy Markdown
Collaborator

@aibrahim-oai aibrahim-oai commented May 8, 2026

Why

/fast was wired as a one-off slash command even though model metadata now exposes service tiers as catalog data. That meant adding another tier, such as a slower/cheaper tier, would require more hardcoded TUI plumbing instead of letting the model catalog drive the available commands.

This change makes service-tier commands data-driven: each advertised service_tiers entry becomes a /name command using the catalog description, while the request path sends the tier id only when the selected model supports it.

What Changed

  • Removed the hardcoded /fast slash-command variant and introduced dynamic service-tier command items in the composer and command popup.
  • Added toggle behavior for service-tier commands: invoking /name selects that tier, and invoking it again clears the selection.
  • Preserved the existing Fast-mode keybinding/status affordances by resolving the current model tier whose name is fast, while still sending the tier request value such as priority.
  • Persisted service-tier selections as raw request strings so non-fast tiers can round-trip through config.
  • Updated the Bedrock catalog entry to advertise fast support through service_tiers with id: "priority" and name: "fast".
  • Added defensive filtering in core so unsupported selected service tiers are omitted from /responses requests.

Validation

  • Added/updated coverage for dynamic service-tier slash command lookup, popup descriptions, composer dispatch, TUI fast toggling, and unsupported-tier omission in core request construction.
  • Local tests were not run per request.

@aibrahim-oai aibrahim-oai marked this pull request as ready for review May 8, 2026 13:52
@aibrahim-oai aibrahim-oai requested a review from a team as a code owner May 8, 2026 13:52
aibrahim-oai added a commit that referenced this pull request May 8, 2026
Co-authored-by: Codex <noreply@openai.com>
@aibrahim-oai aibrahim-oai force-pushed the codex/general-service-tier-slash-commands branch from 3a80749 to b170e31 Compare May 8, 2026 14:11
aibrahim-oai added a commit that referenced this pull request May 8, 2026
Co-authored-by: Codex <noreply@openai.com>
@aibrahim-oai aibrahim-oai force-pushed the codex/general-service-tier-slash-commands branch from 7544f36 to b4e5705 Compare May 8, 2026 14:45
Copy link
Copy Markdown
Contributor

@fcoury-oai fcoury-oai left a comment

Choose a reason for hiding this comment

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

Tested the behavior with gpt-5.5 and gpt-5.4 that advertises service_tiers for fast and it worked as expected.

Code looks good, left one optional nit to address.

Approved! 👍

Comment thread codex-rs/tui/src/chatwidget.rs Outdated
.unwrap_or(false)
}

fn current_model_fast_service_tier(&self) -> Option<ServiceTierCommand> {
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.

nit: we are trying to avoid adding new methods to chatwidget given it's huge size. Do you think we could take this opportunity and extract a new module for service tiers?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

sounds good

aibrahim-oai and others added 4 commits May 8, 2026 19:15
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
@aibrahim-oai aibrahim-oai force-pushed the codex/general-service-tier-slash-commands branch from 5018f71 to 0f21d01 Compare May 8, 2026 16:18
@aibrahim-oai aibrahim-oai merged commit 7c0e54b into main May 8, 2026
26 checks passed
@aibrahim-oai aibrahim-oai deleted the codex/general-service-tier-slash-commands branch May 8, 2026 17:09
@github-actions github-actions Bot locked and limited conversation to collaborators May 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants