Skip to content

fix(providers): wire app-server websocket transport and normalize reasoning model aliases (#14277) - #14281

Merged
diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.51from
gonisulaimann:fix/codex-app-server-transport-alias-14277
Sep 22, 2026
Merged

diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.51from
gonisulaimann:fix/codex-app-server-transport-alias-14277

Conversation

@gonisulaimann

Copy link
Copy Markdown
Contributor

Problem

  1. Missing WebSocket transport on first-class executor: When selecting the first-class codex-app-server provider directly from the executor registry (open-sse/executors/index.ts), the lazy factory instantiated new CodexAppServerExecutor({}, "codex-app-server") with empty options. Without a websocketFn, the executor had no transport available to connect to the app-server.
  2. Model reasoning alias not stripped: In CodexAppServerExecutor.execute, input.model was forwarded verbatim to the turn/start JSON-RPC request. Dispatches with suffixed aliases like gpt-5.5-medium or gpt-5.6-sol-ultra failed upstream because the server does not recognize reasoning-suffixed aliases as model names.

Reported in #14277.

Fix

  1. In open-sse/executors/index.ts, wire the shared WebSocket transport (codex.getCodexAppServerWebsocketTransport()) into the codex-app-server factory while keeping the lazy loading contract intact.
  2. In open-sse/executors/codex-app-server.ts:

Verification

Extended tests/unit/codex-app-server.test.ts with 4 new tests:

  • turn/start receives baseModel and suffix-derived effort (verifies gpt-5.5-medium -> model: gpt-5.5, effort: medium)
  • model suffix effort takes precedence over body effort
  • body effort is forwarded when model has no reasoning suffix
  • registry loader injects codex websocket transport (verifies executor obtained via getExecutor("codex-app-server") dispatches turns over the shared transport)

All 34 tests in tests/unit/codex-app-server.test.ts pass.
tests/unit/executor-map-golden.test.ts passes.
npm run check:cycles passes (0 cycles).

Closes #14277.

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Confirmed this mirrors the exact working pattern already used in codex.ts's internal fallback path (websocketFn: getCodexAppServerWebsocketTransport()) — the registry factory was genuinely the one place missing it. Good catch on the reasoning-suffix precedence too. CI reds here are the unrelated inherited base-red (issue #13866).

Two small items we'll handle at merge unless you get to them first: a changelog.d fragment (merge-integrity gate), and a Co-authored-by trailer for @aref-alapour, who proposed this exact patch in #14277.

…soning model aliases (cheaper-inference#14277)

When selecting the first-class `codex-app-server` provider directly through
the executor registry (`open-sse/executors/index.ts`), the lazy loader
instantiated `CodexAppServerExecutor({}, "codex-app-server")` without
supplying a WebSocket transport function, preventing any connection from
opening.

Additionally, `CodexAppServerExecutor.execute` passed the raw `input.model`
directly to `turn/start` without stripping reasoning suffix aliases (e.g.,
`gpt-5.5-medium`), which caused upstream app-server turns to fail because the
aliased name is not recognized as a valid model ID.

Fixes:
1. In `open-sse/executors/index.ts`, wire the shared WebSocket transport
   (`codex.getCodexAppServerWebsocketTransport()`) into the `codex-app-server`
   executor factory.
2. In `open-sse/executors/codex-app-server.ts`, use `splitCodexReasoningSuffix`
   to send `baseModel` to `turn/start` while passing the selected effort
   separately, prioritizing explicit model suffix selection over request body
   defaults (cheaper-inference#2331). Also support `body.reasoning_effort` in `extractEffort`.

Added regression tests in `tests/unit/codex-app-server.test.ts` verifying:
- baseModel extraction and effort derivation from model suffixes on `turn/start`
- precedence of suffix effort over body reasoning effort
- forwarding of body reasoning effort when the model is unsuffixed
- registry executor initialization with injected transport

Co-authored-by: Aref Alapour <aref-alapour@users.noreply.github.com>
@gonisulaimann
gonisulaimann force-pushed the fix/codex-app-server-transport-alias-14277 branch from 76f0e72 to a8f0a55 Compare September 21, 2026 15:49
@aref-alapour

Copy link
Copy Markdown
Contributor

Thanks for the credit and for picking this up @diegosouzapw

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Thanks @gonisulaimann — merging via the release merge-train. Validated in local merge-train (mt-train10c) on the devbox @ train tip 4d841aa1c740bbaa03868dc0a403c62099a99a42 with the 72 sibling PRs of this batch: typecheck:core, file-size, complexity, cognitive-complexity, changelog-integrity green; changed-area node:test 831/831 (0 failing) and vitest 480/482 — the two reds are autoCombo/provider-family-combos.test.ts timing out at 20s, which reproduces on the PURE release tip under the full vitest suite (and is already tracked by the Release-Green issue #13866), so it is inherited, not this batch's. Merged --admin per merge-gates §3/§4/§7.

@diegosouzapw
diegosouzapw merged commit 95a6e4e into cheaper-inference:release/v3.8.51 Sep 22, 2026
7 of 16 checks passed
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.

fix(providers): wire app-server websocket transport and normalize reasoning model aliases

3 participants