Skip to content

v0.8.0

Latest

Choose a tag to compare

@github-actions github-actions released this 25 Nov 18:43
Immutable release. Only release title and notes can be modified.
7358539

PiG 0.8.0

image

PiG 0.8.0 is a Pi-catch-up, fix, extension-view and security release. It follows Pi 1.6.0 (faac5858), plus later Pi fixes that were backported. It follows PiG 0.7.0, with 141 additions, 267 changes and 725 recorded fixes in CHANGELOG.md (1,036 bug-fix ledger entries: 977 PiG defects, 44 Pi defects PiG fixed first and 15 Pi fixes ported). Install it with go install github.com/MichaelKinsy/PiG/cmd/pig@latest or npm i -g @pi-in-go/pig, or download the pig, pig-standard or pig-acp archives attached to this release.

PiG is a faithful Go implementation of Pi, the reference implementation. Pi's behavior is the contract, and every place PiG differs is a numbered divergence. PiG is not an official Pi project, and Pi's maintainers have not endorsed it. It was created by Michael Kinsy and originally developed at Hewlett Packard Enterprise.

This is a minor release because it catches up to Pi 1.6.0, adds extension views (ui.view) across the terminal, RPC and a reference web client, adds pig --mode rpc --listen, moves the Go root module to Go 1.27, removes Chord v1 (chord/host) and changes several Go and extension SDK APIs. Read "Upgrading" before you update Go code or rebuild extensions.

Thanks

This release includes fixes and features that came from your reports and patches.

  • @balcsida contributed #404 (pig --mode rpc --listen for multi-session RPC in one process) and reported #522, where picking a model from an extension-registered provider after /new built a bare model with context window 0 and no thinking.
  • @eaxeax reported #516 (hang when a Node extension with a prepareLoadout tool registers a tool after loading or calls setActiveTools) and #517 (process.execArgv exposing PiG's loader under --permission), and sent #523.
  • @zochari reported #497, where a custom editor installed by a Go, Rust, Python or Lisp extension could end an interactive session on autocomplete rebuild.
  • @asp345 reported #427, where an interactive shell started by the bash tool suspended PiG with suspended (tty input).
  • @Cade-Peterson reported #417, where pig piglet remove <name> --source left a copied prompt file behind and blocked re-adding an edited Piglet.
  • @yxd-ym reported #429 on per-chunk CPU cost of subprocess-extension message_update handlers (partly addressed in this release; host allocations per event are reduced, and the reporter's CPU figure awaits re-measurement).
  • @Cpt-Falcon contributed #548 (D660), skipping threshold auto-compaction when a model's context window is unknown.
  • @Patrick-Kappen contributed the CI cache changes that stop pull requests from evicting main's build caches.

Fixes for reported issues

  • #522. After /new, /resume, /clone or /fork in interactive mode, picking a model of a provider registered by the new session's extension used to build a bare model with a context window of 0 and no reasoning (0.0%/0 (auto), thinking off), because the model builder stayed bound to the initial registry. The model selector, extension setModel and post-login selection now build from the new session's registry.
  • #517. Node extensions saw PiG's own loader (--import .../register-loader.mjs) in process.execArgv, so a child forked under Node's --permission (--allow-fs-read) failed with ERR_ACCESS_DENIED. PiG now starts Node extension processes through a bootstrap file that registers the loader inside the process, leaving process.execArgv clean as in Pi.
  • #516. A Node extension with a prepareLoadout tool hung PiG when it (or another extension in the same process) registered a tool after loading or called setActiveTools followed by a synchronous API. The same class of hang affected Go, Python and Lisp extensions calling registerTool, setToolRenderers or toolPromptSnippet. The prepareLoadout hook now runs inside the call without deadlocking, as in Pi.
  • #497. A custom editor installed by a Go, Rust, Python or Lisp extension before the autocomplete rebuild after session_start (or on /reload) ended the interactive session with autocomplete provider is no longer available, because those SDKs answered the host's rebuild notice with an error. They now accept it, as the Node runtime does.
  • #427. An interactive shell run by the bash tool or ! kept PiG's controlling terminal and could take the foreground process group, leaving PiG suspended with suspended (tty input) on the next key press (or stalling bash -i). Bash shells, MCP stdio servers and Chord workers now start in their own session (setsid, as in Pi's detached: true), while still leading their own process group for clean teardown.
  • #417. pig piglet remove <name> --source left prompt files copied by pig piglet add behind, so re-adding an edited Piglet of the same name failed with a content conflict. pig piglet add now records copied files and their SHA-256 digests in <name>.files.json, and remove --source deletes unchanged files that no other registered Piglet references.
  • #429 (in part). Host allocations for a streamed message_update handed to a subscribing TypeScript extension fell from 381 allocations (41.1 KB) to 122 allocations (23.9 KB) at one subscriber, and from 202 (26.1 KB) to 55 (9.0 KB) per subscriber at four. The reporter's end-to-end CPU figure is not yet re-measured on the final tip, so #429 remains open.

Pi catch-up

PiG 0.8.0 pins Pi 1.6.0 (faac5858, released 2026-11-20) and carries backported post-1.6.0 Pi fixes (editor history deduplication, single-pass createProvider catalog merge, Bedrock SSO HTTPS_PROXY resolution and prefixed Gemini 3+ compat.supportsStrictMode).

  • Models and defaults. Adds GPT-6.2 Astra (gpt-6.2-astra) and GPT-6.2 Sol (gpt-6.2-sol) on openai, azure and openai-codex (with GPT-6.2 Sol as the new default for those providers and Codex's 500K/272K context windows), adds Claude Fable 5.2 (claude-fable-5-2) on anthropic, adds qwen-token-plan-individual-cn, deepseek-v4.1-flash and qwen4-max-preview on Qwen Token Plan Individual, and updates Azure GPT-6 context windows to 1,050,000 tokens.
  • Session resume and diagnostics. When a session's working directory no longer exists, interactive mode offers Continue, Fork or Cancel (Pi 1.5.2). Startup, session replacement (/new, /resume, /fork, import and RPC equivalents) and model fallback diagnostics are now reported in every mode instead of being dropped or written directly to stderr before the TUI starts.
  • RPC and reload lifecycle. In RPC mode, new_session, switch_session, fork and clone now emit session_start once (after session_shutdown of the old session) instead of twice, and Session.Reload emits session_start to extensions as in Pi. Extension pi.events handler errors now route through the extension error channel instead of printing behind the TUI.
  • Fullscreen scrolling and package installs. Fullscreen scroll frames reuse previous frame output (Container.Render and Box.Render return cached slices while children are unchanged), so wheel and key scrolling no longer re-render the whole transcript. Installing missing git or npm packages at interactive startup captures git and npm output instead of writing over the screen.
  • Provider request fixes. Codex sends the system prompt as a leading developer input item, keeps its prompt cache across mid-conversation thinking-level changes (configuration_update items, including switching to off), and auto-retries 60-minute WebSocket limits (websocket_connection_limit_reached) on a fresh connection. OpenAI Responses reports reasoning items OpenAI drops from requests. openai-completions now defaults to the system instruction role on non-OpenAI hosts (with compat.supportsDeveloperRole to override) and omits empty "tools": [] by default (with compat.requiresToolsWithToolHistory for proxies that need it). Azure OpenAI Responses base URLs that already contain /responses?api-version=... (and OpenAI baseURL values with query strings or fragments, matching openai 7.59.0) reach the endpoint cleanly. Custom models in models.json under a built-in provider inherit composed api and baseUrl defaults. GitHub Copilot sends reasoning_effort for chat-completions effort models and explicit strict for both Responses and Claude tools; llama.cpp decision classifiers receive images; Mistral tool definitions default to strict: false.
  • CLI and terminal. Adds pig auth login [provider] and pig auth logout [provider]. Prints the pig --resume command on its own line on exit, keeps selection across cursor keys in selector search and picks the best match in /login//logout search, keeps tool-preview syntax highlighting readable across terminal themes, and no longer submits an unfinished prompt when pressing Enter on a Tab path completion menu. After an external kill -TSTP, fg re-arms raw mode, paste, keyboard, mouse and screen modes and redraws (D661; bg parks until fg). cacheWarming now defaults to "idle". Pressing Esc during a batch of tool calls records "Operation aborted" results for unstarted calls instead of leaving orphaned tool calls. Mermaid rendering adds pie, mindmap, timeline and gitGraph diagrams. The compaction status line shows elapsed time and streamed size (D652), and terminal.framePacing: "adaptive" is available opt-in.
  • Security and state safety. Unknown api names and unlisted model ids are refused with Pi's error before any request is sent (preventing credentials from being sent to a fallback host). Re-registering a provider with insecure: false restores TLS verification across all request routes, and a models.json insecure: true opt-in no longer carries over to a different baseUrl. Credential and state files (auth.json, models-store.json, settings.json, trust.json, keybindings.json, mcp.json, mcp-auth.json) are written atomically through temporary files (D651), auth.json locks follow symlinks to the real file, and quitting waits for an in-flight OAuth refresh to save. Bundled undici is updated to 8.12.4, gorilla/websocket past GO-2026-6278, klauspost/compress to v1.20.3 (GO-2026-6865), and the pinned Go toolchain to 1.27.4.

Extension SDKs

  • Extension views (ui.view, D614). Extensions can mount one view that renders in the terminal (widget-above, widget-below, panel tabs and dialog overlays when a Piglet sets viewClient: terminal, as PiG Standard does; F6 focuses a panel, Escape returns to the editor) and in a browser. Views support image nodes (kitty, Ghostty, iTerm2 and half-block fallback including tmux) and calendar-style grid nodes. Stock PiG attaches no view client and refuses mounts with unsupported.
  • Wire carrier and reference web client. RPC mode carries views over ui_view_* commands on stdin/stdout and --listen connections (docs/ui-view-carrier.md). With viewClient: terminal and viewEndpoint: socket, an interactive session serves the same view mounts over a Unix socket so an outside client and the terminal stay in sync. examples/ui-view-web (in the source tarball, requires Node, not bundled in the pig binary) provides a reference web client and bridge.mjs --connect <socket>. /reload and ctx.reload() end reloaded extensions' mounts cleanly (broken, owner_gone). See pig docs show ui-views.
  • setModel takes a model object. Across all SDKs, extension setModel now preserves the model object passed (context window, limits, base URL, API, compat, headers) instead of looking up only provider and id.
  • Child session parity and surfaces. Go, Rust, Python and Lisp extensions gain the remaining AgentSession members on child sessions from createAgentSession (live reads, mutations and awaited operations). registerMarkdownTransformer accepts { messageTypes } across all SDKs so transformers can target user, assistant, assistant-thinking, custom, summary and changelog surfaces.
  • Scaffolding, reload and child cleanup. pig extension init <path> --lang node scaffolds a TypeScript extension. Piglet Binaries support build.fusedReload: source to reload a fused Go member from source. A Pi extension that launches the harness and ends it with SIGKILL no longer leaves the PiG binary running behind it.

Chord, Durable and Piglets

Chord and Durable are Go API surfaces of Pi's app kit and runtime; across the whole monorepo PORT_MAP.md now records 1,046 ported entries (✅, 99.7%) and 3 partial entries (🟡).

  • Durable suspendable work and storage. Adds typed signals (durable.DefineSignal), sleeps that wait for signals, tools that park, gates and hook tasks (Pi 473515f9c). Upgrades the native SQLite engine to modernc.org/sqlite v1.62.0 and opens Durable SQLite connections in multi-thread mode (SQLITE_OPEN_NOMUTEX). Fixes a race in SessionImpl.Park so group-commit publication no longer publishes the next part of a storage call before a wait's continuation has run.
  • Chord v2 plugins, sync and app kit. Ports Chord v2 live queries (self.Query), Files v2, store group commit, events across Go and Node hosts, chord/sync (experimental outbox-based session sync) and the complete Chord tutorial with examples/chord-todo. Fixes chord/sync so toggling a store's outbox off and on again continues from a new archive slot (Pi f472efdc1), closes the archive body on a failed ImportStore during PullSession (Pi 434dc5e4d), and synchronizes close flags when a store import is cancelled mid-read.
  • Multi-session RPC (--listen). pig --mode rpc --listen <path> serves one Pi RPC session per Unix socket connection in a single process, with isolated extension processes by default or --listen-share-extensions to share them.
  • Release archives and pig-bolt. Releases now publish pig-standard-<version>-<os>-<arch> and flat pig-acp-<version>-<os>-<arch> (built from @pi-in-go/pigpen-acp 0.2.3) archives for linux, darwin and windows on amd64 and arm64. The experimental pig-aot Piglet is renamed to pig-bolt (command /bolt-runtime), pinned to Pi-Bolt compiler 1.1.2, with support for extensions that resolve files next to their own module and a 2 GB default image cache budget.

Size and speed

Stripped stock pig binary sizes measured on the 0.8.0 release candidate (TestReleaseBinarySizeGate, Go 1.27.4):

  • linux/amd64: 63,008,928 bytes (v0.7.0 was 69,218,464 bytes, 6,209,536 bytes smaller)
  • linux/arm64: 58,458,272 bytes (v0.7.0 was 64,553,120 bytes)
  • darwin/arm64: 60,249,282 bytes (v0.7.0 was 66,391,074 bytes)
  • windows/amd64: 64,714,752 bytes (v0.7.0 was 70,961,152 bytes)

Upgrading

Every breaking change and removal from 0.7.0 is listed below. Run pig extension upgrade to rewrite supported Go SDK calls and list remaining sites.

  • Go toolchain. Building PiG from source now requires Go 1.27 (go.mod and go.work moved from 1.26.0 to 1.27.0 for encoding/json/v2). The extension SDK module (extensions/sdk), examples and generated Go extensions stay on Go 1.26.
  • Extension wire and setModel. Rebuild extensions built with an SDK before 0.8.0; the extension wire now rejects a bare provider/id string in setModel (setModel: model must be a model object). In Go, ctx.SetModel("provider/id") becomes ctx.SetModelNamed("provider/id"), and ctx.SetModel(model) takes a model object (map[string]any). Python, Rust and Lisp still accept both a string and a model object. In Node, pi.setModel(model) uses the object as passed, so pass the registry's object (ctx.modelRegistry.find(provider, id)).
  • coding.BuildModel and coding.ResolveModelScope. coding.BuildModel("provider/id", services) now returns Model not found: provider/id for an unlisted id; use coding.BuildFallbackModel for a custom id. coding.ResolveModelScope is removed; use coding.ResolveModelScopeWithDiagnostics and report its Diagnostics.
  • waitForIdle is command-only. Calling ctx.waitForIdle outside a command handler or withSession callback is now refused (Node throws TypeError; Go, Python, Rust and Lisp return not_a_command_context), including when the session is idle (such as in session_start). Move the wait to a command handler or react in agent_settled.
  • context_edit drafts. In turn_end and agent_before_settle handlers, write replacement: null explicitly when omitting an entry; a context_edit draft without the replacement member is now refused as in Pi.
  • Go extension SDK types and methods. MessageRenderOptions and EntryRenderOptions are no longer comparable (each gains a State map); compare individual fields or use reflect.DeepEqual. (*Extension).MarkdownTransformer now takes variadic ...sdk.MarkdownTransformerOptions (calls compile unchanged; method values or interface types with the old one-parameter signature must update).
  • Go extension host embedders. Programs that embed the extension host and mount view-kit widgets must call subprocess.EnableViewWidgets() (and subprocess.EnableEditorViews() for editors) before building a view (pig calls both). Callers or providers implementing extension.NativeProvider.ResolveAuth must update its signature to func(ctx, ai.CredentialStore, ai.AuthResolutionOverrides) (*ai.AuthResult, error).
  • Cached render slices (TUI). In Node extensions, render() returns readonly string[] and Container returns a cached array while children are unchanged; copy before mutating. In Go, Container.Render and Box.Render return a borrowed read-only slice; copy with slices.Clone before editing lines, and return a new slice when a child's content changes.
  • Chord v1 removed and Chord v2 breaking changes. The Go package chord/host and root-package replicated state (NewReplicatedState, AttachReplicatedStateSource, ReplicatedState) are removed; use chord/next/* and chord/nextnode. In the Chord app kit, StartServer now returns once listening and NewWebSurface/NewTuiSurface return before building (wait on Built() or App.BasesBuilt()). Chord app kit sessions are renamed to sign-ins (app.Sessions to app.SignIns, SessionInfo to SignInInfo, etc.) with no migration, so browsers and paired devices must sign in or pair again.
  • pig --version and PIG_VERSION_FORMAT. pig --version and pig -v now print Pi's version (matching pi --version), and PIG_VERSION_FORMAT is removed. PiG's own release version is printed by pig version. If you use a custom selfUpdateCommand (PIG_SELF_UPDATE_COMMAND or PI_SELF_UPDATE_COMMAND), updating from 0.7.0 to 0.8.0 prints one harmless version-mismatch warning from the outgoing 0.7.0 binary.
  • pig-bolt rename and Qwen retired models. pig-aot is renamed to pig-bolt (piglets/pig-bolt, command /bolt-runtime; a compatibility alias exists at piglets/pig-bolt/pig-aot.yaml and the aot runtime slot and PIG_AOT_* variables remain). Updating installs Pi-Bolt 1.1.2 and rebuilds cached images. Retired deepseek-v3.2 and deepseek-v4-flash are removed from Qwen Token Plan Team providers; use deepseek-v4-flash-0731 or deepseek-v4.1-flash.

Known differences

Every intentional difference between PiG and Pi is tracked as a numbered divergence record in docs/parity/DIVERGENCES.md, with one file per record under docs/parity/divergences/. This release adds new records (including D614 for extension views, D651 for atomic state writes, D652 for compaction progress, D660 for unknown context windows and D661 for external SIGTSTP re-arm): 77 added, 4 deleted and 113 modified divergence files since v0.7.0 (215 files total under docs/parity/divergences/, 212 active approved records bound to their text). Parity inventories at Pi 1.6.0: 1,035 upstream test files (1,026 ported, 0 partial, 0 pending), 15,360 semantic interfaces closed (0 gaps) and 261 behavior contracts (55 ported input handlers).

Known issues deferred to 0.8.1:

  • RPC extension UI reply order: an RPC client can rarely receive a Node extension's UI notification before the reply of the command that triggered it (present since 0.7.0; fix queued for 0.8.1).
  • Extension-installed editor slash completion: with an extension that installs its own editor, a slash command typed and entered before its completion menu catches up (typically a few milliseconds when idle, up to hundreds of milliseconds under load) can be submitted with a stale completion applied (for example /new sent as /nname); the text goes to the model and the command does not run (present since 0.3.0; fix queued for 0.8.1).

Full changelog

See CHANGELOG.md (0.8.0 section).