Repository navigation
test: fix 7 typecheck errors in ws-lane and preflight-400 test files - #2005
ranxianglei wants to merge 1 commit into
Conversation
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
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2019-pr.2005.aeabd37This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2005.tgz
npm install -g packageInstall instructions are refreshed on each push. |
|
[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 Independently verified at #2006 head |
|
[bot] 🏷 重复判定:与 #2006 / #2007 同题同失败域(master typecheck 红灯),判定重复,关闭本 PR。 证据(均已实测,非推断):
完整三方对比见 #2007 帖。即便 rebase 到当前 master,本 PR 的改动也是 #2006/#2007 的子集,无独立价值。 |
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 条。回归审查
改动路径全部在测试 fixture / 断言 debug 参数内,不触碰任何生产代码路径;无行为变更(cast、泛型、async 包装对运行时字节零影响)。缓存/重试/增量游标/去重键:不涉及。无新配置。
config surface:无。