Skip to content

Multi-agent direct edges send the successor a trailing-assistant prefill on Claude — empty or continuation-shaped successor turns #345

Closed

Description

@danny-avila

Symptom

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:

  1. Apply chain-prompt framing by default for direct edges (behavior change for all providers — cleanest semantics).
  2. Insert a minimal user-turn cue only for prefill-semantics providers (Anthropic, Bedrock-Claude) when the payload ends assistant-role (narrowest change).
  3. 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

  1. added a commit that references this issue on Jul 29, 2026
    558f7ec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions