test(core): keep context warning test aligned with default token limit - #6391
Conversation
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
|
Thanks for the PR! Template looks good ✓ Problem: This is an observed CI failure — PR #6387 (still open) raises Direction: Aligned. The test was fragile — it coupled a magic-number fixture to a specific default value. Deriving both the fixture and the assertion string from Approach: Minimal and focused — one file, +6/-2 lines, purely test changes. The math checks out: Moving on to code review and testing. 🔍 中文说明感谢贡献! 模板完整 ✓ 问题:这是一个已观测到的 CI 失败——PR #6387(尚未合并)将 方向:对齐。测试原本存在脆弱性——硬编码数据与特定默认值耦合。从 方案:最小且聚焦——一个文件,+6/-2 行,纯测试改动。数学正确: 进入代码审查和测试 🔍 — Qwen Code · qwen3.7-max |
|
Code review: Clean. The change is exactly what I'd write independently — import the constant, derive the threshold and fixture from it, update the assertion. The Test results: The context warning test passes both before and after this PR with the current Before (main branch)After (this PR)中文说明代码审查: 干净。改动与我的独立方案完全一致——导入常量,从它推导阈值和测试数据,更新断言。 测试结果: context warning 测试在此 PR 前后都通过(当前 — Qwen Code · qwen3.7-max |
|
Straightforward test fix. The old test coupled a magic-number fixture to a specific I verified the approach matches my independent proposal exactly. The only nit ( Approving. ✅ 中文说明简单的测试修复。旧测试将硬编码数据与特定 验证了方案与我的独立方案完全一致。唯一的小问题( 批准。✅ — Qwen Code · qwen3.7-max |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
What this PR does
Updates the context-warning regression test so it derives both the oversized memory fixture and the expected warning text from the current default token limit instead of hard-coding the previous 131,072-token default.
Why it's needed
Multiple PRs that include the 200,000-token default context-window change can hit the same Ubuntu CI failure. The change that introduced this failure condition is PR #6387 (
fix(core): default context windows to 200k), specifically commit17788a2c15bcc6f892034cc9bb5db4764f6e96c4, which changes the unknown-model fallbackDEFAULT_TOKEN_LIMITfrom 131,072 to 200,000.The shared test fixture only crossed the 15% warning threshold for the previous 131,072-token default, so once the default window is larger the warning disappears and
config.getWarnings()returns an empty array. PR #6387 is therefore the introducing PR, but the CI failure shows up across the affected PR stack because they all carry or depend on that default-window change. This keeps the test validating the intended fallback behavior across default-window changes.Reviewer Test Plan
How to verify
Confirm that the context warning test still emits a warning when no explicit contextWindowSize is configured, and that the warning text follows the repository's current default token limit.
Evidence (Before & After)
N/A, non-UI test-only change.
Tested on
Environment (optional)
Local: Node v22.22.0, npm 10.9.4. CI: Qwen Code CI run 28786634109.
Risk & Scope
Linked Issues
Introduced by #6387. Related to the CI failures seen across PRs that include or depend on the 200,000-token default context-window change.
中文说明
What this PR does
更新 context warning 回归测试,让超大 memory fixture 和预期 warning 文案都从当前默认 token limit 推导,而不是写死旧的 131,072 token 默认值。
Why it's needed
多条包含 200,000 token 默认 context window 变更的 PR 都可能遇到同一个 Ubuntu CI 失败。引入这个失败触发条件的是 #6387(
fix(core): default context windows to 200k),具体是 commit17788a2c15bcc6f892034cc9bb5db4764f6e96c4,它把 unknown model fallback 的DEFAULT_TOKEN_LIMIT从 131,072 改成 200,000。共享的旧测试数据只会在之前 131,072 token 默认值下超过 15% warning 阈值;默认窗口变大后,warning 不再出现,
config.getWarnings()返回空数组。因此 #6387 是引入该触发条件的 PR,但这个 CI 失败会出现在受影响 PR 栈里的多条 PR 上,因为它们都携带或依赖这个默认窗口变更。这个改动让测试继续验证预期的 fallback 行为,同时不再被默认窗口数值变化打挂。Reviewer Test Plan
How to verify
确认未显式配置 contextWindowSize 时,context warning 测试仍会触发 warning,并且 warning 文案会跟随仓库当前默认 token limit。
Evidence (Before & After)
N/A,非 UI 的测试修复。
Tested on
Environment (optional)
本地:Node v22.22.0,npm 10.9.4。CI:Qwen Code CI run 28786634109。
Risk & Scope
Linked Issues
由 #6387 引入。关联多条包含或依赖 200,000 token 默认 context window 变更的 PR 上看到的 CI 失败。