replay_session
Replays a Session against a chosen pipeline version to create a new Session for reproducing or retrying a failed or suspect test-case run; this is a paid pipeline run.
Instructions
Replays one Session against a pipeline version into a new Session. Costs money.
Experiment support, for when you need it: to reproduce or retry the replay of one test case
that failed or looks wrong, replay that test case's Session on the version the Experiment's side
uses. It is a paid pipeline run on the customer's models: say what it costs and get a yes first.
The replay is not linked to the Experiment, so the new Session is not added to it and changes none
of its results. To retry an Experiment's failed replays inside the Experiment, use
rerun_failed_experiment with rerun="replays". The source Session and the deployed pipeline
are untouched.
FIRST_USER_MESSAGE replays the first turn only; ALL_USER_MESSAGES replays every turn of a chat in
order. Leave it unset to use the server's default (the first turn), and say so when reporting.
The run's session_id is the new Session; judge it with try_evaluator. If status is
still CREATED or STARTED the wait ran out: poll get_session_replay with its
session_replay_run_id. When it is FAILED, read error_detail and the logs.
setup_source and cleanup_source are optional Python run around the pipeline in an isolated
worker. Setup must define exactly one public top-level function taking no arguments and returning a
mapping with optional env (dict[str, str]), inputs (dict[str, Any], keyed by the pipeline's
declared input names) and logs (list[str]); its env and inputs take precedence over the
Session's own. Cleanup runs even when the replay failed; it must define one public top-level function
taking the setup's return value (None without a setup) and returning a mapping with optional logs.
Helpers must be underscore-prefixed or imported. Omit either to skip that step.
:param pipeline_name: Name of the pipeline.
:param session_id: The Session to replay: a search_session_id, or a single-turn run's query_id.
:param pipeline_version_id: The pipeline version to replay against, e.g. the Experiment side's version.
:param replay_mode: FIRST_USER_MESSAGE or ALL_USER_MESSAGES; unset uses the server's default.
:param setup_source: Python source run before the pipeline; unset skips the step.
:param cleanup_source: Python source run after the pipeline; unset skips the step.
:param wait_seconds: How long to wait for the replay before handing back the run to poll.
:returns: The replay run, with the new Session's session_id, or an error message.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"pipeline_name": "<pipeline_name>",
"session_id": "<session_id>",
"pipeline_version_id": "<pipeline_version_id>"
},
"name": "replay_session"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | ||
| replay_mode | No | ||
| setup_source | No | ||
| wait_seconds | No | ||
| pipeline_name | Yes | ||
| cleanup_source | No | ||
| pipeline_version_id | Yes |