Repository navigation
PiG 0.8.0
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 --listenfor multi-session RPC in one process) and reported #522, where picking a model from an extension-registered provider after/newbuilt a bare model with context window 0 and no thinking. - @eaxeax reported #516 (hang when a Node extension with a
prepareLoadouttool registers a tool after loading or callssetActiveTools) and #517 (process.execArgvexposing 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> --sourceleft 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_updatehandlers (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,/cloneor/forkin 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, extensionsetModeland post-login selection now build from the new session's registry. - #517. Node extensions saw PiG's own loader (
--import .../register-loader.mjs) inprocess.execArgv, so a child forked under Node's--permission(--allow-fs-read) failed withERR_ACCESS_DENIED. PiG now starts Node extension processes through a bootstrap file that registers the loader inside the process, leavingprocess.execArgvclean as in Pi. - #516. A Node extension with a
prepareLoadouttool hung PiG when it (or another extension in the same process) registered a tool after loading or calledsetActiveToolsfollowed by a synchronous API. The same class of hang affected Go, Python and Lisp extensions callingregisterTool,setToolRenderersortoolPromptSnippet. TheprepareLoadouthook 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 withautocomplete 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 withsuspended (tty input)on the next key press (or stallingbash -i). Bash shells, MCP stdio servers and Chord workers now start in their own session (setsid, as in Pi'sdetached: true), while still leading their own process group for clean teardown. - #417.
pig piglet remove <name> --sourceleft prompt files copied bypig piglet addbehind, so re-adding an edited Piglet of the same name failed with a content conflict.pig piglet addnow records copied files and their SHA-256 digests in<name>.files.json, andremove --sourcedeletes unchanged files that no other registered Piglet references. - #429 (in part). Host allocations for a streamed
message_updatehanded 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) onopenai,azureandopenai-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) onanthropic, addsqwen-token-plan-individual-cn,deepseek-v4.1-flashandqwen4-max-previewon 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,forkandclonenow emitsession_startonce (aftersession_shutdownof the old session) instead of twice, andSession.Reloademitssession_startto extensions as in Pi. Extensionpi.eventshandler 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.RenderandBox.Renderreturn 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
developerinput item, keeps its prompt cache across mid-conversation thinking-level changes (configuration_updateitems, including switching tooff), 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-completionsnow defaults to thesysteminstruction role on non-OpenAI hosts (withcompat.supportsDeveloperRoleto override) and omits empty"tools": []by default (withcompat.requiresToolsWithToolHistoryfor proxies that need it). Azure OpenAI Responses base URLs that already contain/responses?api-version=...(and OpenAIbaseURLvalues with query strings or fragments, matchingopenai7.59.0) reach the endpoint cleanly. Custom models inmodels.jsonunder a built-in provider inherit composedapiandbaseUrldefaults. GitHub Copilot sendsreasoning_effortfor chat-completions effort models and explicitstrictfor both Responses and Claude tools; llama.cpp decision classifiers receive images; Mistral tool definitions default tostrict: false. - CLI and terminal. Adds
pig auth login [provider]andpig auth logout [provider]. Prints thepig --resumecommand on its own line on exit, keeps selection across cursor keys in selector search and picks the best match in/login//logoutsearch, 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 externalkill -TSTP,fgre-arms raw mode, paste, keyboard, mouse and screen modes and redraws (D661;bgparks untilfg).cacheWarmingnow 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), andterminal.framePacing: "adaptive"is available opt-in. - Security and state safety. Unknown
apinames 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 withinsecure: falserestores TLS verification across all request routes, and amodels.jsoninsecure: trueopt-in no longer carries over to a differentbaseUrl. 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.jsonlocks follow symlinks to the real file, and quitting waits for an in-flight OAuth refresh to save. Bundledundiciis updated to 8.12.4,gorilla/websocketpast GO-2026-6278,klauspost/compressto 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,paneltabs anddialogoverlays when a Piglet setsviewClient: terminal, as PiG Standard does; F6 focuses a panel, Escape returns to the editor) and in a browser. Views supportimagenodes (kitty, Ghostty, iTerm2 and half-block fallback including tmux) and calendar-stylegridnodes. Stock PiG attaches no view client and refuses mounts withunsupported. - Wire carrier and reference web client. RPC mode carries views over
ui_view_*commands on stdin/stdout and--listenconnections (docs/ui-view-carrier.md). WithviewClient: terminalandviewEndpoint: 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 thepigbinary) provides a reference web client andbridge.mjs --connect <socket>./reloadandctx.reload()end reloaded extensions' mounts cleanly (broken,owner_gone). Seepig docs show ui-views. setModeltakes a model object. Across all SDKs, extensionsetModelnow preserves the model object passed (context window, limits, base URL, API, compat, headers) instead of looking up onlyproviderandid.- Child session parity and surfaces. Go, Rust, Python and Lisp extensions gain the remaining
AgentSessionmembers on child sessions fromcreateAgentSession(live reads, mutations and awaited operations).registerMarkdownTransformeraccepts{ messageTypes }across all SDKs so transformers can targetuser,assistant,assistant-thinking,custom,summaryandchangelogsurfaces. - Scaffolding, reload and child cleanup.
pig extension init <path> --lang nodescaffolds a TypeScript extension. Piglet Binaries supportbuild.fusedReload: sourceto 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 (Pi473515f9c). Upgrades the native SQLite engine tomodernc.org/sqlitev1.62.0 and opens Durable SQLite connections in multi-thread mode (SQLITE_OPEN_NOMUTEX). Fixes a race inSessionImpl.Parkso 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 withexamples/chord-todo. Fixeschord/syncso toggling a store's outbox off and on again continues from a new archive slot (Pif472efdc1), closes the archive body on a failedImportStoreduringPullSession(Pi434dc5e4d), 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-extensionsto share them. - Release archives and
pig-bolt. Releases now publishpig-standard-<version>-<os>-<arch>and flatpig-acp-<version>-<os>-<arch>(built from@pi-in-go/pigpen-acp0.2.3) archives for linux, darwin and windows on amd64 and arm64. The experimentalpig-aotPiglet is renamed topig-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,928bytes (v0.7.0 was69,218,464bytes,6,209,536bytes smaller)linux/arm64:58,458,272bytes (v0.7.0 was64,553,120bytes)darwin/arm64:60,249,282bytes (v0.7.0 was66,391,074bytes)windows/amd64:64,714,752bytes (v0.7.0 was70,961,152bytes)
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.modandgo.workmoved from 1.26.0 to 1.27.0 forencoding/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 bareprovider/idstring insetModel(setModel: model must be a model object). In Go,ctx.SetModel("provider/id")becomesctx.SetModelNamed("provider/id"), andctx.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.BuildModelandcoding.ResolveModelScope.coding.BuildModel("provider/id", services)now returnsModel not found: provider/idfor an unlisted id; usecoding.BuildFallbackModelfor a custom id.coding.ResolveModelScopeis removed; usecoding.ResolveModelScopeWithDiagnosticsand report itsDiagnostics.waitForIdleis command-only. Callingctx.waitForIdleoutside a command handler orwithSessioncallback is now refused (Node throwsTypeError; Go, Python, Rust and Lisp returnnot_a_command_context), including when the session is idle (such as insession_start). Move the wait to a command handler or react inagent_settled.context_editdrafts. Inturn_endandagent_before_settlehandlers, writereplacement: nullexplicitly when omitting an entry; acontext_editdraft without thereplacementmember is now refused as in Pi.- Go extension SDK types and methods.
MessageRenderOptionsandEntryRenderOptionsare no longer comparable (each gains aStatemap); compare individual fields or usereflect.DeepEqual.(*Extension).MarkdownTransformernow 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()(andsubprocess.EnableEditorViews()for editors) before building a view (pigcalls both). Callers or providers implementingextension.NativeProvider.ResolveAuthmust update its signature tofunc(ctx, ai.CredentialStore, ai.AuthResolutionOverrides) (*ai.AuthResult, error). - Cached render slices (TUI). In Node extensions,
render()returnsreadonly string[]andContainerreturns a cached array while children are unchanged; copy before mutating. In Go,Container.RenderandBox.Renderreturn a borrowed read-only slice; copy withslices.Clonebefore 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/hostand root-package replicated state (NewReplicatedState,AttachReplicatedStateSource,ReplicatedState) are removed; usechord/next/*andchord/nextnode. In the Chord app kit,StartServernow returns once listening andNewWebSurface/NewTuiSurfacereturn before building (wait onBuilt()orApp.BasesBuilt()). Chord app kit sessions are renamed to sign-ins (app.Sessionstoapp.SignIns,SessionInfotoSignInInfo, etc.) with no migration, so browsers and paired devices must sign in or pair again. pig --versionandPIG_VERSION_FORMAT.pig --versionandpig -vnow print Pi's version (matchingpi --version), andPIG_VERSION_FORMATis removed. PiG's own release version is printed bypig version. If you use a customselfUpdateCommand(PIG_SELF_UPDATE_COMMANDorPI_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-boltrename and Qwen retired models.pig-aotis renamed topig-bolt(piglets/pig-bolt, command/bolt-runtime; a compatibility alias exists atpiglets/pig-bolt/pig-aot.yamland theaotruntime slot andPIG_AOT_*variables remain). Updating installs Pi-Bolt 1.1.2 and rebuilds cached images. Retireddeepseek-v3.2anddeepseek-v4-flashare removed from Qwen Token Plan Team providers; usedeepseek-v4-flash-0731ordeepseek-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
/newsent 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).