createScriptedAgent
Purpose and behavior
Section titled “Purpose and behavior”Create a CLI-shaped test agent that consumes a snapshot of turns in declaration order, including retries, passes and response repairs. It emits predefined events and complete zero usage by default; turns exhausted throws code process. Use createMemorySandboxProvider explicitly. Conversation IDs support repairs and resume only in the same open sandbox; capture, cold resume, fork, terminals and live input are unavailable. Each independent test needs a fresh agent.
Complete example and detailed rules.
Parameters and properties
Section titled “Parameters and properties”optionsRequiredScriptedAgentOptionsSnapshot of the name and ordered turns for one test agent. No sandbox is allocated until dispatch or createSandbox.options.nameOptionalstring | undefinedObserver-visible agent name; defaults to scripted. Empty names are rejected.options.turnsRequiredreadonly ScriptedTurn[]Nonempty sequence consumed once per agent request, across sandboxes, passes, retries and repairs. Recreate the agent to reset it.

