Skip to content

v0.5.0

Choose a tag to compare

@Dicklesworthstone Dicklesworthstone released this 12 Sep 06:31
· 2222 commits to main since this release

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)" | bash

Already 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-missing

Every 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-msvc somewhere after v0.3.0 — ten hard errors, so
    cargo install pi_agent_rust failed 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::iterator and SIGBUS, 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
    in jobs and mcp::trust read volume_serial_number/file_index off
    std::os::windows::fs::MetadataExt, which are still behind the unstable
    windows_by_handle feature and so unavailable to a crate that must also
    build on stable. Both now go through a new file_identity::FileIdentity
    that reads the same two values from an open handle via winapi-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_* and tool_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 an EventCoalescer. Print, RPC and --classic each
    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.

  • /new and /resume no 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 --message sequence 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.

  • maxFailoversPerTurn counts 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.attempt is now the successful-swap ordinal, and the chain
    position moved to a new chainIndex field
    (bd-oqo03). attempt used to
    carry the chain cursor after it advanced, so the entry at chain index 0
    reported attempt: 1 and looked like a correct ordinal by coincidence.
    Consumers reading attempt to mean "which swap is this" were right by
    accident and are now right on purpose; consumers reading it as a chain
    position should move to chainIndex.

  • 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, with batched=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).
    code reuses 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 normalized reasoning: {"effort": …} object (or
    {"max_tokens": …} when the model's thinkingLevelMap maps a level to
    an integer budget; {"off": "none"} forces thinking off). It is the
    default for reasoning models on the openrouter provider or any
    openrouter.ai base URL, so --thinking high now reaches the model
    instead of being dropped; non-reasoning models send no reasoning key,
    and vendor dialects (thinking/reasoning_effort) are never sent
    through the gateway. xhigh/max are no longer clamped for those
    models, and compat.openRouterRouting keys (including a reasoning or
    store of your own) still merge on top.

  • Inline video and audio input for Gemini-family models (gh
    #212):
    a media content block ({"type":"media","data":…,"mimeType":…,"name":…}),
    InputType::Video/Audio (input: ["video", "audio"] in models.json
    and extension model registration; unknown labels now warn instead of
    vanishing), and a settings-gated read_media tool
    (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 an inline_data part and
    declare video/audio in 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):
    disables AGENTS.md/CLAUDE.md discovery (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-skills remains a separate switch.

  • providers.<id>.modelOverrides in models.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, so compat.openRouterRouting (and
    maxTokens, cost, …) can be pinned for a gateway model such as
    openrouter/deepseek/deepseek-v4-pro without redefining the provider.

  • current_time tool (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 follows TZ); 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 call current_time for anything time-of-day dependent. Essential
    tier and in the default --tools list.

  • Portable DSR quality recipe: .dsr/repos.yaml carries the registered
    pi_agent_rust quality 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 to always-ask on every surface, and print mode
    cannot prompt, so a default -p run 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 final stop_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 yolo as 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 json callers 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 grant bash and 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 a pi.tool hostcall 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_tools and
    Agent::shared_tools expose the handle; Agent::new keeps working.
    pi.setActiveTools now 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 a registerMcpServer call 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 --inline and
    --classic, list the settings-gated browser, computer,
    inspect_image, generate_image, and tts tools, and retire the FAQ
    line that called web browsing and image generation out of scope.

  • DSR quality recipe runs every test binary: the cargo test check 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 with env TMPDIR=/tmp because 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.rs tests that need the legacy pi-mono
    tsx runner (a git-ignored node_modules tree that never reaches the DSR
    workers) are marked #[ignore] with that reason. They report as ignored,
    never as passed, and still run with -- --ignored on 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's capability_prompt flag is now capabilityPrompt, 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's git_commit provenance
    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), and tests/readme_evidence_checker.rs runs
    the self-test plus the live README verdict under cargo test. The live
    check still fails closed on the current performance summary.

Fixed

  • ftui clipped long answer lines instead of wrapping them (gh
    #227):
    the conversation body is one Paragraph, 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 in conversation_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 read self.term, which
    the first frame has not yet received a resize for, and the tail-follow
    scroll went through a u16 offset 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.

  • read returned empty content for every file on Windows (gh
    #182):
    ReadTool opens a file once and clones the handle to fingerprint it for
    the tool-output cache, but File::try_clone shares the OS file position.
    The fingerprint read through positioned_file_read, which is cursor-neutral
    on Unix (read_at) and not on Windows (seek_read leaves 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 and is_error: false — a silent
    wrong answer for any file up to the 2 MiB fingerprint limit. grep was
    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 json stdout is linear in the response length (gh
    #222):
    every message_update line carried the whole accumulated assistant
    message twice (message and assistantMessageEvent.partial), so a
    50 KB reply produced ~500 MB of stdout. message_update records are now
    delta-only, matching upstream pi 0.84; message_start/message_end
    still carry the full message. RPC mode is unchanged.

  • usage.cost is populated (gh
    #221):
    nothing ever priced a finished turn, so usage.cost.* was 0.0 on 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 billed cost is kept as the total —
    the only cost source for ad-hoc gateway model ids.

  • before_provider_request handlers 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.payload are honored.

  • Startup no longer aborts on unrelated OAuth credentials or a read-only
    store
    (gh
    #218,
    #217):
    an explicit --api-key for 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/agent is read without a lock instead of failing
    with auth lock: Permission denied, and the stale-credential prune can
    no longer fail startup.

  • Secret masking catches API keys that contain dots (gh
    #211):
    the sk- rule and the generic KEY=value rule rejected . inside the
    token, so dotted OpenAI-compatible keys (Alibaba BaiLian sk-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 added gho_/ghu_/ghs_/ghr_ GitHub tokens and a
    signed-JWT rule, and orders sk-ant- ahead of sk- 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 carrying finishReason (proxy reset,
    idle timeout, dropped connection) was emitted as a clean Done/Stop, so
    the truncated text was committed to the session and the transient-error
    retry never ran. Both providers now surface a retryable unexpected 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 second startup/session_start hook dispatch) before the
    default FTUI stack creates its own SDK session.

  • Extension pi.tool file 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 /undo and 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 a text/event-stream body 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 emitted failover_start but no matching end, so JSON
    and RPC consumers saw the lifecycle stay open through agent_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 terminal agent_end;
    print JSON mode emits it with the other lifecycle closers
    (auto_retry_end) after the fallback attempt's agent_end. Cooldown
    restoration keeps its own failover_end { restoredPrimary: true }.

  • Fallback chain walks skip no-op entries and stop spending the cap on
    them
    : print mode bounded its chain cursor by maxFailoversPerTurn, 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
    phantom failover_start for 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.sh compared each case's
    result.json test_name (the cargo test function it ran) against the
    harness test id the Rust test stamps on its JSONL diagnostics, so the
    integrity summary failed result_identity_current after 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 in tests/bench_schema.rs were 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 from before_agent_start) with display: false
    are sent to the provider like visible ones; display only 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 .codex file no longer blocks startup: the workspace-trust
    scan treated "Not a directory" on .codex/config.toml as 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.sh referenced an undefined ROOT_DIR in the
    extension-benchmark validation path (since 2026-08-26), which under
    set -u aborted 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
    SHA256SUMS even when the per-asset .sha256 sidecar was authoritative. It
    now probes the release page. tests/installer_regression.sh is 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 one notifications/cancelled); the auto-compaction "stale snapshot"
    test no longer deadlocks against the agent-session lock it was waiting on;
    the /share TUI tests trust their own project settings via
    PI_WORKSPACE_TRUST; the RPC plan-mode test retries approve_plan and
    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 /tan workflow); the swarm runpack golden was regenerated
    after review. One user-visible touch: the /share success 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