OpenShell Agent Runner
OpenShell Agent Runner (OAR) launches one ephemeral agent for one configured
task. Each oar run creates an isolated OpenShell sandbox, runs Pi with the
selected profile, publishes one result, and removes the sandbox. This bounded
lifecycle works well in CI jobs and other automated workflows.
OAR uses an existing OpenShell gateway, workspace, and inference route. It does not create or change providers, credentials, gateways, workspaces, or routes.
Requirements
uv- OpenShell 0.0.111 or newer
- A running OpenShell gateway
- An inference route and its model ID
Quick start
Create the profiles packaged with OAR. MODEL_ID is an ordinary shell variable;
replace its value with the model ID configured on your inference route.
export MODEL_ID="provider/model"
uvx --from openshell-agent-runner oar init ./profiles \
--model "$MODEL_ID"
uvx --from openshell-agent-runner oar doctor --gateway openshell
Validate the included reviewer profile and preview its task:
printf '# Review me\n\nA short document.\n' > document.md
uvx --from openshell-agent-runner oar validate ./profiles/reviewer
uvx --from openshell-agent-runner oar run ./profiles/reviewer \
--task review \
--gateway openshell \
--input document.md \
--output /tmp/oar-review.md \
--dry-run
Replace openshell with your gateway name. Remove --dry-run to launch the
agent and write its result to /tmp/oar-review.md.
oar init copies the packaged profiles into an ordinary directory so you can
inspect, edit, and commit them. Omit --profile to create all packaged profiles,
or repeat --profile NAME to select a subset.
Profiles
A profile contains profile.yaml, Pi's models.json and settings.json, an
OpenShell policy, and the prompts or other files referenced by its tasks. The
profile owns stable behavior and permissions; the CLI supplies values that vary
for each run, such as the task, inputs, output path, gateway, and workspace.
id: reviewer
description: Review an uploaded document.
sandbox:
policy: policy.yaml
upload: []
env: []
tasks:
review:
required_input: document
prompt: prompt.md
tools: [read, grep, find, ls, bash]
skills: []
extensions: []
tools is a strict allowlist. OAR recognizes Pi's built-in bash, edit,
find, grep, ls, read, and write tools. Custom tools must be declared by
an extension used by the same task:
tasks:
check:
prompt: prompts/check.md
tools: [read, custom_check]
extensions:
- path: extensions/custom-check.ts
tools: [custom_check]
oar validate rejects unknown fields, missing or escaping resources, invalid
schemas, and tools that are not built in or declared by a referenced extension.
The runtime also verifies that Pi actually registered every selected tool before
the first model request.
Add output_schema to a task when its result must be JSON. OAR exposes the
built-in Pi submit_result extension for that task, lets Pi correct invalid
submissions during the session, and validates the downloaded result against the
same Draft 2020-12 schema before publishing it.
Commands
oar init PROFILE_ROOT --model MODEL_ID [OPTIONS]
oar validate PROFILE_DIRECTORY
oar run PROFILE_DIRECTORY --task TASK --output PATH [OPTIONS]
oar doctor [OPTIONS]
initcreates editable copies of profiles packaged with OAR.validatechecks a profile and all of its local resources without running it.doctorperforms read-only OpenShell gateway and inference checks.runlaunches a task, or prints its resolved operations with--dry-run.
Run oar COMMAND --help for command options. For task-specific help, select the
profile and task before --help:
uvx --from openshell-agent-runner oar run \
./profiles/reviewer --task review --help
Documentation
The OAR guide explains profile inputs, tools and extensions, uploads, the run lifecycle, structured results, security boundaries, and exit codes.
Development
From projects/openshell-agent-runner:
make check
make build
Run a focused test with make test PYTEST_ARGS="tests/test_config.py". Use
make clean to remove generated build and cache files. See
RELEASING.md
for the local PyPI release process.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openshell_agent_runner-0.0.2.tar.gz.
File metadata
- Download URL: openshell_agent_runner-0.0.2.tar.gz
- Upload date:
- Size: 23.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a90d667babbdfe8b7ffe3177465bf11ffb9422d012b6bc6100fe507a1854b84
|
|
| MD5 |
0e89af3d99b0798142e188d951db16f7
|
|
| BLAKE2b-256 |
470f18a917e497c0e1e31681be2bfdd5188aae5937f31cccbcc8079686f91a0a
|
File details
Details for the file openshell_agent_runner-0.0.2-py3-none-any.whl.
File metadata
- Download URL: openshell_agent_runner-0.0.2-py3-none-any.whl
- Upload date:
- Size: 32.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2086058c76d034c8105d40088c10d10601494c3a8d93d3671c178c4f33949f53
|
|
| MD5 |
a7d170cb0e02e66b844dd3282254442d
|
|
| BLAKE2b-256 |
2b0008def0aeb291c7f0900be626a9029d365412d100bdfa5c772c5be29e68df
|