test(core): align Vertex auth test with content interface - #9899
Conversation
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Thanks @yu-xin-c — your diagnosis was right: main really was broken at contentGenerator.test.ts:776 (TS2339, the leftover countTokens call after #9676). But the identical fix landed first: #9888 merged the exact same change at 09:24 UTC today (main commit 6a21c43), about 15 minutes before this PR was opened.
Verified via the API:
- This PR's diff is byte-for-byte identical to #9888's diff — same file, same hunks, same blobs (
a2082a09d3e→4e1831f4336). - The file blob on this PR's head (
4e1831f4336d…) already matches the same file onmain— merging this PR would change nothing.
So there is nothing left to review or test here. Requesting changes only because the gate needs a formal state; the right outcome is closing this PR as superseded by #9888. Thanks for catching the broken build and taking the time to fix it — you were only minutes late. 🙏
中文说明
感谢 @yu-xin-c —— 你的判断是对的:main 当时确实因 contentGenerator.test.ts:776 的 TS2339(#9676 之后遗留的 countTokens 调用)而构建失败。但相同的修复先一步落地:#9888 已于今天 09:24 UTC 合并了完全一致的改动(main commit 6a21c43),比本 PR 的创建时间早约 15 分钟。
已通过 API 核实:
- 本 PR 的 diff 与 #9888 逐字节一致——同一文件,同一 hunk,同一 blob(
a2082a09d3e→4e1831f4336)。 - 本 PR head 上该文件的 blob(
4e1831f4336d…)与main上的已完全相同——合并本 PR 不会产生任何变化。
因此这里没有可继续审查或测试的内容。标记 request changes 只是流程需要一个正式状态;正确的处理是关闭本 PR(已被 #9888 取代)。感谢你发现构建损坏并花时间修复——只是晚了几分钟。🙏
— Qwen Code · qwen3.8-max
What this PR does
Updates the remaining Vertex auth lazy-construction test to exercise
embedContent, the same survivingContentGeneratoroperation used by the rest of the #9676 test migration.Why it's needed
#9676 removed
countTokensfromContentGenerator, but a Vertex ADC test added independently onmainretained onegenerator.countTokens(...)call. As a result, currentmainfails duringnpm ci, build, and typecheck withTS2339atcontentGenerator.test.ts:776. The PR's own sandboxed verification had already captured the integration failure here.Reviewer Test Plan
How to verify
main, runnpm run build --workspace packages/coreand observeProperty 'countTokens' does not exist on type 'ContentGenerator'.cd packages/core && npx vitest run src/core/contentGenerator.test.ts --maxWorkers=1and confirm all 27 tests pass.npm run typecheckand confirm every workspace plustypecheck:integrationpasses.Evidence (Before & After)
N/A for UI. Before: core compilation stops at
contentGenerator.test.ts:776withTS2339. After: the full repository build completes duringnpm ci, the focused file passes27/27, and workspace plus integration typecheck completes successfully.Tested on
Environment (optional)
Node.js 22.22.2 on macOS. Verified with a clean
npm ci, which completed the full prepare/build pipeline.Risk & Scope
Linked Issues
Follow-up to #9676.
中文说明
本 PR 的改动
将遗漏的 Vertex 认证懒构造测试改为调用
embedContent;这是 #9676 其余测试迁移统一采用、且仍保留在ContentGenerator中的操作。为什么需要
#9676 从
ContentGenerator删除了countTokens,但main上独立加入的一条 Vertex ADC 测试仍保留generator.countTokens(...)。因此当前main在npm ci、build 和 typecheck 阶段都会于contentGenerator.test.ts:776报出TS2339。该集成失败此前也已被该 PR 自身的沙箱验证记录。审查测试计划
验证方法
main上运行npm run build --workspace packages/core,可看到Property 'countTokens' does not exist on type 'ContentGenerator'。cd packages/core && npx vitest run src/core/contentGenerator.test.ts --maxWorkers=1,确认 27 条测试全部通过。npm run typecheck,确认所有 workspace 与typecheck:integration均通过。前后证据
UI 不适用。修改前:core 编译在
contentGenerator.test.ts:776因TS2339中止。修改后:干净npm ci中的全仓库 build 完成,目标文件27/27通过,全工作区与 integration typecheck 成功完成。测试平台
环境(可选)
macOS,Node.js 22.22.2。已通过干净
npm ci验证,它完整执行并通过了 prepare/build 流程。风险与范围
关联问题
#9676 的后续修复。