Skip to content

fix(ci): clear the two TS2677 errors from the API Route Typecheck baseline - #14266

Closed
HouMinXi wants to merge 1 commit into
diegosouzapw:release/v3.8.51from
HouMinXi:fix/release-v3.8.51-basereds
Closed

HouMinXi wants to merge 1 commit into
diegosouzapw:release/v3.8.51from
HouMinXi:fix/release-v3.8.51-basereds

Conversation

@HouMinXi

@HouMinXi HouMinXi commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Two TS2677 errors made API Route Typecheck red on release/v3.8.51 (tracked in #13866).

RerankProviderNodeRow was an interface without an index signature, so it could not be assigned to Record<string, unknown> in the type predicate. Converted to a type alias in src/app/api/v1/_shared/rerankProviderNodes.ts.

The catalog .map() return in src/mitm/handlers/antigravity.ts was inferred as { id, displayName, description?: string } | null. Annotated as DynamicCatalogModel | null and spread description only when present.

config/quality/eslint-suppressions.json is not in this PR. #14255 types the Gemini turn-pairing assertions instead of raising the frozen any-count from 74 to 87.

#14164 also edits the two TypeScript files (a NonNullable<typeof c> narrow). Whichever lands first, the other rebases.

Verification

  • node scripts/check/check-api-typecheck.mjs: OK, 283 pre-existing, 0 new
  • antigravity + rerank unit tests: 29/29

Related to #13866. #13866 stays open.

@diegosouzapw

Copy link
Copy Markdown
Owner

Thanks for tracking down both TS2677 root causes precisely — the interface vs Record<string, unknown> incompatibility explanation is spot on. Two things before this can merge: (1) #14255 is also fixing the same translator-openai-to-gemini.test.ts suppression entry, but at the root (bringing the file's violations back under the frozen 74 cap) rather than raising the cap to 87 — could you drop the eslint-suppressions.json hunk here and let that one own it, so we don't end up with a stale over-suppressed entry (cap 87, real 73) once both land? (2) #14244... sorry, #14164 is also independently fixing antigravity.ts and rerankProviderNodes.ts (differently — a NonNullable<typeof c> narrow instead of the type-alias change). Whichever of the two lands first, the other will need a quick rebase to drop the now-redundant hunk. Once the suppressions.json piece is dropped this is a clean, welcome fix for the base-red.

…eline

RerankProviderNodeRow was an interface without an index signature, so it
could not satisfy Record<string, unknown> in the type predicate. Convert
it to a type alias. Annotate the Antigravity catalog map callback as
DynamicCatalogModel | null so the later `c is DynamicCatalogModel` filter
stops tripping TS2677.

Leave tests/unit/translator-openai-to-gemini.test.ts and
config/quality/eslint-suppressions.json to diegosouzapw#14255, which types the
assertions instead of raising the frozen any-count.

Signed-off-by: Minxi Hou <houminxi@gmail.com>
@HouMinXi
HouMinXi force-pushed the fix/release-v3.8.51-basereds branch from 8282809 to 2ddf98b Compare September 21, 2026 15:52
@HouMinXi

Copy link
Copy Markdown
Contributor Author

Dropped config/quality/eslint-suppressions.json from this PR. #14255 owns the translator-openai-to-gemini any-count (type the assertions, keep the frozen 74). What's left is the two TS2677 edits plus a changelog fragment.

#14164 is still open and also touches antigravity.ts / rerankProviderNodes.ts. I kept those hunks here. If that PR merges first I will rebase and drop the overlap.

Local: node scripts/check/check-api-typecheck.mjs OK (283 frozen, 0 new). antigravity 16/16, rerank 13/13.

@HouMinXi HouMinXi changed the title fix(ci): repair API Route Typecheck and ESLint suppressions base-reds (#13866) fix(ci): clear the two TS2677 errors from the API Route Typecheck baseline Sep 21, 2026
@HouMinXi

Copy link
Copy Markdown
Contributor Author

The two TS2677 errors targeted here were resolved in upstream commit d610c24c62 (#14164) using the NonNullable<typeof ...> narrowing approach in both files.

Verified on the latest release/v3.8.51 tip: node scripts/check/check-api-typecheck.mjs passes cleanly with 0 new errors (283 baseline).

Since #14164 already landed the resolution, this PR is superseded.

@diegosouzapw

Copy link
Copy Markdown
Owner

Thanks @HouMinXi — the two TS2677 errors this PR cleared from the API Route Typecheck baseline were already resolved on release/v3.8.51 by #14164 (merged 2026-09-21), so this change no longer has anything to fix on the tip. Closing as superseded; your diagnosis matched the fix that landed. (merge-batch 2026-09-24)

@HouMinXi
HouMinXi deleted the fix/release-v3.8.51-basereds branch September 24, 2026 08:05
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.

2 participants