Skip to content

feat: add --fast flag to task command for service_tier support#209

Open
WingsOfPanda wants to merge 1 commit intoopenai:mainfrom
WingsOfPanda:feature/fast-mode-flag
Open

feat: add --fast flag to task command for service_tier support#209
WingsOfPanda wants to merge 1 commit intoopenai:mainfrom
WingsOfPanda:feature/fast-mode-flag

Conversation

@WingsOfPanda
Copy link
Copy Markdown

Summary

  • Adds --fast boolean flag to the task command that sets serviceTier: "fast" on thread start/resume requests
  • Threads the parameter through buildTaskRequestexecuteTaskRunrunAppServerTurnbuildThreadParams/buildResumeParams
  • Enables programmatic access to the Codex fast tier (1.5x speed at 2x credits) from the companion script

Motivation

The Codex CLI supports service_tier = "fast" via config.toml and /fast on in interactive mode, but the companion script (codex-companion.mjs) has no way to request fast tier programmatically. This is needed for CI/automation workflows and Claude Code plugin integrations that invoke Codex via the companion script and want to trade credits for speed on time-sensitive tasks.

Usage

# Fast mode on a task
node codex-companion.mjs task --fast --prompt "analyze this code"

# Combined with other flags
node codex-companion.mjs task --fast --prompt-file prompt.md --effort high --write

# Background fast task
node codex-companion.mjs task --fast --background --prompt-file prompt.md

Changes

File Change
plugins/codex/scripts/codex-companion.mjs Parse --fast flag, thread through buildTaskRequest and executeTaskRun
plugins/codex/scripts/lib/codex.mjs Pass serviceTier to buildThreadParams and buildResumeParams when provided

Test plan

  • task --fast with simple prompt — verify faster response
  • task without --fast — verify no regression (serviceTier is null, not sent)
  • task --fast --background — verify fast tier applies to background tasks
  • --help shows --fast in task usage line

🤖 Generated with Claude Code

Codex CLI supports service_tier="fast" (1.5x speed at 2x credits) via
config.toml, but the companion script had no way to pass this through
programmatically. This adds a --fast boolean flag to the task command
that sets serviceTier: "fast" on thread start/resume requests.

Usage:
  node codex-companion.mjs task --fast --prompt "analyze this code"
  node codex-companion.mjs task --fast --prompt-file prompt.md --effort high

Changes:
- codex-companion.mjs: parse --fast flag, thread through buildTaskRequest
  and executeTaskRun to runAppServerTurn
- lib/codex.mjs: pass serviceTier to buildThreadParams and
  buildResumeParams when provided

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant