claude-agent: plugins that edit earlier messages make every turn fork the Claude Code session
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
- 22/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- backend
Hướng nghiên cứu
The fork is decided in sync/decide.ts, which reports a change whenever any earlier message's content hash differs, and sessions.ts then forks the Claude Code session; instructions.ts drops system[0]. Start by reading those three files and reproducing with a multi-turn session that edits an earlier message. Done means later turns resume the same session when only earlier content changed, or plugin system text reaches Claude, with a test covering both cases.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
I use Magic Context with the claude-agent provider. With the plugin on, every turn creates a new Claude Code session forked from the previous one, instead of continuing the same one.
Quick test on 2.4.2, 5 short turns with claude-sonnet-5:
- without the plugin: 1 transcript in ~/.claude/projects
- with Magic Context 0.49.89: 5 transcripts, 4 of them with forkedFrom, and 10 synthetic "No response requested." messages
From what I can see in the code:
- sync/decide.ts returns "changed" as soon as the content of any earlier message differs from the saved hash, and sessions.ts then forks.
- instructions.ts drops system[0]. Magic Context puts its instructions there, so Claude never sees them, the plugin rewrites the reply afterwards, and the next turn forks.
Magic Context closed their side as not planned, since editing earlier history is what the plugin does: https://github.com/cortexkit/magic-context/issues/970
#65227 hides the "No response requested" messages, but the forks stay.
Two things would fix it for me:
- Pass plugin text in system[0] through to Claude, or tell plugin authors to use their own system part.
- Optionally keep the Claude session going when only the content of earlier messages changed, matching messages by OpenCode message ID instead of by content. The old opencode-claude plugin had a draft for this: openchamber/opencode-claude#76
Plugins
@cortexkit/[email protected]
OpenCode version
2.4.2
Steps to reproduce
- Enable a plugin that edits earlier messages (Magic Context for example).
- Send 5 short turns to a claude-agent model in the same session.
- Look at ~/.claude/projects//: 5 transcripts instead of 1.
Operating System
Ubuntu 26.04 (WSL2)
- Ngôn ngữ chính
- TypeScript
- Star
- 230k
- Fork
- 31.3k
- Merge trung bình
- 5 giờ 32 phút
- Pull request đã merge (30 ngày)
- 453
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
-
area/desktop platform/macos status/repro-plausible type/bug version/v2
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
anomalyco/opencode#67064 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 82/100
anomalyco/opencode#67009 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/web type/feature version/v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
anomalyco/opencode#67001 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
skills: a Claude-compatible SKILL.md that fails to parse is dropped without any logCó thể đã có người làm @liwenjie200543 đã nhận 2 ngày trước. Đang mởarea/plugins platform/linux reproduced type/bug version/v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
anomalyco/opencode#66970 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
tui: Mermaid renderer displays <b>/<strong> tags literally and ignores \n line breaksCó thể đã có người làm @argszero đã nhận 2 ngày trước. Đang mởarea/tui platform/wsl status/repro-simulated type/bug version/v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
anomalyco/opencode#66773 · 4 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ự
-
enhancement feature/signals self-driving team/self-driving
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
PostHog/posthog#144208 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue web
Độ 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
-
triage: not actionable
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
oxc-project/oxc#30518 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug Claude useability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
wazuh/wazuh-dashboard-plugins#9751 ·
Maintainer thường phản hồi trong vòng 1 ngày