Skip to content

Orca v0.5.22

Latest

Choose a tag to compare

@github-actions github-actions released this 19 Nov 04:45
· 50 commits to main since this release

Orca v0.5.22

This release adds run_script, an experimental tool that lets the model write one short JavaScript program which calls the read-only tools itself — search, read, filter, and return only what it computed — so a question that took a search, several file reads and a filtering pass costs one model round and one short result instead of one round and a full tool output per call. It is off by default, needs Node.js, and exists first to be measured. The cost estimate now names DeepSeek's per-use tool fees apart from token cost wherever usage is shown, workflow scripts can no longer reach the host's process, files or credentials, and a tool result a script would be handed only part of is refused rather than quietly cut.

Changes

  • run_script (experimental, off by default). A new built-in tool asks for one script, the body of an async function. Inside it await tools.read_file(args), tools.glob(args), tools.grep(args) and tools.git_status(args) take the same arguments object as the tools of those names and resolve to the same text those tools return to the model; a call that fails rejects with an Error carrying the tool's error text. console.log(...values) adds a line to the result, and return value ends it: a string as it is, anything else as indented JSON, undefined as nothing. Nothing else is in scope — no process, no require, no import(), no timers, and no state from an earlier run_script call. The script declares FsRead, FsList, FsSearch and GitInspect, which makes it a read action: no approval prompt in any mode, and usable in Plan mode, exactly like calling the four tools directly. It is served only when the user configuration turns it on and Node.js is installed; the project's .orca/config.toml cannot turn it on, because the whole tools table stays user-owned. The advertised tool list is fixed for a session, so enabling the tool does not move the prompt-cache prefix mid-session. orca config show reports the setting as script = false by default.
  • How a script is run. The script runs in its own Node.js process, built like the workflow host: the script's API lives in the script's realm, the host and the script exchange JSON text only, the host never waits on a promise of the script's, code generation from strings is disabled, Orca's credentials are removed from the environment, and where Node has the permission model (22.13 and later) the process may read the host module and the script and nothing else — it writes nothing and starts nothing. A tool call it makes comes back to Orca, which checks it, not the host: the name must be one of the four; the request must pass the read-only availability check; arguments are validated against the tool's schema; the PreToolUse hook runs for the inner request and may rewrite or block it; and the call executes under the read-only execution profile, the same path a direct read_file batch takes. An inner request's id is <run_script id>:<n>, counting from 1. One script may run for 60 seconds ([tools.script] timeout_secs) and make 100 tool calls (max_tool_calls), both configurable; a call over the limit rejects, and so does every later one. One tool result may not exceed 256 KiB, because a script counts and matches what it is given and a result cut short would give it a wrong answer with no sign that anything was missing: the call rejects and says to ask for less — read_file takes offset and limit, grep takes head_limit and a narrower path. A host line over 1 MiB, or a script over its wall clock, is killed with the whole process tree, and cancelling the turn kills it too. A script counts as one tool call in an operation budget however many calls it makes itself, and its inner calls are not journaled as tool starts, because none of them can have an effect. While a script runs, Orca shows each call it makes and how it ended — grep TODO · ok · 12ms — then the number of calls; the model receives only the script's output, cut at the usual tools.output_truncation limit. A script that throws fails with its message and stack, a syntax error fails before anything runs, a missing Node or a turned-off setting says which, and a host that exits early reports its stderr tail.
  • Tool fees, named apart from token cost. v0.5.21 counts DeepSeek's search, fetch and OCR fees in the estimate; this release shows them as their own figure. UsageTotals gains a service breakdown — the fee in US dollars, the searches, fetches and OCR pages billed — and usage.updated and subagent usage events add service_cost_usd (the part of estimated_cost_usd that is fees) and service_usage (deepseek_searches, deepseek_fetches, deepseek_ocr_pages). /cost appends (tokens $0.012000, tool fees $0.001725: 2 searches, 1 OCR page) once there are fees, /status adds a tool fees: $0.001725 (2 searches, 1 OCR page), included in cost line, and the exec text usage line appends the fee amount. The runtime surface and ACP usage carry the same breakdown, so an attached or daemon client sees what the terminal shows. estimated_cost_usd still means tokens plus fees, and the budget logic is unchanged. A record written before this release has no breakdown and serializes as before; it reads back with a zero breakdown, so older sessions load and resume unchanged.
  • Workflow scripts, inside their own realm. A workflow script could reach the host's process and from there run commands, read and write any file, and read DEEPSEEK_API_KEY: every value the host handed a script — the workflow functions, args, return values, errors, promises — was an object of the host's realm, so its constructor led to the host's Function, and the source scan only stopped the literal spelling (constructor, ['con' + 'structor'], a template literal and six other routes all got through). The workflow functions are now built inside the script's own realm; the host and the script exchange JSON text through one function, and the host no longer waits on a promise of the script's. The host process starts with code generation from strings disabled and without Orca's credentials, and where Node has the permission model (22.13 and later) the process may read the host module and the script, read and replace its mailbox and task list files, and start nothing; a Node without that model, or a platform where the probe does not pass, runs without that layer. The source scan stays as a clear error for the obvious cases. A phase that fails on an error the script threw now reports that error's message (boom) rather than its string form (Error: boom). The script host's Unix process API is registered in the reviewed runtime-surface and Windows platform contracts.
  • Partial results refused. A run_script inner call that would return more than 256 KiB used to hand the script the cut text with a marker at the end, which a script counting or matching lines never looks at; in the comparison runs the model counted 77 tests in a file that has 118 and spent five more scripts finding out why. The call now rejects and tells the script to ask for less, so a script is either given a whole result or a reason to narrow the request.
  • Documentation. The site's configuration page documents [tools.script], what a script can call and the limits, in English and Chinese; the models and prefix-cache pages describe service_cost_usd and service_usage.

Compatibility

  • run_script is opt-in. With the default configuration the tool is not advertised, so the model-facing tool list, the system prompt and the prompt-cache prefix are unchanged. Turning it on requires Node.js on the machine; without it the tool is not advertised and a direct call says Node was not found. The setting lives in the user configuration — a trusted project's .orca/config.toml cannot turn it on or change its limits — and it is read when a session starts, so a change takes effect in a new session. Enabling it adds one tool to the list for the whole session, which is one prompt-cache miss at the start of that session and stable afterwards.
  • A script's authority. run_script declares only read capabilities, so it asks for no approval in any mode and runs in Plan mode. Each call it makes is checked by the runtime against the four-name list, the read-only availability check, the tool's schema and the PreToolUse hooks, and runs in the read-only execution profile; a hook that rewrites or blocks an inner request does so exactly as it does a direct read. A script counts as one tool call against an operation budget, not one per inner call.
  • Usage records and events. The new fields are additive: UsageTotals.service on the surface and ACP types, service_cost_usd and service_usage on usage.updated and subagent usage events, and the fee amount on the exec text usage line. No existing field is renamed, removed or given a new meaning; estimated_cost_usd still covers tokens and fees, and a budget that stops a run does so for the same total as in v0.5.21. A transcript record written before this release reads back with no fees, and a client that ignores the new fields sees the same totals as before.
  • Workflow scripts. The documented workflow API — the workflow functions, args, phase, log and the values scripts return — is unchanged; what changes is that a script can no longer reach host objects, which was never supported. A workflow whose phase throws now shows the thrown message alone rather than Error: <message>. A script that needs to start a process was never able to do so legitimately and still cannot.
  • No breaking changes. This release removes no CLI flag, configuration key, transcript record type or event field and changes no existing meaning. The only new configuration is [tools.script] with enabled (default false), timeout_secs (default 60) and max_tool_calls (default 100), shown by orca config show as script = false.

Verification

Release gates run with framework retries disabled. Linux and native Windows x64/ARM64 checks must pass on the final main commit before the tag is pushed; a tag-triggered release reuses those results instead of rerunning the full suites, while a manual dispatch runs every gate below. The release workflow builds all six target archives, publishes the npm packages, and checks the published archive and package checksums and clean installs.

The changes ship with unit and contract tests across the core, tools and runtime crates: the tool's registration as read-only and not concurrent safe, its advertisement only when enabled and Node is present, and its refusal outside the runtime; real-Node host contracts for a script that calls tools and returns, a rejected call that is catchable, console.log and return-value assembly, and realm tests showing nothing the script holds belongs to the host's realm; runtime tests for the allow-list, schema refusal, hook rewrite and block, the call limit, the wall clock, cancellation, the 1 MiB line limit and the inner request ids; a tool-turn test that reads a real file through tools.read_file and records only what the script returned, and a test that a turned-off or Node-free machine says which; the 256 KiB refusal; usage arithmetic through plus/minus and from_core/to_core, the new event fields, old records read back without fees, and the /cost, /status and exec-line wording with and without fees; and the workflow host's realm confinement, permission-model probe and JSON-text exchange, plus the process API registration in the runtime-surface and Windows platform contracts. scripts/eval/code_mode/run.py runs a small set of repository-investigation tasks with run_script off and on through orca exec against the real provider and records model rounds, tools, tokens, cost and the answers; it measures cost, not correctness, and does not run in CI. The final gates run in CI.

cargo fmt --all -- --check
cargo clippy --workspace --all-targets --locked -j 1
cargo nextest run -p orca-tui --lib --locked --profile ci-serial --retries 0
cargo nextest run --test tui_pty_contract --locked --profile ci-serial --retries 0
cargo nextest run --workspace --all-targets --locked --profile ci --no-fail-fast --retries 0
node scripts/release/verify-version-sync.mjs
node scripts/release/test-stage-npm.mjs
node scripts/release/test-verify-published.mjs
npm --prefix site run build
npm --prefix site run check:seo

Upgrade

npm install -g @blade-ai/orca@0.5.22
orca --version

Or install the native binary with the installer on https://orcaagent.dev/.

To try run_script, add this to your user configuration and start a new session:

[tools.script]
enabled = true