test(e2e): stabilize tool control and subagent cases - #6803
Conversation
E2E test reportManually dispatched the full E2E workflow for commit
The Linux Docker job covers the original #6796 failure environment, and the Linux no-sandbox job covers the original #6773 failure environment. |
|
Thanks for the PR! Template looks good ✓ Problem: Real, observed CI failures — #6796 (Docker sandbox: live model built a malformed path that bypassed the Direction: Test stabilization to make E2E deterministic — clearly aligned with project reliability goals. No product-direction concerns. Size: 0 production lines. Both changes are in Approach: Scope is tight and focused on the two failing cases. The fake-server pattern for tool-control is already established in the same file (line 1074), so this is consistent. The subagent simplification drops ~20 lines of theatrical security-auditor roleplay that was adding model variance without testing anything meaningful. No unrelated changes. Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ 问题:真实的 CI 失败 — #6796(Docker 沙箱:实时模型构造了错误路径,绕过了 方向:测试稳定性修复,使 E2E 测试变得确定——与项目可靠性目标完全一致,无产品方向顾虑。 规模:0 行生产代码。两个文件都在 方案:范围紧凑,只针对两个失败用例。tool-control 的 fake-server 模式在同文件(1074 行)已有先例,保持一致。子代理简化删掉了约 20 行安全审计角色扮演,这些内容增加了模型波动却没测试任何有意义的行为。无无关改动。 进入代码审查 🔍 — Qwen Code · qwen3.7-max |
Code ReviewIndependent proposal: to fix the tool-control flakiness, I'd replace the live model with the The PR does exactly this. Approach matches or exceeds my baseline. tool-control.test.ts: Clean adoption of the fake-server pattern. The handler returns two subagents.test.ts: Drops ~20 lines of security-auditor roleplay that was adding model variance. No critical blockers. No AGENTS.md violations. TestingThis is a test-only PR with no user-visible behavior change — tmux real-scenario testing doesn't apply here (there's nothing to drive in the CLI; the "before/after" is test reliability in CI). CI evidence (manually dispatched E2E workflow for commit All four E2E jobs pass, including the two environments where the original failures occurred. 中文说明代码审查独立方案:修复 tool-control 的不稳定性,用同文件已有的 PR 的实现与方案完全一致。 tool-control.test.ts:干净地采用 fake-server 模式。handler 在第一次请求返回两个 subagents.test.ts:删除约 20 行安全审计角色扮演,这些内容增加了模型波动。 无阻塞性问题,无 AGENTS.md 违规。 测试本 PR 为纯测试改动,无用户可见行为变化——tmux 真实场景测试不适用(CLI 无变化可驱动;before/after 体现为 CI 中的测试可靠性)。 CI 证据(为 commit 四个 E2E 任务全部通过,包括原始失败发生的两个环境。 — Qwen Code · qwen3.7-max |
|
This is a clean, focused test-fix PR. The two changes — fake-server determinism for tool-control and simplified subagent config — are the minimal set needed to resolve the two open CI failures. Both follow patterns already established in the same file. The author's independent CI run (all four E2E jobs green, including both original failure environments) confirms the fix works. No production code is touched, no new abstractions introduced, no scope creep. Nothing to push back on here. Ships it. ✅ 中文说明这是一个干净、聚焦的测试修复 PR。两处改动——tool-control 的 fake-server 确定性和简化的子代理配置——是解决两个 open CI 失败所需的最小集合。两者都遵循同文件已有的模式。 作者独立触发的 CI 运行(四个 E2E 任务全绿,包括两个原始失败环境)确认了修复有效。未触及生产代码,未引入新抽象,无范围蔓延。 没有问题需要回退。合并。✅ — Qwen Code · qwen3.7-max |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
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. |
What this PR does
This PR makes the path-specific tool exclusion E2E deterministic by using a controlled model response that reads one excluded file and one allowed file, then asserting both outcomes. It also updates the subagent E2E prompt to use the current
agenttool name and a minimal file-reading task.Why it's needed
The Docker failure in #6796 was caused by the live model constructing a malformed absolute path outside the test working directory. Because that path no longer matched the configured
.envexclusion, the read proceeded and failed with file-not-found instead of permission denied. The no-sandbox failure in #6773 was caused by a stale prompt that still asked for the renamedtasktool, combined with an unnecessarily complex role prompt that made tool invocation flaky.Reviewer Test Plan
How to verify
Run the SDK TypeScript tool-control and subagent E2E cases. Confirm that the
.envread is denied, the allowed data file is read successfully, the main model invokes theagenttool, and the subagent tool call retains its parent tool-use relationship. The full E2E workflow was also manually dispatched for this commit and should pass in Linux no-sandbox, Linux Docker, macOS, and web-shell regression jobs.Evidence (Before & After)
N/A — test-only reliability changes with no UI impact. Full workflow result: https://github.com/QwenLM/qwen-code/actions/runs/29227887565
Tested on
Environment (optional)
GitHub Actions E2E workflow on Node.js 22: Linux with no sandbox, Linux with Docker sandbox, and macOS. Local verification used Node.js 22.22.0.
Risk & Scope
Linked Issues
Fixes #6796
Fixes #6773
中文说明
本 PR 做了什么
本 PR 通过受控模型响应分别读取一个被排除文件和一个允许读取的文件,并同时断言两个结果,使按路径排除工具的 E2E 测试变得确定。此外,子代理 E2E 提示词改为使用当前的
agent工具名和一个最小化的文件读取任务。为什么需要
#6796 的 Docker 失败是因为实时模型构造了一个位于测试工作目录之外的错误绝对路径。该路径不再匹配配置的
.env排除规则,因此读取继续执行并报文件不存在,而不是权限拒绝。#6773 的 no-sandbox 失败是因为提示词仍要求使用已经更名的task工具,再叠加不必要的复杂角色提示,导致工具调用不稳定。Reviewer 测试计划
如何验证
运行 SDK TypeScript 的工具控制和子代理 E2E 用例。确认
.env读取被拒绝、允许的数据文件可成功读取、主模型调用agent工具,并且子代理工具调用保留父级工具调用关系。本提交还手动触发了完整 E2E workflow,Linux no-sandbox、Linux Docker、macOS 和 web-shell regression job 均应通过。证据(修改前后)
不适用——仅调整测试可靠性,不影响 UI。完整 workflow 结果:https://github.com/QwenLM/qwen-code/actions/runs/29227887565
已测试平台
环境(可选)
GitHub Actions E2E workflow,Node.js 22:Linux no-sandbox、Linux Docker sandbox 和 macOS。本地验证使用 Node.js 22.22.0。
风险与范围
关联 Issue
Fixes #6796
Fixes #6773