man oscar The manual Automation

Batch runs

oscar batch: many prompts unattended, results as JSON lines, resuming, what a batch may do.

MANUAL / AUTOMATION 17 / 29

oscar batch runs many prompts with nobody watching: one session each, in a temporary workspace of its own, results as JSON lines. For evaluations, bulk edits of many small inputs, or collecting answers.

shell
oscar batch prompts.jsonl --out results/            # one at a time
oscar batch prompts.jsonl --out results/ --workers 4
oscar batch prompts.jsonl --out results/ --approve auto --toolsets files,shell
oscar -m openrouter:openai/gpt-5.1 batch prompts.jsonl --out results/

The prompts

One prompt per line, a JSON object or a JSON string:

json
{"id": "q1", "prompt": "Summarise the attached changelog in three bullets."}
{"id": "q2", "task": "Write a haiku about rust."}
"What is the capital of Australia?"

task, input and text work as prompt. A line without an id gets its line number. Ids must be unique; empty lines and lines starting with // are skipped.

The results

<out>/results.jsonl gets one line per prompt as it finishes:

Field
id, line, prompt which prompt
outcome done; refused (a call needed an approval nobody could give); error
text the final answer
conversation the turn's messages: your prompt, the model's replies, tool calls and results
tool_calls each call's name, arguments and whether it worked
refused_calls what was refused, and why
usage, cost_usd, turns tokens, cost and model calls
session, workspace, model, provider where it ran
started_at, finished_at, duration_ms, error

Every text is redacted like any reply. <out>/summary.json counts the outcomes and adds up tokens and cost. Each prompt is also an ordinary session titled batch <id> (oscar sessions, oscar -r <session>).

Resuming. Run the same command again and the prompts that already have a result are skipped; a batch stopped with Ctrl-C (or a crash) carries on where it was. A prompt stopped half-way has no result and runs again. --retry-failed runs the errors again too.

Safety

Nobody is there to approve anything, so:

  • Approvals are never by default: every call that needs approval is refused (reading files, searching and the like still work). --approve auto lets calls that are not dangerous run, each written to the audit log. The approval mode in config.toml does not count; only the flag does. ask and smart are refused for a batch.
  • Dangerous commands are always refused, under any mode.
  • Each prompt has its own empty temporary workspace, removed afterwards (--keep-workspaces keeps them in <out>/workspaces/<id>). Your real workspace is used only when you name it with --workspace yourself, and then every prompt shares it. In host mode commands can still reach the machine, as always: the workspace is where they start, not a wall (use --sandbox workspace for that).
  • Tools that need a person (clarify) are not offered, and memory is left out unless --toolsets names what to offer, so a batch does not write to what Oscar remembers about you. --no-tools takes more away.

Options

--out <dir> where results go (created; the same folder resumes)
--workers N prompts at the same time, 1-16 (default 1)
--approve never|auto see safety
--toolsets LIST / --no-tools LIST which tools or groups are offered (toolsets)
--keep-workspaces keep each prompt's folder
--retry-failed run the errors again
--max-turns N model calls per prompt (default 50)
-m provider:model the model, as for any command (a moa: preset works)

The exit code is 0 when the batch ran (whatever each prompt's outcome), 130 when it was interrupted, 1 when it could not start.