Skip to content

Run.verify()

Run a shell command in this Run's worktree and get its result as a VerifierOutcome: whether it passed, its exit status and its output. A failing command doesn't raise.

outcome = await run.verify("npm test")

Pass the outcome to a step, so the agent sees what failed.

if not outcome.passed:
    await run.step(fixer, outcome, commit="Fix the failing tests")

To run your repository's own build, read it from Run.config.

outcome = await run.verify(run.config["build"])

A command may take 600 seconds unless the project sets build_timeout. A command that runs longer is stopped, and its outcome doesn't pass.

A command's changes to files aren't committed. A step on this Run wipes them before its agent starts, apart from files .gitignore covers.

Run.verify() is recorded like a step. On a resume, it returns its recorded outcome without running the command, unless the command or the work before it changed.

Reference

agl.sdk.Run.verify(command) async

Runs a command in the worktree this Run owns.

Parameters:

  • command (str) –

    The shell command line to run. An empty one passes.

Returns:

Raises:

agl.sdk.VerifierOutcome dataclass

Whether a command passed, with its exit status and output.

passed instance-attribute

True where the command exited 0, False for any other status and for a timeout.

status instance-attribute

The command's exit status.

output instance-attribute

Everything the command wrote, its standard output and standard error together.