acp: usage_update is not sent when a turn fails
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 半日
- 初心者へのやさしさ
- 82/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- rust, typescript
- 領域
- api
調査の方向性
まず packages/cli/src/acp/turn.ts、特に settle を読み、次に packages/cli-rs/crates/acp/src/turn.rs の同じ制御フローを比較します。Issue で説明されている opencode acp セッションの流れを再現します。完了の条件は、失敗したプロンプトターンがエラーを返す前に、累積された usage_update 通知を出力することです。成功したターン、キャンセルされたターン、およびコンテンツでフィルターされたターンは変更しないままにします。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 230k
- フォーク
- 31.3k
- 平均マージ
- 5時間 32分
- マージ済み PR(30日)
- 453
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
anomalyco/opencode のほかの issue
-
area/desktop platform/macos status/repro-plausible type/bug version/v2
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
anomalyco/opencode#67064 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
area/web type/feature version/v2
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
anomalyco/opencode#67001 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
skills: a Claude-compatible SKILL.md that fails to parse is dropped without any log対応中かも @liwenjie200543 が 2 日前に担当しました。 オープンarea/plugins platform/linux reproduced type/bug version/v2
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
anomalyco/opencode#66970 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
tui: Mermaid renderer displays <b>/<strong> tags literally and ignores \n line breaks対応中かも @argszero が 2 日前に担当しました。 オープンarea/tui platform/wsl status/repro-simulated type/bug version/v2
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
anomalyco/opencode#66773 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
area/sdk-api platform/linux type/feature version/v2
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
anomalyco/opencode#66604 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
anomalyco/opencode の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
check:failed streams:edit
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
iptv-org/iptv#60585 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信
-
[Bug]: Critical path skips a child span that ends exactly when the next one starts対応中かも @Piyush4801 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
jaegertracing/jaeger-ui#4865 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
anthropics/claude-code#112972 ·