Skip to content

fix(cli): Handle ACP read_file for managed local paths#6021

Merged
doudouOUC merged 19 commits into
QwenLM:mainfrom
doudouOUC:codex/fix-acp-read-file-skill-roots
Jun 30, 2026
Merged

fix(cli): Handle ACP read_file for managed local paths#6021
doudouOUC merged 19 commits into
QwenLM:mainfrom
doudouOUC:codex/fix-acp-read-file-skill-roots

Conversation

@doudouOUC

@doudouOUC doudouOUC commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

What this PR does

This PR makes ACP-backed read_file preserve the local read behavior that the tool already allows for managed local roots such as skill instructions, temp outputs, subagent transcripts, managed auto-memory, and user extensions. When the serve-side workspace boundary rejects one of those explicitly allowed local reads as outside the workspace, the agent falls back to the local file system service instead of surfacing the workspace-boundary rejection. It also improves error rendering so plain object failures surface their message or structured JSON instead of collapsing to [object Object].

Why it's needed

Fixes #6020. A reported session loaded a user skill and then attempted to read instruction files under /root/.qwen/skills/.... The skill directory is intentionally allowed by read_file, but under qwen serve the ACP file path went through a workspace-bound file system that rejected the same path as outside /workspace. The underlying structured error was then stringified as a plain object, leaving users and telemetry with only Error reading file ...: [object Object]. Aligning ACP fallback with the tool's existing local read roots fixes the false failure while keeping reads outside those roots blocked, and the error-message normalization keeps future failures actionable.

Reviewer Test Plan

How to verify

Run the focused ACP file system test and confirm it covers three outcomes: allowed local roots fall back to local reads, paths outside configured roots do not fall back, and empty configured roots are ignored. Run the focused core utility tests and confirm plain object read failures show the original message instead of [object Object]. Run formatting, typecheck, and build; the expected result is no test/type/build failures, with only the existing VS Code companion curly lint warnings and existing Vite/Browserslist warnings during build.

Evidence (Before & After)

Before: the captured session reported Error reading file /root/.qwen/skills/dataworks-di-data-processor/instructions/interaction_norms.md: [object Object] with error_type=read_content_failure. After: the regression tests confirm ACP path_outside_workspace errors fall back only for explicitly allowed local roots, and plain object read errors render the useful path escapes workspace: ... message instead of [object Object].

Tested on

OS Status
🍏 macOS ✅ tested
🪟 Windows ⚠️ not tested
🐧 Linux ⚠️ not tested

Environment (optional)

Node.js v22.22.3, npm 10.9.8. Verification commands run locally: cd packages/cli && npx vitest run src/acp-integration/service/filesystem.test.ts; cd packages/core && npx vitest run src/utils/fileUtils.test.ts src/utils/errors.test.ts src/tools/edit.test.ts; npx prettier --check packages/cli/src/acp-integration/acpAgent.ts packages/cli/src/acp-integration/service/filesystem.ts packages/cli/src/acp-integration/service/filesystem.test.ts packages/core/src/utils/errors.ts packages/core/src/utils/errors.test.ts packages/core/src/utils/fileUtils.ts packages/core/src/utils/fileUtils.test.ts; npm run typecheck; npm run build.

Risk & Scope

  • Main risk or tradeoff: ACP read behavior now has a narrow local fallback path, so the main risk is accidentally broadening reads beyond what read_file should allow; this is limited by requiring both the structured path_outside_workspace error and an explicit configured local read root match.
  • Not validated / out of scope: I did not run a live qwen serve session against the original DataWorks skill environment; the validation is unit-level plus full typecheck/build. Windows and Linux were not tested locally.
  • Breaking changes / migration notes: Direct OS temp directory reads are no longer auto-allowed merely because they live under os.tmpdir(); those paths now follow the normal read_file permission flow unless they are explicitly configured as local read roots. The fallback remains read-only and only applies after the ACP workspace boundary rejects a path that is already within configured local read roots.

Linked Issues

Fixes #6020

中文说明

What this PR does

这个 PR 让 ACP 场景下的 read_file 保持工具本身已经允许的本地读取行为,例如 skill instructions、临时输出、subagent transcript、托管 auto-memory 和用户 extensions。当 serve 侧 workspace 边界把这些显式允许的本地读取拒绝为 workspace 外路径时,agent 会回退到本地文件系统服务读取,而不是直接把 workspace 边界错误返回给用户。同时,这个 PR 改善了错误渲染逻辑,让普通对象错误展示其中的 message 或结构化 JSON,而不是退化成 [object Object]

Why it's needed

修复 #6020。一次用户反馈的 session 先加载了用户 skill,随后读取 /root/.qwen/skills/... 下的 instruction 文件。skill 目录本来被 read_file 明确允许,但在 qwen serve 下 ACP 文件路径走到了 workspace-bound 文件系统,被同一个路径判定为 /workspace 外部路径。随后这个结构化错误又被当作普通对象字符串化,导致用户和 telemetry 只能看到 Error reading file ...: [object Object]。让 ACP fallback 和工具已有的本地读取根目录对齐,可以修复这个误失败,同时继续阻止这些根目录之外的读取;错误消息正规化也能让未来失败保留可诊断信息。

Reviewer Test Plan

How to verify

运行聚焦的 ACP 文件系统测试,确认它覆盖三个结果:允许的本地 root 会回退到本地读取、配置 root 之外的路径不会回退、空 root 会被忽略。运行聚焦的 core utility 测试,确认普通对象读取失败会展示原始 message,而不是 [object Object]。运行格式检查、typecheck 和 build;预期没有测试、类型或构建失败,build 中只保留既有的 VS Code companion curly lint warnings 和既有的 Vite/Browserslist warnings。

Evidence (Before & After)

修复前:捕获的 session 报告 Error reading file /root/.qwen/skills/dataworks-di-data-processor/instructions/interaction_norms.md: [object Object],并带有 error_type=read_content_failure。修复后:回归测试确认 ACP path_outside_workspace 错误只会在显式允许的本地 root 内回退读取,并且普通对象读取错误会展示有用的 path escapes workspace: ... message,而不是 [object Object]

Tested on

OS Status
🍏 macOS ✅ tested
🪟 Windows ⚠️ not tested
🐧 Linux ⚠️ not tested

Environment (optional)

Node.js v22.22.3,npm 10.9.8。本地运行的验证命令:cd packages/cli && npx vitest run src/acp-integration/service/filesystem.test.tscd packages/core && npx vitest run src/utils/fileUtils.test.ts src/utils/errors.test.ts src/tools/edit.test.tsnpx prettier --check packages/cli/src/acp-integration/acpAgent.ts packages/cli/src/acp-integration/service/filesystem.ts packages/cli/src/acp-integration/service/filesystem.test.ts packages/core/src/utils/errors.ts packages/core/src/utils/errors.test.ts packages/core/src/utils/fileUtils.ts packages/core/src/utils/fileUtils.test.tsnpm run typechecknpm run build

Risk & Scope

  • 主要风险或权衡:ACP 读取行为现在有一个很窄的本地 fallback 路径,因此主要风险是意外放宽 read_file 的读取范围;当前通过同时要求结构化 path_outside_workspace 错误和显式配置的本地读取 root 命中来限制这个风险。
  • 未验证 / 不在范围内:没有在原始 DataWorks skill 环境中运行 live qwen serve session;验证覆盖在单元测试、完整 typecheck 和 build 层面。Windows 和 Linux 没有在本地测试。
  • 破坏性变更 / 迁移说明:直接读取 OS 临时目录不再因为位于 os.tmpdir() 下就被默认放行;除非这些路径被显式配置为本地读取 root,否则会走正常的 read_file 权限流程。fallback 仍然只读,并且只在 ACP workspace 边界拒绝一个已位于配置本地读取 root 内的路径后生效。

Linked Issues

Fixes #6020

Allow ACP read_file calls to fall back to local reads for explicitly permitted local roots when the serve workspace boundary rejects them, and preserve useful messages for plain object read errors.

Co-authored-by: Qwen-Coder <[email protected]>
@doudouOUC
doudouOUC marked this pull request as ready for review June 29, 2026 13:59
Copilot AI review requested due to automatic review settings June 29, 2026 13:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qwen-code-ci-bot

qwen-code-ci-bot commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the PR, @doudouOUC!

Template looks good ✓

On direction: Straightforward bug fix — ACP serve mode rejects read_file for paths the local tool already allows (skill instructions, subagent transcripts, auto-memory, etc.), and the resulting structured error collapses to [object Object]. Fixes the real user-reported issue #6020. Clearly within the project's core tool system scope.

On approach: The two concerns (ACP local read fallback + error normalization) are tightly coupled — the [object Object] rendering is exactly what made the ACP mismatch undiagnosable. The getErrorMessage() consolidation replaces the same error instanceof Error ? error.message : String(error) pattern across 5+ call sites, which is genuine reuse, not drive-by refactoring. The os.tmpdir() removal from read_file's allowed roots is a behavioral tightening declared in Risk & Scope and covered by tests. The scripts/ CI changes (check:serve-fast-path-bundle in test:ci, npx cross-envcross-env) are slightly tangential but small enough and self-consistent. The merge conflict resolution (commit 388cd594f) is clean — the resolve bot flagged a potential duplicate test file, but the PR already updated serve-fast-path-bundle-check.test.js to match the cross-env convention, so no actual conflict exists.

Moving on to code review. 🔍

中文说明

感谢贡献,@doudouOUC

模板完整 ✓

方向:直接的 bug 修复 —— ACP serve 模式下拒绝了 read_file 对本地工具已允许路径的读取(skill instructions、subagent transcripts、auto-memory 等),返回的结构化错误退化为 [object Object]。修复了用户实际报告的问题 #6020,与项目核心工具系统方向一致。

方案:两个关注点(ACP 本地读取 fallback + 错误正规化)紧密耦合 —— [object Object] 渲染正是让 ACP 不匹配问题难以诊断的原因。getErrorMessage() 整合替换了 5+ 个调用点的相同 error instanceof Error ? error.message : String(error) 模式,是真正的复用改进,不是顺手重构。从 read_file 允许根目录中移除 os.tmpdir() 是在 Risk & Scope 中声明的行为收紧,有测试覆盖。scripts/ 的 CI 变更(check:serve-fast-path-bundle 加入 test:cinpx cross-envcross-env)与 bug 修复略有分离但足够小且自洽。合并冲突解决(commit 388cd594f)干净 —— resolve bot 提示了可能的重复测试文件,但 PR 已更新 serve-fast-path-bundle-check.test.js 以匹配 cross-env 惯例,实际不存在冲突。

进入代码审查 🔍

Qwen Code · qwen3.7-max

@doudouOUC doudouOUC self-assigned this Jun 29, 2026
Comment thread packages/cli/src/acp-integration/acpAgent.ts
@qwen-code-ci-bot

qwen-code-ci-bot commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Code Review

Independent proposal: catch path_outside_workspace in AcpFileSystemService.readTextFile, verify the path against the same local read roots that read-file.ts allows, and fall back to the local FS service. For [object Object], extend getErrorMessage() to handle plain objects and replace the scattered inline patterns.

The PR's approach matches closely with two good additions: realpath resolution on both roots and files (prevents symlink-escape attacks), and normalizeError() wrapping plain objects into real Error instances with cause (prevents numeric ACP codes from leaking as Node error codes). The getErrorKind() function correctly reads from data.errorKind (structured field), not top-level — closing the injection vector. The localReadRoots passed from acpAgent.ts mirror read-file.ts's allowed roots plus auto-memory roots.

No critical blockers. The security gating is tight: fallback requires both a recognized errorKind AND realpath-verified subpath membership. Empty roots are excluded. Failed fallbacks preserve the original ACP error as cause.

Testing

Unit tests (all pass in PR worktree)

Test file Tests Result
packages/cli/…/filesystem.test.ts 30
packages/cli/…/acpAgent.test.ts 164
packages/core/…/errors.test.ts 29
packages/core/…/fileUtils.test.ts 100
packages/core/…/edit.test.ts 84
packages/core/…/read-file.test.ts 65
packages/core/…/write-file.test.ts 52
scripts/tests/* 277
Total 801

Typecheck: clean ✅

Real-scenario test (tmux)

Test: read /tmp/triage-6021/test-read.md containing triage-test-content-for-pr-6021.

Before (installed qwen 0.19.1)

$ qwen -p 'Read the file /tmp/triage-6021/test-read.md and tell me what it says. Output only the file contents verbatim.' --max-session-turns 3 2>&1 | tee /tmp/triage-6021/before.log
Warning: QWEN_HOME points to "..." but no settings.json was found there. ...
Warning: QWEN_HOME points to "..." but no settings.json was found there. ...
triage-test-content-for-pr-6021

Result: auto-allowed (path under os.tmpdir()), read succeeds.

After (this PR, npm run dev)

$ npm run dev -- -p 'Read the file /tmp/triage-6021/test-read.md and tell me what it says. Output only the file contents verbatim.' --max-session-turns 3 2>&1 | tee /tmp/triage-6021/after.log

> @qwen-code/[email protected] dev
Warning: Tool "read_file" requires user approval but cannot execute in non-interactive mode.
To enable automatic tool execution, use the -y flag (YOLO mode):
...
The `read_file` tool permission was declined in non-interactive mode, and I cannot work around denied tool calls using shell commands. I'm unable to read the file contents.

Result: permission required (os.tmpdir() removed from auto-allowed roots, and this path isn't under any configured qwen-managed root).

After with -y (this PR, npm run dev)

$ npm run dev -- -p 'Read the file /tmp/triage-6021/test-read.md and tell me what it says. Output only the file contents verbatim.' --max-session-turns 3 -y 2>&1 | tee /tmp/triage-6021/after-yolo.log

> @qwen-code/[email protected] dev
Warning: running headless with --yolo / approval-mode=yolo and no sandbox. ...
triage-test-content-for-pr-6021

Result: with YOLO approval, read succeeds.

Interpretation: The behavioral change is exactly what the PR describes — os.tmpdir() is no longer an auto-allowed root. Arbitrary temp paths now require approval unless under a configured local read root. The tool still works with -y. The ACP-specific fallback (the core fix) requires qwen serve to exercise and is covered by 30 unit tests simulating the workspace boundary error.

中文说明

代码审查

独立方案:在 AcpFileSystemService.readTextFile 中捕获 path_outside_workspace 错误,验证路径是否在 read-file.ts 已允许的本地读取根目录中,然后回退到本地文件系统服务。对于 [object Object] 问题,扩展 getErrorMessage() 以处理普通对象,并替换分散的内联模式。

PR 的方案与此接近,并增加了两个好的改进:对根目录和文件路径使用 realpath 解析(防止符号链接逃逸攻击),以及 normalizeError() 将普通对象包装为带 cause 的真实 Error 实例(防止数值型 ACP 错误码泄漏为 Node 错误码)。getErrorKind() 正确读取 data.errorKind(结构化字段),而非顶层字段 —— 关闭了注入向量。

没有关键阻塞问题。安全门控严格:fallback 需要同时匹配 errorKind 和 realpath 验证的子路径成员关系。空根目录被排除。

测试

单元测试(PR worktree 中全部通过)

共 801 个测试通过。Typecheck 干净。

真实场景测试(tmux)

测试:读取 /tmp/triage-6021/test-read.md(内容:triage-test-content-for-pr-6021)。

修复前(已安装 qwen 0.19.1): 自动允许(路径在 os.tmpdir() 下),读取成功。

修复后(本 PR): 需要权限(os.tmpdir() 从自动允许根目录移除)。

修复后加 -y(本 PR): 使用 YOLO 批准后,读取成功。

解读: 行为变更完全符合 PR 描述。

Qwen Code · qwen3.7-max

@qwen-code-ci-bot

qwen-code-ci-bot commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

This is a clean, well-scoped bug fix. The author understood the problem precisely: ACP serve mode and read_file had a policy mismatch for managed local paths, and the error rendering pipeline collapsed structured errors into [object Object]. Both issues are addressed with minimal, targeted changes.

The fallback logic is properly gated — requires both a recognized errorKind in data (not a top-level field) AND realpath-verified subpath membership against configured roots. The normalizeError() helper and the getErrorMessage() extension replace 5+ inline instanceof Error ? .message : String() patterns, which is genuine consolidation.

The tmux test confirmed the intentional behavioral change: os.tmpdir() is no longer auto-allowed for read_file. Paths under /tmp that aren't in a configured root now need approval. With -y, the read succeeds — the tool still works, it just asks first.

801 unit tests pass. Typecheck clean. The merge conflict resolution is clean and the resolve bot's duplicate test file warning was a false alarm (the PR already updated the existing test).

Two non-blocking notes for the author:

  • The scripts/ CI changes (adding check:serve-fast-path-bundle to test:ci, npxcross-env removal) ride along with the bug fix. Harmless and self-consistent, but ideally split into their own PR for cleaner history.
  • The os.tmpdir() tightening is user-visible — scripts or automations that relied on auto-allowing arbitrary /tmp reads will now see approval prompts. Worth a line in the CHANGELOG when this ships.

Approved. ✅

中文说明

这是一个干净、范围明确的 bug 修复。作者精确理解了问题:ACP serve 模式和 read_file 对托管本地路径存在策略不匹配,错误渲染管线将结构化错误折叠为 [object Object]。两个问题都通过最小化的、有针对性的修改得到解决。

fallback 逻辑有正确的门控 —— 需要同时识别 data 中的 errorKind(非顶层字段)和 realpath 验证的子路径成员关系。normalizeError() 辅助函数和 getErrorMessage() 扩展替换了 5+ 个内联 instanceof Error ? .message : String() 模式,是真正的整合改进。

tmux 测试确认了有意的行为变更:os.tmpdir() 不再被 read_file 自动允许。不在配置根目录下的 /tmp 路径现在需要审批。使用 -y 时读取成功。

801 个单元测试通过。Typecheck 干净。合并冲突解决干净,resolve bot 的重复测试文件警告是误报(PR 已更新既有测试)。

两个不阻塞的备注:

  • scripts/ CI 改动搭车,无害但理想情况应拆分。
  • os.tmpdir() 权限收紧是用户可见的 —— 依赖自动放行任意 /tmp 读取的脚本或自动化现在会看到审批提示。建议在发布时记入 CHANGELOG。

批准 ✅

Qwen Code · qwen3.7-max

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, looks ready to ship. ✅

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] writeTextFile does not normalize plain-object ACP errors. The normalizeError function is only applied in the readTextFile catch block. The writeTextFile method lets ACP errors propagate raw, so write operations that fail with a plain-object error will still surface [object Object] to downstream callers (e.g., write-file.ts uses String(error)). Consider wrapping the writeTextFile await in a try/catch with normalizeError, mirroring the read path.

— qwen3.7-max via Qwen Code /review

Comment thread packages/cli/src/acp-integration/service/filesystem.ts Outdated
Comment thread packages/cli/src/acp-integration/service/filesystem.ts Outdated
Comment thread packages/cli/src/acp-integration/acpAgent.ts

@wenshao wenshao left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] writeTextFile (unmodified in this PR) does not normalize errors the way readTextFile now does. ACP write errors may still surface as [object Object]. Consider adding a try/catch with normalizeError to writeTextFile for symmetry.

— qwen3.7-max via Qwen Code /review

Comment thread packages/cli/src/acp-integration/service/filesystem.ts Outdated
Comment thread packages/cli/src/acp-integration/service/filesystem.ts Outdated
Add the missing getUserAutoMemoryRoot export to the acpAgent test core mock so the updated acpAgent import resolves under Vitest.

Co-authored-by: Qwen-Coder <[email protected]>

@wenshao wenshao left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No review findings. Downgraded from Approve to Comment: CI still running.

— GPT-5 via Qwen Code /review

@ytahdn ytahdn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cross-file note: the same instanceof Error ? error.message : String(error) pattern fixed in fileUtils.ts still exists in edit.ts:728 and write-file.ts:616-619. Since writeTextFile also doesn't normalize errors, write/edit operations can still surface [object Object] to users. Consider applying getErrorMessage() there too for defense in depth.

— qwen3.7-max via Qwen Code /review

Comment thread packages/cli/src/acp-integration/service/filesystem.ts
Comment thread packages/cli/src/acp-integration/service/filesystem.ts
Comment thread packages/cli/src/acp-integration/service/filesystem.ts
Comment thread packages/cli/src/acp-integration/service/filesystem.ts
Comment thread packages/cli/src/acp-integration/service/filesystem.ts
Comment thread packages/core/src/utils/errors.ts
Comment thread packages/cli/src/acp-integration/service/filesystem.ts
Comment thread packages/cli/src/acp-integration/service/filesystem.ts Outdated
Comment thread packages/cli/src/acp-integration/service/filesystem.ts Outdated
Comment thread packages/cli/src/acp-integration/service/filesystem.ts Outdated
Comment thread packages/cli/src/acp-integration/acpAgent.ts
Comment thread packages/cli/src/acp-integration/acpAgent.ts
Comment thread packages/core/src/utils/errors.ts Outdated
ytahdn
ytahdn previously approved these changes Jun 29, 2026

@ytahdn ytahdn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! ✅

— qwen3.7-max via Qwen Code /review

Comment thread packages/cli/src/acp-integration/service/filesystem.ts Outdated
Comment thread packages/cli/src/acp-integration/acpAgent.ts
doudouOUC and others added 3 commits June 30, 2026 00:06
Remove the broad OS temp directory from default read_file allow roots and ACP local read fallback roots. Keep qwen-managed temp roots readable and reuse the shared isSubpath helper after realpath resolution for ACP fallback containment.

Co-authored-by: Qwen-Coder <[email protected]>
Add the serve fast-path bundle check script and root npm script that the current CI workflow invokes. This mirrors the already-merged mainline check without pulling unrelated workflow or test config changes into this PR.

Co-authored-by: Qwen-Coder <[email protected]>

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No review findings. Downgraded from Approve to Comment: CI still running.

— qwen3.7-max via Qwen Code /review

Comment thread packages/cli/src/acp-integration/service/filesystem.ts Outdated
Comment thread packages/core/src/utils/fileUtils.ts

@DragonnZhang DragonnZhang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No additional findings at this head. The path_outside_workspace error-kind gating for local fallback, normalizeError in readTextFile, and the three new filesystem test cases (allowed root falls back, path outside configured root does not, empty configured roots ignored) all look correct. The writeTextFile error normalization gap (not wrapping in normalizeError symmetrically with readTextFile) and the same instanceof Error ? error.message : String(error) pattern in edit.ts:728 / write-file.ts:616-619 are already flagged in the existing reviews.

— claude-sonnet-4-6 via Qwen Code /review


Generated by Claude Code

yiliang114
yiliang114 previously approved these changes Jun 30, 2026

@yiliang114 yiliang114 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yiliang114

Copy link
Copy Markdown
Collaborator

@qwen-code /triage

wenshao
wenshao previously approved these changes Jun 30, 2026
@doudouOUC
doudouOUC enabled auto-merge June 30, 2026 08:21
@doudouOUC
doudouOUC added this pull request to the merge queue Jun 30, 2026

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, looks ready to ship. ✅

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 30, 2026
@yiliang114
yiliang114 added this pull request to the merge queue Jun 30, 2026
Comment thread packages/cli/src/acp-integration/service/filesystem.ts
Comment thread packages/core/src/utils/errors.ts
Comment thread packages/core/src/utils/errors.ts
@doudouOUC
doudouOUC dismissed stale reviews from qwen-code-ci-bot, wenshao, and yiliang114 via e2ffd48 June 30, 2026 10:19
Comment thread packages/cli/src/acp-integration/service/filesystem.ts
Comment thread packages/core/src/utils/errors.ts
Comment thread packages/core/src/utils/errors.ts
@yiliang114
yiliang114 removed this pull request from the merge queue due to a manual request Jun 30, 2026
@wenshao

wenshao commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

@qwen-code /triage

@yiliang114 yiliang114 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yiliang114
yiliang114 enabled auto-merge June 30, 2026 10:41
@yiliang114
yiliang114 added this pull request to the merge queue Jun 30, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 30, 2026

@DragonnZhang DragonnZhang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No new findings at HEAD 339cde1c8. The latest commits fully address the earlier Critical concerns: getLocalReadFallbackPath resolves both file and root paths via realpath() before isSubpath containment (symlink-safe), normalizeError creates a clean Error without copying untrusted properties, getErrorKind only trusts data.errorKind (not top-level), and the fallback read passes the resolved real path (no TOCTOU). The getErrorMessage plain-object branch and os.tmpdir() removal from read-file.ts allowedRoots are intentional behavioral changes documented in the PR body. Test coverage is thorough across symlink escape, missing files, error normalization, and root containment. — Qwen Code /review (automated)

@doudouOUC
doudouOUC added this pull request to the merge queue Jun 30, 2026
Merged via the queue into QwenLM:main with commit ea536d3 Jun 30, 2026
30 checks passed

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Downgraded from Approve to Comment: CI still running. 2 suggestions below — no blockers found.

— qwen3.7-max via Qwen Code /review


throw error;
const errorKind = getErrorKind(error);
const shouldTryLocalReadFallback =

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] No test uses an ACP error with a valid data.errorKind string that is NOT in LOCAL_READ_FALLBACK_ERROR_KINDS (e.g., 'rate_limited'). The code path where getErrorKind() returns a defined string but isLocalReadFallbackErrorKind() returns false — meaning shouldTryLocalReadFallback is false and the error falls through to throw normalizeError(error) — is untested. A regression that broadens the fallback set would silently trigger local reads for unrelated errors.

Consider adding a test that rejects with { code: -32603, message: 'rate limited', data: { errorKind: 'rate_limited' } } and verifies no fallback is attempted.

— qwen3.7-max via Qwen Code /review

@@ -689,9 +687,9 @@ The user has the ability to modify \`content\`. If modified, this will be stated
}
}
} catch (statError: unknown) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggestion] The lstatSync catch block was migrated to getErrorMessage(statError) but no test in write-file.test.ts triggers this path (no mock of fs.lstatSync throwing). The behavioral change is unverified — if lstatSync threw a plain-object error, the new getErrorMessage call would produce different output than the old inline check.

Consider adding a test that mocks fs.existsSync to return true and fs.lstatSync to throw a plain-object error.

— qwen3.7-max via Qwen Code /review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

read_file reports [object Object] for ACP skill reads

9 participants