🤖 fix: Token Budget stage Continues ignore turns whose end an outside client owns (ACP, xum run)

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

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

まだ誰も着手していません。

評価

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

調査の方向性

Start by reading TokenBudgetStrategy.onContextBudgetStepSettled and enqueueContinuation in src/node/services/contextManagement/, then compare the externally owned turn checks in StopContinuationProvenance and AgentSession. Decide how warn and rollover stages should behave when an outside client owns turn completion; done means both paths avoid running an unobserved Continue. The issue says this work belongs to the #5286 lane.

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

説明

Found during review of #7231 (Codex thread PRRT_kwDOPxxmWM6vYpvt). This gap exists on main.

Problem

A Token Budget stage that comes due when a step settles stops the turn and queues a "Continue" (TokenBudgetStrategy.onContextBudgetStepSettled → enqueueContinuation). Nothing in src/node/services/contextManagement/ checks whether a client outside the session owns the turn's end. That client is an ACP prompt, whose prompt() resolves on the stream-end, or a callerOwnsTurnEnd session such as xum run. For such a turn, the client takes the stopped turn's stream-end as completion and can exit. The Continue, and the work after it, then run without that client observing them. enqueueContextContinuation also strips the ACP correlation fields.

The turn.stop hook continuations already gate on this (StopContinuationProvenance.externallyOwnedTurn, AgentSession.isExternallyOwnedTurn). #7231 gates its new refusal-fallback handover the same way, with AgentSession.isExternallyOwnedSend.

Proposed fix

Decide what a budget stage does for an externally owned turn. Option A: do not stop for a warn stage (keep working, and leave the warning for the next send). Option B: keep the stop, but end the turn without a Continue. A rollover stop needs the same decision.

Trigger

The next change to Token Budget settlement. Owner: the #5286 lane.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $512.38

主要言語
TypeScript
スター
2.1k
フォーク
139
平均マージ
3時間 35分
マージ済み PR(30日)
950

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

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

coder/xum のほかの issue

coder/xum の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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