Repository navigation
fix(typecheck): unblock CI — export ProxyOptions + type-narrow #1987/#1994/ws-bridge tests - #2007
Conversation
…e-narrow in #1987/#1994/ws-bridge tests - src/server.ts: re-export type ProxyOptions (issue1987/issue1993 tests import it from server.ts) - tests/issue1987-preflight-baseline-anchor.test.ts: address() as AddressInfo (×2) - tests/codex-responses-ws.test.ts: cast tools/input/error.error (×4 errors, type-level only) - tests/ws-bridge.test.ts: async void fallback handler + Promise<void> resolve Touched test files pass: 5+1+5+3. No runtime changes anywhere.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2021-pr.2007.9ffbcefThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2007.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 Review 完成,结论:PR #2007 可合并。 验证过程(全部实测):master 本地复现恰好 12 错(与 issue 描述逐条一致);三个同题 PR 各建 worktree 跑 七问:
重复判定(open 区同题 3 个 PR,已处置):
顺带发现 → 已立项 #2009(带来源标记): 收工判定:mergeable、基线最新、CI 全绿、定向测试全过、diff 干净(4 文件 +9/-7,每行皆与本 PR 目的相关)——可合并,合并动作留给 owner。合并后 #1946 继承的 4 个 test lane 红灯即消除(rebase/re-run 即可)。 |
问题
master 的 CI(
npm run typecheck=tsc --noEmit --project tsconfig.json)在 #1994(129200d)与 #1989(33d58e5)合并后红灯,typecheck 挂 12 个错误——任何更新分支的 PR(如 #1946)都会继承。两个 PR 各自分支 CI 都是绿的,是当天快节奏合并下的语义竞态:tests/issue1987-preflight-baseline-anchor.test.ts:11与tests/issue1993-preflight-400.test.ts:17:从../src/server.tsimportProxyOptions,但 server.ts 只在本文件 import 该类型、未 re-export → TS2459tests/codex-responses-ws.test.ts(fix(preflight): log+dump rejected summary bodies and shrink-retry hard 400/413 #1994):request.tools?.map?./request.input.find/error.error.code直接在 unknown 上操作 → TS2339/TS2571/TS7006/TS18046 ×4tests/issue1987-preflight-baseline-anchor.test.ts:91,95:upstream.address().port—address()返回AddressInfo | string | null→ TS2531/TS2339 ×4tests/ws-bridge.test.ts:45,111:fallback handler 返回Promise<ServerResponse>而签名是Promise<void>;new Promise(resolve => …)无类型参数 → TS2322/TS2794修复(全部 type-level,零运行时变更)
src/server.ts:export type { ProxyOptions } from "./config.js";(两处测试都从这里 import)tests/issue1987…:address()转型as AddressInfo(×2)tests/codex-responses-ws…:tools/input/error.error加Item[]/形参转型(断言逻辑不变)tests/ws-bridge…:handler 改async (_req, res) => { res.writeHead(200).end(); };resolve 用Promise<void>验证
tsc --noEmit --project tsconfig.json:修复前 12 个 CI 相关错误 → 0(剩余 4 个在tests/dsh-settings-ui.test.ts,是 pnpm 本地特有——它直接await import("esbuild")但 esbuild 不是直接 devDep;CI 用npm install扁平提升可解析,不挂。可另立 issue 处理:esbuild 应入 devDependencies)tsc --noEmit --project tsconfig.build.json:rc=0合并后 #1946 的 4 个 test lane 即恢复,可正常合并。
Closes #2013 — master typecheck gate red (4 test files, 12 errors). Verified on head db1766f: tsc rc=0; affected suites 14/14; all CI test lanes green.