You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Multi-agent direct edges send the successor a trailing-assistant prefill on Claude — empty or continuation-shaped successor turns #345
In a multi-agent direct-edge flow (writer → critic) on Anthropic or Bedrock-Claude, the successor agent's turn can be empty, and even when non-empty it is a prefill continuation of the previous agent's output rather than a response in the successor's own voice.
Reproduced live 3/3 (empty critic) with the scenario runner shipped in #335:
npx tsx --env-file=.env src/scripts/preempt-scenarios.ts --scenario ma-continue --provider anthropic
# baseline (no preemption) for contrast — note the critic's output BEGINS mid-document:
npx tsx --env-file=.env src/scripts/preempt-scenarios.ts --scenario ma-baseline --provider anthropic
Mechanism
The successor's payload ends with the previous agent's assistant turn. Claude treats a trailing assistant message as a prefill, so the successor model continues it. When the trailing turn reads complete — e.g. a preemption steer's short resume ("Constantinople fell in 1453.") — the continuation has nothing to add and returns empty content. OpenAI is unaffected (no prefill semantics); the no-preemption baseline's critic output is itself continuation-shaped (\n\n**Critique:**…), showing the mechanism predates preemption — #335 only makes the trigger shape (short, complete trailing turns) more common.
Fix direction
When a direct-edge successor's payload would end assistant-role, frame the handoff as a user turn — the chain-prompt wrapper that promptInstructions edges already get is most of the machinery (MultiAgentGraph wrapper nodes, CHAIN_PROMPT_PREFIX). Options:
Apply chain-prompt framing by default for direct edges (behavior change for all providers — cleanest semantics).
Insert a minimal user-turn cue only for prefill-semantics providers (Anthropic, Bedrock-Claude) when the payload ends assistant-role (narrowest change).
Document that direct edges targeting Claude should carry promptInstructions (no code change).
Deliberately not fixed in #335: it is a pre-existing multi-agent framing behavior, and changing it affects existing flows that may rely on continuation semantics — it deserves its own decision and review.
Context: #335's PR description ("Known interaction" section) and the ma-continue/ma-baseline scenario replies there.
Activity
🧵 fix: Break the Predecessor Prefill for Bare Direct-Edge Successors …