fix(events): address Codex confirmation review — strengthen /goal guard, fix doc drift
Second-round Codex review of the PR-A taxonomy change found four issues, all verified against the code: - The /goal regression guard asserted only that the steered content reached requests[1], which passes even with the hasSteering override (loop.ts) disabled: leftover steering is re-enqueued as a next-turn queued message and also lands in requests[1], one turn later. The guard now asserts the same-turn shape — ONE turn, TWO steps, a steering/message recorded before step 2 — which is the mechanism the override drives. Proven to fail red with the override disabled. - The event-domain-semantics RFC's consequence list still described the pre-fix behavior (step marked open AFTER step/start, so no step/end owed). It now states the shipped behavior: the loop marks the step open BEFORE the append, so a throwing step/start listener gets a balancing step/end via closeStep(). - architecture.md's loop pseudocode said only continuation listeners force continuation; step/end session-event listeners (the /goal pattern) do too. - The agent/turn-end JSDoc listed a `rejected` TurnEndReason that does not exist on this branch (it belongs to the later interception work). Removed it and regenerated the cordis catalog; `interrupted` (a real variant) stays.
This commit is contained in:
@@ -151,7 +151,8 @@ forever:
|
||||
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)
|
||||
steering pending from continuation listeners forces cont = true
|
||||
steering pending forces cont = true (from continuation listeners OR from
|
||||
step/end session-event listeners — the /goal pattern; hasSteering override)
|
||||
if !cont: break
|
||||
session('turn/end'); emit agent/turn-end
|
||||
await ctx.parallel('session/flush', session) ⟵ durability checkpoint (failure
|
||||
|
||||
Reference in New Issue
Block a user