Support OpenCode v2 diff and plan review integration
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ó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start in plugins/opencode/ and read the linked OpenCode v2 migration, plugin, and CLI plugin documentation alongside the existing revdiff tool, /revdiff command, and plan-review plugin. Trace the installer and existing tests, then define the v2 entrypoints, server/client routing, lifecycle cleanup, and version selection while preserving the v1 integration and stated exit-code behavior.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I'd like revdiff's OpenCode integration to support OpenCode v2. The current integration under plugins/opencode/ uses the v1 plugin and custom-tool APIs, which need to be ported for v2.
References:
Migration considerations
The integration currently includes a revdiff tool, a /revdiff command, and an automatic plan-review plugin.
The plan-review plugin exports an async function returning an event hook. On session.idle, it reads the last assistant message, checks whether it was produced in plan mode, launches revdiff, and sends annotations back to the session. V2 requires a new plugin entrypoint and explicit subscriptions, and the message-reading, plan-detection, and prompt-submission logic needs to be checked against the new server API and lifecycle contracts.
The custom tool also uses the v1 tool() helper. V2 documents tool registration through ctx.tool.transform, with JSON Schema inputs and structured results. Existing Markdown command definitions remain supported, so the /revdiff command may need little change once its underlying tool is available.
There is also a routing consideration beyond the API changes: v2 uses a shared background server by default, including for tool execution. The existing launchers rely on terminal-specific environment variables to open the overlay in the correct pane. The server's environment may not identify the client that requested the review.
A CLI plugin may be a better fit for launching the interactive review in the user's terminal. Preserving the agent-callable tool would also require defining how a server-side request reaches the appropriate CLI client and returns annotations to the originating session.
Expected behavior
- Support manual diff review through
/revdiffand the agent-callablerevdifftool, preserving the existing ref, staged, and only options. - Automatically review completed plans and return annotations to the originating session for revision in plan mode.
- Open reviews in the correct terminal pane and project directory when multiple OpenCode clients share a server.
- Avoid duplicate reviews and unintended launches for unrelated sessions or subagents.
- Preserve exit-code handling: 0 for a clean exit, 10 for success with annotations, and other nonzero statuses as failures.
- Handle cancellation and plugin cleanup without leaving review processes or temporary files behind.
- Update installation instructions and tests for the supported v2 integration.
- Installer checks OpenCode version and installs appropriate plugin + tool + command.
- Existing v1 integration remains intact
Contribution
I'd be happy to try implementing this and submit a PR. Before starting, I'd appreciate feedback on the preferred approach
- Ngôn ngữ chính
- Go
- Star
- 896
- Fork
- 92
- Merge trung bình
- 17 giờ 49 phút
- Pull request đã merge (30 ngày)
- 17
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không 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 umputun/revdiff
-
Support horizontal scrollĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
umputun/revdiff#334 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 64/100
umputun/revdiff#350 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 78/100
umputun/revdiff#341 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
umputun/revdiff#331 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 64/100
umputun/revdiff#324 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của umputun/revdiff
Issue tương tự
-
area: global bug dx priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
grafana/mcp-grafana#1267 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
automation models
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
coverage-gap good-first-pattern help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
GoogleCloudPlatform/k8s-aibom#114 ·
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 72/100
txn2/mcp-data-platform#1984 ·
Maintainer thường phản hồi trong vòng 1 ngày