[FEATURE]:在恢复消息之前,预览受影响的文件并请求确认
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- git, typescript
- Lĩnh vực
- devtools
Hướng nghiên cứu
Start with the revert flow that emits the session.revert.stage log event and see where it restores files from snapshots, since that is where a preview step would go. The config key snapshots in opencode.jsonc controls capture, so check it first when reproducing the empty repos directory. Done means a preview listing affected files appears before the rollback and can be cancelled, with the snapshots default behaviour settled or split into its own issue.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Feature request: preview affected files and ask for confirmation before reverting a message
Problem
When I use Revert from a message menu (or /undo), the files touched by later assistant steps are restored immediately. There is no way to see which files will change before the rollback is applied.
If the working tree contains edits made after that assistant step (by me or by another tool), those edits are silently overwritten. The docs acknowledge this risk:
Current edits to an affected path can be overwritten, so review the restored summary and
git diffbefore continuing.
But no "restored summary" is shown before the rollback happens, and git diff can only be checked afterwards, when the edits are already gone.
The revert is described as staged, but in practice only the conversation is staged (messages can be brought back with /redo) — files are restored right away, with no preview and no confirmation.
Steps to reproduce
- Open a session in a git repository with snapshots enabled.
- Let the assistant edit a file.
- Make an unrelated manual edit to the same file.
- Choose Revert on an earlier message (or run
/undo). - The assistant's change is rolled back and the manual edit is lost, with no warning.
Expected behavior
Before applying the rollback, show which files will be affected and ask for confirmation, for example:
This revert will change 3 files:
222/test.txt restored to version before step 4
src/new.ts removed (created by the reverted step)
src/api.ts restored to version before step 4
[Cancel] [Revert these files]
A concise git diff --stat style preview would already be enough.
Alternatives considered
/redoafter/undo— only undoes the rollback itself; it does not preview anything.- Checking
git statusafterwards — too late, overwritten edits are already gone.
Additional observation (possibly a separate issue)
In my setup, file capture did not work until I set "snapshots": true explicitly in opencode.jsonc.
Before that:
~/.local/share/opencode/reposstayed empty;- the log showed
session.revert.stage ... files=undefined; - no
snapshotentries appeared in the log.
The Snapshots docs say snapshots are enabled by default, so this may be a bug or a version difference. Happy to file it separately if useful.
Environment
- opencode
2.3.2 - OpenCode Desktop
- Git repository with at least one commit
snapshots: trueset explicitly
- Ngôn ngữ chính
- TypeScript
- Star
- 227k
- Fork
- 30.7k
- Merge trung bình
- 3 giờ 57 phút
- Pull request đã merge (30 ngày)
- 484
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 anomalyco/opencode
-
[Site] Active section detection should respect scroll-margin-topCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởarea/web reproduced type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
anomalyco/opencode#65384 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/cli type/feature version/v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
anomalyco/opencode#65379 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Shell tool: no upper bound on the timeout a model can ask for, so one call can hold a turn for hoursĐang mởarea/core platform/linux type/feature version/v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
anomalyco/opencode#65254 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
inference/go type/feature
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 72/100
anomalyco/opencode#65148 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/providers type/feature version/v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
anomalyco/opencode#64845 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của anomalyco/opencode
Issue tương tự
-
[Provider] antigravity-acp catalog omits gemini-4-hydrogen and gemini-4-neon that agy acp offersCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởcatalog provider provider-compatibility
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
lidge-jun/opencodex#9037 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Project submission: xmcp DocsĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
slavakurilyak/awesome-ai-agents#1005 ·
-
kind/bug triage/unresolved
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 60/100
Maintainer thường phản hồi trong vòng 1 ngày
-
effort:S P3 refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nightscout/nocturne#3735 ·
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 62/100
wpilibsuite/systemcore-blocks-interface#641 ·
Maintainer thường phản hồi trong vòng 2 ngày