llm settlement waits on a reply whose request an interrupt already aborted

オープン
#135 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@mikemikimike がすでに取り組んでいます。

2026年11月7日 から。

  • #137 @mikemikimike による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript
領域
testing

調査の方向性

Start by tracing how LLM responses are tracked through settlement and how aborted OpenCode requests are reported by session.step.failed and session.execution.interrupted; the issue does not name source files or tests. Reproduce the streaming reply with a deferred gate, interrupt the session, and check whether settlement still counts the response as active. Done when an aborted response no longer causes settlement to wait for its stream to finish.

索引モデルが issue の本文から書いたものです。

説明

bug

Drive 2.4.0, OpenCodeDriver.use program run with opencode-drive run.

A scripted reply that is still streaming when the session is interrupted keeps settlement waiting, so the program fails at the end with LlmSettlementError: timed out waiting for active LLM responses (unusedResponses: 0, unexpectedRequests: 0), even though every session is idle.

yield* llm.serve((request) => {
  // hangs until the gate opens
  return Stream.make(Llm.text("working ")).pipe(Stream.concat(Stream.fromEffect(Deferred.await(gate)).pipe(Stream.flatMap(() => Stream.make(Llm.text(" released"))))))
})
yield* opencode.session.prompt({ sessionID, text: "wait" })
yield* Effect.sleep(300)
yield* opencode.session.interrupt({ sessionID })
// session.active() is {} from here on; the program ends; settlement waits out settlementTimeout and fails

Expected: once OpenCode aborts the request (the session emits session.step.failed with aborted and session.execution.interrupted), its response stops counting as active. Actual: it stays active until its stream completes, so the only workaround is to open every gate before the program ends.

Seen while recording event streams for interrupt scenarios (a stop mid-reply, mid-tool, mid-subagent). Related wish: an llm helper for "reply that hangs until released" would cover most interrupt tests.

主要言語
TypeScript
スター
41
フォーク
9
平均マージ
4時間
マージ済み PR(30日)
11

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

anomalyco/opencode-drive のほかの issue

anomalyco/opencode-drive の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。