<FollowUp />
<FollowUp /> adds one later turn to its nearest containing <Agent />. AML resolves every follow-up before opening the provider session, then the provider sends the initial prompt and follow-ups through one shared session history.
import { Agent, AmlRuntime, FollowUp } from "@aml-jsx/sdk"import { DeterministicAgentProvider } from "@aml-jsx/sdk/testing"
const provider = new DeterministicAgentProvider({ respond: request => ({ text: [request.prompt, ...(request.followUps ?? [])].join(" | ") }),})
const runtime = new AmlRuntime({ agentProvider: provider })const result = await runtime.evaluate( <Agent> Draft the migration plan. <FollowUp>Estimate the risk of each step.</FollowUp> <FollowUp>Finish with a three-bullet executive summary.</FollowUp> </Agent>)| Prop | Type | Default | Meaning |
|---|---|---|---|
children | AmlRenderable | empty | Content for one later input; it must resolve to non-empty text. |
Session semantics
Section titled “Session semantics”<FollowUp />components are flat. One<FollowUp />cannot contain another.- Authored order is preserved.
- Every turn counts toward
maxTurnsPerAgent; the default budget is 16 turns including the initial prompt. - The same Agent-scoped Tools, MCP servers, model, permissions, Sandbox view, and provider session apply to every turn.
- When structured output is requested through the Agent
schemaprop orevaluate(value, schema), the schema applies only to the final authored turn. If that turn omits the result Tool, built-in ACP providers send one schema-bearing repair prompt afterward.
With tracing enabled, AML starts and ends each agent.turn around actual execution. A later follow-up cannot appear as started before the preceding turn ends. The initial turn has kind="initial"; later turns have kind="follow-up", and all carry a one-based index. ACP messages, Tool updates, plans, and usage emitted during that prompt stay ordered inside its turn. See Observability.
<FollowUp /> is appropriate when later instructions depend on the model’s own session history. Use separate <Agent /> components and ordinary TypeScript data flow when work needs independent providers, models, capabilities, failure handling, or concurrency.
See the editorial passes recipe for a complete session and Runtime and evaluation for turn budgets.