Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5,686 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xz-dev/pi

This is a downstream distribution fork of earendil-works/pi.

It tracks upstream main with a minimal downstream patch stack.

Warning

This fork relies heavily on vibe coding. Logic changes are manually reviewed, and tests are also written by AI under human direction before the full test gate is run.

Almost none of the code in this fork is handwritten by xz-dev. Do not use this distribution if you are uncomfortable with AI-assisted development.

Downstream changes

Features

  • Continue from the nearest protocol-safe conversation boundary with /retry or RPC retry, preserving superseded history as an append-only sibling branch, retaining completed tool results, and synthesizing explicit unknown-outcome errors only for missing results without replaying old tool calls.
    • Use case: Resume after Pi or its provider was interrupted, without replaying completed tool calls.
    • Patch branch: patch/manual-retry
  • Support per-package Skill visibility overrides through skillOverrides.<name>.disableModelInvocation, retaining manual /skill:<name> invocation and project-over-global precedence.
    • Use case: Keep a skill available to /skill:<name> while preventing automatic model invocation.
    • Patch branch: patch/skill-overrides
  • Allow settings.retry.nonRetryableErrorPatterns to fail-fast on gateway-specific terminal quota/limit error messages without expanding the built-in retry classifier.
  • Record blocking extension startup and shutdown operations in a private lifecycle JSONL, and persist visible non-model reminders for individual awaited extension hooks that exceed the configurable threshold.
    • Use case: Diagnose startup/shutdown or slow extension-hook stalls without adding diagnostics to model context.
    • Patch branch: patch/shutdown-lifecycle-log
  • Label slow extension-hook reminders by synchronous or asynchronous execution while preserving historical unlabeled entries.
    • Use case: Tell whether a visible slow-hook reminder came from synchronous or asynchronous extension work.
    • Patch branch: patch/slow-hook-execution-kind
  • Keep raw append-only history portable across provider/model switches while replaying private Responses compaction only for a compatible request target; incompatible requests migrate atomically to bounded classic compaction before provider dispatch.
    • Use case: Compact repeatedly without losing earlier history, then safely switch providers or models without exposing provider-held checkpoint state.
    • Patch branch: patch/provider-transparent-compaction
  • Expose public pi.spliceEntry(entryId) so an extension can delete one non-root session-tree node and reparent its children, preserving descendants.
    • Use case: Remove a hidden watchdog decision node from session history without deleting later conversation descendants.
    • Patch branch: patch/session-tree-splice

Fixes

  • Wait for extension-provider registration refreshes before startup resolves configured models, while preserving synchronous registration and caller-owned cancellation.
  • Rebind active and scoped sessions to refreshed same-ID model metadata so context percentages and automatic compaction use the current context window.
  • earendil-works/pi#6234: make Esc abort recover from lifecycle hooks, extension hooks, provider setup, provider streams, or listener dispatch that never settle.
    • Use case: Recover control when Esc is pressed during a hook, provider setup, stream, or listener that does not settle.
    • Patch branch: patch/esc-abort
  • Keep content and hardware-cursor state in one synchronized terminal release so tmux cannot redraw centered overlays from an intermediate cursor position.

The integrated Esc and manual-retry patches both extend the Agent failure lifecycle. Their independent branches remain directly reviewable; tmp/patch/esc-manual-retry-compat supplies only the downstream combined handleRunFailure() resolution and is merged immediately after them.

Maintenance

  • Keep the fork/pre-release changelog baseline, display, and version handling correct across downstream release cycles.
    • Use case: Keep downstream prerelease display and changelog lookup correct when package and release versions differ.
    • Patch branch: patch/changelog-prerelease

Installation

xz-dev Pi is distributed through immutable GitHub Releases. Each Release ships 12 ZIP bundles: Darwin x64 baseline/modern and arm64; Linux GNU and musl x64 baseline/modern and arm64; and Windows x64 baseline/modern and arm64. Choose modern on an AVX2-capable x64 CPU and baseline otherwise; on Linux, choose gnu for glibc systems and musl for musl systems. Each ZIP contains pi plus pi-native (.exe on Windows) and all version-matched runtime assets. No Node.js, Bun, npm, package manager, or generated installer script is required.

Linux and macOS

# Download the matching pi-<target>.zip from the latest Release, then:
unzip pi-<target>.zip -d pi
chmod +x pi/pi pi/pi-native
./pi/pi --version

Windows Scoop

$scoopRoot = (Resolve-Path (Join-Path (scoop prefix scoop) '..\..\..')).Path
$bucket = Join-Path $scoopRoot 'buckets\xz-dev'
git clone --branch scoop --single-branch https://github.com/xz-dev/pi.git $bucket
scoop install xz-dev/pi

Scoop installs the AVX2-optimized x64 build, or the native arm64 build on Windows arm64. Update with scoop update pi. Use the manual method below for an x64 baseline build.

Windows PowerShell

# Download the matching pi-<target>.zip from the latest Release, then:
Expand-Archive .\pi-<target>.zip -DestinationPath .\pi
.\pi\pi.exe --version

Exact Release installation

Download pi-<target>.zip from the exact xz-v<VERSION> Release instead of Latest, then extract it using the same commands above.

Release assets include SHA256SUMS and GitHub build-provenance attestations for independent verification.

Update

An extracted binary updates itself directly from the matching target ZIP:

pi update --self

The first update converts the extracted directory into a managed layout: the complete ZIP is staged under bundles/<version>, then current is atomically replaced. On POSIX, the root wrapper is also atomically refreshed. On Windows, pi.exe remains stable, waits for pi-native.exe, and returns its exit status without overwriting the running wrapper. A new invocation reads current and starts the activated bundle.

Source checkout

A documented source installation uses the xz-dev checkout and is user-managed:

git clone https://github.com/xz-dev/pi.git
cd pi
npm ci --ignore-scripts
npm run build
cd packages/coding-agent
npm link

For this installation, pi update --self never runs a package-manager update and never queries official upstream Release/update sources; it prints xz-dev source-checkout update instructions that you run yourself.

Automation upstream sync

See MAINTAIN.md for the authoritative downstream branch ownership, rebuild, publication, recovery, and patch-retirement rules.

Twice daily, Upstream Sync rebuilds main from the latest https://github.com/earendil-works/pi.git main, then integrates the maintenance overlay, feature and fix branches, and temporary compatibility branches in a fixed order:

  • 01:28 Asia/Shanghai
  • 13:28 Asia/Shanghai

Before a lease-protected update of main, the workflow installs dependencies, hydrates model data, builds, checks, runs focused integration regressions, validates the exact GitHub Release candidate, audits production and development dependencies, and verifies production dependency signatures. Conflicts, empty integrations, failed gates, or a changed remote lease leave main unchanged. A successful push triggers the full CI, Esc Abort Integration, and Publish GitHub Release workflows for the rebuilt commit.

About

xz-dev flavored earendil-works/pi downstream distribution fork

Topics

Resources

Contributing

Security policy

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages