Skip to content

fix: preserve configured service tiers across ACP prompts - #673

Open
etang4 wants to merge 5 commits into
agentclientprotocol:mainfrom
etang4:fix/preserve-ultrafast-service-tier
Open

etang4 wants to merge 5 commits into
agentclientprotocol:mainfrom
etang4:fix/preserve-ultrafast-service-tier

Conversation

@etang4

@etang4 etang4 commented Oct 24, 2026 •

Copy link
Copy Markdown

A Codex session configured for Ultrafast or Flex can start with the correct tier, but codex-acp reduces that tier to a Fast on/off boolean. Its first prompt then sends serviceTier: null, clearing the selection.

Retain the service-tier string returned by Codex through new, resume, load, and fork operations and subsequent prompts. Explicit ACP Fast On/Off changes still override the selection. Both fast and Codex's canonical priority name are recognized as Fast, with the existing model-support check preserved. Codex remains responsible for account and model eligibility; the adapter does not force a tier that Codex rejected.

Reopening a live session before its first prompt also preserves its tier: the no-rollout fallback leaves the tier unknown instead of reporting a clear. A tier explicitly returned by Codex, including null, still takes precedence over the existing session value.

The change uses the existing app-server string field and removes casts to the older generated fast | flex type. It does not change ACP or generated protocol schemas.

Related work

Validation

At 52d47d7a022525ed19f3757191254e77d8a44310:

  • npm run typecheck
  • Full npm test with Node 24: 1,911 passed, 36 skipped (the existing suite's normal skips)
  • Full npm run test:integration: 10 passed using the real Codex app-server and a local mock Responses API
  • npm run build
  • npm exec --yes --package=bun@1.3.11 -- npm run bundle:all: Linux, macOS, and Windows, each x64 and arm64
  • Repository run-codex smoke helper against real Codex and a local mock model: Flex configured in config.toml reached the model as service_tier: "flex"

Regression coverage exercises the actual new, resume, load, and fork paths, repeated prompts, explicit Fast overrides, both Fast aliases, and empty-session resume/load. It distinguishes an unavailable tier from an explicit null or replacement tier. The new empty-session tests reproduced four unit-test failures before the fix. The real local-gateway tests use Flex because the anonymous model catalog does not advertise Ultrafast; Ultrafast is covered at the app-server request boundary.

Earlier validation at 0a37c04 included a built-adapter protocol probe preserving Ultrafast with Fast disabled. An authenticated Codex 0.164.0 smoke test at 8ccbf8a accepted Ultrafast for GPT-6 Astra and completed one short prompt. These earlier probes were not rerun against the final commit. Cross-platform bundles were built locally; they were not executed on every target OS.

@etang4
etang4 marked this pull request as ready for review October 24, 2026 17:38
Signed-off-by: Eric T <4793472+etang4@users.noreply.github.com>

This branch has not been deployed

No deployments
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