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

未关闭
#3,727 1 条评论 0 个 reaction 已指派 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 小时
30 天内合并 PR
150

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

kagent-dev/kagent 的其他 Issue

查看 kagent-dev/kagent 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。