Repository navigation
fix(providers): wire app-server websocket transport and normalize reasoning model aliases (#14277) - #14281
Conversation
|
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 |
…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>
76f0e72 to
a8f0a55
Compare
|
Thanks for the credit and for picking this up @diegosouzapw |
|
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 |
95a6e4e
into
cheaper-inference:release/v3.8.51
Problem
codex-app-serverprovider directly from the executor registry (open-sse/executors/index.ts), the lazy factory instantiatednew CodexAppServerExecutor({}, "codex-app-server")with empty options. Without awebsocketFn, the executor had no transport available to connect to the app-server.CodexAppServerExecutor.execute,input.modelwas forwarded verbatim to theturn/startJSON-RPC request. Dispatches with suffixed aliases likegpt-5.5-mediumorgpt-5.6-sol-ultrafailed upstream because the server does not recognize reasoning-suffixed aliases as model names.Reported in #14277.
Fix
open-sse/executors/index.ts, wire the shared WebSocket transport (codex.getCodexAppServerWebsocketTransport()) into thecodex-app-serverfactory while keeping the lazy loading contract intact.open-sse/executors/codex-app-server.ts:splitCodexReasoningSuffixfrom./codex/reasoningSuffix.ts.baseModelasmodelon theturn/startpayload.body.reasoning_effortinextractEffortin addition tobody.reasoning.effort.Verification
Extended
tests/unit/codex-app-server.test.tswith 4 new tests:turn/start receives baseModel and suffix-derived effort(verifiesgpt-5.5-medium-> model:gpt-5.5, effort:medium)model suffix effort takes precedence over body effortbody effort is forwarded when model has no reasoning suffixregistry loader injects codex websocket transport(verifies executor obtained viagetExecutor("codex-app-server")dispatches turns over the shared transport)All 34 tests in
tests/unit/codex-app-server.test.tspass.tests/unit/executor-map-golden.test.tspasses.npm run check:cyclespasses (0 cycles).Closes #14277.