Revyl Documentation

Agents

Agent runs reference

Every command, flag, field, status, exit code, error and HTTP route of Revyl's agent runs.

This page describes agent runs completely: the revyl agent commands that start and follow them, the run object they print, how a run ends, what it can check out and create, and the HTTP routes behind the commands. To start your first run, see Run Revyl's agent. The MCP tools are listed in MCP tools.

Terms

TermMeaning
Agent conversationThe transcript that holds a run and its follow-ups. Its ID is agent_conversation_id.
Agent runOne turn of a conversation: one prompt in, one final message out, in a fresh sandbox. Its ID is agent_run_id. A conversation has at most one active run at a time.
Root run, subagent, treeA run that a person, CI, an automation or an outside agent starts is a root run. A run that another run starts from its sandbox is a subagent of that run, and its parent_agent_run_id names that run. A tree is a root run and every subagent under it.
Agent templateA named purpose that Revyl defines, with its own inputs and limits. A run with no template runs Revyl's base agent.
ResourceAnything a run creates, such as a test execution, a device session, an exploration or a build.
ActiveNot finished yet. A run is finished exactly when its finished_at is set.

What a run acts as and who sees it

  • A run acts as its credential. A run you start with revyl auth login or an API key acts as you, and can do in Revyl what you can, except create API keys. A run an automation starts acts as the automation's run-as: a member, or the organization at Admin level (Run Revyl agent from an automation). A subagent never gets more than the run that started it.
  • A run can't turn a device session into a test with revyl test create --from-session, because Revyl can't record that work under the run. It writes the test as Revyl test YAML and saves it with revyl test create --from-file <file>, which Revyl records under the run.
  • Every member of your organization can see every run of Revyl's base agent, which includes every run that revyl agent run, the HTTP API and automations start. Anyone who can see a run can read it and stop it. Only whoever started the conversation, or a run in its tree, can add a follow-up turn.
  • Each turn starts in a fresh sandbox. Files and processes from earlier turns are gone; the conversation's transcript carries over.
  • A root run ends 24 hours after it's created, and a run that reaches its deadline fails with deadline_exceeded. --max-duration can only shorten the deadline. A run that reaches another limit Revyl sets on its tree fails with run_limit_reached.
  • When a run ends on its own, Revyl stops the device sessions and computer sessions it started that are still up. The tests, workflows, explorations and builds it started run to their own end. When a root run ends, every subagent still active under it is stopped.
  • When you stop a run, Revyl stops it, every subagent under it, and everything those runs started that is still active.

Commands

Every command takes the CLI's global --json. Progress goes to stderr; with --json, stdout holds exactly one JSON value, errors included.

revyl agent run

Starts a turn of Revyl's agent and waits for it to end. Without --conversation-id it starts a new conversation; with one it adds a follow-up turn.

revyl agent run (--prompt <text> | --prompt-file <path>) [flags]
FlagTypeDefaultDescription
--promptstringnoneThe turn's message, at most 256 KiB of UTF-8.
--prompt-filepathnoneReads the message from a file, or from stdin with -. Pass at most one of the two prompt flags.
--conversation-idUUIDnoneAdds a follow-up turn to this conversation. A follow-up always takes a prompt.
--templatestringnoneStarts the new conversation on this template (Templates).
--inputkey=valuenoneOne template input. Repeat it for more.
--inputs-filepathnoneTemplate inputs as one JSON object, from a file or stdin with -, at most 256 KiB. --input wins for a key both set.
--repository-urlURLnoneClones this connected repository into the sandbox before the agent starts (Repository checkout). Only when a conversation starts.
--repository-branchstringthe default branchChecks out this branch's newest commit, resolved once when Revyl accepts the run. Needs --repository-url.
--repository-commit-sha40 lowercase hex charactersnoneChecks out exactly this commit. Needs --repository-url; not with --repository-branch.
--max-durationduration, at least 1mthe root run's deadlineEnds the run after this long, for example 45m. It can only shorten the limit.
--idempotency-keystring, 1 to 255 charactersone the CLI makes upThe same key with the same request returns the run Revyl already accepted instead of starting another.
--no-waitboolfalseReturns as soon as Revyl accepts the run.
--wait-timeoutdurationuntil the run ends; 110m inside an agent sandboxStops waiting after this long and exits 124. The run keeps going. Not with --no-wait.

What it prints:

Modestdoutstderr
WaitingThe agent's final messageThe run ID and conversation ID as soon as Revyl accepts the run, the run's URL, each status change, then how it ended
Waiting, --jsonThe run object as it ended, or as it stands when the wait timed outThe same progress
--no-waitThe new run's IDThe run ID, conversation ID and URL
--no-wait --jsonThe run object as acceptednothing
  • A retry with the same --idempotency-key and the same request returns the run already accepted, in whatever state it's in now. The key the CLI makes up is reused only for its own network retries, so running the command again starts a new run. When a start fails with no answer, the error prints the command to run again with the key it used.
  • Ctrl-C stops waiting, exits 130 and leaves the run going. Stop a run with revyl agent stop <agent-run-id>.
  • After exit 124 or 130, pick the wait back up with revyl agent wait <agent-run-id>. Running revyl agent run again starts a second run.
  • Exit codes are in Exit codes.
revyl agent run --prompt "Which tests failed on last night's staging build, and why?"
revyl agent run --prompt-file prompt.md --json
git diff | revyl agent run --prompt-file - --no-wait
revyl agent run --repository-url https://github.com/acme/notes --repository-branch fix/note-title --prompt "Why does the note title test fail on this branch?"
revyl agent run --conversation-id <agent-conversation-id> --prompt "Now check it on iOS."

revyl agent wait

Waits until every listed run has ended, or with --children until everything the calling run started has ended. It holds nothing on the server, so running it again re-attaches.

revyl agent wait (<agent-run-id>... | --children) [--wait-timeout <duration>]
Argument or flagTypeDefaultDescription
<agent-run-id>...UUIDsnoneThe runs to wait for.
--childrenboolfalseWaits for the calling run's subagents and for the test executions, workflow executions, explorations and builds it started directly. Works only inside an agent run, where REVYL_AGENT_RUN_ID is set. Device and computer sessions are left out, because they stay up while the run is going.
--wait-timeoutdurationuntil everything ends; 110m inside an agent sandboxStops waiting after this long and exits 124. 0s checks once and returns.
  • Without --json, stdout has one line per item: agent_run or the resource type, its ID and its status.
  • With --json, stdout is { "wait_timed_out": ..., "agent_runs": [...], "agent_resources": [...] }: every run waited for as a full run object, and the other things --children waited for as resource rows. agent_resources is empty when you pass run IDs.
  • The exit code comes from the runs waited for, and the highest code among them wins (Exit codes). Resources never change it: a failed test is a result to read in its row.
  • A read that fails with a network error, 429 or 5xx is retried for up to 5 minutes. After that the command exits 1 and prints the command that re-attaches. Nothing is stopped.
revyl agent wait <agent-run-id>
revyl agent wait <agent-run-id> <agent-run-id> --json
revyl agent wait <agent-run-id> --wait-timeout 0s
revyl agent wait --children --json

revyl agent get

revyl agent get <agent-run-id>

Reads one run: its status, prompt, final message, output and limits. With --json, stdout is the run object. It exits 0 whenever the read worked, whatever the run's outcome; to turn a run's outcome into an exit code, use revyl agent wait <agent-run-id> --wait-timeout 0s.

revyl agent list

Lists the runs you can see, newest first.

FlagTypeDefaultDescription
--conversation-idUUIDnoneOnly the turns of this conversation.
--root-agent-run-idUUIDnoneEvery run in this run's tree, the root included.
--parent-agent-run-idUUIDnoneOnly the direct subagents of this run.
--agent-run-statusstatusnoneOnly runs in this status. Repeat for more.
--templatestringnoneOnly runs of this template.
--limitint25Runs per page, 1 to 100.
--cursorstringnoneThe next_cursor of the page before.

The table shows each run's ID, status, template, repository, creation time and the first line of its prompt, and stderr prints the --cursor for the next page when there is one. With --json, stdout is { "agent_runs": [...], "next_cursor": ... }.

revyl agent list
revyl agent list --conversation-id <agent-conversation-id> --json
revyl agent list --root-agent-run-id <agent-run-id>
revyl agent list --agent-run-status running --agent-run-status queued

revyl agent stop

revyl agent stop <agent-run-id>

Stops the run, every subagent under it, and everything those runs started that is still active. It returns as soon as Revyl accepts the stop and prints the run, now stopping. The run reports stopped once everything under it has stopped, so revyl agent wait <agent-run-id> after a stop returns when the whole subtree is down. Stopping a subagent leaves the rest of the tree running. Stopping a run that already finished changes nothing and exits 0.

revyl agent resources

Lists the subagents and resources that a run and every subagent under it created, newest first.

revyl agent resources (<agent-run-id> | --conversation-id <agent-conversation-id>) [flags]
Argument or flagTypeDefaultDescription
<agent-run-id>UUIDnoneResources of this run and every subagent under it. Pass a root run to see the whole tree.
--conversation-idUUIDnoneResources of every turn of this conversation and every subagent under them. Pass exactly one of a run ID and --conversation-id.
--resource-typeresource typenoneOnly this kind. Repeat for more.
--only-activeboolfalseOnly resources still queued, running or held open.
--only-this-runboolfalseLeaves out its subagents.
--limitint25Rows per page, 1 to 100.
--cursorstringnoneThe next_cursor of the page before.

With --json, stdout is { "agent_resources": [...], "next_cursor": ... }. It lists only what agent runs created, never every resource in your organization.

revyl agent resources <agent-run-id>
revyl agent resources <agent-run-id> --resource-type test_execution --json
revyl agent resources "$REVYL_AGENT_RUN_ID" --only-this-run --only-active
revyl agent resources --conversation-id <agent-conversation-id>

revyl agent evidence

Resolves the resource a revyl: reference names, so you can look at it before you cite it.

revyl agent evidence <reference>
ArgumentTypeDefaultDescription
<reference>evidence referencenonerevyl:report_action/<report-action-id> or revyl:observation/<observation-id>.

It prints a download link that lasts an hour, the resource's content type and size, and the report and device session it came from. With --json, stdout is { "evidence_kind", "evidence_id", "download_url", "content_type", "size_bytes", "report_id", "device_session_id" }. A reference to something outside your organization, or with nothing stored, fails with agent_evidence_not_found (Errors).

revyl agent evidence revyl:report_action/<report-action-id>
revyl agent evidence revyl:observation/<observation-id> --json

revyl agent templates

revyl agent templates

Lists the templates your organization can start with revyl agent run --template <agent-template-name>. With --json, stdout is { "agent_templates": [...] } (Templates).

Proof runs

revyl agent proof, status and cancel start and follow proof runs, which are different runs from agent runs: status and cancel take a proof run's ID, and get and stop an agent run's. Given the other kind's ID, each command exits 1 and names the command to use instead. See Proof of changes.

The agent run object

revyl agent get, run, stop, list and wait all print this shape with --json, and the HTTP routes return it.

FieldTypeMeaning
agent_run_idUUIDThis run.
agent_conversation_idUUIDThe conversation it's a turn of. Pass it to --conversation-id to follow up.
parent_agent_run_idUUID or nullThe run that started this one. Null for a root run.
root_agent_run_idUUIDThe root of this run's tree. Equal to agent_run_id for a root run.
agent_conversation_owner_user_idUUID or nullThe person who started the conversation; for one an API key started, the key's user.
agent_conversation_owner_automation_idUUID or nullThe automation that started the conversation. At most one of the two owner fields is set, and both are null for a subagent.
agent_run_credential_principal_kinduser or organization_runtime_principalWhom the run acts as: a user, or the organization.
agent_run_credential_user_idUUID or nullThe user the run acts as. Null when it acts as the organization.
agent_run_requested_by_user_idUUID or nullThe person who asked for this turn: the sender, the key's user, or whoever pressed an automation's Run now. Null for a subagent and for a turn a schedule, webhook or pull request started.
agent_run_started_fromui, cli, mcp, api, automation, agent_run or nullWhere the turn was started from. agent_run is a subagent. It's a label, never a security or billing fact, and null for runs started before Revyl recorded it.
agent_run_statusstringSee Statuses.
agent_template_name, agent_template_inputsstring or null, object or nullThe conversation's template and inputs. Null for the base agent.
repository_url, repository_branch, repository_commit_shastring or nullWhat the sandbox checked out: the repository, the branch the run asked for, and the commit frozen when the run was accepted. All null when the run has no checkout.
promptstringThe turn's message, exactly as sent.
final_messagestring or nullThe agent's last message of the turn. Null until the run ends.
agent_run_outputobject or nullThe run's structured output (Output).
agent_run_error_code, agent_run_error_messagestring or nullWhy a failed run failed (Run error codes). Null otherwise, a stopped run included.
created_at, started_at, finished_atISO 8601 UTC or nullfinished_at is set exactly when the run has finished.
deadline_atISO 8601 UTCWhen Revyl ends the run if it's still going. Never later than the root run's.
agent_run_urlstring or nullThe run's page in Revyl.

Statuses

agent_run_statusFinishedMeaning
queued, runningnoAccepted and on its way.
stoppingnoA stop was accepted, and the run and everything under it are being stopped.
completedyesThe agent ended its turn itself. When it ended the turn to ask for something, the question is in final_message.
stoppedyesSomeone stopped it, or stopped a run above it.
failedyesIt couldn't finish. agent_run_error_code says why.

A program that meets a status it doesn't know goes by finished_at.

Run error codes

agent_run_error_codeMeaning
deadline_exceededThe run reached its deadline.
run_limit_reachedThe run reached a limit Revyl sets on its tree.
repository_checkout_failedThe repository checkout failed before the agent started.
output_invalidThe run ended without the valid output its template requires.
dispatch_or_deadline_exhaustedThe run couldn't start before its deadline.
runtime_failed, runtime_exited, runtime_heartbeat_staleThe agent's runtime hit an error, exited before the run finished, or stopped responding.
launch_unconfirmed, supervisor_failed, callback_failedThe run's sandbox never confirmed it started, Revyl lost track of it, or it couldn't report back.
model_failed, tool_failed, checkpoint_failedThe model failed to answer, a tool the agent relied on failed, or the conversation's state couldn't be saved.
cancelledThe run was cancelled before it finished.

agent_run_error_message holds the sentence the table paraphrases. Start the turn again for a failure in the last three rows; for the others, change what the code names first.

Exit codes

revyl agent run (when it waits) and revyl agent wait exit with how the run ended:

CodeMeaning
0The run completed.
1The command itself failed, for example bad usage, not signed in, a run you can't see, a busy conversation, or an API or network error.
2The run was stopped.
3The run failed.
124--wait-timeout passed first. The run keeps going.
130Interrupted. The run keeps going.

Every other command, and revyl agent run --no-wait, exits 0 when it did what you asked and 1 when it couldn't. No exit code depends on what the agent found: read that from final_message or agent_run_output.

Output

Every run can attach one JSON object to itself as agent_run_output. The agent submits it with its submit_output tool: any JSON object of at most 256 KiB, and the last one it submits wins. A run with no template submits one only when you ask for structured data, so ask for it in the prompt and name the keys you want:

revyl agent run --json \
  --prompt "List the tests that failed in the last day. Submit them as output: {\"failed_tests\": [{\"name\": ..., \"reason\": ...}]}" \
  | jq '.agent_run_output'
  • agent_run_output is null until the agent submits one, and it can stay null on a completed run. A stopped or failed run has one only if the agent submitted it before the run ended, so check the status first.
  • final_message stays the agent's free text on every run, and Revyl never reads a result from it.

Repository checkout

A run that starts a conversation can name a repository, and Revyl clones it into the sandbox before the agent starts.

  • The repository must be one your organization connected to Revyl: a GitHub repository the Revyl GitHub App can see (GitHub integration), or a GitLab project your GitLab connection can see (GitLab integration). Pass its URL, for example https://github.com/acme/notes.
  • The run checks out one commit, frozen when Revyl accepts the run. --repository-branch resolves to that branch's newest commit, and the run checks out that commit even if the branch moves on. --repository-commit-sha checks out exactly that commit. With neither, the repository's default branch.
  • A conversation checks out once. Every follow-up checks out the same commit, and a follow-up that names a repository fails with repository_checkout_fixed_for_conversation. Newer code needs a new conversation.
  • The agent never sees the repository token. Revyl hands a read-only token only to the checkout command, which runs before the agent starts. A checkout that fails fails the run with repository_checkout_failed.
  • The run object shows what was checked out in repository_url, repository_branch and repository_commit_sha.

Templates

revyl agent templates lists the templates your organization can start through the CLI and the API, each with its inputs (agent_template_inputs_json_schema), output schema (agent_template_output_json_schema) and max_duration_seconds. No template is available today, so the command prints that a run without --template uses Revyl's base agent, and --json prints { "agent_templates": [] }. A run with no --template runs the base agent.

Resources

A resource row is something a run created, or that Revyl made as part of something a run created.

FieldMeaning
resource_type, resource_idWhich resource. The ID is the one that kind's own commands take.
agent_run_idThe run that created it. Null for a conversation's own turns.
parent_resource_type, parent_resource_idSet when Revyl made this resource as part of another, such as a test execution inside a workflow execution, or its device session and report.
resource_nameThe resource's name, where it has one. For a run, its prompt's opening words.
resource_statusThat kind's own status value. Null for kinds with no status.
is_resource_activeTrue while the resource is queued, running or held open.
resource_urlIts page in Revyl, where it has one.
resource_created_atWhen it was created.

<resource-id> below is the row's resource_id.

resource_typeRead it with
agent_runrevyl agent get <resource-id>
testrevyl test inspect <resource-id>
test_executionrevyl run summary <resource-id>
workflow, workflow_executionThe workflow's page in Revyl, from resource_url
device_sessionThe session's page in Revyl, from resource_url
exploration_runrevyl explore status <resource-id>
build_jobrevyl build status <resource-id>
build_version, apprevyl build list and revyl app list
computer_sessionThe computer run's page in Revyl, from resource_url
modulerevyl module get <resource-id>
scriptrevyl script get <resource-id>
reportIts parent device session or test execution
comment_thread, commentThe comment thread in Atlas
proof_runrevyl agent status <resource-id>
automationrevyl automation get <resource-id>

Evidence references

A run cites an image or a canvas it made by a revyl: reference instead of a file link, which expires.

ReferenceNamesWhere a run gets it
revyl:report_action/<report-action-id>A report action's screenshot: the one taken just after the action, or before it when there is none after. A frame taken just after an action can still show the screen from before the action took effect.screenshot_reference on each action with a screenshot in revyl run inspect --section actions, revyl device report --json and revyl test report --json, beside screenshot_reference_taken: after_action or before_action
revyl:observation/<observation-id>An Atlas capture.The reference of each capture an Atlas read returns in a hosted run
revyl:artifact/<artifact-id>A canvas the run published.The result of publishing it

revyl agent evidence <reference> reads either image reference. A run writes an image into its answer as ![what it shows](<reference>) and links a canvas as [its title](revyl:artifact/<artifact-id>). On the run's page, the answer shows each image it cites inline, or the image's name when it can't be shown.

Errors

A refused request answers with an HTTP status and a stable code. With --json, the CLI prints it on stdout as { "code", "error", "status_code", "detail", "errors", "next_step" } and exits 1; without it, the CLI prints the error and its next step on stderr.

HTTPcodeCauseFix
404agent_run_not_foundNo run with that ID is visible to you.Check the ID and that your API key belongs to the run's organization; list runs with revyl agent list. Given a proof run's ID, the message names revyl agent status.
404agent_conversation_not_foundNo conversation with that ID is visible to you.Pass the agent_conversation_id that revyl agent get <agent-run-id> prints.
404agent_evidence_not_foundNo image with that reference is visible to you: the action or capture is in another organization, or has no screenshot.Check the reference against the screenshot_reference or reference a tool returned.
404agent_template_not_foundNo template with that name is available to your organization.Pick one from revyl agent templates, or leave out --template.
404repository_not_connectedThe repository isn't one your organization connected to Revyl, or its connection can't see it.Connect it (Repository checkout), then run the command again.
404repository_branch_not_foundThe repository has no branch with that name, or no default branch.Check the branch name.
404repository_commit_not_foundThe repository has no such commit.Check the commit SHA.
403agent_conversation_write_forbiddenOnly whoever started the conversation, or a run in its tree, can add a turn to it.Start a new conversation: leave out --conversation-id.
403agent_run_start_not_recordableA run tried to start work Revyl can't record under it, such as compiling a device session into a test.Follow detail.next_step. To save a test, write it as Revyl test YAML and run revyl test create --from-file <file>.
409agent_conversation_busyThe conversation already has an active run. detail.active_agent_run_id names it.Wait for it with revyl agent wait <agent-run-id> and send the turn again, or stop it with revyl agent stop <agent-run-id>.
409idempotency_key_reused_with_different_inputThe idempotency key was already used for a different request.Pass a new key, or send exactly the request that first used it.
409root_agent_run_not_activeA run tried to start a subagent after its root ended or began stopping.Start a new root run.
422agent_prompt_requiredThe run needs a prompt.Pass --prompt or --prompt-file.
422agent_prompt_too_largeThe prompt is over 256 KiB.Shorten it.
422agent_template_input_invalidThe template inputs are invalid. errors lists each problem with its json_pointer. A run without a template takes no inputs.Fix each input listed.
422agent_template_inputs_too_largeThe template inputs are over 256 KiB.Send fewer inputs.
422agent_template_fixed_for_conversationA follow-up tried to set a template or its inputs.Leave out --template, --input and --inputs-file on a follow-up.
422agent_template_not_available_through_agent_runs_apiThe template starts only from its own product in Revyl.Leave out --template, or pick one from revyl agent templates.
422repository_checkout_fixed_for_conversationA follow-up tried to name a repository, branch or commit.Leave out the repository flags on a follow-up, or start a new conversation.
422invalid_agent_run_cursor, invalid_resource_cursorThe cursor isn't one this list returned.Pass the page's next_cursor unchanged, or leave out --cursor.
503repository_provider_unavailableGitHub or GitLab didn't answer, so the run wasn't started.Run the command again shortly.
422noneThe request failed validation, such as max_duration_seconds under 60. The body is { "message": "Validation error", "errors": [...] }.Fix each field listed.

The CLI adds two of its own. not_called_from_agent_run means --children was used where REVYL_AGENT_RUN_ID isn't set: pass run IDs instead. agent runs are not available to your organization on this Revyl server means the server answered as one without agent runs does, with a 404 that has no code or a 405. Check that the Backend and Organization lines of revyl auth status name the Revyl server and organization you meant.

Environment variable

NameSet byPurpose
REVYL_AGENT_RUN_IDRevyl, inside every agent sandboxThe ID of the run the sandbox belongs to, for revyl agent wait --children and reads such as revyl agent resources "$REVYL_AGENT_RUN_ID".

HTTP API

The commands call these routes on https://backend.revyl.ai, authenticated with an API key as Authorization: Bearer $REVYL_API_KEY (Authentication). Field and query names are the JSON names above.

RouteBody or queryReturns
POST /api/v1/agent-runsprompt, agent_conversation_id, agent_template_name, agent_template_inputs, repository_url, repository_branch, repository_commit_sha, max_duration_seconds (at least 60), and an optional Idempotency-Key header of 1 to 255 characters201 and the run. 200 and the run already accepted when the key and request were seen before.
GET /api/v1/agent-runs/{agent_run_id}noneThe run.
GET /api/v1/agent-runsagent_conversation_id, root_agent_run_id, parent_agent_run_id, agent_run_status (repeatable), agent_template_name, limit (1 to 100, default 25), cursor{ "agent_runs": [...], "next_cursor": ... }
POST /api/v1/agent-runs/{agent_run_id}/stopnone202 and the run, now stopping. 200 and the run when it had already finished.
GET /api/v1/agent-resourcesexactly one of agent_run_id and agent_conversation_id, then resource_type (repeatable), is_resource_active, only_this_run, limit (1 to 100, default 25), cursor{ "agent_resources": [...], "next_cursor": ... }
GET /api/v1/agent-evidence/{evidence_kind}/{evidence_id}evidence_kind is report_action or observation{ "evidence_kind", "evidence_id", "download_url", "content_type", "size_bytes", "report_id", "device_session_id" }, where download_url lasts an hour.
GET /api/v1/agent-templatesnone{ "agent_templates": [...] }

No route blocks until a run ends. To wait over HTTP, poll GET /api/v1/agent-runs/{agent_run_id} until finished_at is set. An error body is { "code", "error", "detail", "errors" } (Errors).

curl -X POST "https://backend.revyl.ai/api/v1/agent-runs" \
  -H "Authorization: Bearer $REVYL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: <idempotency-key>" \
  -d '{"prompt": "Which tests failed on last night'\''s staging build, and why?"}'

On this page