acp: usage_update is not sent when a turn fails
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ó
- 2/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 82/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ệ
- rust, typescript
- Lĩnh vực
- api
Hướng nghiên cứu
Bắt đầu bằng cách đọc packages/cli/src/acp/turn.ts, đặc biệt là settle, sau đó so sánh cùng luồng điều khiển trong packages/cli-rs/crates/acp/src/turn.rs. Tái hiện luồng phiên opencode acp được mô tả trong issue. Hoàn thành nghĩa là lượt prompt thất bại sẽ phát ra thông báo usage_update đã tích lũy trước khi trả về lỗi, trong khi các lượt thành công, bị hủy và bị lọc nội dung vẫn không thay đổi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
Over ACP, when a prompt turn ends in an error (provider error, rate limit, auth), opencode replies with the error but never sends usage_update. Usage from the turn's earlier steps, and from the failed step when the provider reports tokens, never reaches the client, so ACP clients undercount context and cost. Successful, cancelled and content-filtered turns do send it.
The adapter already counts these tokens (session.step.failed is folded into the turn usage). In settle in packages/cli/src/acp/turn.ts, the failure returns before sendUsageUpdate runs. packages/cli-rs/crates/acp/src/turn.rs has the same order. Sending the usage update before returning the error would fix it; the error response itself can't carry PromptResponse.usage.
Related but different: #66734 asks for usage at session start and after each model call.
Plugins
None
OpenCode version
2.4.2, still present on dev
Steps to reproduce
- Start
opencode acp, theninitializeandsession/new. - Send a prompt that makes at least one tool call, then fails on a later model call (e.g. the provider returns a rate limit or 500).
- The
session/promptcall returns an error and nousage_updatenotification is sent for that turn.
- 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
-
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
-
area/sdk-api platform/linux type/feature version/v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
anomalyco/opencode#66604 · 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ự
-
Độ 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
-
check:failed streams:edit
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
iptv-org/iptv#60585 · 1 bình luận ·
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 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: Critical path skips a child span that ends exactly when the next one startsCó thể đã có người làm @Piyush4801 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
jaegertracing/jaeger-ui#4865 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
anthropics/claude-code#112972 ·