[BUG] File Changes panel lists a rejected file edit as a changed file
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript, vscode
Hướng nghiên cứu
Start with webview-ui/src/components/chat/utils/fileChangesFromMessages.ts and trace how tool asks are filtered; then read the approval and finalization paths in src/core/task/Task.ts. Add coverage in webview-ui/src/__tests__/fileChangesFromMessages.spec.tsx for approved, auto-approved, rejected, and finalized-failed asks. Done means only approved edits appear in the File Changes panel, including after task reload.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem (one or two sentences)
The File Changes panel lists a file edit that the user rejected. The file was never written. The panel treats a rejected tool ask as an approved one.
Context (who is affected and when)
Every user who rejects a proposed file edit sees the rejected file in the File Changes panel for the rest of the task. The entry also survives a task reload, because the persisted message record carries the same ambiguous flag. This misleads users into believing a rejected write touched their files.
Reproduction steps
- Environment: Zoo Code 3.98.0 in VS Code, Windows 10. Any API provider. Auto-approval for file edits is OFF.
- Start a task. Ask the agent to edit an existing file outside the workspace (any absolute path works).
- When the edit approval dialog appears, click Reject. The agent receives the rejection and the file is not modified.
- Open the File Changes panel.
Observed after step 4: the rejected file is listed in the panel with its full proposed diff.
Expected result
The panel lists only file edits that were approved (by the user or by auto-approval). A rejected edit is not listed.
Actual result
The rejected edit is listed as a changed file, with diff and stats, indistinguishable from a real approved edit.
Variations tried (optional)
- Approved edits and auto-approved edits list correctly; only rejected (and likely failed/finalized) edits leak in.
- The same entry also appears after closing and reopening the task (the persisted
ui_messages.jsoncarries the same flags). - Not verified: whether an auto-denied edit (deny rule / guard) produces the same false entry.
Root cause (analysis against main at dc6d1435e, 2026-11-16)
-
The panel derives its list in
webview-ui/src/components/chat/utils/fileChangesFromMessages.ts. Its filter is:// Only include ask "tool" file edits that the user (or auto-approval) has approved if (isAskTool && !msg.isAnswered) continueThis equates
isAnswered === truewith "approved". -
isAnsweredis also stamped on asks that will NOT complete.Task.finalizePartialToolAsk()insrc/core/task/Task.tssetspartial = falseandisAnswered = trueon a tool ask in error/rejection paths, explicitly to disarm the Save/Reject buttons. Its own doc comment says: "the ask is being finalized because it will NOT complete". -
A real approval marks the ask only on
yesButtonClicked(handleWebviewAskResponseinsrc/core/task/Task.ts), and auto-approval additionally setsautoApprovalDecisionon the message (ask()update path). A rejected/finalized ask therefore hasisAnswered = trueand NOautoApprovalDecision. -
Result: the panel cannot distinguish "answered = approved" from "answered = rejected/failed", so the rejected edit passes the filter and is displayed.
Evidence from persisted task state (sanitized): the tool-ask message for the rejected write has answered = true and an empty autoApprovalDecision, while every genuinely approved edit has autoApprovalDecision = "approve". The target file does not exist on disk at the listed path.
Suggested fix direction
Do not overload isAnswered with "approved". Either:
- add an explicit per-message outcome marker (for example
toolApproval: "approved" | "rejected" | "finalized-failed") set at the three write sites, and filter on it infileChangesFromMessages.ts; or - at minimum, exclude answered asks that have no
autoApprovalDecisionand were not answered byyesButtonClicked.
A unit test in webview-ui/src/__tests__/fileChangesFromMessages.spec.tsx should cover: approved, auto-approved, rejected, and finalized-failed tool asks.
App Version
3.98.0
API Provider (optional)
Not Applicable / Other (UI/state bug, provider-independent)
Model Used (optional)
N/A
Zoo Code Task Links (optional)
No response
Relevant logs or errors (optional)
No logs; the defect is visible in the persisted ui_messages.json flags described above.
- Ngôn ngữ chính
- TypeScript
- Star
- 2k
- Fork
- 301
- Merge trung bình
- 3 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 103
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Zoo-Code-Org/Zoo-Code
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Zoo-Code-Org/Zoo-Code#2773 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Zoo-Code-Org/Zoo-Code#2717 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Zoo-Code-Org/Zoo-Code#2515 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
fix(scripts): stryker-diff.mjs spawns the extensionless .bin shim and cannot run on WindowsCó thể đã có người làm @easonLiangWorldedtech đã nhận 15 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Zoo-Code-Org/Zoo-Code#2514 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
[BUG] search_files hides matching text on long linesCó thể đã có người làm @DananjayaNadun đã nhận 9 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Zoo-Code-Org/Zoo-Code#2496 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của Zoo-Code-Org/Zoo-Code
Issue tương tự
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
EPPIcenter/sampledb3#162 ·
-
Particle-1 modelĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
tashfeenahmed/freellmapi#2169 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
via-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
Maintainer thường phản hồi trong vòng 1 ngày
-
🎙️ task - feat(mechanic): pave git.pull.close, a close of a superseded pull with its why on recordĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ehmpathy/rhachet-roles-ehmpathy#1576 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
vercel-labs/ui#1563 ·
Maintainer thường phản hồi trong vòng 1 ngày