Next Turn Params

Use next_turn values to preserve hidden context and tool state.

Continuation Example

TypeScript
const first = await client.callModel({ model, input });

const second = await client.callModel({
  ...first.next_turn,
  input: [{ role: "user", content: "Continue with rollout risks." }],
});

next_turn Fields

NameTypeRequiredDescription
conversation_id
stringRequiredServer-side conversation state key.
cursor
stringRequiredPosition marker for incremental context.
tools_state
objectSerialized tool interaction state.

Patch Input Only

next-turn-safe.ts
const next = {
  ...result.next_turn,
  input: [{ role: "user", content: userMessage }],
};
Server authority
Treat next-turn payloads as authoritative state snapshots generated by TheRouter.ai.