feat: Wave C pivot - steer markers, not follow-ups
Owner correction (2026-09-26, later): a real lesson is ONE continuous teach->quiz->teach run - there are no run-would-stop moments mid-lesson, and the run ends that DO exist are quiz stopper exits where delivery must not fire. Subagent results must land BETWEEN messages INSIDE the run, never splitting a toolCall from its toolResult. Vehicle 1 now hands markers to agent.steer() - pi's STEERING queue: the loop drains it at TURN BOUNDARIES (after a completed assistant message AND its tool results - the bonded pair survives injection) and again at RUN START (a continuation drains before its first LLM call), then CONTINUES the run with the marker in context. steeringMode "all" replaces followUpMode. registerLiveAgent moved BEFORE runPiTurn and now hands pending markers itself: the start poll drains the queue SYNCHRONOUSLY inside the runPiTurn call, so a later registration would miss it. A marker stranded by a quiz-terminated run therefore rides the ANSWER run's first LLM call - the native replacement for the old continuation coalescing. Settlement reconciliation, the idle wake, probe-handoff exclusion, and the registry-as-truth design are UNCHANGED; stranding is now exactly the stopper-exit case. Tests: jobs 45/45 (fakeAgent.steer; new pin - registration steers pending markers into the new run, parked wake never fires); chat-flow 24/24 (new e2e through the real composition - a gated mid-run turn, a marker delivered while the turn streams, record shape [call, result, MARKER, response] with the marker adjacent to the completed unit, the model SEES the marker in its next prompt, zero wakes); full suite 999/999, tsc/lint/build green. Live smoke (PORT=3004): research dispatched in the probe turn parked behind the dangling quiz; on the quiz answer the marker injected at the answer run's START poll - record [answer result, marker, teacher response], job flipped done/delivered at settlement, brief card rendered with its sources toggle. Plan doc: docs/PI-NATIVE-MIGRATION-PLAN.md gains the pivot section. Deferred (owner list): thinking blocks rendering after messages; vanishing tool-call output tokens.
This commit is contained in:
@@ -165,12 +165,14 @@ function baseAgentOptions(kind: AgentKind, opts: AgentBuildOptions, tools: Agent
|
||||
},
|
||||
streamFn: engine.streamFn,
|
||||
shouldStopAfterTurn: stopper,
|
||||
// Wave C (2026-09-26): markers handed to a live run drain from pi's own
|
||||
// follow-up queue — "all" joins every handed marker in ONE
|
||||
// continuation turn, matching the idle wake's carry-everything
|
||||
// semantics (the default "one-at-a-time" would spend one teacher
|
||||
// turn per marker).
|
||||
followUpMode: "all",
|
||||
// Wave C (2026-09-26, owner correction same day): markers handed to a
|
||||
// live run drain from pi's STEERING queue — the lesson loop is one
|
||||
// continuous teach→quiz→teach run, so delivery must inject at turn
|
||||
// boundaries INSIDE the run, not wait for it to stop (follow-ups).
|
||||
// "all" joins every handed marker at one boundary, matching the idle
|
||||
// wake's carry-everything semantics (the default "one-at-a-time"
|
||||
// would spend one teacher turn per marker).
|
||||
steeringMode: "all",
|
||||
// Wave B (owner-approved 2026-09-26): the model-facing conversion is
|
||||
// THE app seam — markers flatten to their canonical user text
|
||||
// (verdictText / HANDOFF_TEXT / steer text, all single-sourced),
|
||||
|
||||
Reference in New Issue
Block a user