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

Aperta
#3,727 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@xixi-box ci sta già lavorando.

Dal 18/11/2026.

  • #3728 di @xixi-box — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
56/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Go
Stelle
4.5k
Fork
937
Merge medio
1g 10h
PR unite (30g)
150

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di kagent-dev/kagent

Tutte le issue di kagent-dev/kagent

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.