fix(test): restore openai model selection in ACP set_config_option test - #5721
Conversation
PR QwenLM#5676 (an unrelated v5 settings-migration fix) inadvertently reverted the model-selection assertion in the ACP integration test back to a flaky form that asserts the session's current model is present in availableModels. In CI (no real auth) the default current model is not in availableModels, so the assertion fails with "expected false to be true", breaking the Release workflow's "Integration Tests (No Sandbox)" job and gating the Publish Release step. Restore the robust form that explicitly picks an openai model from availableModels (matching the version that shipped in every successful release since March), which avoids the auth-dependent current-model mismatch.
|
Thanks for the PR! Template is complete — all required sections present and filled in properly ✓ Direction: This is squarely aligned with project priorities. The failing No-Sandbox integration job is blocking the Release workflow and preventing publishes (run 27971498894 cited). Test-only, low-risk revert of a known-passing block. The last green release Approach: The scope is minimal and surgical — +8/-8 in a single test file. The fix is the right one: rather than asserting the session's current model (which in unauthenticated CI is not in
One honest note on the "Tested on" row: Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ 方向: 与项目优先级高度对齐。No-Sandbox 集成测试用例失败正在阻塞 Release 工作流(引用的 27971498894 失败 run),导致发布无法进行。仅测试文件的低风险回退,恢复的是已知通过的代码块。最后一次绿色发布 方案: 范围最小且精准 —— 单测试文件 +8/-8。修复方向正确:不再断言会话的 当前 模型(在无鉴权的 CI 里该模型不在
关于 "测试情况" 行坦诚说一句:三个 OS 都标 进入代码审查 🔍 — Qwen Code · qwen3.7-max |
Code reviewDiff is exactly what the PR claims: +8/-8 in one file, replacing the flaky The No correctness bug, no security hole, no AGENTS.md violation. The test-type ( Real-scenario testLive ACP auth isn't reachable from this box — same constraint the PR flagged honestly with Before (main branch — pre-PR code)Reproduced the exact failure the PR cites in run 27971498894. Fails at line 516 on After (this PR)Still fails locally — but at a different, later assertion ( The progression of failure points is itself the evidence: the PR's new assertion at line 516 is reached after the lines the old code died on, which means the earlier flaky path is genuinely gone. The remaining local failure is the expected unauth-environment mismatch, not a code bug. CI's No-Sandbox job — which has real provider auth — is the authoritative validation, and the PR's restored block is byte-identical to what shipped in every green release up to 中文说明代码审查diff 与 PR 自述完全一致:单文件 +8/-8,把 flaky 的
没有正确性 bug、没有安全问题、没有违反 AGENTS.md。类型声明(358/415/473 行的 实际场景测试本环境无法调用真实 ACP 鉴权 —— 这与 PR 在"测试情况"行诚实标注的 Before (main 分支,PR 前代码)完整复现 PR 引用的 run 27971498894 中的失败。在 516 行 (见上方 before 代码块) After (本 PR)本地仍然失败 —— 但断言点后移到 516 行的 (见上方 after 代码块) 失败点的后移本身就是证据:PR 的新断言位于旧代码先死的位置之后,意味着旧的 flaky 路径已被真正消除。本地剩余的失败是预期的"无鉴权环境不匹配",不是代码 bug。CI 的 No-Sandbox job —— 拥有真实 provider 鉴权 —— 是权威校验,且 PR 恢复的代码块与每次绿色发布(直至 — Qwen Code · qwen3.7-max |
|
Stepping back: this PR is a clean, minimal revert of a test-only block that was regressed by #5676's merge. Motivation is concrete and high-impact — the broken No-Sandbox integration job is blocking Release publishes. The fix is the identical block that shipped in every green release from late March through The approach is exactly what I would have proposed independently. Before reading the diff, the obvious fix was "pick a model you know is in Code is straightforward — one Before/after testing reproduces the exact CI failure on main ( If I had to maintain this in six months, I'd thank the author — clear comments ("Use openai model to avoid auth issues"), established pattern, narrow scope, easy to revert. Approving because it's genuinely good: test-only revert of a known-passing block, minimal diff, established convention, clear CI unblock. No reservations worth flagging. 中文说明退一步看:本 PR 是对 #5676 合并时意外回退的纯测试代码块的干净恢复。动机明确且影响大 —— 损坏的 No-Sandbox 集成 job 正在阻塞 Release 发布。修复代码与从 3 月底到 方案正是我自己会独立提出的方向。在读 diff 之前,显而易见的修复就是"挑选一个你确定在 代码直白 —— 一个 before/after 测试在 main 上复现了确切的 CI 失败(516 行 如果半年后由我来维护,我会感谢作者 —— 注释清晰("Use openai model to avoid auth issues")、写法约定俗成、范围窄、易回退。 批准,因为它是真正的好改动:纯测试回退已知通过的代码块、diff 最小、采用既定约定、明确解锁 CI。没有值得标记的保留意见。 — Qwen Code · qwen3.7-max |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
wenshao
left a comment
There was a problem hiding this comment.
No review findings — clean, minimal, test-only change.
The diff is the exact byte-for-byte inverse of PR 5676's regression to this hunk, restoring the long-standing find((m) => m.modelId.includes('openai')) selection so the model assertion no longer depends on the session's auth-dependent current model. The non-null assertion openaiModel!.modelId is safely guarded by the preceding expect(openaiModel).toBeDefined() (a failing vitest assertion throws and halts the test before the ! is dereferenced), and the style matches the surrounding modelOption! / modeOption! usage. Prettier passes and CI is all-green (23 checks).
— claude-opus-4-8 via Qwen Code /qreview
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
No review findings — clean, minimal, test-only change. Downgraded from Approve to Comment: CI still running (29 checks pending). — qwen3.7-max via Qwen Code /review
What this PR does
Restores the ACP integration test
supports session/set_config_option for mode and modelto explicitly select anopenaimodel from the session'savailableModelslist before setting it, instead of asserting that the session's current model already appears inavailableModels.Why it's needed
PR #5676 (an unrelated v5 settings-migration fix) inadvertently reverted this test's model-selection block back to a flaky form:
In CI without real authentication, the session's default current model is not present in
availableModels, so this assertion fails withexpected false to be true. That fails the Release workflow's Integration Tests (No Sandbox) job, which gates Publish Release — so the last several releases never published (e.g. run 27971498894, failing atacp-integration.test.ts:516).The restored form explicitly picks an
openaimodel (the test authenticates withmethodId: 'openai'earlier) and sets that, avoiding the auth-dependent current-model mismatch. This is the exact form that shipped in every successful release from late March until #5676, including the last green release6bc3f853e.Reviewer Test Plan
How to verify
git show <this-commit> -- integration-tests/cli/acp-integration.test.tsis the inverse of fix(cli): keep settings v5 migration idempotent #5676's change to the same file.6bc3f853e; the next No-Sandbox integration run should passsupports session/set_config_option for mode and modelagain.Evidence (Before & After)
N/A (test-only change, not user-visible). Before: assertion
availableModels.some(m => m.modelId === currentValue)→falsein CI → job exits 1 → Publish Release skipped. After: test selects anopenaimodel already present inavailableModelsand sets it, matching the long-standing passing behavior.Tested on
The live ACP integration test requires provider auth + network, so it was not re-run locally. Verified locally:
prettier --checkpasses, no dangling references, and the restored region is byte-identical to the last green release. The authoritative check is the CI No-Sandbox job.Environment (optional)
N/A
Risk & Scope
Linked Issues
Refs failing Release run https://github.com/QwenLM/qwen-code/actions/runs/27971498894 (No Sandbox integration job). Restores behavior regressed by #5676.
中文说明
这个 PR 做了什么
把 ACP 集成测试
supports session/set_config_option for mode and model恢复为:先从会话的availableModels列表里显式挑选一个openai模型再设置,而不是断言"会话当前模型已经存在于availableModels中"。为什么需要
PR #5676(一个不相干的 v5 settings 迁移修复)在合并时意外把这段模型选择代码回退成了 flaky 写法:
在没有真实鉴权的 CI 环境里,会话默认的"当前模型"并不在
availableModels列表中,于是该断言报expected false to be true。这会让 Release 工作流的 Integration Tests (No Sandbox) job 失败,而 Publish Release 依赖它通过 —— 导致最近几次发布都没真正发出去(例如失败 run 27971498894,挂在acp-integration.test.ts:516)。恢复后的写法显式选取一个
openai模型(测试前面已用methodId: 'openai'鉴权)再设置,规避了依赖鉴权的"当前模型不匹配"问题。这正是从 3 月底到 #5676 之前、每次成功发布(含最后一次绿色发布6bc3f853e)所采用的版本。评审验证
git show <本提交> -- integration-tests/cli/acp-integration.test.ts确认它与 fix(cli): keep settings v5 migration idempotent #5676 对同一文件的改动互为逆操作。6bc3f853e逐字节一致;下一次 No-Sandbox 集成测试应重新通过该用例。风险与范围
测试情况
实测 ACP 集成用例需要 provider 鉴权 + 网络,未在本地重跑。本地已验证:
prettier --check通过、无悬空引用、恢复区域与上次绿色发布逐字节一致。权威校验以 CI 的 No-Sandbox job 为准。