Skip to content

fix: preserve priority fast mode#286

Draft
neubig wants to merge 2 commits into
agentclientprotocol:mainfrom
neubig:agent/recognize-priority-fast-mode
Draft

fix: preserve priority fast mode#286
neubig wants to merge 2 commits into
agentclientprotocol:mainfrom
neubig:agent/recognize-priority-fast-mode

Conversation

@neubig

@neubig neubig commented Jul 12, 2026

Copy link
Copy Markdown

Summary

  • recognize Codex's canonical priority service-tier response as Fast mode
  • retain compatibility with the legacy fast response value
  • type session metadata according to the app-server's string response
  • cover both response forms in the Fast-mode session tests

Root cause

Current Codex normalizes both fast and priority configuration values to
priority before returning thread/start or thread/resume. codex-acp only
initialized fastModeEnabled when that response equaled fast, so the first
prompt sent serviceTier: null and cleared a configured Fast tier.

Impact

Fast mode configured through CODEX_CONFIG or config.toml now remains enabled
for new and resumed sessions. ACP clients that cannot directly set the
fast-mode session option, including OpenHands Agent Canvas, can rely on Codex
configuration instead.

Closes #285.

Validation

  • npm test — 298 passed, 28 skipped
  • npm run typecheck
  • npm run build
  • live Codex 0.144.1 app-server reproduction confirmed serviceTier: "priority"

Live evidence

Run on 2026-07-13 UTC on Linux x86_64 with Node v24.15.0 and the real @openai/codex 0.144.1 app-server. The reusable harness is committed as .pr/live_priority_fast_mode.ts; it starts the actual Codex subprocess, initializes the production CodexAcpClient and CodexAcpServer, creates an ACP session with the same {service_tier: "priority"} object supplied by CODEX_CONFIG, sends one real prompt, and records only service-tier/config state and the final response.

The identical command was used for both checkouts:

SOURCE_ROOT="$CHECKOUT" \
TESTED_COMMIT="$(git -C "$CHECKOUT" rev-parse HEAD)" \
node_modules/.bin/tsx .pr/live_priority_fast_mode.ts

Current main: canonical priority is cleared

Commit: 75893cd87741b2fe127f6698a8741a2e625c3787

Codex accepted the configured tier and returned canonical serviceTier: "priority" from thread/start, but codex-acp initialized its Fast option as off. The first real prompt then sent serviceTier: null, clearing the configured tier:

{
  "codexVersion": "0.144.1",
  "configuredServiceTier": "priority",
  "appServerServiceTier": "priority",
  "fastConfigOption": {"type": "select", "currentValue": "off"},
  "fastModeEnabledAfterStart": false,
  "firstPromptServiceTier": null,
  "promptStopReason": "end_turn",
  "finalMessage": "priority-fast-live-ok"
}

PR head: Fast mode remains enabled

Commit: dee5214f2bb53fcd7f8f8a383826de47228c56d7

The same Codex response now initializes Fast mode on, preserves enabled state, and sends the legacy-compatible Fast tier on the first live prompt:

{
  "codexVersion": "0.144.1",
  "configuredServiceTier": "priority",
  "appServerServiceTier": "priority",
  "fastConfigOption": {"type": "select", "currentValue": "on"},
  "fastModeEnabledAfterStart": true,
  "firstPromptServiceTier": "fast",
  "promptStopReason": "end_turn",
  "finalMessage": "priority-fast-live-ok"
}

Both runs issued the production initialize, thread/start, model/list, and turn/start JSON-RPC sequence. On the final PR head, npm run typecheck, npm test (298 passed, 28 skipped), and npm run build also passed.

neubig and others added 2 commits July 12, 2026 10:04
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.

Fast mode is disabled when Codex reports the canonical priority service tier

1 participant