From b8d0da9f8c493fadbf4fdfd013ce1378bfc357e2 Mon Sep 17 00:00:00 2001 From: Tianyi Cui <53024+tianyicui@users.noreply.github.com> Date: Tue, 30 Jun 2026 13:02:56 +0800 Subject: [PATCH] docs(loop): clarify the /goal steering comment names the step/end session event The continuation-override comment said "step-end/continuation listeners". With no agent/step-end emit, the surviving step-boundary listener is the durable step/end SESSION event, so spell it "step/end session-event/continuation listeners" to avoid implying a removed agent/* mirror. Comment-only; no behavior change. --- packages/core/agent-loop/src/loop.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core/agent-loop/src/loop.ts b/packages/core/agent-loop/src/loop.ts index dad1ed9320..7ee480d570 100644 --- a/packages/core/agent-loop/src/loop.ts +++ b/packages/core/agent-loop/src/loop.ts @@ -161,7 +161,7 @@ export interface LoopHandle { * drain steering → session('steering/message'); emit agent/steering * session('step/end') ⟵ durable step boundary (no agent/* mirror) * cont = waterfall agent/turn-continuation(default = hadToolCalls || steered) - * if !cont && steering arrived from step-end/continuation listeners: cont = true + * if !cont && steering arrived from step/end session-event/continuation listeners: cont = true * if !cont: break * session('turn/end'); emit agent/turn-end * await ctx.parallel('session/flush', session) ⟵ durability checkpoint @@ -461,9 +461,9 @@ async function runTurn(ctx: Context, agent: ReactLoopAgent, handle: LoopHandle, break } - // Steering from step-end/continuation listeners (the /goal pattern) - // demands the model see it — it overrides a negative decision; the - // next iteration's drain records it. + // Steering from step/end session-event or continuation listeners (the + // /goal pattern) demands the model see it — it overrides a negative + // decision; the next iteration's drain records it. if (!shouldContinue && agent.inbox.hasSteering) shouldContinue = true // A cancel that landed during the continuation window — after the step's