Repository navigation
fix(ci): repair the API Route Typecheck base-red blocking every PR - #14079
Merged
diegosouzapw merged 1 commit intoSep 18, 2026
Merged
Conversation
The gate fails on the pure release/v3.8.51 tip (3 files above the frozen baseline), so every PR against the release is born red on it. None of the three is a PR defect — they are drift from merged work: - src/lib/usage/glmResetCards.ts: entered the gate's scope when #12754 added the route that imports it. runWithProxyContext is an untyped async helper (Promise<any>), so runWithConnectionFetch<T> could not return T. Every call site passes an async callback and awaits it — declare that contract: fn: () => Promise<T> → Promise<T>. - src/sse/handlers/chat.ts: handleSingleModelChat had no return annotation, so runWithTransientBackendRetry<T extends ResponseLike> fell back to the constraint and the value could no longer feed withSessionHeader(Response). Annotated Promise<Response> (every return path builds a Response). - src/app/api/internal/codex-responses-ws/route.ts: the bridge helpers return either { error: Response } or a payload, but as unannotated object-literal unions TypeScript synthesised error?: undefined on the success member, and every "error" in x guard stopped narrowing (TS2339 x5 on the destructure). Explicit return types keep the discriminant real; the ApiKeyMetadata alias now points at the policy shape (the wider one both sources are assignable to), which clears the TS2740 self-mismatch; logger.warn → log.warn (the module logger factory has no .warn). check-api-typecheck.mjs: OK — 283 errors, baseline ratcheted DOWN from 294 (codex-responses-ws 7→4 TS2339, TS2740 1→0; combos/test and keys/[id] 1→0). typecheck:core clean; 43/43 unit tests in the touched areas green.
This was referenced Sep 18, 2026
fix(compression): repair the unit-test base-reds left by the 09-17 merge wave (RTK + goldens)
#14082
Merged
Merged
Collaborator
Author
|
Validated in local merge-train /tmp/mt-basereds.log on 192.168.0.113 @ train tip c2fb6404606064c56520d7b2a148e8770dc70cd0 (boarded #14022 #14016 #14079 #14082): static gates green; test:unit 40635 tests, 17 failing — every one reproduces on the pure release tip 1603c86 (41 failing there; list in the base-red sweep), zero new reds. Merged with --admin per merge-gates §4/§7 (inherited base-reds only). |
4 of 5 tasks
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…heaper-inference#14079) The gate fails on the pure release/v3.8.51 tip (3 files above the frozen baseline), so every PR against the release is born red on it. None of the three is a PR defect — they are drift from merged work: - src/lib/usage/glmResetCards.ts: entered the gate's scope when cheaper-inference#12754 added the route that imports it. runWithProxyContext is an untyped async helper (Promise<any>), so runWithConnectionFetch<T> could not return T. Every call site passes an async callback and awaits it — declare that contract: fn: () => Promise<T> → Promise<T>. - src/sse/handlers/chat.ts: handleSingleModelChat had no return annotation, so runWithTransientBackendRetry<T extends ResponseLike> fell back to the constraint and the value could no longer feed withSessionHeader(Response). Annotated Promise<Response> (every return path builds a Response). - src/app/api/internal/codex-responses-ws/route.ts: the bridge helpers return either { error: Response } or a payload, but as unannotated object-literal unions TypeScript synthesised error?: undefined on the success member, and every "error" in x guard stopped narrowing (TS2339 x5 on the destructure). Explicit return types keep the discriminant real; the ApiKeyMetadata alias now points at the policy shape (the wider one both sources are assignable to), which clears the TS2740 self-mismatch; logger.warn → log.warn (the module logger factory has no .warn). check-api-typecheck.mjs: OK — 283 errors, baseline ratcheted DOWN from 294 (codex-responses-ws 7→4 TS2339, TS2740 1→0; combos/test and keys/[id] 1→0). typecheck:core clean; 43/43 unit tests in the touched areas green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Base-red — reproduced on the pure
release/v3.8.51tip (1603c86e)node scripts/check/check-api-typecheck.mjsfails on the release tip itself, so every PR against the release is born red onAPI Route Typecheck. Not tracked by the Release-Green issue (#14004), which runs in quick mode.src/lib/usage/glmResetCards.ts:47Promise<any>→TrunWithProxyContextis an untypedasynchelperfn: () => Promise<T>→Promise<T>src/sse/handlers/chat.ts:1286ResponseLike→ResponsehandleSingleModelChathad no return annotation, sorunWithTransientBackendRetry<T extends ResponseLike>fell back to the constraint: Promise<Response>(every return path builds a Response)src/app/api/internal/codex-responses-ws/route.ts{ error } | payloadas unannotated object-literal unions → TS synthesiseserror?: undefinedon the success member and"error" in xstops narrowingCodexWsFailure | CodexWs*Context) keep the discriminant real;ApiKeyMetadataalias moved to the policy shape;logger.warn→log.warnNo
as any, no@ts-ignore, no baseline widening. Baseline ratcheted down 294 → 283.Evidence (local)
check-api-typecheck.mjs→OK — 283 pre-existing error(s), all within frozen baselinenpm run typecheck:core→ cleancheck-complexity/check-cognitive-complexity→ OKcodex-responses-ws-*+glm-reset-card*greenUnit Tests fast-path(≈35 tests red on the tip, being swept separately) and file-size drift onchatcore-translation-paths.test.ts(#14016).