Skip to content

test: fix 7 typecheck errors in ws-lane and preflight-400 test files - #2005

Closed
ranxianglei wants to merge 1 commit into
masterfrom
2026-10-03_master-typecheck-fix
Closed

ranxianglei wants to merge 1 commit into
masterfrom
2026-10-03_master-typecheck-fix

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Closes #2003

问题与根因

master(129200d) typecheck RED:3 个测试文件共 7 个类型错误,merge-ref 机制让所有 open PR 的 required checks 同步变红。

根因链:2e6e508a 把 tests/ 纳入 root tsconfig typecheck 范围并清零存量错误;随后 WS lane(#1968:codex-responses-ws / ws-bridge)与 #1994(issue1993-preflight-400)带进了从未过 typecheck 门的测试文件。700e6ddf 的 master run 被 concurrency 取消,首个暴露点是 0491ca5。

修法(全部测试侧,零 src 改动)

  • tests/codex-responses-ws.test.ts ×3:JSON.parse 结果消费处加显式 Item[] cast(debug arg 的 tools、input.find、error.error)。断言语义与运行时值均不变。
  • tests/issue1993-preflight-400.test.ts:ProxyOptions 改从规范定义处 src/config.ts 导入(server.ts 里只是本地 import 别名,未导出);与其余 20+ 个测试文件的既有做法一致,不在测试内重声明。
  • tests/ws-bridge.test.ts ×2:dispatch fake 改 async 块体(返回 Promise<void>,对齐 src/ws-bridge.ts:81 签名);new Promise 补显式 <void> 泛型。

验证

  • 修前本地复现:npm ci && npx tsc --noEmit --project tsconfig.json → 恰好 issue 所列 7 条。
  • 修后:全仓 typecheck clean;定向跑三个改动文件 13/13 pass。全量回归交给 CI。

回归审查

改动路径全部在测试 fixture / 断言 debug 参数内,不触碰任何生产代码路径;无行为变更(cast、泛型、async 包装对运行时字节零影响)。缓存/重试/增量游标/去重键:不涉及。无新配置。

config surface:无。

tests/ entered the root tsconfig typecheck scope in 2e6e508 (which also
cleared the pre-existing backlog), but the WS-lane merges (#1968) and
#1994 shipped test files that never passed that gate. Fix is entirely
test-side: explicit Item[] casts where JSON.parse results were consumed
as unknown (codex-responses-ws x3), import ProxyOptions from its
canonical home src/config.ts instead of the local alias in server.ts
(issue1993), and Promise<void>-typed fakes in ws-bridge (dispatch
callback + close promise).

Closes #2003
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-03_master-typecheck-fix (0c317c4)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.2019-pr.2005.aeabd37

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr2005.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

[bot] 🏷 Closing as duplicate of #2006 (both target issue #2003).

Two agent sessions were dispatched on the same issue in parallel and each opened a PR 16 seconds apart (#2005 @15:22:43Z, #2006 @15:22:59Z) — the loop guard allows at most one PR per issue, so they must converge.

Why #2006 wins: master moved after this PR's base (#1989 → 33d58e5 landed 5 more errors of the same class in tests/issue1987-preflight-baseline-anchor.test.ts — same ProxyOptions-from-src/server.ts import trap plus address().port narrowing). #2006 was rebased onto 33d58e5 and clears all 12 errors; this PR fixes only the original 7 against the stale base and would leave typecheck RED even if merged.

Independently verified at #2006 head 0ac6b459: tsc --noEmit -p tsconfig.json clean, 14/14 targeted tests pass across the four touched files, CI ubuntu test jobs green. Fix content is substantively identical between the two PRs (test-side casts / import-source fixes, zero runtime impact).

@ranxianglei

Copy link
Copy Markdown
Owner Author

[bot] 🏷 重复判定:与 #2006 / #2007 同题同失败域(master typecheck 红灯),判定重复,关闭本 PR。

证据(均已实测,非推断):

  1. 分支基点过期:本分支基于 129200db(fix(preflight): log+dump rejected summary bodies and shrink-retry hard 400/413 #1994 合并后、fix: preflight transport resilience + shipped-payload baseline anchor (#1987) #1989 合并前)。fix: preflight transport resilience + shipped-payload baseline anchor (#1987) #1989 引入的 tests/issue1987-preflight-baseline-anchor.test.ts 在本分支树里根本不存在,因此本 PR 不可能覆盖它的 5 个错误(TS2459×1 + address() TS2531/TS2339×4)——标题里的「7 个错误」正是分叉时点的错误集合。
  2. CI 已红:4 个 test lane 全挂在 npm run typecheck,job log 的报错恰是 issue1987 那 5 个错误(run 37133032201,已核对)。
  3. 合入当前 master 也不转绿:本地模拟 merge 到 master tip(33d58e5)后跑 tsc -p tsconfig.json,残留同样 5 错。

完整三方对比见 #2007 帖。即便 rebase 到当前 master,本 PR 的改动也是 #2006/#2007 的子集,无独立价值。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

master typecheck RED since #1968/#1994 merges: 7 errors in 3 test files — blocks every open PR's required checks

1 participant