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

Đang mở
#3,727 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@xixi-box đang làm issue này rồi.

Từ ngày 18/11/2026.

  • #3728 của @xixi-box — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
56/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Go
Star
4.5k
Fork
937
Merge trung bình
1 ngày 10 giờ
Pull request đã merge (30 ngày)
150

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của kagent-dev/kagent

Tất cả issue của kagent-dev/kagent

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.