]> git.giacomolli.uk - onechat/commitdiff
Describe queued event delivery boundaries
authorAnderson A. Giacomolli <redacted>
Wed, 11 Nov 2026 17:53:24 +0000 (14:53 -0300)
committerAnderson A. Giacomolli <redacted>
Wed, 11 Nov 2026 18:31:12 +0000 (15:31 -0300)
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

turn.go

diff --git a/turn.go b/turn.go
index 01d6b7b61d98d51700308739c71a208f1030f872..4652321ad2105976a595a74154e1310b1f892443 100644 (file)
--- a/turn.go
+++ b/turn.go
@@ -285,10 +285,11 @@ func (l *TurnLoop) Flush(ctx context.Context) error {
        return l.memory.Flush(ctx)
 }
 
        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()
 
 func (l *TurnLoop) Run(ctx context.Context) error {
        defer l.runs.Close()