fix(models): support Node 26 type stripping - #4076
Conversation
Astro-Han
left a comment
There was a problem hiding this comment.
Approved at exact head 605a995ec6a18b3d4cb98fa29b504aeb8f2770ea. I found no P0–P2 issues.
The problem is real on the supported Node range: Node 26 rejects stripTypeScriptTypes(..., { mode: 'transform' }), preventing the metadata and release checks from loading their committed generated modules. Those modules use erasable TypeScript syntax, so changing the existing loader to mode: 'strip' is the smallest correct fix and keeps the current validation authority intact.
Non-blocking P3: the added committed-module test overlaps the existing loader/check path and requires exporting an otherwise internal helper. It could be removed, or replaced by a narrow Node 26 CI lane if continuous Node 26 coverage becomes a project requirement. This does not block the production fix.
The exact-head hosted test check is successful.
AI-assisted review: Codex coordinated an @reviewer pass; I verified the exact-head diff, affected authority, CI state, and the final severity judgment. Astro-Han owns this approval decision.
简体中文
精确 head 上没有 P0–P2。Node 26 问题真实存在,改用 strip 是最小正确修复。新增测试与现有检查路径部分重复,属于不阻塞的 P3 简化项。
Summary
npm run check:model-metadatafails on supported Node 26 releases before it can validate either committed generated module.Node 26 removed the
transformmode frommodule.stripTypeScriptTypes(), while the metadata checker still requested it. The generated metadata and pricing modules use erasable TypeScript syntax, so the supportedstripmode is sufficient on both Node 22.19 and Node 26.Use
stripand add a regression test that converts and imports both committed generated modules before asserting their runtime exports.Evidence
Verification
npm run check:model-metadataon Node 26.5.0npx --yes node@22.19.0 scripts/sync-model-metadata.mjs --checknode --test scripts/sync-model-metadata.test.mjs— 9/9 passednpm run lintnpm run format:checknode scripts/asf-license-headers.mjs checkgit diff --checkFull build and typecheck were not run for this script-only draft.
AI use
Select exactly one:
Tool(s) and scope: Codex implemented the Node compatibility change, regression test, and PR description.
Checklist
Does this PR entail a change in behavior?