Repository navigation
v0.5.0
v0.4.0 (2026-09-01, 5bd3e353) was tagged but never released and sits 192
commits behind this tag, so it ships none of the work below. v0.5.0 is the
first published release since
v0.3.0
and contains everything since it.
Install
curl -fsSL "https://raw.githubusercontent.com/Dicklesworthstone/pi_agent_rust/main/install.sh?$(date +%s)" | bashAlready on pi: pi self-update.
Assets
| Platform | Archive | Raw binary |
|---|---|---|
| macOS arm64 | pi-darwin-arm64.tar.xz |
pi_darwin_arm64 |
| macOS x86_64 | pi-darwin-amd64.tar.xz |
pi_darwin_amd64 |
| Linux x86_64 | pi-linux-amd64.tar.xz |
pi_linux_amd64 |
| Linux arm64 | pi-linux-arm64.tar.xz |
pi_linux_arm64 |
| Windows x86_64 | pi-windows-amd64.zip |
pi_windows_amd64.exe |
Archives contain pi-0.5.0-<target-triple>/{pi,README.md,LICENSE}. The raw
binaries are what pi self-update fetches. SHA256SUMS covers every asset;
each build-manifest-pi-<platform>.json records the source commit, the
Cargo.lock hash, the toolchain, and the binary's own SHA-256. All five were
built natively on operator hosts from
f32f625
with nightly-2026-08-31; no GitHub Actions are used by this repository.
curl -fsSLO https://github.com/Dicklesworthstone/pi_agent_rust/releases/download/v0.5.0/SHA256SUMS
sha256sum -c SHA256SUMS --ignore-missingEvery binary reports its own provenance: pi --version prints
pi 0.5.0 (f32f6251e …).
Release highlights
Fixed
-
Windows builds again. The crate had stopped compiling for
x86_64-pc-windows-msvcsomewhere after v0.3.0 — ten hard errors, so
cargo install pi_agent_rustfailed outright on Windows and no release
binary could be produced. Nothing caught it because this repository runs no
CI and the quality gate builds only the host target. Three independent
causes: the crash reporter's fatal-signal watcher referenced
signal_hook::iteratorandSIGBUS, neither of which exists off Unix, and
is now Unix-only (Windows abnormal exits that Rust can see arrive as panics,
which the panic hook already captures); and the Windows file-identity checks
injobsandmcp::trustreadvolume_serial_number/file_indexoff
std::os::windows::fs::MetadataExt, which are still behind the unstable
windows_by_handlefeature and so unavailable to a crate that must also
build on stable. Both now go through a newfile_identity::FileIdentity
that reads the same two values from an open handle viawinapi-util, so the
identity comparisons keep their exact TOCTOU semantics on both platforms
rather than being weakened to make the build pass. -
Extensions receive
message_*andtool_execution_*on the default
interactive stack again (bd-82331).AgentEvents reach extensions by two
routes: four lifecycle events are dispatched from inside the agent loop, and
the six observation events reach them only if the surface routes its own
event stream through anEventCoalescer. Print, RPC and--classiceach
did; the SDK path did not, and since v0.4.0 the default interactive stack
IS the SDK path. An extension that observed streaming output or tool
execution loaded, ran its lifecycle hooks, looked installed, and silently
did nothing — with no error, because the events were never routed rather
than dropped. Extensions that modify behaviour (tool_call,
tool_result,context, …) were never affected. -
/newand/resumeno longer silently stop extension observation
(bd-82331). Both build a replacement session from the launch template, which
cannot carry a runtime handle, so the fix above worked until the first
/new— after which observation stopped again for the rest of the session. -
Print mode returns to the primary model after a failover cooldown
(bd-gm481.1). A--messagesequence that failed over ran every later prompt
on the temporary fallback with no way back: nothing recorded what the
primary had been, the chain cursor reset each prompt so the walk could
reinstall the fallback it was already on, and no cooldown was ever started.
RPC has had this since v0.2.0; print now matches it. -
maxFailoversPerTurncounts successful swaps, not scan attempts
(bd-oqo03, bd-oqo03.1). Malformed, uncredentialed, unconstructible, current
and duplicate chain entries consumed the per-turn budget and could hide a
later valid fallback; a prior turn's cursor sitting at the cap could block
every failover in a new turn.
Changed
-
failover_start.attemptis now the successful-swap ordinal, and the chain
position moved to a newchainIndexfield (bd-oqo03).attemptused to
carry the chain cursor after it advanced, so the entry at chain index 0
reportedattempt: 1and looked like a correct ordinal by coincidence.
Consumers readingattemptto mean "which swap is this" were right by
accident and are now right on purpose; consumers reading it as a chain
position should move tochainIndex. -
Extension events are logged on both dispatch routes.
ext.event.start
was emitted for coalescable events only, so whether an event appeared in the
log depended on an internal detail invisible from outside. Batched events
now log identically, withbatched=true.
Carried forward from the unpublished v0.4.0 cycle
Everything below landed after v0.3.0 and has never appeared in a published
release. It is listed separately from the entries above only so each group
reads as one Added/Changed/Fixed set; all of it ships in v0.5.0.
Added
-
Machine-readable fatal-error record in
--mode json/--mode rpc
(gh #217):
a startup failure (config, credentials, state directory, usage) used to
exit non-zero with only stderr prose. Both modes now print exactly one
{"type":"error","phase":"startup","code":"<stable code>","message":"…","exit_code":N}
line on stdout first (phase: "run"if the stream had already opened).
codereuses the auth diagnostic codes (auth.missing_api_key, …) and
otherwise names the error family; text mode is unchanged. -
OpenRouter reasoning forwarding (gh
#220):
compat.thinkingFormat: "openrouter"maps pi's thinking level onto the
gateway's normalizedreasoning: {"effort": …}object (or
{"max_tokens": …}when the model'sthinkingLevelMapmaps a level to
an integer budget;{"off": "none"}forces thinking off). It is the
default for reasoning models on theopenrouterprovider or any
openrouter.aibase URL, so--thinking highnow reaches the model
instead of being dropped; non-reasoning models send noreasoningkey,
and vendor dialects (thinking/reasoning_effort) are never sent
through the gateway.xhigh/maxare no longer clamped for those
models, andcompat.openRouterRoutingkeys (including areasoningor
storeof your own) still merge on top. -
Inline video and audio input for Gemini-family models (gh
#212):
amediacontent block ({"type":"media","data":…,"mimeType":…,"name":…}),
InputType::Video/Audio(input: ["video", "audio"]inmodels.json
and extension model registration; unknown labels now warn instead of
vanishing), and a settings-gatedread_mediatool
(media.enableReadMedia, or--tools read_media) that attaches a local
mp4/webm/mov/mp3/wav/m4a/ogg/flac file. Gemini, Gemini CLI, and Vertex
Gemini models receive the block natively as aninline_datapart and
declarevideo/audioin their bundled catalog entries; every other
provider degrades it to[media omitted: <name>, <mime>, <size>]and the
payload never leaves the machine. One file is capped at 5 MiB
(media.maxBytes) because the block is base64-inlined into the session;
blob sidecar storage for larger inputs is tracked in
#225.
Gemini tool results that carry images or media now attach them on a
trailing user turn instead of dropping them as[Image (…) omitted]. -
--no-context-files(gh
#216):
disablesAGENTS.md/CLAUDE.mddiscovery (global agent dir, cwd, and
every ancestor) and the foreign-format workspace-rules import, so a host
that composes the whole system prompt gets exactly that prompt. Also
PI_NO_CONTEXT_FILES=1.--no-skillsremains a separate switch. -
providers.<id>.modelOverridesinmodels.json(gh
#220):
per-model patches with upstream pi's spelling. A known catalog id is
patched in place; an unknown id under a bundled provider is added from the
provider's ad-hoc defaults, socompat.openRouterRouting(and
maxTokens,cost, …) can be pinned for a gateway model such as
openrouter/deepseek/deepseek-v4-prowithout redefining the provider. -
current_timetool (gh
#207,
#103):
a read-only built-in that returns the host's wall-clock time as UTC and
local ISO-8601 timestamps, the UTC offset, Unix epoch seconds, weekday, and
ISO week (the local zone followsTZ); it takes no arguments and its
details carry stable camelCase keys. The system prompt keeps carrying only
the date so the cached prefix stays stable within a day, and now tells the
model to callcurrent_timefor anything time-of-day dependent. Essential
tier and in the default--toolslist. -
Portable DSR quality recipe:
.dsr/repos.yamlcarries the registered
pi_agent_rustquality checks so any host can run
DSR_REPOS_FILE=.dsr/repos.yaml dsr quality --tool pi_agent_rust(or
merge the entry into~/.config/dsr/repos.yaml) instead of depending on
one machine's registry.
Changed
-
Print mode fails loudly when tool calls were denied for want of an
approval surface (gh
#224):
the approval mode defaults toalways-askon every surface, and print mode
cannot prompt, so a default-prun had every gated tool call denied while
the process still exited 0 with a normal stop reason. A caller reading the
exit code, or the finalstop_reason, saw a successful run that had
silently lost all tool use. Such a run now ends with exit code 3, a
stderr explanation naming--approval-mode yoloas the fix, and — in
--mode json/--mode rpc— the usual single fatal-error record with
"code": "approval.surface_unavailable". The stream is flushed first, so a
JSON host still receives the whole transcript before the failure.This is a breaking change for
--mode jsoncallers that relied on exit
0 regardless of outcome. The default itself is deliberately unchanged: the
absence of a TTY is not consent, and auto-approving to match the Node CLI
would silently grantbashand write access to any script that never opted
in. An ordinary user denial is unaffected and still exits 0. -
Extension hostcalls share the agent's tool registry: the JS, native,
and WASM extension runtimes used to be handed their own plain copy of the
tool registry at pre-warm, so api.toolhostcall could not see tools
mounted later (extension-registered tools, MCP tools, the plan tools) and,
on the SDK and FrankenTUI paths, ran without the session's workspace
confinement. One shared registry (SharedToolRegistry, snapshot-swap; no
lock is held across a tool's execution) now backs the agent and every
extension host: mounts publish a new snapshot, and each hostcall resolves
against the current one under the same undo recorder and workspace roots
as the agent's own tool calls.Agent::with_shared_toolsand
Agent::shared_toolsexpose the handle;Agent::newkeeps working.
pi.setActiveToolsnow applies to the live registry in the same published
swap: extension tools left out of the list are shelved (unreachable for
the agent's next provider schema and for execution) and come back when
named again; built-in and MCP tools are untouched. Previously the call only
updated extension-manager metadata consulted when wrappers were collected,
so an already-mounted tool stayed callable. -
MCP servers registered by extensions after startup reach the live
session: startup copied extension-registered MCP definitions into the
session's MCP manager once, so aregisterMcpServercall from a later
extension callback only updated the extension manager's snapshot and stayed
unreachable until restart. SDK and FrankenTUI sessions now sync at the
start of every prompt (sync_extension_mcp_registrations), the classic
TUI runs the same sync at the start of each turn, and the RPC loop runs it
on the first attempt of every prompt (the session it owns now carries the
MCP manager,AgentSession::set_mcp_manager): definitions the MCP manager
does not know yet are registered under the same trust gate as at startup,
trusted servers are connected, and only tool names not already mounted are
added. -
Docs now describe the shipped TUI: README, AGENTS.md, and
docs/tui.md
document FrankenTUI as the default interactive stack with--inlineand
--classic, list the settings-gatedbrowser,computer,
inspect_image,generate_image, andttstools, and retire the FAQ
line that called web browsing and image generation out of scope. -
DSR quality recipe runs every test binary: the
cargo testcheck now
passes--no-fail-fast, so the integration and conformance binaries execute
and report in the same run even when an earlier binary is red (the check
still fails on any failure). -
DSR test check runs against the worker's
/tmp: the recipe prefixes
the test command withenv TMPDIR=/tmpbecause the project-local temp
directory rch exports can be owned by another uid on a worker, which pi's
strict mode-class checks refuse. -
Drop-in slash-command parity tests are ignored in the gate: the three
tests/dropin_slash_differential.rstests that need the legacy pi-mono
tsx runner (a git-ignorednode_modulestree that never reaches the DSR
workers) are marked#[ignore]with that reason. They report as ignored,
never as passed, and still run with-- --ignoredon a host that
provisioned pi-mono; the strict drop-in program itself is retired. -
JSON-mode extension UI events use camelCase: the
extension_ui_request
envelope'scapability_promptflag is nowcapabilityPrompt, matching
the rest of the JSON-mode contract. -
Performance-evidence validators accept
git_commit: the Rust
validators in the release-readiness, release-evidence and semantic
workspace graph checks treat the perf harness'sgit_commitprovenance
field as optional, like the README evidence checker already did. -
README evidence checker is exercised by the gate: its
--self-test
now validates against its own fixture inventory instead of borrowing the
live performance artifact (it had been failing silently since the
2026-08-28 evidence refresh), andtests/readme_evidence_checker.rsruns
the self-test plus the live README verdict undercargo test. The live
check still fails closed on the current performance summary.
Fixed
-
ftuiclipped long answer lines instead of wrapping them (gh
#227):
the conversation body is oneParagraph, and ftui's paragraph defaults to
WrapMode::None, which stops drawing each line at the right edge of the
region. Any answer line longer than the terminal was truncated mid-word
with no indication, and the markdown renderer could not compensate because
it takes no text width. The body is now wrapped inconversation_text
(word wrap with a grapheme fallback, so unbroken URLs hard-break and
wide characters are measured in cells), with a hanging indent that keeps
wrapped list items and fenced code in their column. Two width bugs fell
out of it: the table budget and the render cache readself.term, which
the first frame has not yet received a resize for, and the tail-follow
scroll went through au16offset that saturates past 65535 rows — both
now use the frame's own body width, and the body is sliced to the visible
window. The bubbletea stack was never affected; it wraps explicitly. -
readreturned empty content for every file on Windows (gh
#182):
ReadToolopens a file once and clones the handle to fingerprint it for
the tool-output cache, butFile::try_cloneshares the OS file position.
The fingerprint read throughpositioned_file_read, which is cursor-neutral
on Unix (read_at) and not on Windows (seek_readleaves the cursor at
the end of the read) or in the portable fallback (it seeks a shared clone).
The real read therefore started at EOF, returned zero bytes, and the empty
file branch answered with empty content andis_error: false— a silent
wrong answer for any file up to the 2 MiB fingerprint limit.grepwas
unaffected because it fingerprints through its own handle. The primitive
now restores the position it found on every platform, which fixes the same
latent hazard at every other call site, and reports a failed restore rather
than leaving the cursor at an unknown offset. Invisible on Linux and macOS
by construction, so it shipped in two releases. -
--mode jsonstdout is linear in the response length (gh
#222):
everymessage_updateline carried the whole accumulated assistant
message twice (messageandassistantMessageEvent.partial), so a
50 KB reply produced ~500 MB of stdout.message_updaterecords are now
delta-only, matching upstream pi 0.84;message_start/message_end
still carry the full message. RPC mode is unchanged. -
usage.costis populated (gh
#221):
nothing ever priced a finished turn, sousage.cost.*was0.0on every
provider. Finished assistant messages are now priced from the model's
catalog rates; OpenRouter requests ask for usage accounting
(usage: {include: true}) and the billedcostis kept as the total —
the only cost source for ad-hoc gateway model ids. -
before_provider_requesthandlers chain (gh
#219):
with several handlers (or several extensions) only the last-registered
handler's rewrite reached the wire. Handlers now run in load order, each
sees the previous handler's payload, and in-place mutations of
event.payloadare honored. -
Startup no longer aborts on unrelated OAuth credentials or a read-only
store (gh
#218,
#217):
an explicit--api-keyfor an explicit model skips the stored-credential
refresh entirely; otherwise expiring OAuth credentials are refreshed per
provider and only a failure for the selected provider is an error. A
non-writable~/.pi/agentis read without a lock instead of failing
withauth lock: Permission denied, and the stale-credential prune can
no longer fail startup. -
Secret masking catches API keys that contain dots (gh
#211):
thesk-rule and the genericKEY=valuerule rejected.inside the
token, so dotted OpenAI-compatible keys (Alibaba BaiLiansk-sp-H.EEDDM…)
reached the model in plaintext while the same key with the dots replaced
by digits was vaulted. Ruleset v2 accepts single dots between token
characters only — a key at the end of a sentence no longer swallows the
period, dots do not count toward the minimum length, and a dotted generic
value without any digit (apiKey: process.env.OPENAI_API_KEY) is left
alone. Same audit addedgho_/ghu_/ghs_/ghr_GitHub tokens and a
signed-JWT rule, and orderssk-ant-ahead ofsk-so the audit label
names the tightest rule. Rotate any dotted key that was pasted into a
session on an earlier build. -
Gemini / Vertex AI no longer report a cut-off stream as a complete
answer (gh
#213):
a transport close before the chunk carryingfinishReason(proxy reset,
idle timeout, dropped connection) was emitted as a cleanDone/Stop, so
the truncated text was committed to the session and the transient-error
retry never ran. Both providers now surface a retryableunexpected EOF
error like the Anthropic and OpenAI streams already did, and a refused
prompt (promptFeedback.blockReason) becomes a named provider error
instead of an empty success. The HTTP body-idle timeout that bounds a
stalled provider stream gained direct tests (stall fires, live-but-slow
streams reset the bound, transport errors pass through). -
FTUI launches boot the extension runtime once: the classic startup
path no longer pre-warms, enables, and then discards a second extension
runtime (with a secondstartup/session_starthook dispatch) before the
default FTUI stack creates its own SDK session. -
Extension
pi.toolfile writes are undoable: the runtime's hostcall
registry now shares the session's undo recorder (and, on the classic
path, its workspace roots), so files written through extension hostcalls
appear in/undoand respect workspace confinement like agent tool calls. -
RPC quarantine rejections name the state: a command refused while
terminal persistence is quarantined now answers with
<command> is quarantined after an indeterminate transition: <reason>,
matching the other quarantine messages, so clients can recognise the state
instead of parsing the underlying persistence failure. Closing stdin while
quarantined still ends the server loop with the surfaced error. -
MCP HTTP transport survives servers without a GET stream: the optional
server-initiated event stream is opened in the background; a server that
answers that GET with anything but 405 or atext/event-streambody used
to retire the whole transport, so the next request or notification failed
with "HTTP transport was aborted before request dispatch". Such answers now
mean "no server stream" and are logged, while requests keep flowing. -
Failover lifecycle closes on fallback turns: a turn that swapped to a
fallback-chain entry emittedfailover_startbut no matching end, so JSON
and RPC consumers saw the lifecycle stay open throughagent_end. Print
JSON mode and the RPC loop now emit exactly one
failover_end { restoredPrimary: false }naming the fallback, whether the
fallback succeeded, failed, or the turn was aborted or its restoration
failed: the RPC loop emits it before its deferred terminalagent_end;
print JSON mode emits it with the other lifecycle closers
(auto_retry_end) after the fallback attempt'sagent_end. Cooldown
restoration keeps its ownfailover_end { restoredPrimary: true }. -
Fallback chain walks skip no-op entries and stop spending the cap on
them: print mode bounded its chain cursor bymaxFailoversPerTurn, so a
malformed, uncredentialed, or unconstructible entry consumed the budget and
hid a later valid entry; both print and RPC would also install a chain
entry equal to the live model or a duplicate of an earlier entry, emitting a
phantomfailover_startfor a swap to itself. The walk is now bounded by
the chain, skips the current model and duplicate specs, and only a
successful swap counts against the per-turn cap on both surfaces. -
Persistence fault-injection runner checks the right test identity:
scripts/e2e/run_persistence_fault_injection.shcompared each case's
result.jsontest_name(the cargo test function it ran) against the
harness test id the Rust test stamps on its JSONL diagnostics, so the
integrity summary failedresult_identity_currentafter both cases
passed. The two identities are now checked separately, and a failed
summary prints the failing check names and any source-tree movement on
stdout instead of a bare exit code. -
Perf orchestrator names its blockers: when the post-generation evidence
contract or the final artifact staging blocks a run, the log now lists the
contract failures, the blocked staging contract ids, and each
stratification layer's evidence state and node/bun ratios, so a gate
transcript explains the refusal without the JSON artifacts. The fake
toolchain fixtures intests/bench_schema.rswere brought back in line
with the current staging and comparison contracts (semantic_context
Criterion estimates, the Criterion-produced pijs comparison contract, the
newer fence ordering and validator wording). -
Hidden extension messages reach the model: custom messages injected by
extensions (for example frombefore_agent_start) withdisplay: false
are sent to the provider like visible ones;displayonly controls TUI
rendering. pi's own hidden provenance records (the semantic context bundle
entry) stay out of the provider context because their payload travels in
the system prompt. -
A stray
.codexfile no longer blocks startup: the workspace-trust
scan treated "Not a directory" on.codex/config.tomlas a configuration
error and refused to start pi in any directory containing a regular file
named.codex; a file where a surface directory is expected now counts as
"no surface", like a missing path. -
Perf orchestrator no longer aborts on
ROOT_DIR:
scripts/perf/orchestrate.shreferenced an undefinedROOT_DIRin the
extension-benchmark validation path (since 2026-08-26), which under
set -uaborted every orchestration that reached it. -
Installer no longer depends on
SHA256SUMS: the network preflight
probed the aggregate checksum manifest, which DSR releases may not ship at
all, so canonical releases warned during preflight and the installer touched
SHA256SUMSeven when the per-asset.sha256sidecar was authoritative. It
now probes the release page.tests/installer_regression.shis green again
(69/69; five cases had been failing since 2026-08-06 without any gate
running them). -
Verification lane realigned with the newer product contracts (test and
evidence changes only, no product behaviour changed): the MCP HTTP transport
tests now expect the fail-closed retirement rule (a malformed, mismatched,
or 202-acknowledged request retires the transport; an indeterminate abort
sends onenotifications/cancelled); the auto-compaction "stale snapshot"
test no longer deadlocks against the agent-session lock it was waiting on;
the/shareTUI tests trust their own project settings via
PI_WORKSPACE_TRUST; the RPC plan-mode test retriesapprove_planand
the follow-up prompt while the RPC loop answers "wait before running"
(it fired both into the still-streaming turn and then into the post-turn
compaction handoff, which is the documented client contract) and drains
the child's output pipes; the FrankenNode matrix check
ignores the generating host's Node/Bun versions; the extension stress test
measures RSS growth after a warm-up cycle; the OCO budget tuner gained real
regret and rollback unit tests; the traceability matrix, e2e scenario
matrix, and perf SLI contracts cover every classified suite again (incl.
the background/tanworkflow); the swarm runpack golden was regenerated
after review. One user-visible touch: the/sharesuccess message now
puts the share URL and the gist link in their own paragraphs so the TUI
no longer soft-wraps them into the warning sentence.
Full changelog: CHANGELOG.md