Repository navigation
v0.23.0
Docs: Rust is on every page, and the docs now say eight languages. Every tabbed guide,
cookbook recipe, scenario and the combined API page now has a Rust tab next to the other seven
(76 tab groups across 31 pages), and all 76 were compile-checked against rust/. There is a new
Rust API overview page (/api/rust/), which the sidebar already linked to. The READMEs,
PUBLISHING.md, SPEC.md, the CI job names and the release runbook now count eight ports and
cover crates.io (ENABLE_CRATES, CARGO_REGISTRY_TOKEN). The ACP host-hooks recipe now covers
Rust too: like Go, Rust has on_permission, on_update, cancel and acp_generate_stream. The
other six ports still lack the hooks (add-go-host-asks 2.6d). Not done: Rust has no
benchmark row on the performance page. That page says so instead of guessing a number.
Install snippets mark crates.io as "from the next release", because the crate is not
published yet.
Rust port (rust/, crate toolnexus on crates.io) is complete: tier full, ready to publish.
A Rust host can now build a toolkit and run the whole tool-calling loop natively on tokio, with
no Node/Python/Go sidecar. New since 0.22.0, on top of the ACP client, skills, MCP client and
core types that were already there:
- Toolkit (
create_toolkit): MCP → skill → builtin → extra tools, first name wins, an extra
tool shadows a builtin,disable_tools/disable_skills,registersafe mid-turn. - The ten builtins with the same names, schemas and outputs as the other ports, the host
boundary (shell,base_dir,confine_to_base_dir,kill_grace_ms; a timeout or cancel
kills the whole process group), hints on every builtin,grepcontext lines and truncation
metadata, edit diffs, and the opt-in extras (background shells,websearchover a provider
you supply,notebook_edit). - HTTP tools (
http_tool). - The unified client: OpenAI and Anthropic styles, concurrent tool calls with
ToolContext.call_id, hooks, streaming, retries with Retry-After andon_error,
conversation stores (memory and file), metrics,request_params/body_transform, prompt
cache, tool tiers,list_models, in-process models, Usage cache tokens, and the API-key-by-host
rule from 0.22.0 (a custombase_urlneedsapi_keyorapi_key_env). - §10 suspension:
wait_for/wait_for_ctx, or a durablestatus: "pending"result. - MCP: non-text content now becomes
ToolResult.parts(images were dropped before),
annotation hints,resource_tools(),load_mcp_with(on_server), and a legacy-SSE fallback
for remote servers (rmcp has no SSE client, so this one is in-house). - ACP host hooks (Go's 0.22.0 set):
on_update, a reject answer fromon_permission, a
cancellablegenerate,generate_stream, andacp_generate/acp_generate_streamto use
an ACP agent as the client's model. - A2A agents, both directions, and the MCP server profile (SPEC §7A–§7C, ported from Go
with its tests mirrored). Outbound:ToolkitOptions.agents, a top-levelagentsconfig
block, orToolkit::add_agentturn each skill on a remote Agent Card into asource: "a2a"
tool that sendsSendMessageand pollsGetTask; a cancel, even mid-request, ends it as
A2A task <id> canceled, and an unreachable agent is skipped instead of failing the toolkit.
Inbound:Toolkit::serve(addr, ServeOptions { client, a2a, on_task, mcp, on_call })publishes
an Agent Card built from the toolkit's skills (same bytes and key order as Go) and answers
JSON-RPC over the client loop, withcontextIdremembered throughclient.ask, a suspended
run reported asinput-required, and memory /file:<dir>/ customTaskStores. Withmcp
(or amcpServerblock) the same server is a stateless streamable-HTTP MCP server at
POST /mcpexposing every tool, §1B parts included. The server side is the newservecargo
feature (hyper + rmcp's server, on by default);--no-default-featuresbuilds without it.
Rust only: a served Task with noclientconfigured fails with a message saying so (Go's
fulfilment would crash and leave the Taskworking). translate(§11):Client::translate/translate_ctx, one provider call with no loop,
including the OpenAI → Anthropic inbound conversion and non-text parts. Ontimeout_msit
returns aTransport("translate timeout after Nms")error where Go returns its context error.- The classifier (§8B):
create_classifierwith thesystemone,llm,customandstatic
styles, the OpenRouter backend preset, client-side limits, the degenerate-criteria warning
(MetricEventgainsquestion/warning),near_uniform,evaluate_batch, and the
byte-identical canonical request. All seven sharedexamples/judge/fixtures pass, hashes included. - Judge adapters and batteries:
ask/gate/Policy/Tape, and all eight batteries
including the opt-inModelRouter, with their hooks, against the shared battery fixtures. - Agents (§7D–§7F):
toolnexus::agents— the runtime with the six verbs, the three gates,
hierarchical budgets with a namedlimiton every stop, nearest-interpreter escalation and the
runtime-levelwait_for, durable pending +resumewith task reattachment;Agent/Spec
with team wiring,run,as_tool/as_tool_with(the child runs under the calling turn's
cancellation, hooks gate and ask bridge); theLoopdoor with the completion gate and
guardrails; personas (from_dir,compose_soul,memory_tool,start_agent); and
compactorwith 0.22.0'son_compact/CompactInfo. Ported from golang/agents with its tests
(92, hermetic); the trace strings and the recorded unset-run golden are byte-identical to Go. - Relay tools and durable resume:
relay_tool,run_with_answer/ask_with_answer,
answer_output/answer_declined/relay_answer, and the relay-vs-builtin collision guard. - Relay tests from Go now mirrored too: streaming relay,
wait_forparked across turns, and a
run deadline breaking the parking. Rust differs from Go there, on purpose:timeout_mswraps
the whole run, so a parkedwait_foris dropped at the deadline (Go lets it finish and fails at
the next step). Either way a park outlivingtimeout_msfails the run.start_agent'sstop
now waits for a beat that is still running, as Go's does. - §1B edge constructors:
ContentPart::text,from_path,from_bytes,from_reader,
from_url(adata:URL decodes to the same part as its bytes), with a typedPartError. - The post-0.22 fixes apply to Rust as well:
RunResult.tool_callsnames the real tool
behindcall_toolwith its inner args (SPEC §4C), and the Anthropic last-toolcache_control
breakpoint is checked against the request body that is actually sent. - MCP elicitation:
ToolkitOptions.wait_for(andMcpLoadOptions.wait_for) bridges a
server'selicitation/createonto §10, form →input, URL →authorization. Without it the
capability is not advertised. - Runnable examples (
cargo run --example basic|agent|native_http|streaming|pending|acp|agents|prompt_cache), all run in CI. - Release: a
cratesleg inrelease.yml, gated byENABLE_CRATESand using the
CARGO_REGISTRY_TOKENsecret inprod(a crate's first publish cannot use Trusted Publishing;
switch once it exists). It skips a version that is already on crates.io.preflightand the
readiness script now checkrust/Cargo.toml. - Conformance: rust is held to tier
full. All 22 client, 12 toolkit and 17 classifier options
are present, with no permitted absences and nounportedentries left. - Docs: every Rust example on the API reference and cookbook pages is now a complete program that
CI compiles and runs (218 of them, through a new Rust runner insite/tests/run-all.sh), and Rust
has the 0.22.0 pages (API key by host, prompt cache, tool tiers, list_models, ACP hooks,
resource_tools, background shells) plus shipped pages for translate, the classifier and attach.
Not done in Rust (openspec/changes/add-rust-port): a Gemini client style (Gemini is a
schema adapter only, as in Go). The Windows code paths compile but have not been run. A few io
and network error strings come from Rust's libraries and differ from Go's wording; the
conformance outputs (skill tool, prompt, tool names and schemas) are byte-identical. Found while
writing the docs, and true of Go as well: on the durable resume path an answer_declined(id, reason) loses its reason (the slot reads "no result supplied on resume"); the inline wait_for
path reports it correctly. Not fixed here, since it is a cross-port change.
Docs and examples for 0.22.0, in all seven ports. The 0.22.0 features had code but no
reference pages, so a reader could only learn them from this changelog. Now each port's API
reference has pages for API key by host, promptCache, toolTiers, listModels, MCP
resourceTools and BackgroundShells, each with runnable examples that CI compiles and
executes. The existing pages cover waitForCtx, onServer, tool hints, onCompact,
asToolWith, callId and the new builtins. There are four new cookbook recipes (API key by
host, prompt cache and tool tiers, host hooks, ACP hooks for Go), README sections in every
port, and a hermetic prompt-cache and tool-tiers example per port. js, python and java examples
now also run in CI through each port's test suite, and the clojure one runs on both hosts.
Not done: the ACP hooks page for the six ports other than Go only says what to use instead,
because those ports do not have the hooks yet (openspec/changes/add-go-host-asks). CI compiles the C#
and Go examples but does not run them, and the Elixir example is run only by hand.
Fixed
- Go prompt cache now caches the tools array (golang only). In 0.22.0,
PromptCachewith
anthropic marked the system prompt and the latest message but never the last tool, because the
adapter emits typed structs and the marker only touched maps. The cache breakpoint promised by
SPEC §4C was missing, so the tools prefix was never cached. The last tool now carries
cache_control: {type: "ephemeral"}(plusttl: "1h"withLongTTL). Every other port
already did this; each now has a test that checks the request body actually sent. createToolkit()with no argument works in js. It threw a TypeError; it now builds
the default toolkit, as python and elixir already did. In java,Toolkit.create(null)now
means default options instead of throwing a NullPointerException. Go, C# and clojure take a required
options value, so they had nothing to fix.- The run result names the real tool behind
call_tool, in all seven ports. With tool tiers,
a call the model made throughcall_tool {name, arguments}was recorded in the run result's
toolCallsascall_toolwith the wrapper arguments. Hooks and stream events already showed
the real tool, so the three views disagreed. The run result now records the real tool and its
inner arguments, after anybeforeToolrewrite. The transcript still keeps the wrapper, and
tool_searchis still recorded astool_search. If you matched on"call_tool"in
toolCalls, match on the real tool name instead (SPEC §4C). - Removed stale "golang only for now" comments from Go source for features every port has, and
corrected the example count inclojure/examples/clj/deps.edn.