From: Anderson A. Giacomolli Date: Wed, 11 Nov 2026 17:53:24 +0000 (-0300) Subject: Describe queued event delivery boundaries X-Git-Url: https://git.giacomolli.uk/onechat/commitdiff_plain/9301f77a5709fe7daea3a71f8dd072c6cd7df4fe Describe queued event delivery boundaries Queue and turn-loop contracts distinguish restored deliveries from external data held outside memory. The comments identify the next turn boundary as the point where an accepted event becomes visible to the agent. Issue: 44d8703 --- diff --git a/turn.go b/turn.go index 01d6b7b..4652321 100644 --- a/turn.go +++ b/turn.go @@ -285,10 +285,11 @@ func (l *TurnLoop) Flush(ctx context.Context) error { return l.memory.Flush(ctx) } -// Run runs a turn each time user messages or reports wait, until ctx ends. It -// returns the error of a failed log write, which stops the agent. At its start -// it resumes the subagents that a stop of the daemon cut, and at its end it -// ends the runs of the subagents and waits for them. +// Run starts a turn when user messages, reports, or queued external events +// wait, until ctx ends. It returns the error of a failed log write, which stops +// the agent. External events enter memory only between chains. At its start it +// resumes the subagents that a stop of the daemon cut, and at its end it ends +// the runs of the subagents and waits for them. func (l *TurnLoop) Run(ctx context.Context) error { defer l.runs.Close()