[BUG] CancelTask fails after an ask-user answer resumed the task ("deferred continuation cannot be resumed")

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

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go

調査の方向性

Start with go/harness/runtime/runtime.go, which defines runtime.ErrSessionAbandoned, and trace how CancelTask handles a turn resumed after an ask_user_response. Reproduce the listed sequence with the Claude harness, then follow the cancellation and deferred continuation code paths. Done means cancellation stops the live turn, marks the task TASK_STATE_CANCELED, and does not require deleting the session.

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

説明

Bug description

CancelTask fails on a task that was resumed by answering an ask-user question and is now working again:

-32603 failed to cancel: cancelation failed: restore runtime pending turn: deferred continuation cannot be resumed; start a new session

The task keeps running and there is no way to stop it short of deleting the whole session. That matters when the resumed work has side effects (here the agent went on to clone a repository and was heading towards git push).

deferred continuation cannot be resumed; start a new session is runtime.ErrSessionAbandoned (go/harness/runtime/runtime.go). It looks like cancellation tries to restore the deferred continuation, which has already been consumed by the answer, instead of cancelling the live turn the answer started.

Steps to reproduce
  1. A Claude harness agent calls AskUserQuestion and the task goes input-required.
  2. Answer it with a valid ask_user_response. The agent resumes and the task is TASK_STATE_WORKING.
  3. While it works, CancelTask the task.
Expected

The running turn is stopped and the task becomes TASK_STATE_CANCELED, as it does for a task that never paused.

Actual

The error above. The task stays TASK_STATE_WORKING and the agent keeps going. Deleting the session from the UI did stop it.

Environment

kagent v1.0.0-alpha17, Substrate v0.6.0-alpha3, Claude harness (Claude Code 2.1.285).

主要言語
Go
スター
4.2k
フォーク
890
平均マージ
1日 6時間
マージ済み PR(30日)
189

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

kagent-dev/kagent のほかの issue

kagent-dev/kagent の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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