The name that LangWatch shows as the target of the run. When you do not set it, the framework uses the class name of the adapter.
Process the conversation and return Claude Code's turn, as text or as
messages per config.output.
A thread's first turn sends the FULL history and lets the CLI mint a
session; later turns --resume it and send only the delta.
This method owns ALL session-map policy — every read, write, and eviction of
this.sessions happens here; runTurn is a pure one-spawn helper that
mutates no instance state. A resume turn evicts its id ONLY when the failure
is a genuinely stale session (isStaleSessionError); every other
failure (auth, rate limit, unknown model, signal, timeout, or the
client-side empty-delta guard that never even spawned) leaves the cached
session untouched — the server session may well still be valid.
On a stale session the behaviour is replayOnLostSession's to decide: by
default the turn rejects; when opted in, the rebuild happens INSIDE this same
turn. It cannot be deferred to "the next turn": ScenarioExecution rethrows
whatever an adapter's call() throws, which aborts the run — so a rejected
turn has no successor to rebuild on.
Scenario agent input (conversation history etc.).
The turn as text, or as AI SDK messages with output: "messages".
Adapter that runs the Claude Code CLI as a Scenario agent.
Example