[BUG] A scheduled run whose prompt was not accepted stays RUNNING until its deadline and is never resent

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

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

@xixi-box がすでに取り組んでいます。

2026年11月18日 から。

  • #3728 @xixi-box による — オープン

評価

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

調査の方向性

Start by tracing reconcile, ClaimScheduledRunDispatch, and SendStreamingMessage, then inspect the tick attempt context and the execution state transitions. Check how ErrSendNotAccepted is handled and whether releasing the dispatch claim or retaining PENDING is supported. Done when a refused send is retried or fails visibly, and the execution no longer stays RUNNING without a task ID until timeout.

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

説明

What happens

reconcile calls ClaimScheduledRunDispatch and sets the execution to RUNNING before SendStreamingMessage. If the send then fails with input was not accepted; retry after the session becomes available (ErrSendNotAccepted), the execution keeps state RUNNING with no task ID. On the next reconcile the branch

if execution.GetTaskId() != "" || execution.GetState() == ...RUNNING {
    return nil
}

returns early, so the prompt is never sent again. The execution stays running until executionTimeout (4 h for us) and then times out. Nothing reports the failure except one controller log line:

level=ERROR msg="failed to advance scheduled execution" execution_id=... error="input was not accepted; retry after the session becomes available"

How we hit it (Substrate gVisor workers):

  • The attempt context is 10 s (context.WithTimeout(ctx, 10*time.Second) in tick). On a worker that hasn't cached the agent image yet, the restore takes longer than that (an image pull of 35 s for us), so the first attempt is cancelled mid-start. The next attempt finds the session not yet available, and the send is refused.
  • The same thing happens when Substrate refuses the actor ("no worker has room for the actor") and the session becomes available later.

Expected

An error that says the input was not accepted means no work was started, so resending can't duplicate native work. The controller should release the dispatch claim (or keep the execution PENDING) and retry until the deadline. Alternatively, it should fail the execution with that reason so the failure is visible at once.

Workaround

Deleting the session marks the execution FAILED ("Session was deleted"). The schedule then has to be triggered again by hand.

主要言語
Go
スター
4.5k
フォーク
937
平均マージ
1日 10時間
マージ済み PR(30日)
150

環境構築

Codespaces で開く

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

はじめの一歩

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

kagent-dev/kagent のほかの issue

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

似ている issue

Go の issue をもっと見る

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

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