Release v2.0.47 of pig. Install via composer global require pigagent/pig:2.0.47 or view on GitHub.
Changed
Changed /model to list unloaded llama.cpp models from the Hugging Face cache and --models-dir, not only presets, when the router loads models on demand; an unloaded model's context window is the one it was trained with, context_length, where it was 128000 (upstream #12730, #12736).
Changed tui.editor.deleteCharBackward and tui.editor.deleteCharForward to include shift+backspace and shift+delete in their defaults, in place of the editor's hard-coded handling, so text fields and the /tree search delete with them too and they can be rebound (upstream #12740).
Fixed
Fixed /login llama.cpp saying no models were loaded before the model list had been fetched: like a provider whose default model is not in the catalogue yet, the model is chosen once the refresh is done, unless one was chosen meanwhile, and the guidance points to /model when there are models (upstream #12730).
Fixed @ file completion passing a query that starts with - to fd as an option: @-test showed nothing, and @-u or @--no-ignore listed files .gitignore hides. A file name starting with - that fd prints as ./-name is offered as -name (upstream #12719).
Fixed a FiberError: Cannot resume a fiber that is not suspended thrown from an unrelated moment of a long-running pig: when PHP destroyed an abandoned, suspended fiber, an await in one of its finally blocks left its callback on the future, which later resumed the ended fiber. Future::await() now resumes only while that await is still waiting.
Release v2.0.46 of pig. Install via composer global require pigagent/pig:2.0.46 or view on GitHub.
New Features
A package's own command: pig … — a package declares "cli": {"vless": "./cli/vless.php"} under extra.pig in its composer.json, and pig vless start -d runs that file with the arguments after the name and a Pig\CodingAgent\Cli\CliContext (where it was typed, the pig that ran it, and daemon() for a pid file and a log of its own). Found from the packages' manifests alone, so no extension factory runs to look; pig's own subcommands come first, and a project's packages count only once the project is trusted. A word no package declares is the start of a message, as before. pig --help lists it.
Program resume (OSC 7577) — in terminals that set OSC7577_TOKEN, interactive mode reports the command that brings the session back after the terminal restarts: pig --session , plus --agent-dir / --session-dir when not the default and the restriction and resource flags as typed. It is cleared when you quit and kept when the terminal ends pig; pig removes the token from every child's environment (upstream #12557, #12602).
MCP 2026-07-28, the stateless revision — pig still opens every connection with initialize, so existing servers work as before; a server that rejects it is spoken to with 2026-07-28 (server/discover, _meta on every request, Mcp-Method / Mcp-Name / Mcp-Param-* headers, input_required rounds, tool-list changes followed with subscriptions/listen). "protocol": "2026-07-28" in mcp.json uses it with servers that speak both; see docs/mcp.md#protocol-versions (upstream #12652).
Changed
Changed OpenRouter's chat-completions image API from openrouter-images to openrouter-chat-images (ImageApi::OpenRouterChatImages, Providers\OpenRouterChatImages); openrouter-images now names OpenRouter's POST /images endpoint. A model in models.json or an extension that says openrouter-images for a chat-completions image model now goes to /images. A list saved in models-store.json before the rename is rewritten on restore, as upstream does (upstream 9a815637, a523974e).
Changed OpenRouter's image requests to go through Providers\JsonRequest::post(), upstream's postJsonRequest(), instead of the openai SDK's request: no Stainless headers or SDK default timeout, and a refusal reads : (upstream 47396cfb, 7c6aa911).
Changed an empty OpenRouter stop to be retried only when its native_finish_reason is MALFORMED_RESPONSE, instead of keeping a copy of OpenRouter's unpublished list of clean stop reasons; OTHER, SAFETY and the rest end the turn as stop with the raw reason recorded (upstream 4bd98dd6).
The shared HTTP stack now schedules socket readiness, timers and Future completions through Pig\Async\Scheduler; an embedding host can supply its own scheduler before use without running a second event loop. Pig keeps its existing native loop and remains dependency-free.
Changed pig web start -d's double fork, pid file and stop into Pig\CodingAgent\Cli\Daemon, which a package's command uses through CliContext::daemon(); pig web behaves as before (web.pid, web.log). Its --host / --port reading is Daemon::hostAndPort(), so a package's command takes them the same way.
Changed chat completions to send reasoning models' system messages as system everywhere except OpenAI's own API; Groq's Qwen answered developer with a 400. supportsDeveloperRole still overrides (upstream #12134).
Changed Mistral to send tools non-strict unless the model's compat sets supportsStrictMode; Mistral Large 4 stalled for minutes before strict tool calls (upstream #12148).
Changed the Codex system prompt to go out as the leading developer input item instead of top-level instructions, so GPT-6.2 can serve it from the prompt cache (upstream #12273).
Changed ant-ling to load its models from models.dev (bailing), replacing Ling/Ring 2.6 with Ling 3.x; thinking is off or high, it uses the deepseek thinking format, thinkingFormat: "ant-ling" in models.json stays as a deprecated alias of deepseek, and the default is Ling-3.1-flash (upstream #11800, 1e7bc721).
Changed the default models for Mistral (mistral-medium-latest) and Cloudflare Workers AI / AI Gateway (@cf/zai-org/glm-5.3), whose old defaults left the catalogue (upstream #12449, #12552).
Changed the Qwen Token Plan providers to the current gateways, skipping models models.dev marks deprecated; the Individual plan lists its current models, including qwen4-max (upstream #12112, #12552).
Changed find path patterns to be relative to the search directory (src//*.ts no longer matches through a parent directory named src; /src/*.ts matches at any depth), and an all-lower-case pattern stays case-insensitive whatever the search path's case (upstream #12116).
Changed the built-in default model to claude-opus-5-5, upstream's Anthropic default: models.dev no longer lists claude-sonnet-4-5 on anthropic, so a fresh session resolved to cloudflare-ai-gateway/claude-sonnet-4-5.
Changed the openai, azure and openai-codex default model to gpt-6.2-sol, and the opencode default to kimi-k3.1-pro, because models.dev no longer lists kimi-k2.7-code there (upstream e56d35ce).
Changed GitHub Copilot to keep the prompt cache across thinking-level and tool changes: Claude 5.x models send effort and tool changes inside the conversation and have Anthropic's cache lifetimes, so they are cache-warmed; GPT-6 models send configuration_update items; GPT-5.3 Codex and the MAI-Code models receive mid-conversation system messages in place (upstream #12539).
Changed GitHub Copilot's Claude models to send strict tools, as direct Anthropic does (upstream #12332).
Changed Gemini 3+ detection to read gemini-N anywhere in the model id, so prefixed ids such as vendor-gemini-4-argon get strict tools, tool-call ids and images inside tool results; compat.supportsStrictMode on google-generative-ai / google-vertex models overrides it (upstream #12371).
Breaking: removed the enableInstallTelemetry setting, its /settings row and PIG_TELEMETRY, following upstream's removal of telemetry. pig never sent install reports; the switch only turned the provider attribution headers off, and OpenRouter, NVIDIA NIM and OpenCode are now always told pig is calling, as upstream does. A settings.json that still has the key loads as before.
Removed the first-run setup screen: upstream's now only asks for analytics consent and defaults the theme to system, and pig collects nothing, so pig starts straight away with the system theme until one is chosen.
Changed showCacheMissNotices into one setting per transcript notice — notices.cacheMisses, notices.cacheWarming, notices.compactionCosts, notices.reasoningDrops, all off by default, under Notices in /settings; an existing showCacheMissNotices value carries over to all four (upstream #12497).
Changed key hints to name the configured keys instead of a fixed Enter/Esc/Tab or "Press esc": the settings and theme submenus, /resume rename and empty state, the "still working" warnings (upstream #12518, #12541).
Changed onResponse and after_provider_response to fire for HTTP error responses and for each retried attempt too, on OpenAI Completions/Responses, Azure, Anthropic, Gemini, Vertex, OpenRouter images and the classifiers; classifiers report a response before reading its body (upstream #12502).
Changed the Qwen Token Plan keys to one variable per plan — QWEN_TOKEN_PLAN_TEAM_API_KEY, QWEN_TOKEN_PLAN_TEAM_CN_API_KEY, QWEN_TOKEN_PLAN_INDIVIDUAL_API_KEY, QWEN_TOKEN_PLAN_INDIVIDUAL_CN_API_KEY, with the shared variables as a fallback; qwen-token-plan and -cn are named "Qwen Token Plan Team" and "Qwen Token Plan Team CN" (upstream #12112).
Changed Mistral's finish_reason: error to read "Provider stopped with: error"; the retry classifier, not the message, makes it retryable (upstream 4f3d2be9).
Changed a Gemini or Vertex stream that ends without a finish reason to say how many chunks it received (upstream #12357).
Changed OpenRouter image generation to stay without automatic retries unless maxRetries is set, because each completed image is billed (upstream 47396cfb).
Changed Pig\Mcp\Transports\McpTransport::send() to take an array $headers argument, and the interface gains sendsHeaders(); a transport extending TransportEvents only needs the new send() signature.
Changed codemode type errors to name JavaScript's types, as upstream does ("got a number", was "got a int").
Added
Added the openrouter-images API, OpenRouter's POST /images, for the image models OpenRouter does not serve on /chat/completions (FLUX, Seedream, Recraft, GPT Image and most others); the prompt is the text parts, images go as input_references, aspectRatio and size as aspect_ratio and resolution. The catalogue puts a model on it when OpenRouter lists only that endpoint for it: 57 of the 71 image models (upstream c80b089f).
Added a JSON Schema for mcp.json, published at https://pigagent.dev/schemas/mcp.schema.json: name it in the file's $schema and an editor completes it and flags a mistyped field, which the loader keeps without a word. pig's has no auth field and no project override entries, which pig's MCP does not read (upstream #12563).
Added compat.supportsReasoningReplay for bedrock-converse-stream, false for Bedrock's Kimi K3 models, which AWS documents as failing with InternalServerException when earlier reasoning is sent back (upstream #12555).
Added GPT-6.2 Astra and GPT-6.2 Sol on openai, azure and openai-codex (long-context pricing tier, tool search, mid-conversation effort, no off); Azure serves 1.05M, Codex 500K (Sol) and 272K (Astra) (upstream e56d35ce, cead615b).
Added the gpt-6-luna-decisions classifier for GitHub Copilot, at the account's /v1/decisions (upstream #12495).
Added --agent-dir , the command-line form of PIG_CODING_AGENT_DIR; it works with subcommands and is carried in the resume command (upstream #12595).
Added aspectRatio and size image generation options, sent as OpenRouter's image_config; codemode's $models->generateImages() takes them as an optional third argument (upstream #12586).
Added reasoning and imageOutput token counts to image usage, and responseId to System One classifier results (upstream a512c3fe, d02145c4, bff71c70).
Added openai_input_transformations diagnostics on OpenAI, Azure and Codex Responses, listing replayed reasoning items the API withheld and why, and the transcript notice "OpenAI dropped N reasoning items: " under notices.reasoningDrops; the Anthropic notice names its reasons too (upstream 03de604b).
Added a blockedKind argument to $ctx->ui->select(), confirm() and input(), the kind of blocked program status (OSC 7501) the dialog reports; the project trust prompt reports permission, at startup and in session, and the "session folder missing" prompt reports blocked too (upstream #12487, #12490).
Added fullOutputError / full_output_error to bash results: when the full output cannot be saved (full disk, quota, unwritable directory) the result says "Could not save the full output: …" instead of a PHP warning, and the partial file is removed (upstream #12452, #12461).
Added NODE_EXTRA_CA_CERTS, read as Node reads it: a PEM file of certificate authorities trusted in addition to the system's, for a company's proxy or a private CA (Pig\Async\Socket::useExtraCaFile(), TlsRoots). PHP takes one file of authorities and trusts only what it holds, so pig writes the system's and the extra ones together to a temporary file, once, and removes it on exit. A file that cannot be used is named in a warning and ignored.
Fixed
Fixed pig staying alive and unreachable when its terminal goes away without a signal (a revoked tty, an orphaned background job, a closed SSH channel): a read or write failing with EIO, EPIPE, ENOTCONN or ENOTTY, or the input ending, now settles the session — the aborted turn saved, session_shutdown emitted — without writing to the terminal, and exits with 129 after at most 5 seconds. The next start says pig exited on … because its terminal went away (write EPIPE). Use /resume to continue that session. A hung-up terminal used to spin the loop reading nothing (upstream #12317).
Fixed SIGTERM and SIGHUP ending interactive mode at once, so session_shutdown never ran and extensions' processes were left behind; they shut down the way a quit does, the session first and then the terminal, and keep the resume command (upstream #5080).
Fixed automatic retry missing three transient errors: a gateway's upstream_error: upstream SSE stream failed (upstream #12605), Bedrock's token throttle Throttling error: Too many tokens, please wait before trying again. (upstream #12573), and Gemini's Provider stopped with: MALFORMED_RESPONSE on the native Google and Vertex APIs (upstream #12622).
Fixed OpenCode Go's 48 MiB request limit (HTTP 400 decoded body exceeds 50331648 bytes) being retried as a transient error until the retries ran out, and every later prompt failing the same way; it is a context overflow now, so the session compacts and goes on (upstream #12625).
Fixed Google thought signatures in URL-safe base64, which some Gemini-compatible hosts return, being dropped on replay, so every follow-up to a tool call was a 400 INVALID_ARGUMENT on Gemini 3 (upstream #12637).
Fixed quotes losing their colour after a list bullet or an inline span on the same line, and taking the message's default colour for their text, LaTeX blocks included: a quote's children now render in the quote's style, as upstream's (upstream #12663).
Fixed prefilled inputs (/model , /login , session rename, /tree labels, an extension's input() with a value) putting the cursor before the text, so /model son then net searched netson; Input::setValue() puts it after the value, is one undo step, and ends the typing, kill or yank before it (upstream #12676, 1baa4244).
Fixed /tree summaries leaving out the message picked when going back to something typed: it leaves the conversation and goes back to the editor, so it is summarised with the rest of the branch, and session_before_tree gets it in entriesToSummarize with its parent as commonAncestorId (upstream #12576).
Fixed two prompts reaching an idle session together — released from an async input handler — both starting a run, the second failing with "Agent is already processing" after before_agent_start ran; it is queued into the first run by its streamingBehavior, or refused without one (upstream #12186).
Fixed the resume command (on exit and OSC 7577) giving the session's ID for a file opened from outside the session directory, which --session cannot find; it gives the file's path (upstream 9063e9d1).
Fixed SSE streams rescanning an incomplete line on every chunk, which made a large event take time quadratic in its size (a 4 MiB line took about 9 s, now about 0.02 s). A CR at the end of a chunk now ends its line at once, so CR-only events on an open stream are no longer held back (upstream #12451).
Fixed the MCP Streamable HTTP size limit measuring each network chunk instead of the SSE event, so an event arriving in many small chunks could grow without bound; a stream that ends without a final blank line still delivers its last event, and a failed stream is closed (upstream #12451).
Fixed MCP Streamable HTTP treating an SSE response that echoes the request id as a string ("1" for 1) as unanswered, which resumed with GET and then failed a request that had been answered (upstream #12430).
Fixed more temporary provider failures not being retried: "rate increased too quickly" (upstream #12434), finish_reason: "error" and OpenRouter empty responses (#12455), admission-ceiling timeouts, Anthropic api_error events, "repeat the request later", gateway provider-unavailable and partial-response errors (#12352), Cloudflare 525 and bare socket codes such as read ECONNRESET (#12136).
Fixed a Codex WebSocket turn failing when the server's 60-minute connection limit hit mid-response: the error is retried on a fresh connection, and cached connections rotate after 45 minutes instead of 55 (upstream #12229).
Fixed GPT-6.2 dropping earlier reasoning as prefix_mismatch: replayed function_call and custom_tool_call items now carry status: "completed" (upstream #12367).
Fixed OpenRouter/Bifrost reasoning_details: a signature-only reasoning.text delta is no longer dropped and entries with a different index no longer merge, so Claude's signed reasoning replays intact (upstream a9ee7a35).
Fixed GitHub Copilot reasoning_opaque on chat completions being lost: it is stored with the thinking block and sent back with its reasoning text, or alone (upstream #12505).
Fixed an OpenRouter turn ending silently when only reasoning streamed and finish_reason: "stop" hid a failing native_finish_reason: that is now an "OpenRouter returned an empty response" error and is retried; the native reason is recorded in the raw stop reason and in error text (upstream ddf5868d, 9b911b40).
Fixed Gemini 4 Hydrogen/Neon xhigh failing before the request: it is sent as XHIGH, budget models give it the high budget, and Vertex Gemini 2.5 Flash-Lite gets Flash-Lite's budgets (upstream 001ffff3).
Fixed HTTP 400 with thinking off on Claude Sonnet 5.5 through GitHub Copilot, and Opus/Sonnet 5.5 through Cloudflare AI Gateway, Vercel AI Gateway, OpenCode and Amazon Bedrock: whether a Claude can turn thinking off now comes from Anthropic's own models.dev entry, for every host (upstream #12489).
Fixed GitHub Copilot Responses models sending tools without strict, which Copilot treats as strict and then fills omitted optional arguments (upstream #12329).
Fixed Workers AI GPT-OSS 120B/20B, Granite 4.0 H Micro and Llama 3.3 70B rejecting replayed tool-only assistant turns; they now get requiresNonNullAssistantContent (upstream b8be10a7).
Fixed Bedrock Kimi K3.1 and GLM 5.3 ignoring the selected thinking level: they offer models.dev's effort levels and send them as reasoning_effort (upstream #12551).
Fixed the catalogue still listing shut-down Groq models, the hand-added mistral/mistral-medium-3.5 and gpt-5-chat-latest (upstream #12453, #12450).
Fixed bash output that ended in a line over 50KB followed by a blank line, or a short line followed by one long line, showing "(no output)" or only newlines; the end of that line is now shown and the notice names that line (upstream #12355, #12092).
Fixed !! command output counting toward the context token estimate, which could start compaction early and keep less history (upstream #12592).
Fixed tool calls still running after an abort mid-batch, extensions' permission prompts included; each remaining call is answered with "Operation aborted" without running (upstream 4438c58b).
Fixed Enter on an autocomplete menu sending the prompt when the completion started with /, such as a Tab path menu (look at /tmp/fi) or a slash command argument; Enter now submits only from the command name menu (upstream #12312).
Fixed the regular screen clearing the scrollback whenever an appended Kitty image reached past the bottom; it falls back to a full redraw only for an image taller than the screen (upstream #12597).
Fixed Kitty images disappearing in Konsole: image IDs now fit a signed 32-bit integer (upstream #12596).
Fixed Markdown shown raw after an unclosed currency $ (Costs +$50 for this): an unclosed $ before a digit, or across a line break, is no longer a formula still streaming (upstream #12472).
Fixed copies on Wayland being dropped by Klipper when the text looked like code: wl-copy is told the text is text/plain (upstream #12446).
Fixed /llama → "Download model…" downloading the typed owner/repository after the selection had moved to another result (upstream #12537).
Fixed changing the thinking level on openai-codex GPT-6 models invalidating the prompt cache: changes are configuration_update items, and off is sent as effort none (upstream fcc33744).
Fixed openai-codex ignoring maxTokens: it is sent as max_output_tokens (at least 16) unless compat.supportsMaxOutputTokens is false (upstream fcc33744).
Fixed Azure listing GPT-6 and GPT-6.1 with a 272K window instead of 1.05M.
Fixed GitHub Copilot Gemini and Kimi models never receiving the thinking level, and their reasoning tokens always counting as 0 (upstream #12110).
Fixed GitHub Copilot listing classifier models the account cannot use, such as microsoft-decision-1 on plans without it: after /login or the next token refresh, only the decision models in the account's Copilot catalogue are listed (upstream #12495).
Fixed errors containing request_too_large inside a longer identifier (plugin_request_too_large) being treated as context overflow and sent into compact-and-retry (upstream #12438).
Fixed non-strict Anthropic tool schemas dropping a root additionalProperties and the declared $schema dialect (upstream #12100, 4245b07b).
Fixed Gemini's CONTINUATION finish reason ending the turn as an error instead of length (upstream f72f799a).
Fixed /login, /logout, /scoped-models, /resume and /settings search: typing a query selects the best match instead of the row the cursor was on, and Left/Right/Home/End no longer move the selection (upstream #12246, #12334).
Fixed /copy and RPC get_last_assistant_text returning nothing after a turn that was interrupted, failed or only called tools; they skip such messages and return the previous answer (upstream #12121).
Fixed the bash/powershell truncation notice numbering lines and measuring an over-long line against the ~100KB tail pig keeps in memory instead of the whole output (seq 1 100000 said "Showing lines 15069-17068 of 17068").
Fixed openai-codex starting GPT-6 requests at medium whatever level was selected: requests start at the selected effort and send configuration_update items only when it changes (upstream #12437).
Fixed the OpenAI Codex WebSocket losing its continuation, and resending the whole history, whenever the output token limit shrank as the context grew (upstream b9aae359).
Fixed OpenRouter image output tokens being priced at the text rate, which undercharged by 10x or more and priced image-only models such as FLUX.2 at nothing; they use the model's cost.imageOutput, tiers included, and the count survives the session file (upstream #12586 ccda1f74).
Fixed OpenRouter image generation reporting success when the response had no choices, carried an error, or ended with a finish_reason other than stop; it also uses OpenRouter's billed cost, as the OpenRouter classifiers now do (upstream 596540d4, bff71c70).
Fixed OpenAI Decisions usage counting cached and cache-write input tokens as uncached input (upstream #12358).
Fixed a modelOverrides cost that does not name imageOutput dropping the model's image price.
Fixed /login showing a stored !command API key that does not resolve as configured: it says "stored key did not resolve", and saving the same key runs the command again, so signing in to a secret manager recovers without a restart (upstream #12454, 71356387).
Fixed a session whose model is gone or has no key switching models silently: "Could not restore model x/y. Using a/b" is shown in the chat, or on stderr in print and RPC modes (upstream #12234).
Fixed a $pig->events() handler that throws being only logged: it is reported as that extension's error (events:) in every mode; errors from a handler still running after its session was replaced are dropped (upstream #12233).
Fixed git package commands able to wait on an ssh prompt: ssh runs in batch mode unless GIT_SSH_COMMAND is set, and a failure caused by a credentials prompt says to set up a credential helper or an ssh agent (upstream #12236).
Fixed bash, read, ls, find and grep counting the empty line after a final newline: seq 1 100000 is "of 100000", and a 2,000-line file that ends in a newline is read whole (upstream splitLinesForCounting).
Fixed llama.cpp decision models that read images being sent text only (upstream #12335).
Fixed a Mermaid diagram too wide for the terminal showing its source without saying why: once the message is complete it says how many columns it needs (upstream #12442).
Fixed up-arrow history filling with copies: a repeated prompt moves to the front instead of being added again (upstream #12370).
Fixed an external kill -TSTP leaving the terminal in pig's modes: it is handled like Ctrl+Z while pig's screen owns the terminal (upstream #12283, #12339).
Fixed an overlay over an inline image leaving a hole and covering its own text: the covered image is hidden and comes back when the overlay closes, and images beside an overlay stay (upstream #12109).
Fixed true colour under GNU screen with an inherited COLORTERM: pig uses 256 colours unless TERM ends in -direct; PIG_TRUE_COLOR=1 or terminal.trueColor opts in (upstream d87e3273).
Fixed WSL detection missing a terminal started by a systemd service: WSL_DISTRO_NAME, WSL_INTEROP or WSLENV, else /proc/version, everywhere (upstream #12634).
Fixed right-click in Tabby on Windows pasting twice in fullscreen (upstream #12473).
Fixed URLs over 8192 characters being wrapped in OSC 8 hyperlinks (upstream #12475).
Fixed Alt+Enter (follow-up) ignoring the highlighted completion: a command name is applied and queued, a file or argument completion is only inserted (upstream 27157503).
Fixed an invalid MCP server protocol failing only at connect time: it is rejected when the config is loaded.
Fixed the /bug hint wording: "use /bug to send a report to the developers." (upstream e3c63263).
Release v2.0.45 of pig. Install via composer global require pigagent/pig:2.0.45 or view on GitHub.
Fixed
A file downloaded from pig web (a link to a non-image the agent produced) was saved as file.ext instead of its own name: /api/file named nothing, so the browser took the URL's last segment. The response now carries Content-Disposition with the file's name (filename* for non-ASCII names), images still showing inline (HttpServer::fileHeaders()).
Release v2.0.44 of pig. Install via composer global require pigagent/pig:2.0.44 or view on GitHub.
Fixed
Removing a package from pig web's Packages panel left its panels and its usage source in the page — yw123's tab stayed in Usage — until pig web restart: the server's copy of the extensions was loaded once, at start. A successful install, update or remove now loads it again, as /reload does in the terminal, after forgetting what the previous load registered (HttpServer::reloadExtensions()).
Release v2.0.43 of pig. Install via composer global require pigagent/pig:2.0.43 or view on GitHub.
New Features
Sign in with ChatGPT for the openai provider, as pi has it (OauthProvider::OpenAi, Utils\Oauth\OpenAiChatGpt, upstream's openaiChatGPTOAuth): /login → OpenAI (ChatGPT subscription) signs in through OpenAI's open-source flow, which registers a client of this installation's own instead of borrowing the Codex CLI's, and the openai models then draw on the ChatGPT plan's usage on the OpenAI API. ChatGPT's settings list the client by name, where it can be capped or disconnected; pig names it pig (upstream's hint is Pi), as the developer asked, so ChatGPT shows the app that is signed in. The credential keeps the client id OpenAI issued and the scopes it granted, which every renewal sends back. The existing ChatGPT Plus/Pro sign-in for openai-codex stays as it is.
Added
deviceId in the person's settings.json (Settings::getOrCreateDeviceId(), upstream's): a random UUID made the first time a sign-in needs one — Sign in with ChatGPT sends it as the installation — and never read from a project's settings, so a committed file cannot give every clone the same id. Auth::login() takes upstream's getDeviceId (pig auth login hands it over), and Uuid::v4() makes it.
Changed
The browser-or-paste wait the OpenAI sign-ins share is CallbackServer::waitForCallbackOrManualInput(), where upstream keeps it (callback-server.ts), and a callback server can require the client id a registration issues.
Release v2.0.42 of pig. Install via composer global require pigagent/pig:2.0.42 or view on GitHub.
New Features
A Packages panel in pig web (the header's ⋯ menu, or /packages in the page): the installed packages with their source, what each brings, its git tag or commit and its scope, and Install…, Update, Update all and Remove buttons, like DeepSeek Harness's plugin manager. Two tabs, Installed and Market: the market is the GitHub repositories with the topic pig-package (the list pigagent.dev/packages is built from), most stars first, each with Install, asked of GitHub only when its tab is opened. The buttons run pig install, pig update and pig remove as child processes (Web\PackagesPanel), so the page does exactly what the commands do and a slow clone does not hold it up. Admin-only with several accounts, like every panel.
Added
A tabs block for web panels (WebPanel, panels.js): ['type' => 'tabs', 'tabs' => [['label' => …, 'blocks' => […]], …]], drawn like the SSH workbench's sub-tabs. A lazy section in a tab is fetched when the tab is opened, and the chosen tab survives the redraw after an action.
Changed
Usage looks the same whichever extension reports it. The usual windows get pig's names by their short (5h, wk, mo → 5-hour limit, Weekly limit, Monthly limit; 5 小时额度, 每周额度, 每月额度), where Antigravity said "Five Hour Limit Remaining" and OpenCode Go "Rolling 5h"; a pace estimate is passed as days (UsageMeter::$daysLeft) and worded by pig in the page's language; every group is a card, named or not; the web meter's words leave out the percentage its bar already shows; and the Usage panel has a tab per source, each asked for only when opened. A web panel's meter is now coloured as the terminal's bars are — green from half left, yellow from a fifth, red below — where it was the accent colour until under a fifth; this applies to every panel's meters (classes plenty, low, out).
The web panels test (fixtures/web-panels.mjs) checks a meter on its own rather than pig-antigravity's quota section, which that package's accounts panel no longer draws (it is the Usage panel's); web-panels-blocks.json keeps the accounts half.
The API keys modal's configured list gives every row one height, so a row with a Delete button no longer stands taller than the rows around it; the button is the compact danger one the Packages panel's Remove uses (.key-row).
pig web's ⋯ menu no longer has a separate 🧩 Extensions entry, which only listed the panels to open or move: every panel is already in the ⋯ menu or the sidebar, and next to the new 🧩 Packages entry two 🧩 entries for different things were one too many. A panel now moves between the ⋯ menu and the sidebar from its own window (the button beside Refresh).
pig remove takes back everything the package left in the settings: its packages entry, the packages key once it is empty (upstream keeps []), and its extensions' names in disabledExtensions, which nothing used to clear (PackageManager::removeAndPersist(), Settings::forgetDisabledExtensions()). All of it on the decoded settings, written back with json_encode(); an emptied settings file is {}, not [].
Release v2.0.41 of pig. Install via composer global require pigagent/pig:2.0.41 or view on GitHub.
New Features
Plan usage in one place for every extension: registerUsage() lets an extension report a subscription's limits (5-hour, weekly, monthly…) as groups of meters, and pig draws them — /usage [id] in the terminal, an optional dim line per source in the footer refreshed every few minutes (status: true), and a Usage panel in pig web (the header's ⋯ menu, or /usage in the page). Every bar shows what is left and is coloured by it, in the look /antigravity.usage had, so a second extension's usage no longer needs its own command, status line and panel.
Release v2.0.40 of pig. Install via composer global require pigagent/pig:2.0.40 or view on GitHub.
Added
Added automatic page reload when pig web restart replaces any file under Web/assets/, for standalone desktop and Home Screen PWAs that have no browser refresh button (HttpServer::assetVersion(), network.js). session_bound carries an assetVersion fingerprint of every asset's relative path, modification time, and byte size, and / (index.html) is served with Cache-Control: no-cache alongside /assets/* and /theme.css; when a reconnecting WebSocket receives a fingerprint different from the one the page first bound under, the page calls location.reload() once against the already-listening server, while backend-only restarts and network reconnects keep the same fingerprint and do not reload.
Fixed
Fixed Socket::lookupInChild() attempting to spawn a DNS helper subprocess when PHP_BINARY is empty or proc_open is unavailable in embedded/mobile runtimes, falling back cleanly to gethostbyname().
Release v2.0.39 of pig. Install via composer global require pigagent/pig:2.0.39 or view on GitHub.
Changed
Added a SwiftUI-style spring expand/collapse animation (element.animate() with cubic-bezier(0.32, 0.72, 0, 1), 220ms) to pig web's tool cards that pre-reserves the scroller's bottom headroom before collapsing, so the clicked .tool-header stays pinned at the exact same screen coordinate across every frame while the body smoothly slides open or shut below it.
Release v2.0.38 of pig. Install via composer global require pigagent/pig:2.0.38 or view on GitHub.
Fixed
Fixed pig web pulling the last tool card's title from the top of the screen down to the middle when collapsed near the end of a conversation: collapsing a tall .tool-body near the bottom reduces scrollHeight below scrollTop + clientHeight, causing the browser to clamp scrollTop down by the height difference. ToolCard.toggleExpand() now holds the scroller's bottom headroom (dataset.collapsePad) so scrollTop is not clamped and the clicked .tool-header stays at the exact same screen coordinate (trimmed automatically as the reader scrolls up or new messages arrive).
Release v2.0.37 of pig. Install via composer global require pigagent/pig:2.0.37 or view on GitHub.
Fixed
Fixed pig web jumping a tool card's title from the top of the screen to the middle when collapsed: disabled browser scroll anchoring on .chat-scroll (overflow-anchor: none, which otherwise anchored to the message below the collapsed card) and gated the chat scroller's ResizeObserver so it only auto-scrolls when scrollHeight grows, never when a card shrinks.
Release v2.0.36 of pig. Install via composer global require pigagent/pig:2.0.36 or view on GitHub.
Fixed
Reverted the pig web tool-card expand/collapse changes from 2.0.34–2.0.35 back to the exact 2.0.32 toggle behavior so collapsing a tool card does not shift the scroll position.
Release v2.0.35 of pig. Install via composer global require pigagent/pig:2.0.35 or view on GitHub.
Fixed
Fixed pig web tool cards jumping the page and pulling the clicked .tool-header title down when expanded or collapsed: removed the height transition on .tool-body (which fired the chat scroller's ResizeObserver on every animation frame) and pinned .tool-header's viewport position across ToolCard.setExpanded() so only the body below the title opens or closes.
Release v2.0.34 of pig. Install via composer global require pigagent/pig:2.0.34 or view on GitHub.
Added
Added one-tap copy buttons to pig web's Markdown blocks (.quote-copy-btn, floating at the top-right like .tool-body-copy and always visible on touch screens) and to every user and assistant message (.msg-copy-btn in the message footer beside Translate), so quoted posts and replies can be copied on a phone without dragging text-selection handles.
Changed
Changed pig web's collapsible blocks — tool execution cards (.tool-card, /doctor and /diff included), blocks (.thinking-box, .compaction-box, [skill] cards, .sf-advanced) and schedule confirmation cards (.sc-card) — to animate smoothly on expand and collapse (cubic-bezier(0.16, 1, 0.3, 1) height, padding and opacity transitions, with ToolCard.setExpanded() measuring each card's real content height up to 480px so short outputs do not pause over empty headroom), and wired the Ctrl + O shortcut listed in the HUD to expand or collapse all tool cards in the active conversation.
Release v2.0.33 of pig. Install via composer global require pigagent/pig:2.0.33 or view on GitHub.
Added
Added optional chunked upload progress callbacks on Socket::write() and Request::$onUploadProgress for HTTP/1.1 and HTTP/2 request bodies.
Added Loop::turn(), one iteration of the event loop that never waits — for a host that owns the thread, as a GUI's run loop driving pig's from a timer, where tick() sleeping until the next timer would hold the window still.
Added decompression of gzip responses in HttpClient::send() (InflatedBody): a request that sets accept-encoding: gzip itself reads the body as it was before the server compressed it, chunk by chunk. Requests that do not set the header still go out with identity, so nothing pig sends changes.
Fixed
Fixed pig web on a phone shifting the page up by an extra keyboard height when the on-screen keyboard rises — clipping the header off the top of the screen and leaving a keyboard-tall blank gap between the prompt panel and the keyboard: Chromium 108+ defaults to interactive-widget=resizes-visual (keeping the layout viewport at full screen height and panning visualViewport.offsetTop down by the keyboard height, while body { overflow: hidden } stops window.scrollTo(0, 0) from resetting visualViewport.offsetTop), and on a portrait phone the shrunk body's prompt still fell inside the panned visual viewport so the browser never unpanned it. index.html and login.html now specify interactive-widget=resizes-content, viewport.js offsets body (and fixed drawers/modals) by --app-offset (visualViewport.offsetTop) whenever an on-screen keyboard is open, and the chat scroller's ResizeObserver now watches the scroller itself so shrinking the viewport keeps the bottom of the conversation in view.
Fixed TlsRoots::systemFile() and Socket::enableTls() ignoring SSL_CERT_FILE in the environment when PHP has no openssl.cafile and its default_cert_file does not exist on the machine (a runtime built without a certificate path on a phone, where PHP's ext/openssl passes OpenSSL neither).
Release v2.0.32 of pig. Install via composer global require pigagent/pig:2.0.32 or view on GitHub.
Fixed
Fixed a codemode script getting an array from a tool whose text looked like JSON — $tools->read() of a .json file, a cat package.json — where the description promises a string, so a script that echoed it failed. A tool without an output schema now gives its text as one string, as upstream's toScriptValue() does; a tool with one still gives its structured content.
Fixed a codemode script that returned NAN or INF, or passed one to a tool, failing as "the sandbox exited" or waiting until its timeout: the value went out as an empty line the host skipped. It is now a script error that says which value JSON cannot carry, as store() already said (upstream's #11901).
Fixed codemode's preview of a call's arguments and error being cut through a character, which ended a Chinese argument in a replacement character, and its arguments showing as \u escapes; they are cut where a character ends and keep their text, as upstream's preview does (#7121).
Fixed codemode scripts calling the wrong MCP tool when two names differ only in - and _, such as read-file and read_file: both were the identifier mcp__s__read_file, which ran whichever was registered first. As upstream, MCP tool names replace every character but letters, digits and _ with _ (mcp__my-server__x is now mcp__my_server__x), every tool of a server whose name then collides gets the hash suffix, a server's namespace is mcp__my_server with my-server as an alias, and a server name that differs from another only in - and _ is rejected. A --tools or --exclude-tools pattern that spelled a server name with - must use _ now.
Fixed the mcp_servers prompt section telling the model to find unlisted servers' tools with searchTools(), upstream's JavaScript name; a PHP script calls search_tools().
Release v2.0.31 of pig. Install via composer global require pigagent/pig:2.0.31 or view on GitHub.
Changed
Changed the codemode hint for a quote that closed a string early to name the line PHP stops at. A string run straight into a \ or another string was not counted, so for 'python3 -c '\''... the hint named a later line than PHP did. When the line has a shell's '\'', the hint now also says that is a shell's way to put a ' inside '...', which PHP lacks: told only of one quote, a model moved that command into a nowdoc and wrote the next one with '\'' again.
Changed the codemode tool's description to say that text a tool takes as written — a command, an edit's oldText and newText — goes in a nowdoc, where nothing is escaped and a shell's '\'' is not PHP. Models kept writing such text inside '...' or "..." and failing on its quotes; the description test's limit is 1650 characters now, from 1500.
Release v2.0.30 of pig. Install via composer global require pigagent/pig:2.0.30 or view on GitHub.
Changed
Changed a codemode script's error for a function the sandbox turns off, such as file_get_contents(): PHP calls it undefined, and a model told that gave up as if PHP lacked it. The error now says it is turned off on purpose, so files, commands and the network go through $tools, and names the tools given that do its job — $tools->read(), $tools->edit(), $tools->bash() (DisabledFunction). The disabled list is the same, now in four groups (CodemodeSandbox::FILE_FUNCTIONS and the rest).
Changed the codemode hint for $ name to call it a shell prompt only where it is one, at the start of a line; mid-line (as $ item) it says only that a PHP variable has no space after $.
Release v2.0.29 of pig. Install via composer global require pigagent/pig:2.0.29 or view on GitHub.
Changed
Changed a codemode script's parse error to name two more mistakes PHP words only by their symptom, as the heredoc one already was. A script written as a shell prompt, $ dec_src = ..., got unexpected identifier "dec_src", expecting variable; a " inside a "..." string, as in an edit's oldText, got unexpected identifier "s". Shown those, a model stopped instead of retrying. The error now adds the line and the mistake: no space after $, or the quote that closed the string, with a nowdoc as the way to write text that holds quotes (ShellPromptVariable, QuoteInString).
Release v2.0.28 of pig. Install via composer global require pigagent/pig:2.0.28 or view on GitHub.
Fixed
Fixed pig web on a phone sending the message on Enter, with no way to break a line: an on-screen keyboard has no Shift. Typing on one, Enter now breaks the line and the send button sends; with a hardware keyboard — a desktop's, or an iPad's Magic Keyboard — Enter still sends, as in the terminal.
Fixed a white scrollbar on the right of pig web's message box on Android: on a touch screen one line with its padding is 42px, the box was sized 40px, and a box 2px short of its content scrolls. It now grows to its content and scrolls only past 160px.
Release v2.0.27 of pig. Install via composer global require pigagent/pig:2.0.27 or view on GitHub.
Fixed
Fixed pig web not showing a prompt sent from another device: with the same conversation open on a phone and a laptop, the laptop showed only the agent's answer to what was asked on the phone, never the question. A page used to draw a user message only when it had typed it or when it left the queue; now it draws every one that arrives, except the echo of a prompt it sent itself and already drew. A message an extension sends with sendUserMessage() shows up the same way.
Release v2.0.26 of pig. Install via composer global require pigagent/pig:2.0.26 or view on GitHub.
Changed
Changed a codemode script's parse error to name a heredoc or nowdoc that never closes: PHP reports only what it left open, at the script's last line (Unclosed '[' on line 7), when the mistake was a <<<'NEW' on line 51 closed with OLD,. The error now adds which opening never closes and on which line, so the model fixes that line rather than the brackets.
Fixed
Fixed pig web's tabs sharing one input box: what was typed, the pictures and files attached and the uploads still running now stay with the tab they were added in and come back when it is opened again, and a message that fails to send goes back into its own tab's box even when another is on screen. Up and Down bring back only the prompts of the conversation the tab holds now: when an extension replaces it (newSession(), switchSession()), the history starts over. And a reload no longer changes what Up brings back: each conversation's prompts are kept in the browser (the 30 used most recently; not for a private tab), with the forms the conversation itself does not keep (/skill, @file, !cmd) and those older than the page it loads with.
Release v2.0.25 of pig. Install via composer global require pigagent/pig:2.0.25 or view on GitHub.
Fixed
Fixed pig web's telemetry line wrapping onto a second line and running into the thinking-level selector once it carried the token-speed reading: it is one line now, cut at its end with … as the terminal's footer is cut, with the whole line as its tooltip. The ⚡ reading moved to the end, so a narrow window loses it before the context percentage.
Release v2.0.24 of pig. Install via composer global require pigagent/pig:2.0.24 or view on GitHub.
Fixed
Fixed pig web's retry banner (Retrying in 2s (attempt 1/3)) standing still and staying up after the retry had started — for as long as the retried request took, up to minutes when it hung again, until a reload took it away. It now counts down once a second, the seconds rounded up as the terminal's Retrying (1/3) in 2s... does, and goes when the retry starts, as the terminal's indicator gives way to Working.
Fixed pig web saying it could not reach pig (Cannot read properties of undefined (reading 'level')) and reconnecting for ever on a conversation whose process started before the telemetry line's footer field existed, such as one still running across pig update: its line is now left empty until the process restarts.
Release v2.0.23 of pig. Install via composer global require pigagent/pig:2.0.23 or view on GitHub.
Changed
Changed pig web's telemetry line under the prompt to say what the terminal's footer says, the same way: the ⚡ token-speed reading (tok/s, average, time to first token; off with tokenSpeed.enabled: false), cache reads and writes and the latest cache hit rate (R, W, CH), (sub) on a subscription, (auto) when auto-compaction is on, ? for the context right after a compaction, the context coloured past 70% and 90%, and the terminal's number format (565k, not 565.0k). The page used to build a shorter line of its own; it now draws get_state's new footer (FooterComponent::usage() and TokenSpeed, the terminal's own code), and refreshes it as each answer starts and ends.
Release v2.0.22 of pig. Install via composer global require pigagent/pig:2.0.22 or view on GitHub.
Fixed
Fixed an MCP tool argument sent as an empty object {} reaching the server as []: arguments are PHP arrays once decoded, where the two are one value, so a server that validates (pydantic, zod) refused {"filter": []} for an object parameter. The server's input schema now decides which each empty value was (JsonSchema::objects()), through properties, items, additionalProperties, allOf/anyOf/oneOf and local $refs — for a direct call and a codemode script alike.
Fixed codemode scripts being unable to call a tool named has (or HAS, __call, __construct): $tools->has(...) ran $tools' own has() method, because PHP sends only unknown method names to __call, and method names ignore case. Such a tool is now $tools->has_(...).
Fixed codemode's @options error saying "safe integer", a JavaScript term, for max_output_tokens; it now says "non-negative integer".
Release v2.0.21 of pig. Install via composer global require pigagent/pig:2.0.21 or view on GitHub.
Fixed
Fixed pig web opening the on-screen keyboard automatically on phones and touch screens whenever a conversation, tab, folder picker, session list, terminal drawer or login page was opened: automatic initial focus (autoFocus() in assets/js/utils.js, and login.js) now runs only on desktop viewports with fine pointers, leaving small screens clear until an input is tapped.
Release v2.0.20 of pig. Install via composer global require pigagent/pig:2.0.20 or view on GitHub.
New Features
Web Push for pig web — a turn that finished, a scheduled run that is done, failed or waiting for an answer, now reaches a phone whose page is not open: iOS freezes a page seconds after it is left, so the page could not say it. Once notifications are allowed, the browser is subscribed and the server sends what the page would have shown through the browser's push service, only while no page of that account's is being looked at, so nothing is said twice; a click opens the conversation. Pure PHP over ext-openssl (RFC 8291 encryption, RFC 8292 VAPID), no new package; the key and the subscriptions are kept in ~/.pig/agent/web-push.json (0600). On an iPhone, add pig to the Home Screen first (iOS 16.4+): the page now has a web app manifest for that.
Fixed
Fixed pig web showing no system notification on Android Chrome, over https and with permission granted: Android has no Notification constructor for a page and threw, which the page swallowed. Notifications now go through a service worker (assets/js/sw.js, which controls no page and caches nothing) with showNotification(), and a click still opens the conversation that sent it. A notification with the same title now sounds again on Android (renotify) instead of replacing the last one silently.
Release v2.0.19 of pig. Install via composer global require pigagent/pig:2.0.19 or view on GitHub.
Added
Added Pig\Ai\Http\HttpTransport, the interface HttpClient now implements: every provider, OAuth flow and helper that only sends takes a transport instead of the concrete client, so an extension can wrap its client once to count, limit or log its requests, as upstream wraps fetch. HttpClient stays final; follow() stays on it.
Added /system-prompt, pig's own, to show what the model is given in full: the system prompt as the next request sends it (AgentSession::systemPrompt(), with the skills' descriptions and the context files in it), each tool offered with its description and parameters (type, required or optional), the tools registered and not offered, and every skill with its path, marked when disable-model-invocation keeps it out of the prompt. The web UI answers it with a dialog (with a copy button for the prompt) over RPC's new get_system_prompt.
Added the system prompt to /export's HTML (and /share's, and RPC export_html's), as upstream's export shows it: the conversation's leading system message as a "System Prompt" block with the tools it declares (each with its description and its parameters' types, required or optional), and each later one as "System Prompt Update" naming what it changed (instructions, project_context, -rules, tools +bash -grep) with the tools it added and removed. A long prompt is folded, as long tool output is. A session saved before pig recorded system messages shows the prompt it was exported with; upstream lists that session's tools too, which pig does not hand the export.
Added tool exposure, as upstream's ToolDefinition.exposure: an extension registers a tool direct (the default), model-only, codemode, deferred or hidden, and the session's loadout applies upstream's rules — only direct and model-only tools are activated by registering them, codemode and deferred tools are callable from other tools (codemode scripts, AgentSession::executeTool()) whether active or not and found by tool_search, and hidden ones are never active. ToolDefinition also takes upstream's namespace and outputSchema, $pig->getAllTools() reports exposure and namespace, and prepareLoadout receives a LoadoutView (upstream's ToolLoadout). pig's own toolExposure setting overrides any tool's exposure by name or * pattern ({"toolExposure": {"schedule": "deferred"}}), so the schemas of tools the model rarely needs are left out of every request until tool_search loads them.
Added upstream's warning when MCP tools that are not direct cannot be reached because neither codemode nor tool_search is active.
Added upstream's autoEnableCodemode to mcp.json (beside mcpServers, the project's over the user's): false keeps codemode from being activated for codemode servers. Activation now also runs after a sign-in, a reconnect, a change in /mcp, and an extension's servers changing, as upstream's does.
Added "New custom session" to the web UI's sidebar, in place of "New private session": a dialog chooses a normal or a private session, the built-in tools it starts with (read, bash, edit and write ticked; grep, find and ls not), and which extensions load — every one the conversation on screen loaded, built-ins included; the built-ins start ticked and the rest not. An extension left unticked is not loaded; a ticked one has all its tools on. The page sends names only, which the server checks, so it can take tools and extensions away from a session and never add code to it.
Changed
The system prompt's "Available tools" lists the tools the request declares, as upstream's buildSystemPromptSections() does: one prepareLoadout hides (codemode's) is left out of the list and the guidelines, and the list ends with "Additional tools may be available.", since a tool without a snippet is declared all the same and one behind tool_search or codemode is still callable. A web session with more tools in its panel than in its prompt was this.
Changed the schedule tool to be offered only in the web UI's conversations, and only to create tasks: the schedule is the web server's, so terminal sessions no longer send its schema, and changing, pausing, running and deleting tasks is left to the Scheduled page. Its schema went from eight actions to one, and from twelve parameters to six: the timezone is this machine's and the model and thinking level the defaults, which the Scheduled page changes.
Changed the error Async::run() raises when the loop runs out of work while the root coroutine waits to name where it waits (It is suspended at: …, from ReflectionFiber::getTrace()), so a hang that only one machine sees says what it waited for.
Changed --tools to upstream's rule for MCP tools it keeps without matching them (_isActivatable()): they are declared only once tool_search loads them, so a direct one is no longer declared by pig --tools read,codemode.
Changed tool_search to upstream's: always registered, inactive until an MCP server with deferred exposure or --tools/defaultTools names it, model-only, with upstream's fixed description (it no longer lists the servers, so it does not change as servers connect). It searches every registered codemode or deferred tool that is not active and activates the matches, so a loaded tool is recorded in the session and survives /tree and resume.
Changed MCP tools to be registered with their exposure, as upstream's: a server's codemode and deferred tools are both registered deferred, callable from codemode scripts and loadable by tool_search — a script can now call a deferred tool that was not loaded, and tool_search can load a codemode one. codemode-deferred is read as codemode, as upstream reads it, so such a server's tools are listed in the codemode description by their server only. MCP results carry the whole CallToolResult as structuredContent, which is what a codemode script receives. A resource link names read_mcp_resource whenever that tool reaches the server's resources. Changing a server's exposure in /mcp takes tools that are no longer direct off the model, and activates tools that became direct. The resource tools take codemode exposure when the widest server's is codemode.
Changed the system prompt's opening sentence to upstream's word for word, with pi's name changed to pig's: "You are a coding assistant running inside pig, a coding agent harness. Help users inspect files, run commands, and modify code." It used to leave "running inside …, a coding agent harness" out. Prompt filters written against pi's opener, such as the Antigravity extension's, now recognise pig's as well.
Fixed
The schedule tool's line in the system prompt said its name twice (- schedule: schedule: create a task…): its snippet no longer starts with it.
[Extensions] (the terminal's startup header, and pig web's panel under a new conversation) lists the extensions that loaded, as upstream's does, and no longer every file in the extensions folders: one a setting or a custom session left out (pig-vless unticked) was named as if it had loaded.
An extension unticked in pig web's "New custom session" that belongs to a package leaves the whole package out (ResolvedPaths::withoutPackagesOf()): its skills, prompts and themes no longer reach the conversation without it, as pig-quant's quant skill did.
pig web's "New custom session" dialog opened from a custom session starts at the default again: the extensions that session left out are offered too (get_loaded_resources's new leftOutExtensions), where before they were missing and could not be ticked back on.
Fixed a timer of one event loop being cancelled by an id kept from an earlier one: watcher ids were numbered per loop, so after Loop::reset() an id something still held (a destructor run late by the GC, as PHP 8.5 does) named an unrelated watcher of the new loop. It showed as a coroutine's delay() never waking, in TuiDocsEvalTest on PHP 8.5. Ids are now unique in the process.
Fixed a request failing with Connection closed after the server said GOAWAY after the session had been idle for a while. A server that shuts an idle HTTP/2 connection down gracefully sends GOAWAY and then a PING (RFC 9113 §6.8); the GOAWAY closed the pooled connection, the PING after it was still answered, and writing that answer to the closed connection threw out of the pool's check of whether the connection could be used — failing the next request instead of opening a new connection. Frames after the one that closes the connection are no longer handled, a connection that died while idle is reported as unusable rather than throwing, and a request the server never acted on (the connection closed before it went out, or a GOAWAY said its stream was not processed) is sent once more on a new connection, whatever its method.
Fixed a request that timed out on a pooled HTTP/2 connection which had gone dark (the computer slept, a NAT forgot it) being retried onto the same connection, to wait another whole idle timeout (five minutes by default). A connection on which nothing at all arrived for a whole timeout is no longer handed out: what is in flight on it finishes, and the next request opens a new one.
Fixed a stream the server refused with REFUSED_STREAM not being sent again: RFC 9113 says such a stream was never processed, so it is sent once more on a new connection, as a request a GOAWAY left unprocessed is.
Fixed a HEAD request, and a 204 or 304 response, over HTTP/2 failing with Connection closed after 0 of N promised bytes: their content-length is the length a body would have had, and there is none, as HTTP/1.1 already treated them.
Fixed a request over HTTP/2 waiting until its timeout for room under the server's limit on concurrent streams (SETTINGS_MAX_CONCURRENT_STREAMS) that had already been made: a stream the server had ended still counted against the limit until its body was read, and a stream given up part way (Esc) freed its place without waking the request waiting for it, when that request was the one reading the connection.
Release v2.0.18 of pig. Install via composer global require pigagent/pig:2.0.18 or view on GitHub.
Added
Added eight coding cases under evals/ for php scripts/eval.php — l1-off-by-one, l1-read-and-answer, l2-add-option, l2-find-bug, l2-rename-method, l3-dedupe, l3-no-dependency and l3-root-cause — each checked by its own tests, with the tests' checksum pinned so a run cannot pass by changing them.
Changed
Changed Container, Box and the fullscreen transcript to hand back the rows they drew last when no child's rows changed, as upstream's #11968 renderChildLines(): a frame where the conversation did not change no longer copies every row of it once per level of nesting, and a Box no longer pads and joins its children's rows to check its cache. On a 2,800-message session a keystroke frame went from 28.8ms to 24.5ms. A Container subclass that read the protected $mouseLayout reads $childLines (Pig\Tui\ChildLines) instead.
Changed the resume command printed on exit to its own line after To resume this session:, so it can be selected with a triple-click, as upstream's #12237.
Changed the order of a quit to upstream's: the screen is handed back first, then extensions get session_shutdown, tools are told, and the session is let go of. Letting go suspends, and a frame drawn meanwhile repainted the last screen on the way out.
Changed an HTTP/2 connection to open as Node's fetch does, read off the wire from Node 26: a window of 256 KiB per stream and 512 KiB for the connection (were 8 MiB), and pseudo-headers in the order :authority, :method, :path, :scheme. A stream that delivers more than its opening window, a download, is raised to 8 MiB afterwards, so large downloads keep their speed.
Fixed
Fixed fullscreen scrolling slowing down as the conversation grows, as upstream's #11968: the wheel, page and line keys, top and bottom, prompt jumps and selection auto-scroll now reuse the previous frame's component output instead of rendering the whole transcript again, and slicing a row by columns no longer segments runs of ASCII, CJK, kana, box drawing and other characters that are always a grapheme of their own. The scrollbar, which cuts every row in view, remembers the rows it cut in the frame before. On a 2,800-message session at 198×43 a wheel frame went from 34.5ms to 4.1ms.
Fixed the test certificate's temporary files being removed by every process the suite forks: a WebDaemonTest child removed them on its way out, outside any test, and the run printed NoTestCaseObjectOnCallStackException and two unlink() warnings after passing. Only the process that made them removes them now.
Fixed TuiBase::stop() calling flush() on a terminal that is not a BufferedTerminal, such as a test's virtual terminal.
Fixed scripts/bench-tui.php: it asked for the fullscreen renderer through PIG_TUI_MODE, which nothing reads any more, so it measured regular mode and ran out of memory on a long session; it now passes tuiMode, raises the memory limit as bin/pig does, measures a wheel notch, and waits out the frame throttle between frames instead of counting it, which made every cheap frame read 16ms.
Fixed /quit from fullscreen jumping to the screen pig was started from before the transcript appeared, which on a long conversation was visible for as long as the whole conversation took to render again. The transcript is now rendered first and printed in the same synchronized write that leaves the alternate screen, and flushed before pig exits.
Release v2.0.17 of pig. Install via composer global require pigagent/pig:2.0.17 or view on GitHub.
New Features
HTTP/2 for every https request, and connections kept for the next request, as Node's fetch does. A TLS connection offers h2 and http/1.1; where the server takes h2 the connection joins Pig\Ai\Http\Http2\Http2Pool and every later request to that host — from any provider, and several at once — goes over it, with no new handshake. Through an HTTP or SOCKS5 proxy the tunnel carries it the same way. Otherwise it is HTTP/1.1, and a connection whose response was read to its end waits in Http1Pool (four seconds, or what the server's Keep-Alive: timeout says) for the next request to the same origin, plain http and proxies included; a request that can be repeated is repeated on a new connection if the kept one turns out to be closed. Negotiated, as in Node: a server that does not offer h2 gets HTTP/1.1. Nothing to configure and no new dependency: the framing, HPACK (Huffman included, checked against RFC 7541's examples) and flow control are in packages/ai/src/Http/Http2/.
Added
Added PromptTemplatesDocsEval, upstream's prompt-templates.docs.eval.ts: the model creates a /current-time prompt template for the project or for the user, reload loads it, and invoking it must send exactly the requested prompt — with the template in the requested scope and nothing in the other. The eval harness now loads skills and prompt templates as a session does, at startup and on reload.
Added php scripts/eval.php --audit, upstream's eval:audit: the documentation audit runs on its own switch, since it scans every page.
Changed
Changed a 204, a 304, a response to HEAD and a 1xx to end without a body, whatever their headers say, where the HTTP/1.1 reader waited for the server to close the connection.
Changed Pig\Ai\Http\ResponseBody to an abstract class, with Http1Body and Http2\Http2Body behind it. Pig\Async\Socket::connect() and enableTls() take the protocols to offer (alpnProtocol() says which the server chose), and Socket keeps every await in flight apart, so one coroutine can read a socket while another writes it. Proxy::open() takes the same list.
Changed php scripts/eval.php --host to run the smoke eval only, as upstream's eval:host does; the documentation audit moved to --audit.
Changed the documentation audit to require evidence: a run that did not read the page and at least one file under packages/coding-agent/src fails, whatever its verdict.
Changed Pig\Evals\Report::readTaskObservation() to read only the assertion whose fullName is the task's, so a sibling case in the same suite file no longer turns an observation into errored; classifyCaseStatus() is private, as upstream's is.
Removed the extensions eval's toolLoaded field, which the tool result already proves.
Release v2.0.16 of pig. Install via composer global require pigagent/pig:2.0.16 or view on GitHub.
Fixed
Fixed the web page asking who is logged in on every failed reconnect. With the server gone (its computer asleep, the tunnel down) each retry failed twice, the socket and /api/login/state, and filled the browser's console: 198 lines in half an hour. It is asked once per run of failures, and again when the page is looked at, the network returns, or a connection that was up is lost.
Release v2.0.15 of pig. Install via composer global require pigagent/pig:2.0.15 or view on GitHub.
Changed
Changed what a fullscreen frame draws when the window's width changes: the rows in view are wrapped again at once and the rest of the conversation afterwards, in the background. Dragging the window's edge in a long session was sluggish, because every frame re-wrapped every message and tool call: about 300ms a frame with 1,700 tool calls, where the screen shows fifty rows (upstream pi takes about 800ms on the same session). Such a frame now takes about 20ms whatever the session's length, and a view scrolled up keeps showing the same rows while what is above it is re-wrapped. Regular mode is unchanged.
Release v2.0.14 of pig. Install via composer global require pigagent/pig:2.0.14 or view on GitHub.
Fixed
Fixed a PHP notice printed over the interface during a codemode run: fwrite(): Write of 101 bytes failed with errno=32 Broken pipe in …/CodemodeSandbox.php. When one arm of a script's parallel() failed, the script ended and its process exited while the other arms' tools were still at work; their answers were then written to a pipe nobody read. Such an answer is now dropped quietly, and the run reports the script's own failure as before.
Fixed codemode leaving a script's tool calls running after the script had ended. The tool's description tells the model that "calls still running when the script ends are cancelled", and they were only marked so: a call that one arm of a parallel() had started kept going after another arm failed, and after a timeout, so files could still change once the model had been told the script failed. Every nested call now gets a signal that ends with the script, as upstream's sandbox gives it.
Release v2.0.13 of pig. Install via composer global require pigagent/pig:2.0.13 or view on GitHub.
Added
Added pig's user documentation to the package: docs/*.md is a copy of the site's English pages (php scripts/sync-docs.php, run before each release), so the system prompt's docs section has pages to name on every machine and not only where the site's repository sits beside pig. Asked about pig itself on an installed machine, the model had nothing to read and searched the source.
Added a line of pig's own to the docs section: settings (docs/settings.md), command-line options and which tools are on (docs/cli.md), slash commands, and that every other page is named for its topic.
Fixed
Fixed cli.md saying that naming a built-in extension's tool in --tools or defaultTools does not turn it on, a paragraph above the one on enabling codemode by exactly that: it is true of tool_search only. The page now also documents the schedule tool.
Release v2.0.12 of pig. Install via composer global require pigagent/pig:2.0.12 or view on GitHub.
Added
Added the loaded resources to the web UI's welcome: a new conversation lists its context files, skills, prompt templates and extensions in a panel under its quick-action chips — what the terminal lists under its header at startup as [Context], [Skills], [Prompts] and [Extensions], in the same order (a context file by its path, so the global AGENTS.md and the project's are told apart). A last row lists the conversation's active tools, which is where a built-in extension's tool such as codemode shows as on or off. Behind it is get_loaded_resources, a pig-only RPC command.
Changed
Removed Pig\Evals\Harness::withDocsSection() and documentationSectionText(), a second copy of the docs section that nothing called once the default prompt carried it.
Fixed
Fixed the system prompt's docs section (2.0.10) naming documentation that is not on the machine: pig's user documentation lives in the site's repository, not in the package, so an installed pig was told to read docs/extensions.md and twelve more files that do not exist. The section is now sent only when the documentation is there (PIG_DOCS_DIR, /docs, or the site's checkout beside the repository), and no longer lists docs/codemode.md, a page pig's documentation does not have.
Fixed two SystemMessageTranscriptTest cases that 2.0.10 left failing, and made the suite build the same system prompt on every machine: test/bootstrap.php points PIG_DOCS_DIR at a directory that is not there.
Release v2.0.11 of pig. Install via composer global require pigagent/pig:2.0.11 or view on GitHub.
Changed
Changed the llama.cpp provider's default server address to http://127.0.0.1:9931, llama.cpp's own default port, from :8080 (upstream #12001). A server kept on 8080 is reached by giving that address to /login llama.cpp.
Changed the default for Anthropic message threads to go by endpoint, not by provider id: any provider whose baseUrl is on api.anthropic.com — a second account configured as anthropic-1-api, say — now continues the server-side thread and sends only the new messages; a gateway still needs supportsMessageThreads: true (upstream #11987).
Fixed
Fixed find answering "No files found matching pattern" for a pattern that starts with ./ (./src/*.ts, ./*.json): fd's full paths never contain /./, so the leading ./ is dropped before fd is asked (upstream #12020).
Fixed tools that tool_search had loaded being lost on resume or /reload when an extension registers a loader tool and hides it at session_start: hiding a tool outside the restored loadout no longer drops the MCP tools still waiting for their server; replacing the loadout still does (upstream #11996).
Fixed Kitty images going blank after a fullscreen full redraw (a resize, a theme change): the redraw cleared the screen with ED 2 after deleting the placements, which makes Kitty free the uploaded image data the next placement reuses. Every row is cleared on its own already, so the screen clear is skipped while uploads are held (upstream #12010).
Fixed hard line breaks after an inline image in Markdown being drawn as one row with newlines inside it, which pushed everything below the image out of place (upstream #12017).
Fixed a strict tool whose schema has a node without a type (items: {}, a bare const, an "any" value) being sent strict and refused by OpenAI: with strict: "prefer" it now goes non-strict, with "require" it fails before the request; an enum without a type stays strict (upstream #12049).
Release v2.0.10 of pig. Install via composer global require pigagent/pig:2.0.10 or view on GitHub.
Added
SystemPrompt::sections() now includes the docs routing section (… naming Config::readmePath(), Config::docsPath() and Config::examplesPath()), matching upstream's buildSystemPromptSections().
Added examples/extensions/hello.php and examples/extensions/custom-footer.php (ported from upstream's hello.ts and custom-footer.ts).
Release v2.0.9 of pig. Install via composer global require pigagent/pig:2.0.9 or view on GitHub.
Changed
Pig\Evals\Harness stages an isolated package directory (PIG_PACKAGE_DIR / PIG_DOCS_DIR) for with_docs runs, restricts file tools to the eval sandbox roots via a tool_call guard, keeps the eval session JSONL outside ~/.pig/agent, and shares the host Auth instance across turns so extension providers such as pig-antigravity retain multi-account failover and token refresh.
Fixed
Pig\Evals\Harness read $event->systemPrompt as a property instead of calling $event->systemPrompt() in the before_agent_start prompt-transform handler, and Cli::artifactRunId() called Uuid::v4() instead of Uuid::v7().
Pig\Evals\Evals\TuiDocsEval::inspectContextFooter() initializes the default dark theme before rendering the reference FooterComponent when run standalone from Cli.
Release v2.0.8 of pig. Install via composer global require pigagent/pig:2.0.8 or view on GitHub.
New Features
Behavioral and documentation-lift evaluation harness (packages/evals) — Ported upstream's packages/evals (Pig\Evals\): Plan (plan.ts), Report (report.ts), Harness (harness.ts), Judge, AcmeServer (acme-server.ts), ConfiguredRuntime (configured-runtime.ts), RecordingTerminal, Cli (cli.ts), and the seven eval suites (SmokeEval, DocumentationAuditEval, ExtensionsDocsEval, ModelsDocsEval, OpenAiProviderDocsEval, CustomProviderDocsEval, TuiDocsEval), runnable via php scripts/eval.php --host and php scripts/eval.php --docs.
Added
AgentToolResult::$terminate: returning terminate: true from every tool call in a batch ends the agent loop after the tool results are recorded without starting another model turn, matching upstream's batch early-termination rule.
Config::readmePath(), Config::docsPath(), Config::examplesPath(), and Config::changelogPath().
Auth::apiKey() and ConfiguredApiKeyAuth::resolve() accept request-scoped environment variables (SimpleStreamOptions::$env), forwarded by ModelRegistry::streamSimple().
Fixed
$ctx->ui->setFooter() now replaces the built-in footer while a custom footer is set and restores the built-in footer when cleared or on /reload, and passes the built-in FooterComponent (getGitBranch(), getExtensionStatuses(), getAvailableProviderCount(), onBranchChange()) as the third argument to the factory.
Release v2.0.7 of pig. Install via composer global require pigagent/pig:2.0.7 or view on GitHub.
Changed
pig-vless is no longer bundled with pig: it is the package pig-vless (MIT), installed with pig install git:github.com/owner888/pig-vless — same /vless command, vless.* settings (including vless.wsPath for WebSocket and non-blocking DNS) and disabledExtensions: ["pig-vless"]. pig update removes the old bundled copy and prints the install line.
Release v2.0.6 of pig. Install via composer global require pigagent/pig:2.0.6 or view on GitHub.
Added
pig-vless supports VLESS over WebSocket (vless.wsPath, type=ws&path=…, RFC 6455 binary frames and Sec-WebSocket-Protocol 0-RTT early data) alongside TCP and TLS, and resolves target domain names off the event loop through Pig\Async\Dns.
Release v2.0.5 of pig. Install via composer global require pigagent/pig:2.0.5 or view on GitHub.
New Features
Private sharing on pigagent.dev — /share keeps the session's HTML export on pigagent.dev for 30, 7 or 1 days, encrypted on your machine (AES-256-GCM) with the key only in the link, https://pigagent.dev/s/#: the server holds ciphertext and the page decrypts in the browser. Before anything is sent, /share lists what in the session looks like a key or token — the values in auth.json, credential-named environment variables, the providers' key shapes — to redact, send as it is, or cancel. This is the default (sessionShareDestination: "auto"); "gist" keeps the secret GitHub gist.
Added
/unshare deletes one of this machine's shares from pigagent.dev before it expires. Shares are listed in shares.json in the agent directory, with the token that deletes them (mode 0600).
PIG_SHARE_SERVER points /share at another server with pigagent.dev's share API.
Pig\Async\Loop uses PHP 8.6's native Io\Poll\Context (epoll on Linux, kqueue on macOS and BSD) when running on PHP 8.6+, removing the FD_SETSIZE descriptor cap and the $O(n)$ per-tick scan of stream_select() while keeping stream_select() on PHP 8.3–8.5 and Windows.
Changed
Removed Radius, pi's gateway: the radius provider and its models, RADIUS_API_KEY, the pi-messages API, "Sign in with Radius" in /login and pig auth login, "oauth": "radius" in models.json, and sessionShareDestination: "radius" (read as auto). pig sends nothing to pi's servers. A radius entry pi wrote in auth.json is left alone.
Release v2.0.4 of pig. Install via composer global require pigagent/pig:2.0.4 or view on GitHub.
Fixed
bin/pig lost its executable bit in 2.0.3, so a git checkout updated to it answered permission denied when pig was run. It is executable again, and a test now fails when git records a command listed under bin in composer.json as anything but executable.
Release v2.0.3 of pig. Install via composer global require pigagent/pig:2.0.3 or view on GitHub.
Changed
Antigravity is no longer bundled with pig: it is the package pig-antigravity (MIT), installed with pig install git:github.com/owner888/pig-antigravity — same provider, /login antigravity, linked accounts with failover, /antigravity.* commands, generate_image and google_search tools and web panel. Sign-ins, the stored model catalog and disabledExtensions: ["pig-antigravity"] carry over. pig update removes the old bundled copy and prints the install line. The package's first release is in step with pi-antigravity 0.12.0 (the Antigravity CLI 1.4.0 identity that Gemini 4 Argon is shown to, a model list that is the deployment's own answer, and fixes to google_search, 429s for models not being served, unreachable endpoints and retries that hung); its own changelog has the details.
Video understanding is no longer bundled either: it is the package pig-gemini-video (MIT), installed with pig install git:github.com/owner888/pig-gemini-video — same analyze_video tool, /gemini-video command and geminiVideo.* settings. Its Antigravity route needs the pig-antigravity package; without it, it uses a Gemini API key.
/doctor no longer has a line of its own for Antigravity: a provider a package brings is a row under the sign-ins like any other, and that package has /antigravity.doctor.
The web UI's provider picker no longer prefers antigravity when no provider is chosen yet; it starts on the first one.
Fixed
A session forked into a folder reached through a symbolic link (--fork, or "Fork into …" when a session's own folder has gone) recorded the folder the link leads to, and was filed apart from the other sessions of the folder it was started in; it records the folder as it was named, as pi does and as every other session already did.
A folder of the server could be given to a Docker account although it was the system's, where the system folder is itself a link — /etc on macOS.
Release v2.0.2 of pig. Install via composer global require pigagent/pig:2.0.2 or view on GitHub.
New Features
Mermaid diagrams by lovely-mermaid — Mermaid diagrams are drawn by a port of lovely-mermaid 0.3.3, the renderer pi now uses, instead of grok-mermaid 0.2.3. New: mindmap; composite states (state X { … }, -- regions) as frames; the flowchart @{ shape: … } node syntax and kebab-case ids; sequence activations as a double lifeline; ER and class cardinalities at their own ends of the edge; a short local return arrow for an edge back to the rank above; a frontmatter title: above the diagram; parallel edge labels joined with / . The author's classDef, class and ::: styles colour the nodes (fill, stroke, text, bold) over the theme, and a click/link URL becomes a terminal link on the label where the terminal supports links. Every grammar is lenient now: what parsed is drawn and the rest is listed in the warning line, and a diagram over a size cap draws its beginning. pie, timeline and gitGraph are drawn as upstream draws them instead of pig's own way; journey and kanban stay pig's (upstream #8158).
MCP sign-in without registering a client — MCP sign-in identifies pig with its Client ID Metadata Document, https://pigagent.dev/oauth/client.json, when the authorization server supports documents for public clients, instead of registering a client with every server; elsewhere it registers as before. An authorization server that sends no iss gets a document and callback path of its own (/oauth//client.json, /callback/). oauth.clientRegistration chooses: auto (default), dcr to always register, cimd to always use the document. oauth.clientName sets the registered client's name (default pig) and makes auto register. pig mcp add takes --oauth-client-registration and --oauth-client-name (upstream 908aa7b7).
Added
Claude Fable 5.2 (and Mythos 5.2) uses per-message effort and mid-conversation system messages as 5.1 does, on Anthropic and through OpenRouter, and a request its safety classifiers refuse is answered by Claude Opus 5 through server-side fallback (upstream 0d1793c2).
Qwen Token Plan Individual CN provider, qwen-token-plan-individual-cn: the Individual plan's models on the China endpoint, with QWEN_TOKEN_PLAN_CN_API_KEY (upstream #7989).
models.json compat promptCacheKeyMode for OpenAI Completions and Responses: auto (default) keeps each API's rule, enabled sends prompt_cache_key to a compatible proxy whenever caching is on, disabled never sends it (upstream #9442).
registerMarkdownTransformer($transformer, ['messageTypes' => [...]]) chooses the surfaces a transformer runs on: besides the default user, assistant and assistant-thinking, custom (custom messages without a renderer, expanded skill blocks), summary (expanded branch and compaction summaries) and changelog (What's New, /changelog, Extension Updates). The context names the surface as messageType; thinking blocks now go through transformers too; a transformer that throws is skipped; an extension has one transformer, and registering again replaces it (upstream #11756).
A tool, message or entry renderer's options have keyText($action) and keyHint($action, $description), which name the keys as the person bound them (upstream #11630).
Changed
cacheWarming now defaults to "idle" instead of "streaming": eligible prompt caches are also kept warm for up to 30 minutes between agent runs, only when a refresh is expected to pay for itself. Set "cacheWarming": "streaming" in the global settings for the previous behavior (upstream 7bcc15c9).
/login and /logout list the preferred partners Radius and OpenRouter first, then the other providers alphabetically. Partners are marked ✦; the selected Radius row shimmers in the Radius logo colors and the selected OpenRouter row glows in OpenRouter's color (upstream 683a7a86).
When a session's working directory no longer exists (the project folder was renamed, say), the question at startup, in /resume and in /import offers three choices: continue in the current directory (asked again next time), fork the session into the current directory (a new session whose header names it, with the original kept and pointed to as parentSession, so it is not asked again), or cancel (upstream #11975).
grep takes context lines from ripgrep's own output instead of reading every matched file whole: memory follows the output, not the size of the files, and a file in a Docker or SSH account's container or machine is no longer read separately. Overlapping context around nearby matches is shown once, and a lone CR inside a line is kept as content, as the read tool keeps it (upstream #11705).
pig update --models refreshes every provider's model catalog into ~/.pig/agent/models-store.json, as pi update --models does, instead of running the generator of a git checkout (which did nothing for a Composer install and rewrote tracked files in a checkout). A provider whose login has gone stale is a warning naming pig auth login , and the other catalogs still refresh; the command fails only for other errors (upstream 6382d870).
A Docker or SSH account's conversations load only the extensions the admin lets such accounts have: sandbox.extensions in settings.json, by name as disabledExtensions, by default pig-schedule and pig-tool-search. An extension runs on the server as its user, so its own tools, commands or MCP servers (pig-mcp), or a sandboxed PHP script (pig-codemode), could otherwise reach what the container or the other machine keeps the account away from. Add pig-antigravity, say, to let those accounts use the Antigravity models.
The default model per provider follows upstream's newer models at the same or a lower price: Claude Opus 5.5 for Anthropic and Bedrock, gpt-6.1-sol for Azure, gemini-4-argon for Google and Vertex, Kimi K2.7 Code, MiniMax M3, GLM 5.3 and Qwen 3.8 Max where those were older versions (upstream d84123b3, b425754a).
OpenAI Responses sends the session id as session-id instead of session_id (upstream #11793).
The skills hint in the system prompt says to resolve a skill's relative paths against its directory, names bash as the reader when there is no read tool, and names no tool when the reader is reachable only through another one (codemode). With neither read nor bash active, the skills are left out of the prompt (upstream 705d047c, #8552, c30840c2).
A llama.cpp server that cannot be reached is named with the cause (Could not reach llama.cpp server at http://…: …) instead of fetch failed (upstream #11779).
OpenAI Completions no longer sends "tools": [] when a request has no tools but the conversation has tool calls, which vLLM 0.20+ rejects; compat.requiresToolsWithToolHistory: true restores it for proxies that need it, such as older LiteLLM (upstream #11891).
Prompt template arguments: a quote starts quoting only at the start of an argument, so doesn't keeps its apostrophe; an unclosed quote is text; inside quotes, a backslash before the same quote keeps it ("the \"fast\" path"), other backslashes stay as typed (upstream #11873).
pig update lists the packages it changed with their versions (composer:vendor/name 1.2.0 -> 1.3.0, a git package's commits), says when they are already up to date, says when nothing was updated because of warnings, and says the packages were skipped in offline mode instead of claiming they were updated (upstream #11707, #11711).
Fullscreen Kitty images are drawn after the rows they cover on every Kitty terminal, not only WezTerm, so terminals that keep images in cells (Orca's xterm.js) show the whole image (upstream #11890).
Fixed
grep with exactly as many matches as its limit no longer says the limit was reached, and the last allowed match keeps its trailing context; UTF-16 files with a BOM show correctly with context (upstream #11705).
/import of a session whose working directory had gone left a copy in the session directory when the question was cancelled; nothing is left now, and a fork copies the original file (upstream #11975).
find with exactly as many matches as its limit no longer says the limit was reached: it asks fd for one more (upstream #7121).
find inside a git repository uses fd's git-aware ignores, so the repository's .gitignore stops at a nested repository instead of hiding its files (upstream #5960).
find can be stopped: an abort stops fd, and one during its setup no longer starts it (upstream #11974). A pattern starting with - is no longer read as an fd option, and results fd found before exiting non-zero are shown.
With several accounts, the extensions' panels (the Antigravity sign-ins) and their own endpoints were open to every account; they are the admin's now, as the API keys are.
A queued message with pictures, or one that was a prompt template, stayed in the queue list after it was delivered.
An RPC or print run shut down mid-turn now stops the turn and waits for it to settle before the session is closed, so the interrupted tool's result and the answer are saved (upstream #9126).
Anthropic: a non-strict tool schema keeps its root $defs / definitions, so a property's $ref still resolves (upstream 4a6a58eb).
A stale cursor marker could reach the terminal and show as stray characters (upstream #9441).
auth.json reached through a symlink and by its real path takes one lock, so two pigs no longer renew one token with the same refresh token (upstream #11787).
pig config uses the keys from keybindings.json (upstream #11788).
Alacritty is recognised by TERM or ALACRITTY_WINDOW_ID too, for hyperlinks (upstream #11777).
An MCP token refresh no longer registers an OAuth client or prepares a browser sign-in when it cannot refresh, which could spoil a sign-in in progress; a pasted redirect URL must be on the sign-in's own redirect URI, and a code is exchanged only by the sign-in that asked for it.
tool_search and the codemode resolves to summary follow local $refs into $defs, so a word only in an MCP server's nested model is found and its fields are named (upstream #11850).
Text pasted into the prompt survived a restore only as its [paste #1 +20 lines] marker: taking the queue back into the editor, opening the external editor, switching to an extension's editor, a follow-up, or an extension reading the editor's text now get what was pasted (upstream #10146).
A prompt and a tree navigation could overlap: a navigation is refused while a prompt's input handlers run, and a prompt is refused while a navigation's hooks or branch summary run, which isCompacting() now counts as upstream's does (upstream #9155).
HTML comments in Markdown are hidden — a comment-only block leaves no line and no extra gap, an inline one leaves no double space, and one still streaming in stays hidden — in messages, What's New, /changelog and Extension Updates (upstream #11755).
A write whose content is still streaming highlighted the whole file on every delta; it highlights only the lines that changed, and the first fifty together, until the call is whole (upstream #10971).
Anthropic subscription (OAuth) requests reported an outdated Claude Code version; they report 2.1.322 (upstream a05e3a07).
Release v2.0.1 of pig. Install via composer global require pigagent/pig:2.0.1 or view on GitHub.
New Features
SSH accounts — besides the host and Docker, an account can work as a system user reached over SSH: another user on the same server, or another machine. The admin sets the host, port, user, a private key on the server and the workspace there (⋯ → Accounts → Connection, with "Save and test"). The account's tools, !commands, /diff, AGENTS.md, folder picker, file previews, uploads, scheduled tasks and web terminal all work there, as that user; its conversations, the models and the API keys stay on the server. pig keeps its own known_hosts (a host key is learnt the first time and must not change after) and shares one connection per machine. sandbox.ssh in settings.json names another ssh command.
Folders of the server for a Docker account — the admin gives a Docker account folders that are on the server (⋯ → Accounts → Folders), each read-write or read-only. They are mounted in its container at the same path, listed in its folder picker beside its own directory, and it can start conversations, run commands and schedule tasks in them. pig's home, the accounts' directories and the system's folders cannot be given. The container is made again with them the next time it is needed.
Changed
Starting a conversation or a terminal for a Docker account no longer holds up the rest of the server while its container starts.
The Antigravity extension's panel is called "Antigravity" rather than "Accounts", now that pig web has accounts of its own.
The built-in model catalogue is regenerated from models.dev: Claude Fable 5.2 (Anthropic, Bedrock, OpenCode, OpenRouter, Vercel AI Gateway), Kimi K3.1 on Bedrock, Meta's Muse Ember, and OpenRouter's and Vercel AI Gateway's current lists and prices; OpenCode's and OpenRouter's Crouton Alpha preview is gone.
Fixed
For a Docker account, /diff, its list of untracked files, the doctor's git status and the PR description's diff ran git on the host in the account's directory, where a .git/config of the account's could run a command as the server's user; they now run in the account's container.
Release v2.0.0 of pig. Install via composer global require pigagent/pig:2.0.0 or view on GitHub.
New Features
Several people on one pig web — with sessions kept in MySQL or SQLite (storage in settings.json), the web UI has accounts. Each account sees and opens only its own conversations, scheduled tasks and terminals, the admin's included; the admin adds and removes accounts, sets their passwords and makes others admins (⋯ → Accounts), and alone holds the server's API keys and SSH nodes. With session files there is one account, the admin.
An account in a container of its own — an account runs on the host or, the default for new ones, in a long-lived Docker container: its tools, its !commands, its scheduled runs and its web terminal run there, in its own directory, mounted at the same path inside; nothing of its projects' .pig/ is loaded, and the host's keys and files stay out of reach. Build the image once with docker build -t pig-sandbox "$(composer global config home)/vendor/pigagent/pig/docker/sandbox"; sandbox in settings.json names another image (image), where the accounts' directories go (workspaces) and the docker command.
Changed
Logging in to pig web is a name and a password, with session files too. The one-time setup code is gone: while there is no account, the page makes the first, the admin (or pig web password on the server does). A password set before is the account admin's: log in as admin with it.pig web password takes the account's name.
With sessions in a database, the scheduled tasks are kept there too: scheduled-tasks.json is taken over the first time and kept as scheduled-tasks.json.imported. A task runs as the account that made it.
A MySQL or SQLite session store keeps created_at, updated_at and deleted_at on every table, set by the database itself (SQLite through a trigger, so both behave alike), in UTC to the millisecond. Deleting a session in the web UI marks it deleted rather than erasing it. The tables from 1.9.9 are moved over the first time pig opens them, each session keeping when it was last written.
A long-running pig web on MySQL reconnects when the server drops the connection (wait_timeout, a restart) rather than failing every write afterwards, and a write the server ended to break a deadlock is run again.
Fixed
Every page could list the web UI's terminals and type into any of them; each terminal is now its opener's.
Several processes starting the same new session on MySQL at once could have one fail with a deadlock; several pigs opening an empty database at once could fail creating the same index.
Release v1.9.9 of pig. Install via composer global require pigagent/pig:1.9.9 or view on GitHub.
Added
Sessions can be kept in MySQL or SQLite instead of files, for a server: set storage in ~/.pig/agent/settings.json to a mysql:host=…;dbname=… DSN or a sqlite:pig.db path, or to {"dsn": …, "user": …, "password": "$MYSQL_PASSWORD"}. What is kept is still pi's session file, line for line, so a session exports to the same .jsonl. It needs PHP's pdo_mysql or pdo_sqlite; a database that cannot be opened stops pig with the reason rather than falling back to files. Without the setting nothing changes. /import x.jsonl brings a session file into the database; the files you already have stay where they are, and setting storage back to jsonl shows them again.
Release v1.9.8 of pig. Install via composer global require pigagent/pig:1.9.8 or view on GitHub.
Changed
The built-in tools take upstream's operations (ReadOperations, WriteOperations, EditOperations, LsOperations, FindOperations, GrepOperations, and BashOperations for bash and powershell), so an extension can create tools that work somewhere other than this machine, over SSH or in a container, as upstream's can. Without them the tools work on this machine as before. A file tool's failure now ends with the reason the file system gave (Could not write a.txt: No space left on device).
Sessions are read and written through a SessionStore (SessionManager::sessionStore()), the first step towards keeping them elsewhere than in files (MySQL or SQLite for a server with several users, see docs/dev/design/storage.md). JsonlSessionStore, pi's session files exactly as before, is the default, and nothing changes in what is written or where. The web UI's folder list, a tool's running output kept for picking a stopped run back up, the scheduled tasks' check for their conversation and /doctor's session size go through it too.
Release v1.9.7 of pig. Install via composer global require pigagent/pig:1.9.7 or view on GitHub.
Changed
The built-in model catalogue is regenerated from models.dev: new Bedrock, Copilot, Hugging Face and Together models, OpenRouter's and Vercel AI Gateway's current lists and prices, and the models the Radius gateway, OpenCode and NVIDIA no longer serve gone (Radius no longer offers GPT-5.4, OpenCode no longer DeepSeek V4 Flash).
The command runner the terminal uses for fd, git, the clipboard and the like reads a command's output as it arrives, where it slept 5 ms between reads and took one pipe buffer each time: a few hundred KB of output, such as fd's warnings on a tree with many unreadable directories, is read several times faster.
Fixed
Fixed Azure OpenAI models dropping OpenAI's long-context price tier (upstream #11949): the Azure copies of the openai models kept only the four base rates, so a request above 272K input tokens — realistic on Azure's 1.05M windows — was costed at the short-context rates. They now keep the tier, as Azure bills it.
Release v1.9.6 of pig. Install via composer global require pigagent/pig:1.9.6 or view on GitHub.
Added
Anthropic message threads (upstream #11545): with a session id and caching on, a request continues the server-side thread of the previous reply (message-threads-2026-08-12 beta) and sends only the new messages, without the system prompt and tools. When anything earlier in the request changed, or the server can't continue, the full request is sent — a rejected continue is resent once as a new thread, and an endpoint that rejects threads gets them turned off for the session; either is recorded as an anthropic_thread_fallback diagnostic. Token counts and prompt caching are unchanged. On by default only for the anthropic provider on api.anthropic.com; the compat.supportsMessageThreads key in models.json changes that, for example for a gateway that forwards thread. A session's thread state is dropped when the session ends.
StreamOptions::$disableContinuation (upstream): a request that neither uses nor replaces server-side continuation state such as message threads. Cache-warming refreshes set it, so a refresh never takes over where the conversation continues from.
Changed
Cache warming's policy — when a refresh is due, whether a request can be replayed, whether a refresh pays for itself — is Pig\Ai\CacheWarming with Pig\Ai\CacheWarmingDecision, moved out of CodingAgent\Session\CacheWarmer as upstream moved it into pi-ai (#11857), under upstream's names. CacheWarmer keeps the scheduling.
Fixed
Fixed a cache refresh leaving out the request's thinkingBudgets: the refresh asked for a different thinking budget from the request it repeated, which Anthropic keys its cache on. It now repeats the request's options whole, as upstream's does.
Fixed MCP stdio servers' large messages being framed in quadratic time (upstream #11791): every chunk searched the whole buffered message from its first byte for a newline, and every line cut copied the rest of the buffer. The search now starts where the last one stopped, and the buffer is cut once per chunk.
Fixed the startup header printing Pig vdev-main when pig runs from a branch: the v now goes only before a release number, so a checkout reads Pig dev-main.
Release v1.9.5 of pig. Install via composer global require pigagent/pig:1.9.5 or view on GitHub.
Added
pig auth login and pig auth logout (upstream): log in or out from the shell without starting a session, as /login and /logout do. Account sign-in takes the provider's browser method and names the others; --no-browser takes one of those instead (Anthropic's copy-code, OpenAI's device code), and --api-key saves an API key, asked for without echo. The provider's model catalog is fetched after a login. Logout leaves environment variables and models.json alone and is safe to repeat.
Changed
pig mcp login's pasted redirect URL is read through the same off-the-loop question as pig auth login (Cli\TerminalQuestion, upstream's questionTerminal()), and the end of input now ends the sign-in instead of waiting on for the browser.
Release v1.9.4 of pig. Install via composer global require pigagent/pig:1.9.4 or view on GitHub.
Added
GitHub Copilot's microsoft-decision-1 classifier (upstream #11679): classify() with a Copilot sign-in or key, at the account's endpoint under /v1/systemone, with Copilot's headers.
Fixed
Fixed pbcopy staying in pig's process group on macOS, so Ctrl+Z stopped it with pig: the clipboard writers' detaching (upstream #11179) put setsid in front of the command, and macOS has no setsid. Without one, PHP's own posix_setsid() starts the command now (Process::inNewSession(), shared with bash's, which already did this).
Fixed Anthropic and Bedrock paying a rejected request on every turn once Claude had refused a session's strict tools for its limits: the session now sends its strict: "prefer" tools non-strict from then on, until it ends (upstream #11626). Pig\Ai\Utils\StrictToolLimits holds the check and the per-session note, where ConstrainedSampling held the check.
Fixed SIGTERM and SIGHUP killing pig --mode rpc and pig -p on the spot, with no session_shutdown and no disposal: they now shut down as the end of input does and exit 143 or 129. A shutdown under way is not cut short by one signal — process managers close stdin and send SIGTERM together — and a second exits at once (upstream #11752).
Fixed edit rewriting the line endings of lines it did not touch (upstream #11751): the file was written back whole with the first ending it held, so a two-line edit of a file mixing LF and CRLF changed every other line, and a lone CR anywhere became an LF. Only the replaced ranges are written now; new lines take the ending of the line they start on (CR only in a file with no LF at all), and the diff is drawn before the file is written.
Fixed read loading the whole file before applying offset / limit (upstream #11750): a one-line read of a 200 MB log held it three times over (546 MB peak; past a memory_limit, a fatal error that ends pig) and froze the screen and escape until it was done. It now streams the file in 1 MB chunks, counting the lines it does not show in C and storing only what the answer can hold — the same read takes 0.06 s and 4 MB — and looks at escape every few megabytes. The output is unchanged byte for byte, checked against the old algorithm over every range and chunk size.
Release v1.9.3 of pig. Install via composer global require pigagent/pig:1.9.3 or view on GitHub.
Added
A model's compat takes requiresNonNullAssistantContent (upstream #8118): a tool-call-only assistant turn is sent with content: "" rather than null, for an OpenAI-compatible endpoint that rejects the null. In models.json and its schema.
/model's scope is shown under the header at startup when --models set one — Model scope: sonnet:high, haiku (Ctrl+P to cycle), upstream's notice (#11512), which pig never drew.
Changed
Consecutive cache warms share one Cache warmed: $… line with the running total, as upstream's do; each is still its own usage entry.
The openai-codex provider is named OpenAI Codex, without (legacy), as upstream renamed it.
The output reserve for a long conversation is 15% of its estimated input (at least 32,768 tokens when the window has room), not a flat margin, so an undercount of a large context no longer runs it past the window (upstream #11712).
Fixed
Fixed grep's glob being matched from the session's folder rather than from path: path: "repo", glob: "migrations/main/*.js" found nothing. rg now runs inside the searched folder (symlinked ones too), a leading ./ in the glob is dropped, and the parameter says the glob is relative to path (upstream #11895). A pattern starting with - is no longer read as an rg flag.
Fixed a resume restoring a stale thinking level after going back in the tree: the live level is recorded on the branch before the next prompt, unless it differs only by clamping (upstream #11888).
Fixed ctrl+p doing nothing when the scope held one model and the current model was outside it, and skipping the scope's first model when cycling in from outside: forward lands on the first entry, backward on the last (upstream #11832).
Fixed images in steered and follow-up messages going out (and into the session) at full size: they are fitted to the model's limits with the same hints as a prompt's (upstream #11782).
Fixed a branch summary being written from messages a context_edit had hidden or replaced — a retried failed attempt went to the summarizer again (upstream #11680).
Fixed a connection failure reading only Connection error.: the underlying cause is appended, e.g. Connection error.: connect ECONNREFUSED … (111) (upstream #11783).
Fixed a gateway's "cut short after the reply had begun" not being retried (upstream #11879).
Fixed the /tree search line having no cursor (upstream #9157).
Fixed the pig-llama Hugging Face search jumping back to the top when results arrived after the selection had been moved (upstream #11810).
.dart, .groovy, .gradle and .nix files are highlighted in read/write views (upstream #11790).
Release v1.9.2 of pig. Install via composer global require pigagent/pig:1.9.2 or view on GitHub.
Added
A tool card in pig web lists the calls the tool made through the session while it ran — a codemode script's read, an orchestrating tool's calls — as rows under its header: live from the nested tool_execution_* events (which were drawn as cards of their own), and read back later from the result's nestedCalls record, with a note when the record is incomplete. A codemode card keeps its own list.
tool_call and tool_result extension events carry parentToolCallId for a call another tool made (a codemode script's), as upstream's do: a permission gate can hold a script's call to a different rule than the model's, where before only the / in the call's id said as much.
Changed
The status above the prompt is upstream's StatusIndicator family — Interactive\StatusIndicator with WorkingStatusIndicator, RetryStatusIndicator (its countdown inside, stopped with it), CompactionStatusIndicator and BranchSummaryStatusIndicator — where InteractiveMode built each loader inline and kept a string beside it for the kind. Same labels, same place (the prompt's border); docs/dev/upstream.md closes the last of the audit's open rows with it, and records why the 3D easter egg and the Earendil announcement are not ported.
Release v1.9.1 of pig. Install via composer global require pigagent/pig:1.9.1 or view on GitHub.
Changed
A file sent from pig web is drawn in the message as the tile it was in the composer — name, kind, click to view — with the question as the text under it, where the message showed the staged path as a line of text. The same when the conversation is read back later: the tile opens the file from disk.
Usage::plus() is upstream's combineUsage(), one method where Compaction and pig-codemode each had a private copy.
The collapsed previews of a codemode call — the script and its output — are cut by visual rows, as upstream's VisualLinePreview cuts them, not by logical lines: a script's output is often one long JSON line, which a line cut let wrap across the whole screen. Interactive\BashOutputComponent took a keep: 'start' for it.
From the upstream audit in docs/dev/upstream.md, closed: a tool result records the calls the tool made through the session while it ran (nestedCalls, upstream's NestedCallRecorder → Session\NestedCallRecorder), bounded as upstream bounds it, with their summed usage added to the result's usage — the record is read back for compaction's file lists, as upstream reads it, and pig-codemode's own result no longer bills the nested tools' usage (that is the message's now), only the script's models.* calls; Auth::removeRuntimeApiKey() / hasRuntimeApiKey() (upstream's RuntimeCredentials), a logout dropping the --api-key with the stored credential, and /login saying runtime for such a key; Pig\Mcp\Oauth\McpRefreshLockBusyError where a busy refresh lock was a generic RuntimeException, and an MCP sign-in now takes the server's refresh lock for its refresh and goes to the browser when another process holds it (upstream's refreshBeforeSignIn()), with FileLockBusyError under it so a busy FileLock can be told from a broken one; the footer's branch in a git worktree or submodule (.git as a gitdir: file, upstream's findGitPaths()), where it showed the main checkout's.
Fixed
Fixed pig web staying on a page whose login session had ended (logged out elsewhere, a new password, thirty days) until some action — a rename, the sidebar — came back Not logged in. in an alert: every /api/… call now goes to the login page on a 401, and logging out closes that session's WebSockets, so a page left open on it goes to the login page at once instead of living on over its socket.
Release v1.9.0 of pig. Install via composer global require pigagent/pig:1.9.0 or view on GitHub.
Changed
Breaking: twenty-one classes take upstream's names, from the audit in docs/dev/upstream.md ("Names that differ from upstream"). Pig\Ai: PricingTier → ModelCostTier, AnthropicCompat → AnthropicMessagesCompat, Utils\Headers → Utils\ProviderHeaders, Utils\StreamingJson → Utils\StreamingJsonParser, Utils\Oauth\Credentials → Utils\Oauth\OauthCredentials, Utils\Oauth\Provider → Utils\Oauth\OauthProvider, Extension\ClassificationApi → Extension\ProviderClassifier, Extension\ImageGenerationApi → Extension\ProviderImages, Providers\AzureOpenAiConfig → Providers\AzureEndpointOptions. Pig\CodingAgent: ModelRefreshResult → ModelsRefreshResult, ModelReference → ModelReferenceResult, Prompt\FileCommand → Prompt\PromptTemplate, Interactive\SettingsSubmenu → Interactive\SelectSubmenu, and the session-file entries take upstream's suffix — Session\BashExecution → BashExecutionMessage, BranchSummary → BranchSummaryEntry, CompactionSummary → CompactionEntry, Label → LabelEntry, ModelChange → ModelChangeEntry, ThinkingLevelChange → ThinkingLevelChangeEntry (their stored forms are unchanged). Pig\Mcp\Transports\Transport → McpTransport; Pig\Codemode\Sandbox → CodemodeSandbox. Fields and methods are as they were; an extension changes its use lines. Kept on purpose, and why, is in the same document: ReasoningEffort (the provider-side subset of Pig\Agent\ThinkingLevel), OauthFlow, StartedSession, VirtualModelRegistry.
Release v1.8.0 of pig. Install via composer global require pigagent/pig:1.8.0 or view on GitHub.
Changed
Breaking: Pig\CodingAgent\CustomTools\ is folded into Pig\CodingAgent\Extensions\, where upstream keeps it (core/extensions/types.ts, wrapper.ts) — the namespace was the tool-files era's and 1.7.0 left it behind. Upstream's names where it has them: CustomTool → ToolDefinition, LoadedCustomTool → RegisteredTool, RenderOptions → ToolRenderResultOptions; CustomToolSet, WrappedCustomTool, ToolProblem and CustomToolSessionEvent are pig's own and moved with their names. Fields and constructors are unchanged, so an extension changes its use lines and new CustomTool( → new ToolDefinition( and nothing else. An extension that still names the old namespace, or Hooks\, now fails to load with a line that says where the class went.
A file dropped, pasted or attached in pig web that is not a picture shows as a tile beside the pictures — a glyph for its kind (code, PDF, archive, audio, video, sheet, document, text) or its extension for anything else, its name under, × to drop it — instead of its upload path landing in the prompt. The path still goes with the message when it is sent, one a line ahead of the question, so the model and the transcript see what they did. A ! bash line still gets the quoted path at the cursor.
Fixed
Fixed pig crashed: Class "Pig\CodingAgent\Extensions\LoadedHook" not found on opening a project whose .pig/ had not been trusted yet: the project_trust question in bin/pig still wrapped each extension in the class 1.7.0 removed. The runner takes the loader's extensions as they are.
Release v1.7.0 of pig. Install via composer global require pigagent/pig:1.7.0 or view on GitHub.
Added
Added configuration schemas for models.json, settings.json, keybindings.json and theme files, published at https://pigagent.dev/schemas/.schema.json (upstream #9880, #10751): name one in a file's $schema and an editor completes and checks it. All four files accept $schema; in models.json it must be a string. The schemas live in packages/coding-agent/schemas/ and models.json and themes are checked against them at runtime, with upstream's messages.
Added LaTeX math rendering in Markdown, ported from upstream: inline $…$ / \(…\) and display $$…$$ / \[…\] math drawn as terminal-friendly Unicode (fractions, scripts, symbols, aligned equations, cases, matrices, stacked display fractions and operator limits). Unsupported, malformed or still-streaming math shows as written, and an unclosed display opener never swallows a following table (upstream #11159). Markdown takes renderLatex: false to turn it off.
Changed
Theme files are validated strictly, as upstream's are since #9880: a top-level key, a colors token or an export key the theme schema does not name refuses the theme (schema is false at the key, then must not have additional properties), and every theme loaded from the command line onward is checked, not only those the interactive mode loads. Theme errors are upstream's messages to the word, a union's branch errors included, at most eight.
models.json providers, models and modelOverrides entries are checked against the models schema with upstream's messages (providers..models.0.contextWindow: must be > 0): known compat fields must have their type (supportsLongCacheRetention: "yes" refuses the provider) while unknown ones are kept, a non-string thinkingLevelMap level or a list where openRouterRouting wants an object is a schema error instead of being dropped, and a template kwarg object must be a $var reference. As before, pig refuses only the provider, model or override the error is in.
Keybinding values in the published schema also accept the modifier spellings pig reads (control, option, cmd, command, meta) and pageup / pagedown, so pig's own command+enter default is valid.
Breaking: hooks and tool files are extensions now, as upstream merged them. Pig\CodingAgent\Hooks\HookApi and Pig\CodingAgent\CustomTools\CustomToolApi are gone and everything they had (on(), sendMessage(), appendEntry(), registerCommand(), exec(), the renderers) is on Pig\CodingAgent\Extensions\ExtensionApi; a factory is handed ExtensionApi $pig (the parameter is $pig in every example and doc, where it was $pi). ~/.pig/agent/hooks, /.pig/hooks, ~/.pig/agent/tools//index.php, /.pig/tools, the hooks and customTools settings, --no-hooks, --no-tool-files and /hooks are gone: move a hook file to the matching extensions/ folder and it loads as it is; a tool file becomes an extension whose factory $pig->registerTool()s what it used to return. A file left in either folder, or either setting, stops the startup and says where it goes — not loaded from the old place, not skipped quietly. A registered tool with a built-in's name now replaces the built-in, as upstream's does, where a tool file was refused the name. LoadedHook, HookLoader and CustomToolLoader are gone too, and the two keys left the settings schema. The Pig\CodingAgent\Hooks\ namespace is Pig\CodingAgent\Extensions\ now, as upstream's core/extensions/ is — HookRunner → ExtensionRunner, HookContext → ExtensionContext ($ctx), HookUi → ExtensionUi, HookEvent → ExtensionEvent, HookState → ExtensionState, HookedTool → ExtensionGuardedTool, Session\HookMessage → Session\CustomMessage (its stored form is unchanged), RegisteredCommand::$hookPath → $extensionPath; HookError is folded into ExtensionError (path, stage, message), which the runner now reports run-time faults with too. Events\, Results\ and Boundary\ moved with the namespace, names unchanged. The runner is extensionRunner wherever it is held, as upstream holds it: StartedSession::$extensionRunner, AgentSession::extensionRunner() / setExtensionRunner(), and the $extensionRunner the modes take where they took $hooks.
Release v1.6.10 of pig. Install via composer global require pigagent/pig:1.6.10 or view on GitHub.
Changed
/diff (terminal and pig web) names the untracked files under the diff — Untracked (not in the diff): test.txt — because git diff compares tracked files only, so a new file left /diff saying "no changes" while git status listed it. Names only, in the file's order; /diff --no-index /dev/null still shows one's contents.
Fixed
Fixed a prompt Gemini refused (promptFeedback.blockReason, a 200 with no candidate) being reported as Google stream ended without a finish reason and then retried, again and again, with the same prompt. GoogleShared::onChunk() now ends the turn with Gemini refused the prompt: — not retryable — after recording the usage on the same chunk, so the input Google billed for is still the turn's. The Antigravity extension's own copy of that check is gone; it shares this one.
Fixed Could not write the session to saying nothing about why: the PHP warning behind the failed write (permission denied, disk full, …) is now part of the message.
Release v1.6.9 of pig. Install via composer global require pigagent/pig:1.6.9 or view on GitHub.
Fixed
Fixed prompts (especially those with screenshots) in pig web waiting until the full image upload and server prepareRun() completed before appearing in the conversation: submitMessage() now renders the user message bubble optimistically on send (removing it if the child answers queued or duplicate or if the send fails), and HttpServer::slimForBrowser() strips full user and system message bodies (including echoed base64 images) from live message_start / message_end events.
Release v1.6.8 of pig. Install via composer global require pigagent/pig:1.6.8 or view on GitHub.
Fixed
Fixed pig web reconnecting in a loop (closing a connection: a compressed WebSocket frame could not be inflated) when a browser sent a permessage-deflate compressed frame: Websocket::decode() and Websocket::encode() now use inflate_init(ZLIB_ENCODING_RAW) / inflate_add(..., ZLIB_SYNC_FLUSH) and deflate_init(ZLIB_ENCODING_RAW) / deflate_add(..., ZLIB_SYNC_FLUSH) per RFC 7692 §7.2 instead of gzinflate() / gzdeflate(), which rejected the browser's BFINAL=0 sync-flushed stream.
Release v1.6.7 of pig. Install via composer global require pigagent/pig:1.6.7 or view on GitHub.
Fixed
Fixed FooterTest::testRightAfterACompactionTheContextIsUnknownNotZero failing in CI when new CompactionSummary(...) and the post-compaction AssistantMessage received the same millisecond timestamp, causing Compaction::lastUsage() ($message->timestamp <= $compactedAt) to treat the post-compaction turn as pre-compaction.
Added the missing ## [1.5.8] - 2026-11-04 section in CHANGELOG.md.
Release v1.6.6 of pig. Install via composer global require pigagent/pig:1.6.6 or view on GitHub.
Added
Added examples/extensions/subagent/, a port of pi's subagent example: the subagent tool delegates a task to a child pig --mode json -p --no-session with its own context window, in single, parallel (max 8, 4 concurrent) and chain ({previous}) modes; agents are ~/.pig/agent/agents/*.md and .pig/agents/*.md in pi's frontmatter format, with the four sample agents and three workflow prompts. An example, not a built-in: linked into ~/.pig/agent/extensions/ by hand, as pi's is.
Process::stream() and Process::streamAsync() take a cwd, as runAsync() does.
Release v1.6.5 of pig. Install via composer global require pigagent/pig:1.6.5 or view on GitHub.
Added
Added scripts/eval.php, an agent eval runner: each evals//CASE.md (frontmatter assertions + prompt, optional fixture/ working directory) is run through bin/pig --mode json --incognito -p and checked deterministically — final answer (contains / not_contains / regex), files in the working directory (exists / contains / equals), shell check commands, and tool names called / not called — reporting tokens, cost and wall time per case; --json for machine output, --keep to inspect the working directory, options after -- go to bin/pig (e.g. -- --model … to compare models). Two starter cases under evals/.
Release v1.6.4 of pig. Install via composer global require pigagent/pig:1.6.4 or view on GitHub.
Changed
pig web compresses all HTTP text and JSON responses ≥ 512 bytes (/, /login, /theme.css, /api/sessions/all, /api/models, and the rest) with gzip when the client accepts it, strips redundant full-message live events (entry_appended, turn_end, non-delta message_updates, agent_end.messages, and full message_end bodies) before forwarding over the browser WebSocket, binds the active tab first on connect/reconnect before background tabs, and fetches get_commands once per tab bind rather than on every state refresh.
Fixed
Fixed pig web closing active slow-tunnel connections with silent for N s, no pong while a large payload was still draining in $sendBuffer ahead of the queued WebSocket ping: TcpConnection::silentFor() now counts recent $lastDrainAt write progress as activity while the buffer is draining.
Release v1.6.3 of pig. Install via composer global require pigagent/pig:1.6.3 or view on GitHub.
Added
Added five Mermaid diagram kinds grok-mermaid does not draw, each a class of its own beside the port in Mermaid\: pie as a bar listing with each slice's share (and value under showData), timeline down the screen with periods, events and section rules, journey as tasks with star scores and actors, kanban as columns of cards (with the @{ … } assignee, ticket and priority as a muted line), and gitGraph as git log --graph draws one — lanes, forks, merges, HIGHLIGHT / REVERSE commits, tags and cherry-picks. Each falls back to the source box as before when it does not fit or does not parse; gantt, mindmap and the rest still show as source. test/fixtures/mermaid/pig-cases.json pins what they draw.
Release v1.6.2 of pig. Install via composer global require pigagent/pig:1.6.2 or view on GitHub.
Added
Added WebSocket permessage-deflate compression (Sec-WebSocket-Extensions: permessage-deflate; server_no_context_takeover; client_no_context_takeover, RFC 7692) in pig web, compressing outgoing frames ≥ 256 bytes with gzdeflate and inflating incoming RSV1 frames across continuations.
Fixed
Fixed pig web getting stuck on get_messages: no answer in 30s over high-loss or low-bandwidth tunnels (such as a congested Tailscale link): RpcMode::imagesAsRefs() strips opaque high-entropy provider signatures (thoughtSignature, thinkingSignature, textSignature) from web history payloads, FIRST_LOAD matches FIRST_DRAW (60 messages) so the initial load shrinks by ~96% (867 KB → 31 KB with permessage-deflate), and Tab.loadMessages(), Tab.refreshState(), and Tab.loadCommands() coalesce concurrent calls onto one in-flight Promise and clear the unreachable banner on completion.
Release v1.6.1 of pig. Install via composer global require pigagent/pig:1.6.1 or view on GitHub.
Added
Added Pig\Ai\Http\Retrying::fetch(), the one retry loop for plain requests — a catalog, a market-data page, a download: a transport failure or a 408/425/429/5xx is tried again (three attempts unless told otherwise), Retry-After is honoured, otherwise the wait doubles with jitter up to a cap, an abort cuts the wait short, and the last answer comes back whatever its status for the caller to judge. Model requests keep ProviderRetry and Retry. AGENTS.md says so: no retry loop at a call site.
Changed
RemoteCatalog::request() goes through Retrying::fetch() with upstream's numbers (three attempts, no wait, its status list) instead of a loop of its own.
Release v1.6.0 of pig. Install via composer global require pigagent/pig:1.6.0 or view on GitHub.
Added
Added the first run's two questions, upstream's first-time setup: a theme (system, dark or light, previewed as the cursor moves) and whether pig may name itself to the model providers (enableInstallTelemetry), on a screen of their own before anything else, when there is no ~/.pig/agent/settings.json yet. Escape skips and saves nothing.
Added the theme row's submenu to /settings, upstream's ThemeSubmenu: pick one theme, or automatic for one theme when the terminal is light and another when it is dark — the light/dark pair the theme controller already followed, which until now could only be written into settings.json by hand. Moving the cursor previews; Escape puts the original back.
Added the HTTP idle timeout row to /settings (30 sec, 1 min, 2 min, 5 min, disabled), upstream's: saved as httpIdleTimeoutMs and applied to every request from then on.
Added upstream's search line to /settings (SettingsList's enableSearch): type to keep the rows the query matches, best first, by the same fuzzy ranking the model picker uses; Space is a character of the query once something is typed, and Escape still leaves. The submenus keep no search line, as upstream's do not.
Release v1.5.9 of pig. Install via composer global require pigagent/pig:1.5.9 or view on GitHub.
Changed
registerWebPanel() and WebPanel say what $icon is: the glyph the sidebar shows before the title, as it is — an emoji, say — so a word there is drawn as a word.
Fixed
Fixed the footer showing 0.0% of the context window right after a compaction, which read as the conversation having been emptied: until the next response measures the new context it shows ?, as upstream's getContextUsage() does.
Fixed Up in the web page's prompt box sometimes bringing back the prompt before the last one: when the conversation is drawn afresh (after LIVE_CAP live messages, a reconnect, or opening the tab again) the history is rebuilt from the page's messages, and a prompt the page does not hold yet — the one just sent and still being answered, or typed as a form the conversation does not keep (/skill, @file, !cmd) — went behind the page's prompts instead of in front of them.
Release v1.5.8 of pig. Install via composer global require pigagent/pig:1.5.8 or view on GitHub.
Fixed
Fixed Gemini MALFORMED_FUNCTION_CALL errors not being retried automatically and detached bash tool subprocesses from /dev/tty via setsid so background commands cannot write onto or hang the TUI screen.
Release v1.5.7 of pig. Install via composer global require pigagent/pig:1.5.7 or view on GitHub.
Added
Added drag-over highlight and upload progress animation (.pending-upload-chip with spinner, filename, percentage, and progress bar, plus .btn-attach.uploading) when staging files in pig web.
Release v1.5.6 of pig. Install via composer global require pigagent/pig:1.5.6 or view on GitHub.
Fixed
Fixed /model and /scoped-models showing Could not refresh ; showing cached models. for unconfigured built-in providers (such as zai-coding-cn): ModelRefresh::remoteCatalog() now skips the network phase when the provider has no configured credential (!$auth->hasKeyFor($provider)), matching upstream pi's Models.refresh() (resolveRefreshCredential()) instead of firing 40 concurrent catalog requests at once, and RemoteCatalog::request() now retries transient transport failures and 408/425/429/500/502/503/504 responses up to twice as upstream's fetchWithRetry() does.
Fixed pig web restart resetting a daemon started with --host or --port (such as pig web start -d --host 0.0.0.0) back to 127.0.0.1:8088: WebDaemon now records the daemon's host and port in web.pid (falling back to the startup banner in web.log for older pid files), shows the listening address in pig web status, and preserves it across pig web restart unless new --host / --port flags are passed.
Release v1.5.5 of pig. Install via composer global require pigagent/pig:1.5.5 or view on GitHub.
Fixed
Fixed pig web greying out non-image files in the 📎 file picker and ignoring non-image files when dragged or pasted into the page: #file-input no longer restricts accept to image/*, dragover/drop run in capture phase with dropEffect = "copy", and non-image files are staged in 4 MB chunks through POST /api/upload into sys_get_temp_dir()/pig-upload-/ with their path inserted at the prompt cursor (quoted in ! commands, matching the TUI editor).
Release v1.5.4 of pig. Install via composer global require pigagent/pig:1.5.4 or view on GitHub.
Fixed
Fixed a Chrome memory leak in pig web over long runs and WebSocket reconnections: pigUnreachable now holds at most one retry timer (cleared on pigReachable) and disconnected tabs leave reconnection to network.js instead of multiplying retry timers by 3 every 3 seconds; refreshState runs before loadMessages so conversations started in the current tab always fetch history images by reference (images: "refs") rather than inline base64; programmatic scroll updates (renderMessages, backfill, ResizeObserver) keep lastScrollTop in sync so redrawing a shorter page is not mistaken for scrolling up and never disables LIVE_CAP; ToolCard.finish() releases raw result payloads and removes finished cards from tab.toolCards; and closing a tab sends detach_session and disconnects its observers and timers.
Release v1.5.3 of pig. Install via composer global require pigagent/pig:1.5.3 or view on GitHub.
Added
Added PIG_SELF_UPDATE_COMMAND environment variable and selfUpdateCommand setting (string[]) to configure custom commands for self-updating pig in external package managers (such as mise or Nix), supporting {packageName}, {version}, and {installSpec} placeholders.
Added extra.pig.changelogPath configuration in package composer.json to present extension release notes under "Extension Updates" when package versions change.
Added PreparesArguments interface allowing tools to prepare, normalize, and validate arguments before execution.
Added TrustedUrl validator to verify OAuth redirect targets and callback schemes.
Changed
pig web sends its page in a quarter of the bytes, and a reload in almost none: scripts and stylesheets are gzipped for a browser that takes it (894KB to 218KB for a first load, the API answers included), and each carries an ETag, so a reload is answered with 304s instead of the same files again (94KB, most of it the API). They are still checked on every load, so a page sees the files of a pig update at once.
The terminal's xterm (344KB with its stylesheet, more than a third of the page) is fetched when a terminal is first opened — the local one or a node's SSH one — instead of with every page.
Updated built-in model catalogs for Azure, OpenAI, OpenAI Codex, OpenCode, and OpenRouter aligned with upstream pi.
Fixed
Fixed EditTool and EditDiff multi-block replacements, fuzzy matching, and trailing newline preservation, resolving line offset reconciliation issues aligned with upstream pi.
Fixed Process::run and Process::runAsync hanging or corrupting multi-byte text on high-volume output by enforcing $maxBuffer with UTF-8 safe boundary truncation.
Fixed Bedrock strict tool calling fallback handling and parameter schemas.
Fixed TUI Markdown rendering edge cases for nested lists, table alignments, and inline formatting boundaries.
Release v1.5.2 of pig. Install via composer global require pigagent/pig:1.5.2 or view on GitHub.
Fixed
Fixed pig web reading the newest thirty conversations through, every one of them, each time a page opened, to list them in the sidebar — on the one thread that also answers the page, so opening a conversation waited behind it. A row needs the first thing said and the last name given, and now reads only those: the top of the file until the first prompt, and the file searched from its end for the last name. On the developer's machine that was 108MB read for the list, one conversation of it 63MB of screenshots; 48 real conversations now list in 40ms instead of 582ms, with the same rows. The terminal's /resume, which counts messages and searches what was said, reads files as before.
Release v1.5.1 of pig. Install via composer global require pigagent/pig:1.5.1 or view on GitHub.
Fixed
Fixed an extension's ctx.ui.setWorkingMessage() during a run being overwritten by Working on the loader's next frame: the loader draws its line from its own message, and the new text was written past it.
Release v1.5.0 of pig. Install via composer global require pigagent/pig:1.5.0 or view on GitHub.
New Features
A session names itself, as Claude Code's do: after the first prompt settles, pig asks the session's model, in the background, for a few words on what the first exchange is about — in the language the person writes in — and makes them the session's name, for the footer, the session list and the Web UI's tabs. Asked once per session, never over a name given with /name (or a scheduled task's), never in -p; the question is the first message and the first answer cut to 300 characters each, so it costs a few hundred tokens once, written to the session file as a session_title usage entry so it is on the bill. Off with autoSessionName.enabled: false in settings.json or the *Name sessions* row in /settings — the key the developer's smart-session extension read, which this replaces: delete ~/.pig/agent/extensions/smart-session.php, or both will name the session.
The terminal's window and tab title is the session's name (pig while it has none), and follows /name, a new session and /resume.
Changed
Web search is no longer bundled with pig: it is the package pig-web-search (MIT), installed with pig install git:github.com/owner888/pig-web-search — web_search, fetch_web_page, browse_web_page and /search as before. pig update removes the old copy from ~/.pig/agent/extensions/ and prints that line; disabledExtensions: ["pig-web-search"] still reaches the package.
Release v1.4.0 of pig. Install via composer global require pigagent/pig:1.4.0 or view on GitHub.
Changed
Android use is no longer bundled with pig: it is the package pig-android-use, licensed Apache-2.0, installed with pig install git:github.com/owner888/pig-android-use. Same tools, /android command, skill and web page, plus notes on 23 common apps. pig update (with or without --extensions) removes the old bundled copy from ~/.pig/agent/extensions/ and prints the install line; a copy that is a git checkout of its own is left alone. The extension keeps its name, so disabledExtensions: ["pig-android-use"] still reaches the package.
Computer use is no longer bundled with pig either: it is the package pig-computer (MIT), installed with pig install git:github.com/owner888/pig-computer — same tools, /computer command, skill and web page. pig update removes the old bundled copy the same way and prints the install line; without it installed, pig has no desktop tools, so a request about an app is not taken for the Mac's. The README no longer calls it browser automation: it drives the macOS desktop.
Fixed
Fixed codemode sending a picture as base64 text when a script returned or printed a tool result that had one — return ['shot' => $tools->android_observe(...)] put a whole screenshot into the output as text, tens of thousands of tokens the model could not see, cut off by the output limit. An image block inside a returned value or a text() argument is now shown as an image, and the text says [image: image/jpeg, shown as an image] where it was. Upstream never hands a script a picture (a tool resolves to its text), so this follows pig's own ['text', 'images'] results.
Fixed a confirmation with a long message leaving nothing to answer: the permission gate puts the whole command in its question, and a hundred-line heredoc pushed Yes / No out of the fullscreen dock — the dialog had the keys and the turn waited on it, but there was nothing on screen to choose. A dialog's title now takes at most half the screen, keeping its first and last lines and saying how many are between (… 87 more lines …); select and input dialogs get the same.
Release v1.3.2 of pig. Install via composer global require pigagent/pig:1.3.2 or view on GitHub.
Changed
In pig web, a command card's header button copies the command — the thing one most often wants to run again — and the output has a copy button of its own at its top right, which stays in view while the output scrolls (shown on hover, always on a touch screen). Other tools' cards keep the header button for their output and get the same one over it.
Release v1.3.1 of pig. Install via composer global require pigagent/pig:1.3.1 or view on GitHub.
Changed
pig web's banner says how much to worry: a page's first "connecting" stays in the usual colour, a connection lost and being retried is drawn as a warning and says so ("Disconnected from server. Retrying..."), and after three failed reconnects, or when pig cannot be reached, it turns to an error. A model request being retried is a warning too. One colour for all of them made the routine look as alarming as the real thing.
Release v1.3.0 of pig. Install via composer global require pigagent/pig:1.3.0 or view on GitHub.
Changed
In pig web, a unified diff in a command's output — git diff, git show, diff -u — is coloured like the edit tool's: removed and added lines, file headers and hunk headers. git colours only for a terminal, and the colour is added when the card is drawn rather than asked of git, so what the model reads stays plain. Output that only has lines starting with - or + (a listing, a list) stays plain; copying the card still copies the output exactly.
Release v1.2.5 of pig. Install via composer global require pigagent/pig:1.2.5 or view on GitHub.
Fixed
A pig web page that was away — hidden for more than 30 seconds, a laptop locked or asleep while the conversation went on from another device — no longer draws everything it missed one message at a time. It keeps what it needs (whether a run is going, the stop button, notifications) and, when it is looked at again, loads the last page only, as a reconnect does; older messages come back when scrolled to. A backlog delivered all at once on waking is dropped the same way. On 3,000 tool rounds in a hidden tab: 7s of work instead of 90s, and the latest answer on screen 28ms after the tab is shown.
A tab left open and visible through a long run redraws its last page every 300 messages instead of growing without end (110,000 page nodes on 3,000 rounds, now 17,600), and keeps up with the run instead of falling minutes behind. Never while you are scrolled up reading.
Release v1.2.4 of pig. Install via composer global require pigagent/pig:1.2.4 or view on GitHub.
Fixed
After the computer sleeps, a run carries on within seconds of waking instead of up to five minutes later. A model's stream that died while the lid was shut was waited on for the whole idle timeout, because a wait counts only time awake; pig now notices that the clock jumped past the time it was awake, fails the reads it was waiting on as timed out, and the usual retry continues the run.
pig web reconnects after the computer sleeps, rather than trusting a connection that still says it is open, and an answer that was streaming when the page reconnected keeps appearing instead of stopping at what had arrived before.
Release v1.2.3 of pig. Install via composer global require pigagent/pig:1.2.3 or view on GitHub.
Fixed
Opening a long session in pig web no longer waits for all of a long run: the first page started at the last prompt, so one prompt followed by hundreds of tool calls sent and drew every one of them before anything showed (5.4MB and 2.4s on a 1,500-call run, now 329KB and 0.6s). A page now starts at a prompt only when one is within reach, otherwise at the nearest message that is not a tool result, so a call and its result stay together; scrolling up still brings back the rest. While it loads, the tab says so instead of showing the new-session welcome screen.
Release v1.2.2 of pig. Install via composer global require pigagent/pig:1.2.2 or view on GitHub.
Fixed
Mermaid parser tolerates whitespace in node style class annotations (such as node["Label"] ::: className or ::: className): spaces after the closing bracket and between ::: and the class identifier are no longer treated as unparsed statement remnants, preventing spurious dropped, expected a link warnings and keeping terminal diagram rendering enabled.
Release v1.2.1 of pig. Install via composer global require pigagent/pig:1.2.1 or view on GitHub.
Fixed
ProcessTerminal::flush() no longer falsely times out with "Terminal stopped accepting output with N bytes still to write" when draining large buffers (such as long conversation transcripts on /quit or mode switch) across fast chunked writes. Draining now measures true idle starvation time rather than incrementing a fixed timeout per loop iteration.
When the terminal really does stop taking output while pig exits or suspends, it is still put back the way pig found it: the failed write used to skip that, leaving the shell in raw mode — no echo, Enter not starting a new line — until reset.
A plain pig update installs a bundled extension added since the last update — before, only the first run on a new machine or pig update --extensions did, so a release's new extension reached nobody who already had pig until they knew to ask. What has been offered is kept in ~/.pig/agent/extensions/.bundled.json, so a bundled extension you deleted stays deleted; for an install from before the record, the five shipped until now count as offered already.
Release v1.2.0 of pig. Install via composer global require pigagent/pig:1.2.0 or view on GitHub.
Added
pig-gemini-video, a bundled extension: any model can watch a local video through Gemini — the analyze_video tool returns Gemini's answer as text, and /gemini-video [prompt] puts it into the conversation. It goes through an Antigravity subscription when one is signed in (the video sent inline, up to 14MB) and otherwise, or for a larger file, or when that fails, through a Gemini API key, uploading big files through the Files API and deleting them after. geminiVideo.via (auto, gemini, antigravity), geminiVideo.model and geminiVideo.antigravityModel choose; PIG_GEMINI_VIDEO_DEBUG=1 logs failed responses, secrets removed. Existing installs get it with pig update --extensions.
Release v1.1.0 of pig. Install via composer global require pigagent/pig:1.1.0 or view on GitHub.
Added
The footer shows how fast an answer streams, as the developer's token-speed extension did: ⚡ … while it comes in, then ⚡ · avg · TTFT after the session name. Not upstream's. tokenSpeed.enabled: false in settings.json, or the *Token speed* row in /settings, turns it off; nothing of it is written to the session file. An extension that still sets the token-speed status shares the same place rather than showing it twice.
Changed
A resize, ctrl+o or a theme change no longer parses every message's Markdown again: the parse depends on the text alone, so the most recent 512 messages keep theirs in one shared cache and are only laid out again at the new width — about 7% of a resize frame on a long session. Upstream holds each message's parse weakly; a PHP object held only weakly is freed at once, hence the cap instead. A streaming answer takes one place in the cache, not one per token.
Release v1.0.4 of pig. Install via composer global require pigagent/pig:1.0.4 or view on GitHub.
Fixed
The OAuth fallback port test safely handles port 53692 when already bound by the OS or another runner process, suppressing unhandled socket bind warnings in CI test suites.
Release v1.0.3 of pig. Install via composer global require pigagent/pig:1.0.3 or view on GitHub.
Added
/copycode, or /cc, copies one code block of the last answer, picked from a list that also offers the whole answer; an answer with no code block is copied whole. Fences are read as Markdown reads them — a ``` block that shows a `` block stays one block — and a block inside a list item comes back without the list's indentation.
Release v1.0.2 of pig. Install via composer global require pigagent/pig:1.0.2 or view on GitHub.
Fixed
Copying works under Termux without the Termux:API app: when termux-clipboard-set is not there, the copy goes out as OSC 52, which Termux's own terminal puts on the clipboard. Upstream sends nothing there, so /copy — and an extension's copy — silently did nothing unless both Termux:API and its termux-api package were installed. An extension's new SystemClipboard() now writes that sequence through the screen's terminal too, in order with the frames.
A collapsed command output whose note is omitted (such as the running preview) stops wrapping once its visual row budget is satisfied, instead of continuing backwards across every earlier line counting dropped rows that are never displayed.
The test asserting that collapsing a long command output costs only the tail warms up the component and text wrapping classes first, avoiding timing failures from class autoloading under CI runner load.
Running phpunit no longer launches Chrome or opens background /web daemon tabs: removed the intrusive /web restart daemon tests and guarded WebMode browser opening under test and offline environments.
Release v1.0.1 of pig. Install via composer global require pigagent/pig:1.0.1 or view on GitHub.
Fixed
A long tool call no longer holds the screen while it streams: its arguments are read as they arrive instead of being parsed again from the start with every piece, which made a 70KB write cost 4.5 seconds of the event loop and now costs about 15ms (upstream #9265).
A blockquote nested dozens of levels deep renders in one pass instead of re-wrapping its lines at every level, which grew about threefold per level (upstream #11321).
In fullscreen, an image whose top has scrolled above the viewport is cropped instead of vanishing, inside a padded or bordered box too.
MCP OAuth accepts only http and https addresses, for the metadata it is given and for the authorization endpoint it opens.
A model named as provider/id resolves when the provider's own id contains a slash (upstream #11397).
A configured package that fails to install is left out with a warning naming pig remove , instead of taking every package's resources with it; pig install and pig update still fail on it (upstream #11304).
On Termux, fd and rg are not downloaded — the published builds are for glibc Linux and do not run on Android — and the message says pkg install fd ripgrep; install.sh installs both there.
Changed
Gemini tool schemas send const as a one-value enum, leaving literal data such as default and examples as written.
With per-message effort, Anthropic requests send a fixed low top-level effort.
Tool search puts a tool first when the query is its name.
Double-click in fullscreen selects a whole path such as ~/.pig/agent/settings.json, as iTerm2 does.
/scoped-models shows a model's name beside its id when the name says something the id does not.
The pi-messages protocol's final events carry responseModel.
Kimi K3.1 Pro models are treated as the Kimi K3 family in the built-in model lists.
Release v1.0.0 of pig. Install via composer global require pigagent/pig:1.0.0 or view on GitHub.
Changed
The README shows how to compact a model with a large window early: compaction.modelOverrides with a reserveTokens of most of the window, so a 1M-token Gemini is compacted at about 200k instead of sending most of a million tokens with every request. pi reads the same key.
Release v1.0.0-rc.3 of pig. Install via composer global require pigagent/pig:1.0.0-rc.3 or view on GitHub.
Changed
A resize, or ctrl+o, on a long session lays the transcript out again in about 60% of the time it took: a cluster's width is remembered instead of measured on every frame, and wrapping walks a line a run of characters at a time rather than a byte at a time.
The README says what 1.0 promises to keep stable: the extension API, the files in ~/.pig/agent, the session file, the RPC protocol and the command line. Everything else is internal.
pig-computer and pig-android-use keep their screenshots in the extension's artifactsDirectory(), so an incognito session's are removed with it instead of left in ~/.pig/agent/artifacts.
Release v1.0.0-rc.2 of pig. Install via composer global require pigagent/pig:1.0.0-rc.2 or view on GitHub.
Fixed
Fixed the terminal UI freezing while the terminal took a big frame: a resize or ctrl+o on a long conversation redraws megabytes, and writing them used to wait until the terminal had taken every byte — seconds in which no key was read and Escape did nothing (PIG_STALL_LOG measured 4 and 16 seconds). Output the terminal does not take at once is now written from the event loop as it reads, and the next frame is drawn once it has caught up, with everything that changed meanwhile.
Release v1.0.0-rc.1 of pig. Install via composer global require pigagent/pig:1.0.0-rc.1 or view on GitHub.
Added
Added ImageMagick as the image codec where PHP has no GD extension (Termux's PHP among them): the read tool, a pasted picture and a tool's screenshot are fitted inside the provider's limits through magick (or IM6's convert) with the same steps as through GD, instead of being left out and handed to the model to shrink with commands of its own. When PHP has no GD the installer installs it on Termux (pkg install php-gd, Termux's PHP being built without it), and elsewhere installs ImageMagick with the system's package manager (brew, apt-get, dnf, yum, pacman, zypper or apk), /doctor says what resizes pictures, and with neither the omission now says what is missing.
Changed
The README says where pig runs: macOS, Linux and Android (Termux); on Windows, WSL.
Fixed
Fixed the installer recognising Termux only through $PREFIX: $TERMUX_VERSION and /data/data/com.termux were checked but their answer was thrown away.
Fixed skill and prompt template frontmatter being read a line at a time: it is YAML now, as upstream reads it. A SKILL.md whose frontmatter is not YAML — most often a second : in an unquoted description, description: Use when: … — is refused with the reason and the line, as pi refuses it, instead of loading anyway; a prompt template with one is left out with the same warning; and a folded or literal description (description: > or |) is read whole instead of as >.
Fixed PIG_STALL_LOG naming another coroutine's await as where a stalled one resumed from: each coroutine's own suspension is kept, a coroutine's start has none, and each line now says how many cycle-collector runs fell inside the stall and for how long, and how much memory the process held.
Fixed a pre-release's changelog heading being read as the release it precedes: ## [1.0.0-rc.1] is 1.0.0-rc.1, so the candidate's notes are not shown again as news when 1.0.0 comes.
Release v0.12.1 of pig. Install via composer global require pigagent/pig:0.12.1 or view on GitHub.
Fixed
Fixed @ error suppression in Dns::start() and SchemaErrors::matches() triggering test/lint.php failures: replaced with set_error_handler and restore_error_handler as required by repo conventions.
Fixed test/lint.php false positive on static class property accesses (self::$prop, Class::$prop) inside closures in uncapturedClosureReads().
Fixed InteractiveModeTest failing on macOS when checking clipboard unavailability message.
Release v0.12.0 of pig. Install via composer global require pigagent/pig:0.12.0 or view on GitHub.
Added
Added /discard, pig's own: after a confirmation it quits and moves the current session's file to the trash, for a question decided afterwards not to be worth keeping (--no-session is the same decision made before starting). With nothing on disk yet it simply quits.
Added incognito, pig's own, after Chrome's incognito window: pig --incognito starts a private session, /incognito makes the current one private part way (its file goes to the trash after a confirmation), and the web UI has "New private session". A private session writes no session file, no logs and no crash records, keeps a command's full output only in its own temporary directory (removed when it ends), and does not save the default model /login picks for you; settings you change on purpose are still saved. The footer and the editor's border mark it, and a notice says that requests still go to the model provider. Extensions are told with isIncognito() and get artifactsDirectory() for what they save.
Release v0.11.4 of pig. Install via composer global require pigagent/pig:0.11.4 or view on GitHub.
Changed
The web UI's tool call titles (the command or path a call ran on) and the titles of skill, summary and hook blocks can be selected and copied; a click that ends a selection no longer expands or collapses the card or block.
Release v0.11.3 of pig. Install via composer global require pigagent/pig:0.11.3 or view on GitHub.
Changed
PIG_TIMING=1 prints upstream's tables: Startup Timings: main in upstream's format, and a new Startup Timings: extensions with a module import and a factory line for each extension (builtin: for a built-in), so the cost of each extension can be read and a pig table compared with a pi one.
Fixed
Fixed a slow DNS server freezing the whole terminal: a host name is now looked up in a child process while the event loop keeps running, instead of inside the connect, where the lookup held everything for seconds (up to the connect timeout). Addresses are kept for five minutes per host; TLS still verifies and names the host.
Fixed an extension in ~/.pig/agent/extensions being loaded and initialised only to be replaced by a trusted project's extension of the same name: it is now held back until the project's trust is known and loaded only when no project copy took its name. Starting pig in its own repository loaded every bundled extension twice.
Faster startup with a large model catalog: the model table is rebuilt in one pass over the stored catalogs instead of one pass per catalog (it is rebuilt whenever an extension registers models), the shipped rows are keyed once, and the catalog's 1,700 rows share their identical compat and price objects.
Release v0.11.2 of pig. Install via composer global require pigagent/pig:0.11.2 or view on GitHub.
Fixed
Fixed the startup package update check holding the terminal for most of a second: git ls-remote for each git package and the Composer queries now wait on the event loop instead of blocking it, so the first frames and the keyboard are not held while a remote answers.
Fixed PIG_STALL_LOG reporting the quit itself on the terminal: watching stops when the interactive mode stops. A coroutine held before its first suspension is now logged under the closure it runs (Async.php:94 → pig:1321) instead of the shared starter.
Release v0.11.1 of pig. Install via composer global require pigagent/pig:0.11.1 or view on GitHub.
Fixed
Fixed bin/pig losing its executable bit in 0.11.0, so running it from a git checkout failed with "permission denied". Composer installs were not affected.
Release v0.11.0 of pig. Install via composer global require pigagent/pig:0.11.0 or view on GitHub.
Added
Added MiniMax-M3.1-Flash to the MiniMax providers: they now list every tool-calling model but the older M2, M2.1, M2.5 and M2.5-highspeed MiniMax asked to hide, and a model with effort levels uses adaptive thinking with output_config.effort, since MiniMax-M3.1-Flash rejects thinking.type: "disabled" (upstream #11121).
Added Clef Omni and Jev 1.14 to Workers AI's classifiers.
Added image input for System One classifiers: Jev from TypeSafe and Workers AI, Clef from Workers AI and OpenRouter's decision models take ClassifierContext images, each in its service's form — TypeSafe assets with its TypeSafe-Danger-Zone-Images opt-in header, Clef's images data URLs (PNG, JPEG and WebP, at most four), or OpenRouter's image_url parts. A classifier's compat (imageInput, sendImageOptInHeader) chooses the form; a models.json provider's compat and baseUrl now reach its classifier models, and an extension's classifier models take compat too.
Added the Radius gateway's catalog for the signed-in account: Radius models an organization owner disabled are no longer listed. The catalog is saved in models-store.json and replaces the shipped Radius models, offline too.
Added outputPad to the render options a custom tool's renderers are given (upstream #10557).
Added namespace aliases for codemode tools: describe_namespace() and search_tools()'s namespace find an MCP server by docs or mcp__docs, in place of the rule that took the part after a name's last __.
Added an agentName to the OpenAI Codex sign-in, which names the app as the browser login's originator (upstream #10433).
Changed
GPT-6 models on the openai provider keep the prompt cache when the thinking level changes: with an API key, reasoning.effort stays fixed and the level is sent as configuration_update input items, recorded on each reply so earlier input is rebuilt unchanged. Controlled by compat.supportsMidConvoEffort; not used with Sign in with ChatGPT or with thinking off (upstream #10853).
Xiaomi MiMo models offer only thinking on and off and send no reasoning effort (upstream #10818).
Claude Haiku 5.5 and Claude Opus 5 can be switched off: off sends plain disabled thinking instead of an effort message (upstream #10753).
Gemini 4 and later models are sent Google's thinkingLevel instead of a token budget (upstream #10890).
The Codex provider no longer lists GPT-5.5 and GPT-5.3 Codex Spark, which the backend rejects for ChatGPT accounts, and GPT-6.1 Sol has a 500K context window there (upstream #11173, #10840).
Model and caller headers now override the Codex provider's originator and User-Agent, as for every other provider; Authorization and chatgpt-account-id stay fixed (upstream #10429).
Anthropic sign-in falls back to a free loopback port when 53692 cannot be bound (Hyper-V and WSL reserve port ranges on Windows), and without any callback port it still takes a pasted redirect URL (upstream #10571).
Custom providers pointing at opencode.ai are sent OpenCode's x-opencode-session header too.
OpenRouter responses on Chat Completions and Anthropic Messages report OpenRouter's billed cost as usage.cost.total (with the upstream inference cost for BYOK requests) and mark it totalFromProvider; the per-component costs stay catalog estimates (upstream #10286).
MCP OAuth sign-ins can be cancelled at every step: Esc on the manager's status screens and session shutdown abort a sign-in in flight, every request to the authorization server is handed the abort, an aborted refresh no longer falls back to a new authorization, and pig mcp login --timeout limits the whole sign-in rather than only the wait for the browser (upstream #10565).
Closing an MCP HTTP session sends the last request's token instead of asking for one, so closing never waits for a token refresh (upstream #10565).
MCP tool result schemas in codemode describe content blocks and relocate the server's own $refs under structuredContent, so they resolve as declared.
Kitty keyboard reporting now includes alternate keys, so bindings naming a shifted symbol (+, ctrl++) match Shift plus the unshifted key (upstream #9880).
Fuzzy matching ranks a contiguous occurrence above an earlier scattered one, and the session picker's search matches the name, id, messages and working directory separately: the name ranks first, and the id and messages match only as exact text (upstream #11220).
Windows shell detection finds PowerShell 7 under %ProgramFiles% and Windows PowerShell and the legacy WSL launcher under %SystemRoot%, wherever Windows is installed (upstream #9501).
A failed copy names what to install: the Termux:API app and termux-api package on Termux, wl-clipboard under Wayland, xclip or xsel under X11.
The codemode description and CODEMODE.md say a tool with an output schema (such as bash exiting non-zero) answers its structured result on failure too; codemode's image() errors describe image blocks without calling them MCP blocks.
Fixed
Fixed Anthropic dropping a held system update when it came before an assistant message that converts to nothing: it is now sent before the next assistant message that goes out (upstream #11091).
Fixed images in an error tool result being lost on Anthropic and Bedrock Claude: they now follow the tool results with a caption naming the call (upstream #10794).
Fixed ChatGPT Business workspace usage limits being retried: subscription_sharing_workplace_individual_usage_limit_exceeded is no longer retried and says to ask the workspace admin.
Fixed escape sequences and UTF-8 characters split across two reads of bash output leaving fragments such as 31m in the output: an unfinished sequence is held back until the rest arrives (upstream #10504).
Fixed Workers AI classifier prices: Clef Flash is $0.038 with a 24,576-token context, Jev $0.042.
Fixed OpenRouter router models such as openrouter/auto getting negative prices in the catalog: a negative or unreadable price is now treated as unknown.
Fixed the cursor marker being dropped when an overlay ends directly left of the cursor, which lost the hardware cursor's place.
Fixed a terminal colour reply split between the ESC and the backslash of its terminator leaking its hex text as keystrokes.
Release v0.10.2 of pig. Install via composer global require pigagent/pig:0.10.2 or view on GitHub.
Fixed
Fixed headless Chrome launch timing out under CI load in WebSearchExtensionTest: raised HeadlessBrowser::LAUNCH_TIMEOUT from 15s to 30s, drained both stdout and stderr for the DevTools endpoint line, and included trailing output in the timeout error.
Release v0.10.1 of pig. Install via composer global require pigagent/pig:0.10.1 or view on GitHub.
Fixed
Fixed McpExtensionTest intermittently failing in CI: the session start integration test now waits for background MCP server connections to settle before asserting problem notices on servers that connect asynchronously.
Release v0.10.0 of pig. Install via composer global require pigagent/pig:0.10.0 or view on GitHub.
Added
Added client identity to pig/ai: an identity request option (ClientIdentity) chooses the User-Agent (detailed with a version, short, or custom) and the attribution headers for OpenRouter, NVIDIA NIM and OpenCode (ClientAttribution). Agent loops attribute requests to pig by default, and Agent::$identity overrides it field by field.
Added model catalog updates from pigagent.dev: each built-in provider's list (chat, image and classifier models) is fetched at most every four hours, revalidated with its ETag, saved in models-store.json for offline use, and laid over the shipped models only when it is newer than them. OpenRouter's per-key list is narrowed from the shipped models plus that catalog. PIG_MODEL_CATALOG_URL names another catalog server; off turns it off. Radius and providers an extension replaces are left out.
Added per-key OpenRouter model lists: with an OpenRouter key, pig lists only the chat models that key may use, with the key's context size, max output and prices (GET /models/user, at the base URL models.json sets, so guardrails and regional endpoints apply). The list is saved in models-store.json and used offline (upstream #10672).
Added reachesTools to CustomTool, so a tool that reaches other tools declares which ones a call may reach ('all', or the words that may name them); getAllTools() carries it. The codemode tool reaches the servers a script names, or every one when it searches or enumerates tools; tool_search reaches all.
Added Kimi Code subscription sign-in for the kimi-coding provider: /login → Kimi Code (subscription), a device code approved on kimi.com, with token renewal; KIMI_CODE_OAUTH_HOST (or KIMI_OAUTH_HOST) overrides the authorization host.
Added Radius uploads to /share: signed in to Radius, the session's JSONL goes up as an organization artifact and the share URL is its link. The sessionShareDestination setting (also a /settings row) chooses auto (Radius when signed in, otherwise a GitHub gist; the default), gist or radius (upstream #10870).
Changed
Provider requests now send pig/ (; php/; ) as their User-Agent, and the attribution headers come from the client identity: before_provider_headers handlers no longer see the OpenRouter, NVIDIA and OpenCode attribution headers (returning null for one still removes it), Cloudflare gets the detailed User-Agent instead of pig-coding-agent, as do GitHub release checks for tool downloads, and OpenCode gets x-opencode-client whenever attribution is on, not only with a session. Amazon Bedrock appends pig/ to the AWS SDK's user agent, as upstream appends pi/.
The first prompt waits only for MCP servers with direct tools; a codemode or tool_search server is waited for by the call that reaches it (its tool_call), and codemode or tool_search is activated from the configuration before servers connect.
Changed the kimi-coding provider to OpenAI Chat Completions at https://api.kimi.com/coding/v1, the protocol the official Kimi Code client uses: K3, K3-256K and Kimi For Coding take tools added mid-conversation without losing the prompt cache. A models.json override of the kimi-coding base URL must now include /v1 (upstream #10720).
Moved OpenCode Zen and OpenCode Go to the opencode.ai/inference endpoints, which fixes OpenCode Go's Gemini models (404 on /zen/go); OpenCode Go's MiniMax M2.7 now uses the Anthropic Messages API, as Chat Completions answers "Model does not support this protocol".
Changed the built-in model catalog to pi's model JSON: one file per provider in packages/ai/data/models/, the format of pi's own catalog, of pi.dev's /api/models/providers/ and of models.json, read at startup instead of derived from PHP tables. The models, prices and request settings are unchanged; scripts/generate-models.php writes the rows and then the JSON, and scripts/build-models.php rebuilds the JSON after a hand edit.
Fixed
Fixed OpenAI Responses models losing the prompt cache on every deferred tool load after a tool was removed: models with additional_tools declare every tool in additional_tools items, starting with one at the head of the input, and announce removals as text; tool search and Kimi tool messages move the top-level tool list once per removal or redeclared name and keep later loads anchored (upstream #10940).
Release v0.9.1 of pig. Install via composer global require pigagent/pig:0.9.1 or view on GitHub.
Fixed
Fixed /quit from fullscreen crashing with "Call to undefined method TuiMainScreen::resolveFakeCursors()" in a pig that was updated while it ran: both renderers are now loaded when the first one is created, so a later switch cannot mix an old base class with a new screen.
Fixed pig crashing at startup with "Cannot redeclare" when a package's checkout is the project and the same package is installed: an entry file's declarations now include the helpers it requires from __DIR__, so a different copy is refused by name and an identical one is treated as the same extension.
Release v0.9.0 of pig. Install via composer global require pigagent/pig:0.9.0 or view on GitHub.
Changed
--model no longer lets catalog order choose between providers that offer the same model: the provider with credentials is used, then pig's rule that the provider making a model beats one reselling it, and otherwise pig refuses with the candidates and asks for --provider or provider/model. --api-key does not choose a provider. A provider/id the provider does not list is used as a custom model id on that provider, with a warning, and a :suffix that is not a thinking level stays part of the id (upstream #10160).
--models and enabledModels add a model for each provider that offers it, with a warning naming them; an id containing [ is matched as an id before being read as a glob.
A second extension dialog (select, confirm, input, editor, custom) opens on top of the one showing instead of being refused; answering it brings the earlier one back (upstream #11166).
Fixed
Fixed pig crashing at startup with "Cannot redeclare class" in a project whose extensions/ folder holds an extension's helper files: a project that is a pig package now loads the extensions its manifest names, as installing it would, and a file another extension already included is reported as not an extension instead of being loaded a second time. The trust question lists the same files.
Fixed pasting in the shell hanging on Linux after copying in pig and suspending it with Ctrl+Z: the wl-copy/xclip/xsel process that keeps serving the clipboard now runs in its own session (via setsid) and is not stopped with pig (upstream #11179).
Fixed tool calls in a response cut off at the output limit being run with arguments the salvage parser may have completed wrongly: they are now reported as not executed, and the model is asked to send them again.
Fixed a response cut off below the model's output limit ending the turn: the session now compacts and retries once, as it does for a context overflow ("Truncated response recovery failed …" if the retry is cut off too).
Fixed sessions breaking after that recovery when the truncated tool call had a result: the result was kept without its call and providers rejected every later request (upstream #11227).
Fixed pig config crashing with "Theme not initialized" before drawing anything: it now sets up the theme from settings first, as upstream's selectConfig() does.
Fixed a crash inside pig config leaving the terminal in raw mode, which printed the crash message as a staircase.
Fixed /android and /computer failing on every use: they called sendMessage() with only the text. Their answers are now shown on screen as notices instead of being sent to the model.
Release v0.8.0 of pig. Install via composer global require pigagent/pig:0.8.0 or view on GitHub.
Added
Added deliverAs to $pi->sendMessage(): 'steer' (the default while busy), 'followUp', or 'nextTurn', which holds the message for the next run.
Changed
Breaking:BeforeAgentStartEventResult takes a HookMessage instead of text: new BeforeAgentStartEventResult(new HookMessage('git', [new TextContent('on branch main')])). Every handler's message is kept, in hook order, and follows the run's starting message instead of going in front of the prompt.
Breaking:before_agent_start also fires for runs started by $pi->sendMessage(…, triggerTurn: true) while idle. BeforeAgentStartEvent has messageType: 'user' events carry prompt and images, 'custom' events carry the starting message and no prompt. Handlers that should act only on prompts must check $event->messageType === 'user'.
Breaking:HookRunner::emitBeforeAgentStart() takes the trigger (['messageType' => 'user', 'prompt' => …, 'images' => …] or ['messageType' => 'custom', 'message' => …]) and returns the handlers' messages; the send writer given to HookRunner::initialize() gets deliverAs as a third argument.
The session counts as busy while a run starts, before_agent_start handlers included: $ctx->isIdle() is false, $pi->sendMessage() goes into the starting run instead of starting a second one, and an abort requested meanwhile aborts the run once it starts.
Fixed
Fixed runs started by $pi->sendMessage(…, triggerTurn: true) skipping before_agent_start, which lost the prompt sections its handlers add.
Release v0.7.0 of pig. Install via composer global require pigagent/pig:0.7.0 or view on GitHub.
Added
Added durationMs to assistant messages (measured by AssistantMessageEventStream from the request's start), to tool result messages and to tool_execution_end (hook, RPC and JSON events): how long execute() took, on a monotonic clock. Tool rows show the recorded Took, also after a session is reloaded.
Added argumentsError to tool calls: a finished call whose arguments are not a JSON object no longer runs with the fields parsed before the error; validation fails and shows the model the text it sent.
Added PIG_CLIPBOARD_OSC52=1, and OSC 52 copies for SSH/mosh sessions and headless Linux, so a copy reaches a remote client's clipboard.
Added TuiAltScreen::resetTextSelection(); a rebuilt transcript drops the old selection.
Added Herdr and Rex terminal detection (OSC 8 hyperlinks, Kitty images).
Added FakeCursor::renderFakeCursor(): Editor and Input mark their drawn cursor and the renderer draws it, or leaves it out where showHardwareCursor puts the terminal cursor.
Resumed sessions restore their recorded tools only when the tools came from the defaults, apply --tools +name/-name on top, and activate extension tools the branch never mentioned.
Compaction and branch summaries use the model's output limit instead of a fixed cap, and no longer include thinking in the summarization request; /compact also reaches the summary of a split turn.
Thinking from a different model is dropped on a model switch instead of being sent as text.
OpenAI-compatible streams handle reasoning before content, so a chunk carrying both keeps thinking before the answer.
Print mode prints a response cut off at the output limit, warns on stderr and exits 1.
pig mcp list reports resources: true instead of listing every resource.
Changed the default GitHub Copilot model to gpt-6.1-sol.
Fixed
Fixed Anthropic requests failing when the strict tool set exceeds the provider's limits: they are retried once with prefer tools non-strict.
Fixed automatic retry missing stream disconnected before completion and treating digits inside request ids or byte counts as status codes.
Fixed any HTTP 413 not counting as context overflow, and whitespace-only tool output being sent as-is to OpenAI and Google providers.
Fixed \u escapes such as \usepackage breaking tool-call argument parsing.
Fixed MCP tool calls failing on non-object structuredContent, cancelled MCP requests being sent after an OAuth refresh, an unverifiable iss being accepted at sign-in, and mcp.json with a BOM failing to parse.
Fixed ~ in !pattern, +path and -path resource setting entries, a symlinked AGENTS.md in a nested worktree being skipped, empty quoted prompt template arguments being dropped, and @ file completion with regex metacharacters.
Fixed the grep tool following RIPGREP_CONFIG_PATH (rg --no-config), codemode joining output in quadratic time, a misplaced // @options: line being ignored, and unhandled wheel input under a focused overlay not scrolling the transcript.
Release v0.6.99 of pig. Install via composer global require pigagent/pig:0.6.99 or view on GitHub.
Fixed
Fixed fullscreen sessions dying with Allowed memory size … exhausted on long transcripts — each frame's layout tree was a reference cycle holding the whole transcript's lines, and hundreds of frames piled up waiting for PHP's cycle collector; a retired frame is now freed at once.
Fixed the terminal being left in mouse-reporting, raw and alternate-screen mode (the shell printing 35;31;25M… on every mouse move) when pig exits without stopping the TUI, e.g. on a fatal error — upstream's exit restore is ported, stty is restored too, and a fatal error is printed again after leaving the alternate screen.
Release v0.6.98 of pig. Install via composer global require pigagent/pig:0.6.98 or view on GitHub.
Added
Hardware H.264 stream capture for pig-android-use: Added MediaCodec hardware-accelerated H.264 video stream frame capture via screenrecord --output-format=h264 piped directly to local ffmpeg. Cuts screenshot capture latency on high-resolution flagship devices (such as 2K 3200x1440 screens) from ~2.3s down to ~0.7s with zero phone CPU compression bottleneck.
Added FFMPEG_PATH environment variable support and hardware_accelerated diagnosis reporting in /android screenshot and android_doctor.
Changed
Graceful screenshot fallback in pig-android-use: AdbClient::captureScreen() automatically probes for hardware acceleration and silently falls back to standard screencapRaw + JPEG pipeline if ffmpeg is absent or the device does not emit H.264 streams, preserving 100% compatibility.
Screen wake-up and keyguard handling: AdbClient::wakeUp() now dismisses keyguards and settles display flinger layer stack state to prevent UNASSIGNED_LAYER_STACK errors during automated screen capture.
Release v0.6.97 of pig. Install via composer global require pigagent/pig:0.6.97 or view on GitHub.
Fixed
Working no longer disappears for the rest of a run after a retry. A successful retry is announced at the end of the answer it got — often a tool call — and that took down every loader, so the turn after the tool (the model reading its result) ran with nothing above the prompt and looked stuck. Only the retry countdown is cleared now, and Working comes back at every turn's start, as in pi.
Release v0.6.96 of pig. Install via composer global require pigagent/pig:0.6.96 or view on GitHub.
Fixed
A long session no longer stops following the window. A bash result with one long line of non-ASCII text (50KB of scraped Chinese page text, here) cost the square of its length to wrap, at every new width: a resize drew nothing for over ten seconds, while a fresh session followed at once. Each character is now found in a small window instead of by splitting the rest of the line.
Release v0.6.95 of pig. Install via composer global require pigagent/pig:0.6.95 or view on GitHub.
Fixed
/resume opens the session list even when this folder has no sessions yet, as pi's does — it says "No sessions in current folder. Press Tab to view all." and Tab shows every project's, so a session from another folder can be resumed (pig switches to its folder). It used to stop at "No earlier sessions here yet."
Release v0.6.94 of pig. Install via composer global require pigagent/pig:0.6.94 or view on GitHub.
Added
PIG_STALL_LOG=1 logs every moment the event loop is held for 0.3s or more — nothing drawn, no key read — to ~/.pig/agent/logs/pig-.log: how long, which callback, and where the coroutine it resumed had suspended before and after. For tracking down an occasional pause, such as a message that takes a second to appear after Enter.
Release v0.6.93 of pig. Install via composer global require pigagent/pig:0.6.93 or view on GitHub.
Fixed
Top-level document navigation in Web UI SameOriginMiddleware: Permitted top-level GET/HEAD document navigations (Sec-Fetch-Mode: navigate) when launching the Web UI from external apps (e.g. Telegram, Termux, Android Intent launchers), preventing false-positive 403 Requests from another site are refused errors on mobile browsers.
Release v0.6.92 of pig. Install via composer global require pigagent/pig:0.6.92 or view on GitHub.
Fixed
Case-insensitive provider authentication resolution: Lookups for stored credentials in auth.json (such as kind(), hasKeyFor(), apiKey(), and apiKeyCredential()) now fall back to case-insensitive matching, ensuring variations like my-gateway, My-Gateway, or myGateway all resolve cleanly without authentication mismatches.
Release v0.6.91 of pig. Install via composer global require pigagent/pig:0.6.91 or view on GitHub.
Fixed
Seamless session model switching after custom provider discovery: Automatically updates the active session's model scope when new custom models are discovered and saved to models.json, ensuring the session immediately switches to the discovered model without requiring manual picker navigation.
File path paste on Ctrl+V: Pastes a copied file by its own path before looking for a picture, matching upstream pi: photos copied from Telegram or files copied in Finder/file managers land directly in the prompt as file paths.
Release v0.6.90 of pig. Install via composer global require pigagent/pig:0.6.90 or view on GitHub.
Changed
The Working loader shows how long it has been running again (Working · 16s), and so do compaction and branch summary — taken out in 0.6.75 to match upstream, back at the developer's request and recorded in docs/dev/decisions.md as a deliberate difference.
Release v0.6.89 of pig. Install via composer global require pigagent/pig:0.6.89 or view on GitHub.
Fixed
Endpoint model discovery in /login custom provider setup wizard: Corrected the internal HTTP client invocation to HttpClient::follow(new Request(...)) when probing $baseUrl/models, fixing an issue where model discovery silently fell back to a default model.
Release v0.6.88 of pig. Install via composer global require pigagent/pig:0.6.88 or view on GitHub.
New Features
Interactive setup wizard for custom OpenAI-compatible providers in /login:
Running /login for any custom or unconfigured provider (or selecting + Add custom provider (OpenAI compatible)... from the API key menu) launches a two-step setup wizard.
Interactively prompts for the endpoint's Base URL and API key directly in the terminal without requiring manual edits to models.json.
Automatically queries GET $baseUrl/models, populates the model catalog into ~/.pig/agent/models.json, stores the API key in auth.json, reloads custom models, and switches the session to the newly discovered model immediately.
Fixed
A turn no longer stops on Write failed: Connection closed by peer and pig's other transport errors (Read failed, Connection closed before the response head was complete, TLS handshake with … failed): they are retried like the fetch failed / other side closed Node reports for the same thing, which pi retries. Upstream's newer retryable wording is in too (temporarily unavailable, upstream provider returned an error, unable to forward upstream, HTTP/2 stream failed, …).
Release v0.6.87 of pig. Install via composer global require pigagent/pig:0.6.87 or view on GitHub.
Added
Custom provider API key authentication and automatic env variable resolution:
Custom providers declared in models.json are now dynamically discovered by /login under "Sign in with an API key", prompting for and storing credentials securely in auth.json.
Added automatic fallback to canonical environment variable names (_API_KEY) for any custom provider declared outside built-ins.
Fixed
Transport-level transient error retries:
Aligned retryable error patterns with upstream pi, adding socket-level transport disconnect matching (Connection closed by peer, Read failed, TLS handshake failed) and gateway forwarding failure phrases.
Release v0.6.86 of pig. Install via composer global require pigagent/pig:0.6.86 or view on GitHub.
Fixed
Guaranteed profile persistence in install.sh:
Always ensures that pig (and bootstrapped Composer if applicable) is permanently appended to the user's shell profile (.profile or .zprofile), even when symlinking into an existing system bin directory succeeds.
Automatically creates .profile if none exists, appends clean $HOME-relative export lines with dedicated labels (# pig and # composer), and immediately sources the file for the current session.
Release v0.6.85 of pig. Install via composer global require pigagent/pig:0.6.85 or view on GitHub.
Changed
Clean $HOME-relative PATH export and ~/.zprofile detection in install.sh:
Automatically formats the appended PATH export using portable $HOME variables (e.g. export PATH="$HOME/.composer/vendor/bin:$PATH" or $HOME/.config/composer/vendor/bin) instead of hardcoded absolute paths, matching standard user profile style.
Added native detection for ~/.zprofile under zsh shells.
Enhanced duplicate path checking to recognize both absolute and $HOME-prefixed lines.
Release v0.6.84 of pig. Install via composer global require pigagent/pig:0.6.84 or view on GitHub.
Fixed
Unified system bin symlinking for Composer in install.sh:
Automatically prioritizes default system PATH directories (such as /data/data/com.termux/files/usr/bin in Termux, or /usr/local/bin) when bootstrapping Composer.
Symmetrically links composer into the system PATH via a unified link_binary_to_path helper, ensuring which composer resolves directly and consistently alongside which pig.
Release v0.6.83 of pig. Install via composer global require pigagent/pig:0.6.83 or view on GitHub.
Fixed
Persistent command resolution after quitting initial session in install.sh:
Dynamically searches and resolves the concrete pig binary across all Composer vendor paths (~/.config/composer/vendor/bin, ~/.composer/vendor/bin, and Android Termux home paths).
Robustly links pig directly into default system PATH directories (such as /data/data/com.termux/files/usr/bin in Termux, /usr/local/bin, or ~/.local/bin), preventing No command pig found after exiting the initial interactive launch (/quit).
Enhanced installed_pig_is_first_on_path to resolve symlink targets against the installed binary.
Release v0.6.81 of pig. Install via composer global require pigagent/pig:0.6.81 or view on GitHub.
Fixed
Instant PATH symlinking and dual profile targeting in install.sh:
Automatically symlinks pig directly into writable directories already on PATH (such as $PREFIX/bin in Termux, /usr/local/bin, or ~/.local/bin), enabling immediate pig command execution out of the box.
For bash environments, profile updates now dual-target both ~/.bashrc (for interactive non-login terminal windows) and ~/.profile (for login sessions), properly tagging # pig & composer global bin so both composer and pig are always available.
Added robust directory fallback in composer_bin_dir across ~/.config/composer/vendor/bin and ~/.composer/vendor/bin.
Release v0.6.79 of pig. Install via composer global require pigagent/pig:0.6.79 or view on GitHub.
Fixed
Termux PATH configuration and default shell profile in install.sh: Fixed an issue where Android Termux defaulted to writing PATH exports to ~/.profile when ~/.bashrc did not yet exist, leaving Termux's interactive non-login bash shells unable to find pig. The installer now reliably detects Termux environments (TERMUX_VERSION, /data/data/com.termux, $PREFIX) and routes shell profile updates directly to ~/.bashrc.
Immediate session sourcing in install.sh: Automatically sources the target shell configuration file (. "$config_file") and exports PATH variables immediately upon appending, making binaries visible to the current installer process and prompting users with the exact source command for their current terminal window.
Release v0.6.78 of pig. Install via composer global require pigagent/pig:0.6.78 or view on GitHub.
New Features
/login signs in the way pi's does: it asks Sign in with an account, Sign in with an API key, or Sign in with Radius, then lists the providers for that kind in a searchable list with each one's status (✓ configured, ✓ env: OPENAI_API_KEY, • not configured).
API keys for every built-in provider — Anthropic, OpenAI, Gemini, DeepSeek, OpenRouter, Groq, Mistral, xAI, Moonshot, Z.AI, MiniMax, Qwen, Xiaomi and the rest — prompted for and kept in auth.json, beside the extensions' api-key sign-ins. Amazon Bedrock, Google Vertex AI and the Cloudflare providers say they are configured from the environment.
Radius: the Radius gateway's OAuth sign-in, by browser (loopback on 127.0.0.1:1456) or device code.
With no model chosen yet, a sign-in switches to the provider's default model (upstream's defaultModelPerProvider) and says which.
/login starts that provider's sign-in; a cancelled sign-in goes back to the list it was chosen from.
/logout lists what /login stored — sign-ins and API keys — and says Logged out of or Removed stored API key for .
Release v0.6.77 of pig. Install via composer global require pigagent/pig:0.6.77 or view on GitHub.
Added
Automatic pure PHP Composer bootstrapping in install.sh: When preflight checks confirm PHP >= 8.3 and its required extensions, the installer automatically checks whether composer is available on PATH. If missing, it downloads and configures the official Composer binary to a writable directory (/usr/local/bin, ~/.local/bin, or ~/bin) via pure PHP with automatic fallback, requiring zero manual setup.
macOS Homebrew PHP installation prompt in install.sh: If PHP is missing or below 8.3 on macOS and Homebrew is detected, the installer interactively prompts via /dev/tty to execute brew install php, automatically configures PATH, and continues the preflight check.
Targeted PHP installation guidance for Linux distributions: Automatically identifies the Linux distro (Ubuntu/Debian, Fedora/RHEL, Arch Linux, Alpine) when PHP is missing or incompatible, printing exact copy-paste installation commands.
Changed
Multi-directory shell PATH configuration in install.sh: When Composer is bootstrapped into a local user directory not yet on PATH, the profile prompt batches both the Composer directory and Composer's global bin directory into your shell configuration (~/.zshrc, ~/.bashrc, or config.fish).
Updated documentation and guides: Aligned README.md, README.zh-CN.md, and the official site documentation (quickstart.md in English and Simplified Chinese) with the new automated Composer bootstrap and macOS PHP setup workflows.
Release v0.6.76 of pig. Install via composer global require pigagent/pig:0.6.76 or view on GitHub.
Changed
The web page's tool cards, messages and footer now say what the TUI says since 0.6.75, which is what upstream pi says:
Tool card titles: [skill] deploy and read resource AGENTS.md for a skill or an AGENTS/CLAUDE file, read a.php:5-29 for a range; grep /x/ in src (glob) limit N, find x in . (limit N), ls . (limit N); a tool with no title of its own shows name key=value …, cut to 100 characters.
Warning lines under a card, in the warning colour and visible with the card collapsed: bash's [Full output: . Truncated: showing X of Y lines] (the tool's own footer leaves the output), read's [Truncated: …], and ls/find/grep's [Truncated: 200 entries limit, …]. The (exit N) / cancelled notes are gone — the output already says them.
write: no \r or trailing blank lines; a failure is shown in red under the content; content that is not a string says [invalid content arg - expected string].
codemode: its own card — the script, each nested call with its status, time and cost, Model calls: $… when more than one was priced, then the output without the Script completed header, red when the run failed.
Messages: [branch] / Branch summary; bold labels on compaction, branch, skill and hook blocks; a hook's message is shown whole rather than folded; a response cut short by the token limit says Response was truncated before completion.
Footer: the extensions' statuses are sorted by key and joined by a space.
Release v0.6.75 of pig. Install via composer global require pigagent/pig:0.6.75 or view on GitHub.
Changed
The TUI now follows the latest upstream pi rather than a pinned commit (AGENTS.md, docs/dev/upstream.md), and every place it drew a message or a tool call differently has been brought in line:
Tool calls: a collapsed read is its heading alone — a skill, an AGENTS.md/CLAUDE.md or one of pig's own docs as one line ([skill] deploy (ctrl+o to expand), read resource AGENTS.md); edit no longer appends :line; write trims trailing blank lines and says N more lines, T total; grep writes limit N; ls, find and grep add [Truncated: …] for the limits they hit; a tool with no view of its own shows name key=value … collapsed and a key: value line each expanded, its result ten lines under it.
Hints: every ... (N more lines, ctrl+o to expand) / (N earlier lines, …) names the expand key, muted with the key dim.
bash: (timeout 30s) on the title; the tool's own [… Full output: …] footer becomes one warning line, [Full output: . Truncated: showing X of Y lines]; the (exit N) / cancelled status is gone, since the output already says it; Took 0.4s has a blank line above it.
Pictures: a blank line above each; when they cannot or should not be drawn, the label is a line of the result's text.
Messages: the compaction and branch summary blocks have a bold label, Compacted from N tokens (ctrl+o to expand) / Branch summary (…), and expand to the summary under a bold header; a hook's message has a bold label, is not folded, and one a hook draws itself gets a blank line above it; an expanded skill block has no extra blank line under its label; a run of thinking blocks is one thought, with a blank line under it only when something follows; a response cut short by the token limit says Response was truncated before completion.
Status: the loader says Working, with no running timer; footer statuses are sorted by key and joined by a space, and a long path is cut at the end.
codemode: expanded shows the whole script; each model call shows its cost and more than one adds Model calls: $…; a failed run's output is red; collapsed names the full-output file; Took 1.2s under the result.
Custom tool renderers: renderCall is given a RenderOptions as its third argument, and RenderOptions carries isError and timer (Elapsed 1.2s / Took 1.2s). A renderResult body is now drawn straight under the heading, as upstream adds it — a renderer that wants a blank line above draws one.
Release v0.6.74 of pig. Install via composer global require pigagent/pig:0.6.74 or view on GitHub.
Fixed
The scheduled-task pages hid the header's left half and the tab bar, so the header's buttons slid to the left and the top of the page changed from one view to the next. A page now takes the conversation's place only; the header and the tab bar are the same on every page, and docs/dev/design/web-ui.md says so.
Release v0.6.73 of pig. Install via composer global require pigagent/pig:0.6.73 or view on GitHub.
Added
Size tokens for the web page — text, control heights, corners, spacing, icons (--text-*, --control-*, --radius-*, --space-*, --icon-* in style.css), taken from what the page already used most, with the rules in docs/dev/design/web-ui.md. Every font size and corner on the page uses them now — the stylesheet's and the scripts' inline styles alike — and WebStyleTokensTest fails on one written in px. The odd sizes in between went to the nearest token (9–10.5px labels to 11px, 12.5px to 12px, ×/+ glyphs to 16px, 10–14px corners to 8 or 12px).
Changed
The scheduled-task pages, form and confirmation card are redrawn on those tokens: 13px text, 32px buttons, 6–8px corners, as the rest of the page — they had been drawn larger than anything around them.
Fixed
WebMessageBlocksTest failed with needsTranslation is not defined since messages got a Translate button: the fixture runs the page's own message renderer and now hands it the page's own translation helpers.
Release v0.6.72 of pig. Install via composer global require pigagent/pig:0.6.72 or view on GitHub.
Added
Translate messages in the Web UI, as Telegram has it, under the language settings: a *Translate* button on every answer (and *Show original* back), *Translate entire chats* to press it as each answer arrives, and *Do not translate* for the languages you read — an answer whose script says it is in one gets no button. The session's model is the translator (RPC translate {text, language, doNotTranslate}, answered text: null for one already in your language); questions get the button too; tool output and thinking are not translated.
Changed
The web UI's scheduled tasks are laid out as the Claude app's: a page in the main area with the tasks as cards (search, filter, sort) and a *New task* menu — *Create with pig* opens a conversation with the request in the prompt, *Set up manually* opens the form; a task's conversation in the sidebar opens the task's page (history; instructions, schedule and permission; Run now and the on/off switch; edit and delete under "⋯"), with its clock at the end of the row; the form is a dialog with the permission and model in a bar under the instructions, a row per trigger and *Advanced* settings for the folder and thinking level; times are shown in the viewer's timezone.
A schedule call's confirmation in the web UI is a card in the conversation, under the call — "pig wants to create a scheduled task", the arguments, then task, schedule, where it runs, source and instructions — answered with Cancel (Esc) or Schedule (⌘/Ctrl+Enter), rather than a dialog over the page.
Added
A scheduled task can have more than one trigger (the form's "+"); it runs at the soonest, and a one-time trigger is dropped once it fires. triggers in /api/scheduled/save; a task written with one schedule reads as one trigger.
A permission per scheduled task: *Auto* answers a run's confirmations yes so it does not stop for approval, *Manual* waits for you. New tasks — from the form or the schedule tool (permission) — default to *Auto*, as the Claude app's do; tasks saved before stay *Manual*, which is how they ran.
Release v0.6.71 of pig. Install via composer global require pigagent/pig:0.6.71 or view on GitHub.
Added
Prompt history in the Web UI, as the TUI has it: Up on the first line of the input (empty, caret at its start, or already browsing) brings back the prompts sent before, newest first, and Down on the last line goes forward again and past the newest returns what was being typed. Per tab, 100 kept, filled from the conversation when the tab loads it.
Fixed
Up in the TUI brought back nothing after --resume, /resume or a session switch: the editor's history was only filled by prompts typed in this run. It is filled from the session's user messages when the conversation is drawn, as upstream's renderInitialMessages() does.
Release v0.6.70 of pig. Install via composer global require pigagent/pig:0.6.70 or view on GitHub.
Added
RPC prompt takes a requestId: sent again under an id the conversation already took, it is answered {disposition: "duplicate"} and not asked twice — kept as a pig.request custom entry, so it holds across a restart. The Web UI sends one, and when a send's answer is lost (a dropped connection, the agent restarting) and you press send again, it is the same request.
Fixed
In the Web UI, a new conversation whose connection dropped before it was saved came back as another new conversation, while the first went on answering where it could not be seen; the page now finds its own conversation again after a reconnect.
Release v0.6.69 of pig. Install via composer global require pigagent/pig:0.6.69 or view on GitHub.
Added
/continue carries on a run that stopped when pig did. A conversation opened mid-run — with -c, --resume or /resume — says so under the transcript (This conversation stopped in the middle of a run. /continue carries it on.), and nothing runs until you ask. The Web UI shows the same line with a Continue button; get_state reports it as isStoppedMidRun.
Fixed
A tool call carried on after a stop is answered in the row the transcript already drew, in the terminal and the Web UI, instead of a second row while the first one kept saying it was running.
Release v0.6.68 of pig. Install via composer global require pigagent/pig:0.6.68 or view on GitHub.
Changed
A tool call a stopped run left half done is answered with what it had printed before the notice that it was interrupted, so the model can see how far a build or a script got. The running tool's output is kept beside the session file as .running.json while it runs — the tail a result would show, rewritten at most ten times a second and slower for large output, readable by you alone — and removed when its result is written or the session is deleted.
Release v0.6.67 of pig. Install via composer global require pigagent/pig:0.6.67 or view on GitHub.
Changed
A run that stopped inside a tool call is carried on rather than refused (continueRun(), which the web daemon's scheduled runs use): a call that may have been running is run again if its tool only reads (read, grep, find, ls), and otherwise answered Tool was interrupted and may have partially run for the model to decide — pi-durable's replay policy. The calls after it, which never started, run as they would have. An extension tool opts in with CustomTool(replay: ToolReplay::Safe).
Fixed
A run stopped between two of a turn's tool calls was carried on with the rest answered No result provided; they are run now.
Release v0.6.66 of pig. Install via composer global require pigagent/pig:0.6.66 or view on GitHub.
Changed
The startup header is upstream's as its terminals without the logo draw it: the pixel pig is gone, the first line reads Pig vX with the wordmark in pink, and the key hints below it have the key dim and what it does muted.
[Extensions] no longer names the built-ins (pig-codemode, pig-llama, pig-mcp, pig-schedule, pig-tool-search) — upstream marks its built-ins hidden — and [Tools] names only tools loaded from tool folders, not the tools an extension registered, as upstream lists no tools at all.
Fixed
pi failed every start with models.json error: Availability refresh: ENOTDIR: not a directory, rmdir '~/.pi/agent/auth.json.lock' once pig had renewed a token: pig took its flock() on a plain file named auth.json.lock in pi's folder, which is the name proper-lockfile gives its lock *directory*. pig's lock is auth.json.flock now (and mcp-auth-refresh-.flock for MCP tokens), and a .lock file an older pig left is removed when pig starts; a .lock directory, pi's own, is left alone.
Release v0.6.65 of pig. Install via composer global require pigagent/pig:0.6.65 or view on GitHub.
Changed
AGENTS.md carries a hard rule at its top — it stays under 200 lines, everything else goes into docs/dev/ — and AgentsFileTest fails the suite when it does not.
Release v0.6.64 of pig. Install via composer global require pigagent/pig:0.6.64 or view on GitHub.
Changed
The repository's agent instructions are AGENTS.md now rather than CLAUDE.md: pig and pi read either, and Claude Code reads AGENTS.md when there is no CLAUDE.md. The comments that named the file, and the headers of docs/dev/, say so.
Release v0.6.63 of pig. Install via composer global require pigagent/pig:0.6.63 or view on GitHub.
Changed
CLAUDE.md is down from 13,658 lines (about 280k tokens, sent with every request in this repository) to 145. The rest moved, unedited, to docs/dev/: decisions.md, upstream.md, and per area design/.md and traps/.md, which CLAUDE.md indexes. Source comments that pointed at CLAUDE.md point at the file the entry is in now.
A context overflow whose system prompt alone is past the model's window — a project's context files grown beyond a smaller model — is no longer compacted and retried, which could not help. pig says so instead: how large the prompt is, the model's window, the largest context files by size, and that --no-context-files (-nc) leaves them out.
Release v0.6.62 of pig. Install via composer global require pigagent/pig:0.6.62 or view on GitHub.
Fixed
An Ollama (MLX) model's "input length (N tokens) exceeds the model's maximum context length (M tokens)" is recognised as a context overflow, so the conversation is compacted and the turn retried instead of stopping on the error. The pattern only knew the form without "tokens" inside the parentheses.
Release v0.6.61 of pig. Install via composer global require pigagent/pig:0.6.61 or view on GitHub.
Changed
Web: a message sent while the agent is working waits above the input as Steering: … or Follow-up: …, as in the TUI, and joins the conversation when it is delivered rather than when it was typed. "↳ Edit queued messages" puts everything queued back into the input without stopping the turn, and Stop does the same before it stops.
Release v0.6.60 of pig. Install via composer global require pigagent/pig:0.6.60 or view on GitHub.
Fixed
auth.json is written to a file beside it and renamed into place, so another pig reading it — every web conversation does before each prompt — never finds it half-written. Reading it in that moment emptied every credential in the reader, and the reader's next save could write that back over the file. A symlinked auth.json is written where it points and stays a link.
Release v0.6.59 of pig. Install via composer global require pigagent/pig:0.6.59 or view on GitHub.
Added
Web: API keys can be set from the page. ⋯ → API Keys lists every provider that takes a key, shows where each one's key comes from (saved, the environment, or a subscription signed in from the terminal), and stores, replaces or removes a key in auth.json. When no model has a key, the page opens it by itself.
Changed
--mode rpc reads auth.json again before each prompt, so a key stored by another process — the web page's key panel, or /login in a terminal — is used by a conversation that was already open.
Release v0.6.58 of pig. Install via composer global require pigagent/pig:0.6.58 or view on GitHub.
Changed
Model registry regenerated from models.dev: Gemini 4 Argon across Google, Vertex, Copilot, OpenRouter, Vercel and OpenCode; Claude 5.5 and GPT-6/5.6 rows now come from the catalogue instead of being hand-written; retired OpenRouter and Vercel Qwen 3 models are gone.
Release v0.6.57 of pig. Install via composer global require pigagent/pig:0.6.57 or view on GitHub.
Changed
Antigravity: the shipped model list is regenerated from the deployment's catalogue. Claude Opus 5.5 and Claude Sonnet 5.5 are new; Gemini 3.7 Flash, Gemini 3.6 Flash, Claude Opus 4.6, Claude Sonnet 4.6 and Gemini 3.1 Pro are gone, because the deployment no longer serves them. Eleven models, down from fourteen.
Antigravity: a 404 on Gemini 3.8 Flash is reported instead of being retried on 3.7, which the deployment no longer serves. The fallback chain is upstream's and comes back by itself when a catalogue names 3.7 again.
Fixed
scripts/fetch-antigravity-models.php works again. It called a settings method that had been renamed, loaded the installed copy of the extension beside the checkout's one, and printed no model rows for the endpoint's own reply. It now groups that reply the way the extension does at refresh, names each model from its id, and prints the six-column rows Models.php holds.
Release v0.6.56 of pig. Install via composer global require pigagent/pig:0.6.56 or view on GitHub.
Changed
Web: a conversation's history no longer carries its images. They come by reference and are fetched one at a time as they scroll into view ( from /api/session-image), so a history of screenshots — computer use, Android use — costs a page only its text and the images it shows, instead of megabytes for every part it loads. Images shown live, as a turn runs, are as before.
Added
--mode rpc: get_messages takes images: "refs", to give each image as {type: "image", mimeType, ref} without its data, and get_image {ref} answers one as {mimeType, data}. ref is the message's index and the path to the image in it (12.content.3). Without it, images are inline as upstream's.
Release v0.6.55 of pig. Install via composer global require pigagent/pig:0.6.55 or view on GitHub.
Fixed
pig web no longer runs out of memory while a command streams a lot of output — a build log, say — to a page across a slow link. A running command told the screen its output's tail (up to 50 KB) on every read, many times a second, megabytes a second of the same text; the page's send buffer passed its limit again and again (closing a connection: send buffer past 160 MB in the log), and the queue to a session that had stopped reading grew until the server died (Allowed memory size … exhausted in RpcClient). The live output is now updated at most ten times a second, its last state always shown. A page that falls behind is sent only the newest of a running command's updates when it catches up, not every one in between. A page now loads a background tab's conversation when the tab is opened, not every tab's at once after a reconnect. Both write queues — to a page and to a session — drain from an offset instead of copying what is left after every write, which was quadratic and pinned the CPU. With that, the limits are brakes rather than room: a page's queue is closed at 8 MB when it has read nothing for 15 s and at 32 MB regardless (were 32 and 160), and a session's input refuses more past 8 MB queued; one message bigger than a limit still goes out whole when nothing is queued before it.
Release v0.6.54 of pig. Install via composer global require pigagent/pig:0.6.54 or view on GitHub.
Fixed
pig web over a tunnel (Tailscale and other utun interfaces on macOS): a page with a long conversation no longer reconnects every few seconds. macOS answers a write it cannot queue yet with ENOBUFS, which PHP does not treat as "try again" as it does EAGAIN, so the write failed and the page's socket was closed as soon as megabytes went out — and the page asked for them again on reconnect. A full queue is now waited out (20 ms, then write on), and frames go out 256 KB at a time.
pig web logs why it closed a connection when the choice was its own — write failed (and the system's words), the peer read nothing for 15 s, the send buffer past its limit, no pong for a minute, an unreadable frame — so a page that keeps reconnecting can be explained from the server's log.
Release v0.6.53 of pig. Install via composer global require pigagent/pig:0.6.53 or view on GitHub.
Fixed
pig web no longer dies of memory, and the page no longer reconnects over and over, when a very long conversation is open — one with many screenshots from computer or Android use is hundreds of megabytes. The page asked the session for the whole conversation in one get_messages, and the server, decoding that line and encoding it again for the page, ran out of memory (Allowed memory size … exhausted in TcpConnection::sendRaw()), restarted, and was asked again. The page now asks for the end only — about 180 messages — and for the parts before it as you scroll up.
Added
--mode rpc: get_messages takes an optional limit, and before, to answer only the end of the conversation, or the part before an index; the part starts at a user message, and the answer says where it sits (total, start). Without limit it answers everything, as upstream's.
Release v0.6.52 of pig. Install via composer global require pigagent/pig:0.6.52 or view on GitHub.
Fixed
pig web with a long conversation open: the page no longer reconnects over and over, and no longer shows Future::await() must be called inside a coroutine with get_messages: no answer in 30s. Two causes, both met by a page whose tabs each load a large conversation at once. The send buffer's 32 MB limit (0.6.44) closed a peer that was reading, just slowly — over a VPN, say — so the page reconnected, asked for the same again and was closed again; it now closes only a peer that has read nothing for 15 seconds, with 160 MB as the line memory draws regardless. And a command relayed to a session's child while the child was busy writing back waited for its input pipe to have room, which needs a fiber the socket handler does not have; it is now queued and sent, in order, as the pipe drains.
Release v0.6.51 of pig. Install via composer global require pigagent/pig:0.6.51 or view on GitHub.
Added
Extensions: $ctx->ui->systemNotify($title, $body) tells the person outside the window, and pig picks how. In the terminal, a desktop notification (osascript, notify-send), or over SSH the terminal's own (OSC 777, shown by Ghostty, iTerm2 and WezTerm) and a bell — the notifier starts without being waited for. Behind pig web, the page's: when you are looking elsewhere (another window, another app, a background tab) its title gains (n) ✓, its icon a green dot, a short chime plays, all cleared when you come back, and where the browser allows it (localhost or https, and you said yes when asked, on your first message) a system notification that a click brings the conversation back from — over plain http:// on a LAN address browsers offer none. A host over --mode rpc gets extension_ui_request {method: "systemNotify", title, body}; print, json and mcp modes have nowhere to send it. pig's own, as registerWebPanel(); pi's extensions have no such call.
examples/extensions/system-notify.php: copy it to ~/.pig/agent/extensions/ to be told when a piece of work is done — once, when the turn settles, through systemNotify(), so the same file works in the terminal and the page.
Release v0.6.50 of pig. Install via composer global require pigagent/pig:0.6.50 or view on GitHub.
Fixed
test/lint.php finds every @ error suppression. It looked for them with a regex after stripping strings and comments, and the nested quotes of a PowerShell command in SessionList.php paired up wrongly and hid the @proc_open below them. It now reads PHP's own tokens. That @proc_open (moving a session to the trash) is a set_error_handler around the call, as everywhere else.
Release v0.6.49 of pig. Install via composer global require pigagent/pig:0.6.49 or view on GitHub.
Added
Web: Enter with nothing focused puts the cursor in the prompt, as in Telegram — after reading, clicking in the conversation or switching tabs, the next Enter takes you back to typing. A focused button, link or field keeps its Enter, and nothing happens while a dialog, menu, image or the terminal is open.
Release v0.6.48 of pig. Install via composer global require pigagent/pig:0.6.48 or view on GitHub.
Fixed
Web: picking a command from the / list with Enter no longer sends what was typed first — /di, then Enter on /diff, sent /di and left /diff in the prompt to be sent again. The list now has its keys before the prompt does, and Enter on a command completes it and sends it in one press, as in the TUI; Tab (or a click) only completes it.
Release v0.6.47 of pig. Install via composer global require pigagent/pig:0.6.47 or view on GitHub.
Changed
pig web closes a WebSocket that has been silent for two of its pings (about a minute) — an iPad with its lid shut, a tab iOS has suspended. It pinged every 25 seconds but never checked for the pong, so a gone peer stayed bound to its session, with events piling up behind it, until TCP gave up many minutes later. The page reconnects when it wakes and loads the conversation again.
Removed
The socket protocol's own {"type":"ping"} / pong messages. The page never sent them; keep-alive is the WebSocket protocol's ping and pong, which a browser answers by itself.
Release v0.6.46 of pig. Install via composer global require pigagent/pig:0.6.46 or view on GitHub.
Fixed
Web: underscores in names survive Markdown — set_error_handler was drawn as "set", an italic "error" and "handler", underscores gone, even inside a code span. _ now emphasises only at a word's edge, as CommonMark has it, and code spans are left alone.
Release v0.6.45 of pig. Install via composer global require pigagent/pig:0.6.45 or view on GitHub.
Changed
Web: a long conversation opens as fast as a short one. The last 60 or so messages are drawn at once, about 120 more before them while the page is idle, and the rest only as you scroll up — the next part is drawn whenever you come within two screens of the top, before you reach it, so scrolling stays smooth and a conversation nobody scrolls back through does not cost its whole history in the page. Your place is kept as parts arrive. Parts are cut at a user message, so a tool call and its result are drawn together.
Fixed
Web: scrolling a long conversation no longer stutters. The messages had content-visibility: auto (0.6.40), so each block — a bash card's output, a highlighted code block — was only drawn as it scrolled into view, and its guessed height was corrected as it was. Removed; switching tabs stays fast, which came from keeping a background tab's layout (visibility instead of display: none).
Release v0.6.44 of pig. Install via composer global require pigagent/pig:0.6.44 or view on GitHub.
Fixed
pig web no longer dies with "Allowed memory size exhausted" in TcpConnection::sendRaw() when a browser tab stops reading (an iPad tab in the background, a laptop asleep). Every event for that tab was appended to its send buffer without limit until PHP's memory ran out, taking the server and every other tab down with it. Past 32 MB waiting the connection is closed instead, and the page reconnects and reloads the conversation when it reads again.
Release v0.6.43 of pig. Install via composer global require pigagent/pig:0.6.43 or view on GitHub.
Fixed
Web: on an iPad with a hardware keyboard the page no longer twitches when the prompt is focused or while typing. Safari keeps a focused field 40px clear of the floating input bar: closer, it panned the whole page up as the bar came up and back a frame later, and scrolled it on every keystroke. The prompt is now raised by what that takes, measured the first time the bar comes up and kept in this browser, so after that focusing moves nothing. The page also no longer takes the shrunk innerHeight Safari reports for a frame as the bar comes up, nor shrinks for the bar's in-between heights; everything short of an on-screen keyboard keeps the full height.
Release v0.6.42 of pig. Install via composer global require pigagent/pig:0.6.42 or view on GitHub.
Changed
Web: Log out moved into the header's ⋯ menu, out of the top bar where it was easy to press by accident. The ⋯ menu is now always present on desktop, holding Log out alongside the extensions' panels.
Web: iPad Safari with a hardware keyboard no longer jumps the prompt up on focus. The floating input bar (under 150px) is allowed to overlap the bottom metadata row instead of shrinking the viewport.
Release v0.6.41 of pig. Install via composer global require pigagent/pig:0.6.41 or view on GitHub.
Changed
Web: the header has a ⋯ menu on the desktop too, and the extensions' panels live there — a panel placed in the header (such as Accounts) is an entry in it, with the Extensions list beside it — instead of a button each in the bar. On a phone the menu also holds the bar's buttons, as before, and now the header panels as well, which a phone could not reach before. With no panels the desktop shows no ⋯.
Web: quiet text stays readable in dark themes such as labra, whose muted and dim are too dark for text. The header's labelled buttons (theme, language, account, extensions, SSH nodes, terminal) are in the text colour; the folder name, the session file badge, background tabs and the numbers under the prompt use a new --color-text-subtle, mixed from the text and the page (6:1 in labra, about the default themes' muted elsewhere).
Web: the sidebar's group headings (Extensions, Today, Yesterday…) are 12px regular instead of 11px bold, closer to the items under them.
Web: the sidebar's icons (New session, Search, Scheduled, extension panels) are the colour of their labels instead of a dimmer grey.
Web: the selected conversation in the sidebar is drawn like the "New messages" pill — blue border and text on the raised surface, instead of on a blue-tinted ground that made the text hard to read.
Follow-up keys: Cmd+Enter and Ctrl+Enter queue a message for after the turn, in the TUI and the web page alike; Alt/Option+Enter is a new line, like Shift+Enter. A terminal without the kitty keyboard protocol sends Option+Return as Shift+Return's bytes or as a bare Return, so Alt+Enter could never be told apart there. On macOS, Ctrl+Return in such a terminal is read from the modifier state, as Cmd+Return already was.
Fixed
Web: a message sent while the agent works no longer fails with "Agent is already processing". The page decided between steer and prompt from the state it read when the tab opened, which never followed a turn; it now always sends prompt with a streamingBehavior and lets the agent decide. Enter steers and Cmd/Ctrl+Enter queues a follow-up, as in the TUI, and images sent mid-turn are no longer dropped.
Release v0.6.40 of pig. Install via composer global require pigagent/pig:0.6.40 or view on GitHub.
Fixed
Web: switching tabs no longer pauses on a long conversation. A background tab's chat is hidden with visibility instead of display: none, so it keeps its layout, and messages off screen are skipped with content-visibility: auto. The phone layout's tighter chat padding applies again (its rule named #chat-scroll, which no longer exists).
Release v0.6.39 of pig. Install via composer global require pigagent/pig:0.6.39 or view on GitHub.
Changed
Android use: tapping the screen is a last resort too — the android-use skill and android_ready now say to use adb from bash first (am start, input, settings, install/push/pull), and the screen tools only when the person asks for them or adb cannot do the job.
Release v0.6.38 of pig. Install via composer global require pigagent/pig:0.6.38 or view on GitHub.
Changed
Computer use and Android use: the skills (computer-use, android-use) and the screen viewer pages are in English, like the rest of what pig puts in front of the model.
Fixed
Computer use: the model opened Chrome on the desktop to download a file curl fetches in one call. The computer-use skill and computer_ready now call the desktop a last resort: used only when the person asks for computer use or when bash and the other tools cannot do the job; downloads, API calls and reading pages go through bash (curl) or fetch_web_page.
Release v0.6.37 of pig. Install via composer global require pigagent/pig:0.6.37 or view on GitHub.
Fixed
Installer: answering "Start pig now?" with Enter did nothing. Piped to sh, the script's standard input is the download itself, and pig started on it saw no terminal, went into print mode with nothing to say and exited at once. It is started on the terminal now.
Release v0.6.36 of pig. Install via composer global require pigagent/pig:0.6.36 or view on GitHub.
Fixed
Web UI: the thinking-level menu drew the levels of another provider's model with the same id — choosing raccoonx's gemini-3.8-flash showed Google's five levels, picked medium, and the agent then set off because raccoonx's model is declared without reasoning. The model is now looked up by provider and id.
Release v0.6.35 of pig. Install via composer global require pigagent/pig:0.6.35 or view on GitHub.
Fixed
Test suite isolation: added test/bootstrap.php to isolate PHPUnit test runs within a temporary $HOME directory. Tests that omitted custom home paths or cleared environment variables previously polluted the developer's real ~/.pig/agent sessions, nodes.json, and Trash. The bootstrap provides an isolated environment with a deleting trash stand-in, cleans up on shutdown, and preserves downloaded tool binaries.
Release v0.6.34 of pig. Install via composer global require pigagent/pig:0.6.34 or view on GitHub.
Fixed
Shell execution: fixed a race condition between Run::wait()'s background process poller and Process::awaitFinish(). When a command terminated via signal right as the 100ms background polling loop queried proc_get_status(), the first-read signal status (signaled: true, termsig: N) was consumed, causing awaitFinish()'s subsequent query to erroneously report Command exited with code -1. Run now immediately cancels background process polling upon pipe completion and passes captured exit statuses directly to awaitFinish().
Release v0.6.33 of pig. Install via composer global require pigagent/pig:0.6.33 or view on GitHub.
Changed
Web UI: the "Load more" button in the All sessions window says how many are left — 加载更多(剩余 N 条) / Load more (N left), the total less what is already shown.
Release v0.6.32 of pig. Install via composer global require pigagent/pig:0.6.32 or view on GitHub.
Fixed
Custom models: pi's ~/.pi/agent/models.json was ignored whenever ~/.pig/agent/models.json existed, so a provider declared for pi disappeared from pig as soon as pig had a file of its own. Both are read now, pig's laid over pi's a provider at a time: a provider named in both is taken whole from pig's file, key included.
Release v0.6.31 of pig. Install via composer global require pigagent/pig:0.6.31 or view on GitHub.
Fixed
Web UI: the login page loaded unstyled in a browser whose extension rewrites the Origin header — theme.css, style.css, login.js and the favicon came back 403 because Origin: http://127.0.0.1 (port gone) did not match Host. The same-origin check now believes the browser's own Sec-Fetch-Site when it is sent (same-origin and none pass; same-site and cross-site are refused, so another port on 127.0.0.1 is still kept out), and compares Origin with Host only when it is not.
Release v0.6.30 of pig. Install via composer global require pigagent/pig:0.6.30 or view on GitHub.
Fixed
The WebSocket protocol test for large multi-frame messages deadlocked on systems with small default socket buffers (8 KB on macOS). Writing 70+ KB into a blocking Unix domain socket filled the send buffer and hung waiting for the server to read on the same thread; the test now streams chunks non-blocking and pumps the server in the same loop, preserving full test coverage for 64-bit frame headers (> 65,535 bytes) without hanging.
Release v0.6.29 of pig. Install via composer global require pigagent/pig:0.6.29 or view on GitHub.
Added
The web UI's sidebar starts open on a screen at least 1024 px wide — a MacBook, an iPad held sideways — and closed on a phone or an iPad upright. Turning the iPad or resizing the window across that width opens or closes it; a toggle in between stays as you left it.
Fixed
A screenshot (or any message over about 128 KB) sent from the web UI never reached the agent, and the page said prompt: no answer in 30s — or the connection dropped. The browser sends a large message as several WebSocket frames, and the server handed each frame on as a whole message, so the agent was given broken pieces. The server now puts the frames back together before reading the message; a 6 MB screenshot reaches the agent in about two seconds.
Release v0.6.28 of pig. Install via composer global require pigagent/pig:0.6.28 or view on GitHub.
Added
pig web install [--port N] [--host H] and pig web uninstall (macOS): the web UI as a launchd login service, so it is running again after the computer restarts. install writes ~/Library/LaunchAgents/dev.pigagent.web.plist — launchd runs php pig --mode web --no-browser in the folder install was typed in, with that shell's PATH and proxy variables and pig's agent directory, restarts it if it dies, and logs to web.log — and loads it. API keys exported in the shell are not copied into the plist; sign in with /login or keep them in auth.json. While the service is installed, pig web start, stop, status and restart (and /web) go through launchctl: stop unloads it until the next login or start, and a --port or --host for one start is refused, since install again is what changes them. On other systems install says so and pig web start -d is what there is.
A scheduled run the web daemon was in the middle of when it stopped is carried on when it starts again: its conversation is opened and continued from the last thing in it (continue over RPC, AgentSession::continueRun()). A last turn that failed or was aborted is dropped and asked again; a conversation that had already answered is a finished run; one that stopped inside a tool call is refused and marked failed rather than running a command twice. A run that never wrote a session file still ends as failed.
Fixed
The web UI's copy buttons (a tool card's 📋, a code block's Copy, the terminal drawer's folder badge) did nothing when the page was opened over plain http from another machine — a phone on the LAN, a Tailscale address. The browser has no navigator.clipboard outside https and localhost, so the click threw; they now copy through the page's selection there, and show ✗ when the browser refuses.
The web UI's theme button said the theme's id (dark) in either language. It now says a short name in the page's language — 暗黑 / 浅色 / 墨绿, Dark / Light / Labra — and changes with the language; a theme with no translation keeps its own name.
With many conversations open in the web UI, the tab strip squeezed every tab down to an ellipsis with its × hidden, so the earlier ones could not be closed. Tabs now keep their width and the strip scrolls sideways — swipe, trackpad or mouse wheel — with + pinned at the right; switching tabs scrolls the active one into view, and on a touch screen every tab shows its ×.
Release v0.6.27 of pig. Install via composer global require pigagent/pig:0.6.27 or view on GitHub.
Fixed
The Antigravity accounts panel said there were no accounts after /login antigravity: the sign-in was in auth.json and the list read only antigravity-accounts.json. As pi-antigravity does, the signed-in account is now filed in the store and made active whenever the accounts are listed or chosen — in the Web UI, /antigravity.accounts and the 429 failover — and the page's server sees a sign-in made in a terminal after it started.
Changed
A scheduled task has a conversation of its own, as in the Claude app: it is in the sidebar, with the clock, the moment the task is saved — from the Scheduled page or by asking — and every run carries on in it, so a run sees what the last one found. "Open conversation" on the task's page opens it. A run that comes due while you are mid-turn in that conversation is skipped; moving the task to another folder starts a new conversation there. Tasks saved before get theirs at their next run.
A finished scheduled run is marked unread: a blue dot on its conversation in the sidebar and beside Scheduled, gone once you open the conversation — on any device, since it is kept with the tasks. A run waiting for your answer keeps its amber dot.
Release v0.6.26 of pig. Install via composer global require pigagent/pig:0.6.26 or view on GitHub.
Fixed
Answering an extension's question in the Web UI did nothing: Yes, No, OK or a typed answer closed the dialog and was never sent, so the tool that asked — the schedule tool's confirmation, a hook's confirm — stayed "Running…" for good. Broken since the Web UI moved to ES modules.
Changed
An extension's question dialogs in the Web UI (confirm, input, editor) answer with the same buttons as the page's other dialogs: full-size, in a footer, with the default answer filled in, instead of two small outlined buttons under the text.
Release v0.6.25 of pig. Install via composer global require pigagent/pig:0.6.25 or view on GitHub.
New Features
Scheduled tasks by asking — say "every morning at 9, check what changed upstream and tell me whether this checkout needs it" in the terminal or the Web UI, and the new schedule tool (builtin:schedule) sets it up: list, create, update, delete, switch on or off, and run now. Every change is shown to you to confirm first; without anyone to confirm (-p) the tool only reads. A run reports by default and asks before pulling or editing.
Added
The pig web that runs the schedule writes where it listens into scheduled-tasks.lock, and pig on the same machine reaches /api/scheduled with a local token (~/.pig/agent/web-local-token, 0600) that opens nothing else. With no pig web running, the tool says to start one; an older one still running is told to restart.
Release v0.6.24 of pig. Install via composer global require pigagent/pig:0.6.24 or view on GitHub.
Fixed
iPad Safari kept the Web UI's header off screen while typing: focusing the prompt brought up the keyboard or the floating input bar, Safari scrolled the page to keep the field visible, and the header (language, accounts, theme) went off the top. The page now takes its height from what is visible and stays in place; the floating input bar itself is iPadOS's own.
Release v0.6.23 of pig. Install via composer global require pigagent/pig:0.6.23 or view on GitHub.
Changed
Removed deprecated docker browser service in favor of native desktop controller.
Fixed
The Web UI is fully translated: the SSH node workbench (which showed Chinese in English), its forms and dialogs, the web terminal's buttons, an extension's question dialogs (Yes / No / OK / hints), the tab bar, the export, diff, doctor and bug-report messages, and the connection banner now follow the page's language. Both languages have the same keys, and a test keeps every key the page uses in both.
The SSH node workbench's own dialogs opened behind it (add / edit node, host-key fingerprint, SFTP editor) and could not be clicked; they now open on top.
Release v0.6.22 of pig. Install via composer global require pigagent/pig:0.6.22 or view on GitHub.
Added
The Web UI asks for a password: always, on 127.0.0.1 too. The first time, pig web start prints a one-time setup code to set the password with on the page; pig web password sets or changes it. Sessions last 30 days and survive a restart; logging out is in the header and the mobile menu.
Fixed
Other websites can no longer reach the Web UI's API or WebSocket: requests from another origin are refused and the API no longer sends Access-Control-Allow-Origin: * — before, any page open in the same browser could call 127.0.0.1:8088, terminal included.
README's default web port is 8088, as the server uses, not 8080.
Release v0.6.21 of pig. Install via composer global require pigagent/pig:0.6.21 or view on GitHub.
Added
The Web UI lets a new conversation start in any folder: until the first message, a 📁 chip by the model pickers opens a picker with the folders used before, a path field that completes subfolders, and a folder browser — as the terminal starts wherever pig is run.
Release v0.6.20 of pig. Install via composer global require pigagent/pig:0.6.20 or view on GitHub.
Added
A panel's action can ask the person like a hook does: its handler gets a $ui with the same confirm(), select(), input(), editor() and notify() as $ctx->ui, drawn by the page with the same dialogs as a conversation's extension questions.
Release v0.6.19 of pig. Install via composer global require pigagent/pig:0.6.19 or view on GitHub.
Added
A Web UI panel can live in the header (registerWebPanel(..., placement: 'header', label: …)), and the person decides: the header's new 🧩 Extensions button (and the mobile menu) lists every extension panel, to open it or move it between the header and the sidebar; the choice is kept in the browser.
Changed
The Antigravity accounts panel is back in the header as "🔑 Accounts", where it was before it moved into the extension.
A panel button that asks first uses the page's own dialog instead of the browser's confirm(); with a dialog over a panel, Escape closes only the dialog.
Release v0.6.18 of pig. Install via composer global require pigagent/pig:0.6.18 or view on GitHub.
Added
Extensions can put a panel in the Web UI's sidebar (registerWebPanel()): the extension returns blocks — text, lists with buttons, meters, cards, sections loaded later — and the page draws them in its own theme and language under a new Extensions group; slash commands can open it. No extension code runs in the browser.
Changed
The Antigravity accounts panel moved into the Antigravity extension: it is in the sidebar's Extensions group (and /accounts) instead of a header button, and only appears when the extension is loaded. Rotate shows only when there is more than one account.
Fixed
The Web UI's empty-conversation "Diagnose" chip runs pig's own /doctor instead of /antigravity.doctor, which failed when the Antigravity extension was not loaded.
Release v0.6.17 of pig. Install via composer global require pigagent/pig:0.6.17 or view on GitHub.
Added
An extension's setTheme() switches the Web UI's theme: the page changes theme (every tab), as the terminal does, and an unknown name is refused with an error. getAllThemes() and getTheme() answer from the theme files in the Web UI instead of nothing, and theme() is the theme the page shows — the page tells each conversation's agent its theme when the tab opens and whenever it changes (pig's set_theme RPC command). A plain RPC host that does not say which theme it shows keeps upstream's answers.
Fixed
An extension's $ctx->ui in the Web UI now does what it does in the terminal: setWidget lines are drawn above or below the prompt, setTitle sets the page title, notify warnings and info stay in the transcript as the TUI's Warning: and dim lines (including ones sent from session_start), a dialog with a timeout counts down and closes, and a setStatus coloured with the theme no longer shows raw escape codes. Widgets, statuses and the title are replayed to a page that reloads or joins later.
Colours in extension widgets and statuses are drawn in the Web UI in the page's theme colours, instead of being stripped.
The Web UI's / list offers the conversation's own commands: extension commands, prompt templates and skill: commands from get_commands, after the built-ins — and no longer lists Antigravity's commands when that extension is not loaded.
Release v0.6.16 of pig. Install via composer global require pigagent/pig:0.6.16 or view on GitHub.
Changed
Post-login model switch guidance when active model lacks credentials:
InteractiveMode now prompts the user to use /model to switch models when logging into a provider while the currently active model has no configured API key, preventing immediate No API key for provider failures.
Release v0.6.15 of pig. Install via composer global require pigagent/pig:0.6.15 or view on GitHub.
Added
Automatic bundled extensions initialization on fresh installs (SelfUpdate::ensureBundledExtensions):
bin/pig and install.sh now automatically populate bundled core extensions (pig-antigravity, pig-computer, pig-web-search, pig-android-use, pig-vless) into ~/.pig/agent/extensions/ on initial run.
New installations now have Antigravity, computer use, and web search ready out of the box with zero manual installation commands.
Release v0.6.14 of pig. Install via composer global require pigagent/pig:0.6.14 or view on GitHub.
Fixed
Suppressed full historical changelog dump on fresh installations (aligned with upstream pi):
bin/pig now records the active version into lastChangelogVersion on first run without dumping the entire multi-year changelog history onto the screen.
Startup changelog display is now reserved strictly for incremental upgrades newer than the previously recorded version, keeping initial onboarding clean and distraction-free.
Release v0.6.13 of pig. Install via composer global require pigagent/pig:0.6.13 or view on GitHub.
Added
Instant interactive launch and shell profile PATH configuration in install.sh (aligned with upstream pi):
install.sh now automatically prompts via /dev/tty to append Composer's global bin directory to the user's shell configuration (~/.zshrc, ~/.bashrc, or config.fish).
Added prompt_start_pig to offer launching pig immediately via exec "$bin_dir/pig" upon install completion, eliminating command not found: pig without requiring manual terminal restarts or manual export PATH commands.
Release v0.6.12 of pig. Install via composer global require pigagent/pig:0.6.12 or view on GitHub.
Added
Google Search grounding tool (google_search) and /antigravity.search in pig-antigravity (aligned with pi-antigravity v0.10.0):
Added native Google Search Grounding over Cloud Code Assist via gemini-3.5-flash-lite (fallbacks: gemini-3.1-flash-lite, gemini-3-flash), returning synthesized evidence briefs (Findings, Gaps, Next checks), source links, and verified UTF-8 byte offset citations.
Added /antigravity.search [--thinking] [--url ] slash command for interactive web search.
Added feature toggles ANTIGRAVITY_NO_SEARCH_TOOL, ANTIGRAVITY_NO_IMAGE_TOOL, and ANTIGRAVITY_NO_EXTRA_TOOLS to prevent tool collisions when using dedicated search providers.
Changed
Direct image endpoint with legacy fallback in pig-antigravity:
ImageGenerator now queries /v1internal:generateContent with requestType: "image_gen" first, eliminating SSE stream overhead and falling back to /v1internal:streamGenerateContent?alt=sse only on HTTP 404.
Fixed
Stable signed-int64 session IDs in pig-antigravity:
Derived stable signed 64-bit integer session IDs (toInt64SessionId) from conversation seeds / session IDs instead of generating a new random integer every turn, enabling Google's server-side session cache and prompt optimization.
Account verification link guidance on 403 VALIDATION_REQUIRED:
Extracted validation_url from Google 403 error payloads, guiding users with direct verification URLs to unlock accounts without confusing generic permission errors.
Premature stream termination detection:
Detected streams closing abruptly without candidates[0].finishReason and surfaced clear failure diagnostics instead of truncating responses silently.
Release v0.6.11 of pig. Install via composer global require pigagent/pig:0.6.11 or view on GitHub.
New Features
Scheduled tasks in the web UI. The sidebar's Scheduled entry is live: a task is a prompt, a folder, an optional model and thinking level, and a schedule — manual, hourly, daily, weekdays, weekly, once, or a custom cron expression in the browser's timezone. Each run is a fresh pig --mode rpc conversation in the session pool, listed in the sidebar with a clock; opening it while it runs shows it live. A hook's question during a run waits for an answer (the run reads "Waiting for your answer" and the sidebar shows a dot), and the question is asked again of whoever opens the conversation. A run missed while the machine slept or the server was down happens once when it is back; an occurrence while the previous run is still going is logged as skipped. Only one web server per home runs the schedule. Tasks and their last 50 runs per task live in ~/.pig/agent/scheduled-tasks.json.
Fixed
Object serialization for tools without parameters in Anthropic and strict schemas: Formatted empty tool properties definitions as stdClass ({}) instead of empty PHP lists ([]) in Anthropic::convertTool() and ConstrainedSampling::getJsonSchemaToolParameters(), resolving 400 tools.N.custom.input_schema.properties: Input should be an object errors on Anthropic when using no-argument tools like computer_doctor.
Release v0.6.8 of pig. Install via composer global require pigagent/pig:0.6.8 or view on GitHub.
Changed
Refined Web UI divider aesthetics and theme contrast (--color-divider):
Introduced --color-divider using low-alpha text color mixing (color-mix(in srgb, var(--color-text-primary) 10%, transparent)), ensuring subtle, non-intrusive pane boundaries, modal borders, and table dividers across all active theme backgrounds.
Release v0.6.7 of pig. Install via composer global require pigagent/pig:0.6.7 or view on GitHub.
New Features
TUI-synchronized theme engine for Web UI (ThemeStylesheet, /theme.css, /api/themes):
Web UI now sources all themes directly from the TUI's theme files (packages/coding-agent/src/Theme/*.json), dynamically generating /theme.css with semantic CSS variables (--color-*) per theme and serving dynamic theme lists via /api/themes.
Replaced hard-coded color definitions across Web components (terminal palettes, modal dialogs, input fields, tool cards, language settings, and node workbench) with dynamic theme variables.
Implemented HtmlExport::deriveExportColors() to automatically compute page, card, and info backgrounds from base user message colors for themes without explicit export blocks.
Release v0.6.6 of pig. Install via composer global require pigagent/pig:0.6.6 or view on GitHub.
Fixed
Working directory validation and warning suppression in RpcClient::start(): Checked that the target $cwd exists before invoking proc_open(), throwing a clear RpcError instead of letting proc_open() fail with a raw PHP posix_spawn() failed: No such file or directory warning. Captured potential proc_open() warnings using a scoped set_error_handler to prevent raw warnings from leaking onto TUI or CLI streams. Ensured HttpServer safely falls back to the server root when a restored or client-supplied session tab points to a deleted directory.
Release v0.6.5 of pig. Install via composer global require pigagent/pig:0.6.5 or view on GitHub.
Changed
Polished Web UI sidebar aesthetics and interaction stability: Verified and unified sidebar navigation layout, crisp SVG icons, and smooth transitions for session item hover states.
Fixed
Consistent system trash and web session cleanup: Ensured session deletion across Web UI and CLI interfaces routes through OS-native trash commands (macOS Finder delete / Linux gio trash / Windows PowerShell RecycleBin) and verified clean restart workflows.
Release v0.6.4 of pig. Install via composer global require pigagent/pig:0.6.4 or view on GitHub.
Fixed
System trash/recycle bin integration for session deletion: Replaced direct hard unlink() in Web session deletion (/api/sessions/delete) with OS-native trash integration (SessionList::deleteSessionFile()). Enhanced trash handling across macOS (osascript Finder delete / trash CLI), Linux (gio trash / trash-put), and Windows (PowerShell RecycleBin), safely moving deleted sessions into the operating system's native Recycle Bin with clean fallback to unlink(). Corrected dialog prompt text to accurately indicate system trash rather than a nonexistent subfolder.
Release v0.6.2 of pig. Install via composer global require pigagent/pig:0.6.2 or view on GitHub.
Added
composer: package sources: pig install composer:vendor/name (or @; an exact version is pinned) installs a package with Composer into a shared project per scope — ~/.pig/agent/composer, .pig/composer with -l, a temporary one for -e — as pi installs npm: packages into its npm root. pig remove, pig update (unpinned only), pig list, the startup update check and settings changes of the constraint all work as they do for npm in pi. The shared project replaces pigagent/pig, so a package that requires pig never installs a second copy, and blocks Composer plugins. Packages published to Packagist can now be installed this way.
Extension provider image generation & classification APIs (Pig\Ai\Extension\ImageGenerationApi, Pig\Ai\Extension\ClassificationApi): Extensions registering custom providers via registerProvider() can now implement custom image generation (images: [...]) and classifier evaluation (classifiers: [...]), fully integrated with codemode sandbox $models->getAvailableOfType() and $models->generateImages().
Claude-style sidebar session actions and dropdown menu: Redesigned session items in the Web drawer with folder tags right-aligned, seamlessly hidden on hover to reveal a three-dots (···) action button. Added a Claude-aligned floating dropdown menu supporting session rename and danger-styled deletion.
Changed
Web sidebar hover aesthetics and height stability: Locked .drawer-item vertical line height and dimensions to ensure zero height jumping between default badge and hover action states. Replaced harsh border styling with pure rounded background blocks on hover.
Fixed
Antigravity image generation model discovery and registration: Restored Antigravity image models registration during catalog installation and discovery, enabling seamless script access via codemode.
Release v0.6.1 of pig. Install via composer global require pigagent/pig:0.6.1 or view on GitHub.
Fixed
VLESS proxy localhost target IPv4 loopback resolution: Resolved localhost targets to 127.0.0.1 in VlessServer::connect(), avoiding connection refusal on dual-stack Linux runners where localhost resolves to ::1 while target servers only bind IPv4.
RPC dialog timeout test polling resilience (RpcModeTest): Replaced brittle fixed-tick sleep in testADialogWithATimeoutSaysSoAndAnswersNoWhenItRunsOut with resilient polling until timeout expiration, preventing CI runner timing flakes.
pig --mode rpc now speaks pi's wire exactly: every command, field, response and event name, so a client written for pi --mode rpc drives pig. New commands clear_queue, get_available_thinking_levels, get_entries, get_tree, set_session_name, get_commands; prompt answers once with {disposition} and takes streamingBehavior; steer / follow_up take images; get_state and get_session_stats have upstream's shapes; compact returns the CompactionResult; bash takes excludeFromContext and streams bash_execution_update.
Events are upstream's: message_update carries deltas ({usage, assistantMessageEvent}) instead of the whole message, toolcall_start/delta/end, agent_settled, queue_update, entry_appended, thinking_level_changed, auto_retry_start/end, and compaction_start/end for manual, threshold and overflow compactions. --mode json writes the session header first.
Hook dialogs are extension_ui_request / extension_ui_response with a UUID on every request, setStatus / setWidget / setTitle, and dialog timeouts in every UI.
Keybindings registry with upstream's ids (Keybindings, Pig\Tui\KeybindingsManager, KillRing, UndoStack):
Every upstream keybinding id can be rebound in keybindings.json, editor and input keys included, with upstream's platform defaults (Windows/WSL, macOS) and old-name migrations; /reload reloads keybindings and themes.
New editing keys: undo, kill ring with yank / yank-pop, delete word forward, jump to character, page up/down; the tree gets fold/unfold, label edit (Shift+L) and label timestamps (Shift+T); the session list gets path toggle, delete (confirmed, to the trash when possible) and page keys.
Session picker search and sorting (Cli\SessionList, Cli\SessionSearch): Tab switches between this folder and all projects, Ctrl+S cycles threaded / recent / fuzzy, Ctrl+N shows named sessions only, Ctrl+R renames (inside /resume), and the search takes "phrases" and re:.
Resuming another project's session carries on in its directory (Session\SessionCwd, Cli\StartupSelector): pig picks the session before trust, settings and extensions and builds everything for the session's own working directory; /resume, /import and RPC's switch_session rebuild the runtime the same way. A directory that has gone is asked about on a terminal ("continue in current cwd") and is an error otherwise.
SYSTEM.md and APPEND_SYSTEM.md (Prompt\SystemPromptFiles): replace or extend the system prompt from the trusted project's .pig/ or the agent directory; --system-prompt and --append-system-prompt do the same for one run (text or a file path).
Structured bash results and the powershell tool (Tools\ShellTool, PowerShellTool): bash returns upstream's {output, truncated, full_output_path?, exit_code, wall_time_seconds} to codemode scripts (up to 1 MiB of output); powershell is available on native Windows through --tools / defaultTools (untested on Windows).
Added
Added CLI options --provider, --system-prompt, --append-system-prompt (repeatable), --session-id, --fork, --tui-mode regular|fullscreen, --verbose, --offline and --update-check, and the pig auth check|print-api-key|print-bearer-token subcommand (--json, --credentials, --no-refresh, --min-expiry).
Added piped standard input to the first message: git diff | pig -p "review this" sends the diff, then any @file text, then the message.
Added /scoped-models (pick the --models scope in a session; save writes enabledModels), /import (copy a session file into this project and resume it), /share (a secret GitHub gist of the HTML export via gh, viewed on PIG_SHARE_VIEWER_URL) and /export .jsonl.
Added upstream's /bug flow: describe the problem, choose whether to include the transcript (a model-written summary otherwise), then Upload Report or Export as Zip (pig-bug-report-.zip); uploads are refused under PIG_OFFLINE.
Added prompt-template substitutions ${N:-default}, ${@:-default}, ${ARGUMENTS:-default}, ${@:N} and ${@:N:L}, and argument-hint in the completion list.
Added skill discovery from ~/.agents/skills and, in a trusted project, .agents/skills in the working directory and each ancestor up to the repository root; disable-model-invocation: true keeps a skill out of the prompt while /skill:name still works.
Added AGENTS.override.md, AGENTS.MD and CLAUDE.MD to the context-file names (one file per directory, upstream's order); a nested linked git worktree no longer loads the main checkout's copy.
Added the max thinking level where a model supports it, with upstream's descriptions in the thinking menus.
Added $NAME, ${NAME} and !command values for models.jsonapiKey and headers and for auth.json keys; models.json entries can now target a built-in or extension provider (baseUrl, headers, compat for all its models), replace a model by id, and use modelOverrides; apiKey is optional.
Added ANTHROPIC_AUTH_TOKEN (sent as Authorization: Bearer, ahead of ANTHROPIC_OAUTH_TOKEN and ANTHROPIC_API_KEY).
Added upstream's legacy registerProvider(name, config) form for extensions, $ctx->modelRegistry, and (request, ctx) for virtual model routers.
Added PIG_SESSION_ID, PIG_SESSION_FILE, PIG_PROVIDER, PIG_MODEL and PIG_REASONING_LEVEL to the environment of bash / powershell commands, and PIG_CODING_AGENT=true / AI_AGENT=pig for every child process.
Added PIG_PACKAGE_DIR, PIG_TUI_ESC_TIMEOUT and PIG_SKIP_VERSION_CHECK, and Termux clipboard support (termux-clipboard-get / termux-clipboard-set).
Added per-model cost lines and a Tools/summaries line to /session.
Added catalog refresh when /model or /scoped-models opens, and for /model when nothing cached matches.
Changed
codemode is always registered but inactive, as upstream's (CustomTool(defaultActive: false)): turn it on with --tools …,codemode, --tools +codemode, defaultTools (["+codemode"]) or setActiveTools(); an MCP server with codemode exposure turns it on and it stays on. Breaking:codemode.enabled is removed — use "defaultTools": ["+codemode"].
/share links to pigagent.dev's own viewer, https://pigagent.dev/session/# (still overridable with PIG_SHARE_VIEWER_URL).
Breaking — PIG_HOME is now PIG_CODING_AGENT_DIR (upstream's PI_CODING_AGENT_DIR, ~ expanded). PIG_HOME is not read: rename it in your shell profile.
Breaking — --no-save is now --no-session, with no alias. A --no-session run now reads your settings and models.json like any other run; only the conversation is not written. Its session still has an id (--session-id sets it).
Breaking — a bare apiKey in models.json (or a key in auth.json) is a literal."apiKey": "MY_KEY" used to name an environment variable; write "$MY_KEY" (or "${MY_KEY}") now.
Breaking — prompt templates live in prompts/, not commands/: move ~/.pig/agent/commands/*.md to ~/.pig/agent/prompts/ and .pig/commands/ to .pig/prompts/. The conventional directories load their direct children only.
Breaking — skills are no longer read from other tools' folders: ~/.claude/skills, .claude/skills, ~/.codex/skills, ~/.pi/agent/skills and .pi/skills (and pi's theme directories) are gone. Add any of them to the skills setting to keep it. The first skill of a name now wins, with a collision warning for the rest.
Breaking — skills, prompts and themes settings are lists of paths with !pattern, +path and -path. The old skills object (enabled, ignoredSkills, includeSkills, the enable* switches) is reported and ignored; enableSkillCommands is a top-level key.
Breaking — RPC wire renames: hook_ui_request / hook_ui_response → extension_ui_request / extension_ui_response; export → export_html; go_to → navigate_tree ({targetId, summarize, customInstructions, replaceInstructions, label}, answering {cancelled, …}); get_branch is removed (use get_entries / get_tree); auto_compaction_start/end → compaction_start/end; retry_start/end → auto_retry_start/end; bash_output → bash_execution_update; message_update sends deltas; hook_error → extension_error {extensionPath, event, error}; switch_session / new_session return {cancelled}; a bad line is Failed to parse command: …. RpcClient methods use upstream's names (getState(), getAvailableModels(), exportHtml(), …) and wait for agent_settled.
Breaking — environment variables no longer read: PIG_MODEL, PI_MODEL, PIG_PROVIDER, PI_PROVIDER, PIG_THINKING, PI_REASONING_LEVEL, PIG_TUI_MODE, PI_TUI_MODE and ALL_PROXY. Use --model, --provider, --thinking, --tui-mode or the settings instead.
Breaking — PIG_* only, no PI_* fallback: PI_CACHE_RETENTION → PIG_CACHE_RETENTION; PIG_TUI_TRACE → PIG_TUI_WRITE_LOG (a directory gets tui--.log); PIG_CLEAR_ON_SHRINK, PIG_HARDWARE_CURSOR, PIG_OFFLINE (1/true/yes), PIG_PROGRAM_STATUS, PIG_HYPERLINKS, PIG_IMAGE_PROTOCOL, PIG_TRUE_COLOR and PIG_OAUTH_CALLBACK_HOST no longer read their PI_ names.
Breaking — command-line parsing follows upstream's: -r / --resume takes no value (use --session ); Escape in the startup picker prints No session selected and exits 0; an unknown short option is an error, and an unknown long option is an error unless an extension registers it; --api-key requires --model / --models; --mode text on a terminal opens the TUI, while -p or a non-terminal stream is print mode; print mode with nothing to send exits 0 quietly; --list-models takes a search only when one follows; after --, @file is still a file.
Changed --session for another project's session to ask whether to fork it into this one (on standard error when nothing can answer); --session-id opens that exact id or creates a session with it.
Changed proxy selection to undici's rules: https:// uses https_proxy → HTTPS_PROXY → the HTTP proxy; http:// uses http_proxy → HTTP_PROXY → direct; httpProxy fills an unset HTTP_PROXY / HTTPS_PROXY; no_proxy accepts *.example.com; an empty proxy.bypass no longer clears no_proxy.
Changed compaction to upstream's implementation and names (Compaction::calculateContextTokens(), prepareCompaction(), compact(), …): a cut inside a turn is summarised as two requests joined under "Turn Context (split turn)", tool results shown to the summariser are cut at 2,000 characters, and "Compacted from N tokens" uses the projected estimate. Threshold compaction now runs in every mode, before each prompt and after each run; an overflow is compacted and retried once.
Changed branch summaries to upstream's: file lists come only from the part of the branch that fits the budget, with "Additional focus" or full replacement instructions, a label, and "No content to summarize" for an empty branch.
Changed compaction and tree hook events to upstream's fields (SessionBeforeCompactEvent, SessionCompactEvent, SessionBeforeTreeEvent, SessionTreeEvent; fromHook → fromExtension); session_before_* handlers stop at the first cancel, else the last answer wins.
Changed !!command to be recorded in the session (left out of model requests) instead of not being saved; a bash execution's spillPath is now fullOutputPath.
Changed defaultThinkingLevel's default to medium, clamped to the model; set_thinking_level over RPC clamps too.
Changed models.json to be re-read whenever /model opens, and to apply after extension providers.
Changed shellPath to expand ~ and file://; bash is found as upstream finds it (shellPath, then Git Bash / bash.exe on Windows, else /bin/bash, bash on PATH, sh), so a Homebrew bash needs shellPath.
Changed compaction settings to accept only non-negative safe integers (0 allowed); an invalid value is reported with upstream's message.
Changed the project trust prompt's triggers to upstream's (settings.json, mcp.json, extensions, skills, prompts, themes, SYSTEM.md, APPEND_SYSTEM.md, .agents/skills), plus pig's hooks and tools.
Changed Ctrl+C to cancel a loader or close the config selector, and Ctrl+D with text in the editor to delete forward (it exits only on an empty editor).
Changed pig -r to open the list even when this project has no sessions, so other projects can be reached with Tab.
Changed the slash command list to add /scoped-models, /import and /share, with /quit as the listed name (/exit still works).
Release v0.5.31 of pig. Install via composer global require pigagent/pig:0.5.31 or view on GitHub.
New Features
The web UI's sidebar is laid out like Claude's: New session, Search and Scheduled (a placeholder for now) at the top, then the conversations of every project in one list, grouped by the day they were last written to (Today, Yesterday, a date), each with its folder beside it. "View all" and Search (also ⌘K) open one panel that lists every conversation or searches their names and contents, as --resume does.
Added
SessionManager::listAll() and searchAll(), and the /api/sessions/all endpoint they answer, across pig's and pi's sessions/.
Providers with a fetched catalog (Provider(refreshModels:), upstream's refreshModels()): ModelRefresh restores the stored catalog when the provider registers, refreshes every one in the background when the TUI or RPC mode starts (not under PIG_OFFLINE), and refreshes the one you signed into after /login, warning when that times out or fails.
SelectList layouts (SelectListLayout): the label column fits the widest label between upstream's bounds in the theme, thinking, settings, slash-command, per-model and /llama pickers.
Changed
The web sidebar no longer asks for a folder before showing its conversations, and a new session opens in the active tab's directory.
Removing an api-key sign-in with /logout says upstream's Removed stored API key for . Environment variables and models.json config are unchanged.
Fixed
The web sidebar showed nothing and "+ New Session" did nothing: app.js read two variables it never declared, which an ES module throws on.
Embedded upstream's four core built-ins directly from repository source: builtin:llama.cpp (pig-llama), builtin:codemode (pig-codemode), builtin:tool-search (pig-tool-search), and builtin:mcp (pig-mcp).
Supported toggling built-in extensions in settings.json (-builtin:, +builtin:, !builtin:*) and interactive pig config under the *Built-in* group.
Allowed explicit loading via -e builtin: even with --no-extensions enabled.
Automatically omitted built-in extensions when overridden by user/external extensions (omitReplaced) and warned against stale copies in ~/.pig/agent/extensions.
Native pig-llama Extension & Extension API Key Auth (extensions/pig-llama, ApiKeyAuth):
Ported upstream's extensions/llama extension providing the local llama.cpp provider and runtime model discovery from /v1/models.
Added Provider::$apiKeyAuth enabling extensions to register interactive API key authentication flows (/login llama.cpp).
Decoupled tool_search from the MCP extension into a dedicated built-in extension, dynamically activating when any MCP server has deferred tools via DeferredTools.
Added --skill and --prompt-template CLI options to explicitly load skill and prompt-template files/directories for single runs, taking precedence even when --no-skills or --no-prompt-templates are enabled.
Aligned theme CLI options with upstream pi: --theme loads themes from files/directories, --use-theme sets the active theme name, and --no-themes disables all theme directory auto-discovery.
Supported repeated usage for -e, --skill, --prompt-template, and --theme.
Changed
--theme Takes Path, --use-theme Takes Name:
Aligned --theme to accept file/directory paths and moved theme name selection to --use-theme , strictly matching upstream pi.
Fixed
Adjacent Emoji Grapheme Cluster Splitting under PCRE2 10.42 (Graphemes::split()):
Implemented splitPictographs() in Graphemes::split() to work around the PCRE2 10.42 bug bundled in PHP 8.3 (where \X improperly joined adjacent pictographs lacking a ZWJ), ensuring Width::visible("🙂🙂🙂") computes as 6 columns matching terminal rendering and fixing cursor alignment and markdown wrapping.
Explicit -e Options Preserved under -ne:
Allowed explicit -e extension paths to load even when --no-extensions (-ne) is passed, and properly preserved multiple -e options without dropping prior occurrences.
Implemented a pure-PHP zero-dependency port of grok-mermaid 0.2.3, rendering ```mermaid blocks natively in terminal as Unicode box-drawing diagrams (flowcharts with subgraphs, state, class, ER, and sequence diagrams).
Integrated MermaidTransformer into markdown rendering pipeline with markdown.mermaid setting (streaming [default], final, off) and /settings row.
Automatically dispatched attribution headers matching upstream pi: X-OpenRouter-Title: pig and site URL for OpenRouter, X-BILLING-INVOKE-ORIGIN: Pig and custom User-Agent for Cloudflare, and x-opencode-client: pig for OpenCode, controlled via enableInstallTelemetry and PIG_TELEMETRY.
UUID v7 Implementation (Pig\Ai\Utils\Uuid::v7):
Implemented standard timestamp-ordered UUID v7 generation for session request tracing and summaries.
Added
Added upstream CLI tool and loader flags: --no-tools (-nt), --no-builtin-tools (-nbt), --name (-n), --no-prompt-templates (-np), and --no-context-files (-nc).
Changed
Renamed legacy --no-tools (which skipped tools/ directories) to --no-tool-files, adhering to upstream semantics where --no-tools disables all tools entirely.
Fixed
Help Text Proxy Key Alignment:
Updated pig --help proxy setting reference from deprecated proxy.url to standard httpProxy.
Implemented pure-PHP zero-dependency RFC 6455 WebSocket client (Pig\Ai\Http\WebSocket) over native non-blocking sockets with proxy tunneling support.
Added native transport: "auto" support for ChatGPT Codex backend (OpenAiCodexResponses): pooling and caching WebSocket connections per session and account (5-minute idle TTL), streaming input deltas via previous_response_id, and gracefully falling back to SSE on socket interruptions.
Independent Steering and Follow-Up Queue Modes (steeringMode, followUpMode):
Split queue modes into dedicated steeringMode and followUpMode settings (one-at-a-time, all, cancel), matching upstream pi.
Added dedicated /settings rows and RPC commands set_steering_mode and set_follow_up_mode.
Ported upstream pi's cache warmer: automatically re-sends the latest request with a 1-token budget just prior to cache TTL expiration (e.g. Anthropic 300s/3600s) when projected cache miss savings exceed $0.05.
Persisted warm events into .jsonl session files as pi-compatible usage entries (UsageEntry) and aggregated them in /session cost totals.
Added cacheWarming mode to Settings (off / streaming / idle, default streaming) and interactive /settings row.
Added cache_warming_decision hook event (CacheWarmingDecisionEvent, CacheWarmingDecisionEventResult), allowing extensions to inspect or override warming decisions.
Implemented pure-PHP zero-dependency cross-process file locking via kernel-managed flock() with non-blocking async event loop polling (Pig\CodingAgent\FileLock).
Added double-checked locking to Auth::fresh() and McpOauth: re-reading credentials immediately upon acquiring the lock, reusing tokens freshly renewed by peer processes, and completely eliminating token rotation desync race conditions between concurrent sessions.
Release v0.5.23 of pig. Install via composer global require pigagent/pig:0.5.23 or view on GitHub.
Changed
Extensions and hooks may declare classes, and /reload says what it cannot do (Hooks\DeclaredSymbols):
A named class or function in an extension no longer refuses the load. On /reload, a file with declarations runs the factory it first loaded with (PHP cannot unload a class), and when its files changed since, the reload reports it and says to restart pig. A different copy of an extension whose classes are already in memory is refused by name; an identical copy at another path is served by the first. The bundled extensions dropped their class_exists guards.
Added /fork command (upstream's user-message-selector.ts): lists historical user prompts across all branches, forks the conversation prior to the chosen turn into an independent .jsonl session file, and restores the prompt text into the editor.
Added /clone command: clones the active conversation branch at the current leaf into a new session file.
Implemented SessionManager::fork($leafId) with upstream createBranchedSession() parity: re-chaining labels off the new leaf, remapping compaction firstKeptEntryId cuts, and recording parentSession lineage in the session header.
Integrated session_before_fork hook interception, lifecycle transitions (session_shutdown('fork') -> session_start('fork')), and tool notifications with reason fork.
Added RPC commands fork, clone, and get_fork_messages along with client wrapper methods in RpcClient.
Release v0.5.21 of pig. Install via composer global require pigagent/pig:0.5.21 or view on GitHub.
Added
Disabled Extensions Configuration via Settings (Settings::disabledExtensions):
Added support for disabling specific bundled or installed extensions by name via disabledExtensions in settings.json (e.g. ["pig-android-use", "pig-computer"]), merging cleanly with CLI flags across interactive TUI, session startup, and /reload.
Release v0.5.20 of pig. Install via composer global require pigagent/pig:0.5.20 or view on GitHub.
Fixed
Empty Tool Parameters Encoding & Non-String Enum Rejections on Antigravity / Google (GoogleShared, pig-computer):
Enforced new stdClass() serialization for empty 'properties' => [] schemas in GoogleShared::sanitizeForOpenApi(), preventing Antigravity 400 errors (Cannot bind a list to map for field 'properties').
Removed integer enum declaration on computer_click.click_count, complying with Gemini OpenAPI string-only enum restrictions.
Added token and cost accounting to tool results: codemode $models->* calls and nested tools record their usage, and AgentSession::stats() aggregates tool costs alongside assistant turns in session totals.
Routed nested script tool calls through AgentSession::executeNestedTool() with / call IDs and ToolArguments::validate() schema enforcement.
Dispatched parentToolCallId across agent events, hook notifications, and RPC streaming, cleanly grouping child executions under parent cards in TUI.
Fixed
Home Directory Test Isolation in Antigravity Catalog Tests (AntigravityCatalogTest, AntigravityExtensionTest):
Corrected test isolation to isolate both PI_HOME and PIG_HOME across catalog and extension tests, eliminating test leaks from local developer configuration files.
Release v0.5.17 of pig. Install via composer global require pigagent/pig:0.5.17 or view on GitHub.
New Features
Models Namespace in Codemode Sandbox ($models, __CodemodeModels):
Exposed $models in sandbox scripts providing $models->getModelOfType(), $models->classify(), and $models->generateImages(), supporting non-LLM image generation and classification with a 4-slot concurrency limiter and aggregated usage details.
Codemode Tool Exposure Modes (codemode.mode: on | only, prepareLoadout):
Implemented prepareLoadout hook support on CustomTool:
on mode: automatically appends Codemode: $tools->x([...]) resolves to a string. to all declared tool descriptions.
only mode: hides declared tools completely from the agent, delegating their availability exclusively into codemode script execution.
Added describe_namespace($name) and namespace filtering on search_tools(), allowing scripts to inspect and query tools belonging to specific MCP servers or namespaces.
Lark Grammar Sampling for Codemode (Source::GRAMMAR):
Declared native Lark grammar sampling on the codemode tool, constraining model outputs to syntactically valid PHP on supported endpoints (supportsOpenAIGrammarTools).
Implemented 16 MiB payload size and 100,000 item thresholds for text(), image(), and echo calls, terminating runaways with LengthException while preserving prior output.
Magic Byte Image Type Verification (image()):
Validated image payloads by sniffing binary magic bytes (PNG, JPEG, GIF, WebP) and stripping whitespace/newlines, preventing corrupted base64 payloads from causing provider 400 errors.
Automated Image Disk Persistence in Results:
Automatically persisted rendered images to pig-codemode-*. on disk with an [Image saved to ...] banner, ensuring models can inspect generated images.
Release v0.5.16 of pig. Install via composer global require pigagent/pig:0.5.16 or view on GitHub.
New Features
Collapsible Skill Invocation Cards in Web UI (app.js, style.css):
Replayed /skill:name user messages as sleek collapsible [skill] name summary cards with child prompts cleanly separated, preventing raw XML blocks and SKILL.md contents from flooding the user chat bubble.
Web UI Notice Blocks & Dynamic Fallback Alerts (msg-notice, model_fallback):
Added quiet .msg-notice transcript line styling matching TUI say().
Added real-time notifications when hitting quota walls and transitioning to fallback models (model_fallback_notice), automatically updating the active model selector bar.
Displayed virtual model routing telemetry in Web UI header (→ routed-id • level).
Added banner indicators for summarization and branch summary retries (summarization_retry_*).
Added
Home Directory Expansion in MCP Stdio Configs (Paths::expand, McpConfig):
Automatically expanded ~ in command, args, and cwd fields of mcp.json stdio configurations, enabling clean, portable configs across different machines and user paths.
Release v0.5.15 of pig. Install via composer global require pigagent/pig:0.5.15 or view on GitHub.
Added
README and package documentation now explain how packages can be listed on pigagent.dev/packages via GitHub topic pig-package and preview assets (extra.pig.image / extra.pig.video).
Changed
Transitioned pig-vless proxy control lifecycle to match /web conventions: loading the extension sets UUID and listen address without opening ports; /vless start | stop | restart | status provide runtime daemon control.
Fixed
Operator Precedence in Tool Renderer Checks (ToolExecutionComponent::drawsItself):
Parenthesized null-coalescing expressions in ToolExecutionComponent::drawsItself() (($a ?? null) !== null || ($b ?? null) !== null), eliminating PHP Warning: Undefined array key "renderResult" when invoking custom tools that provide no custom renderers.
Implemented standalone, pure-PHP VLESS proxy inbound supporting TCP relay via dual asynchronous Web\TcpConnection pipelines over Raw protocol, allowing mobile clients (Shadowrocket) to proxy traffic.
Supported optional non-blocking TLS server handshake after socket acceptance.
Designed with opt-in configuration ("vless": {} in settings.json), automatic UUID generation and persistence, silent drop defense on authentication failures, and /vless share URL generation.
Release v0.5.13 of pig. Install via composer global require pigagent/pig:0.5.13 or view on GitHub.
Fixed
Recursive Directory Deletion in WebSearch Test (WebSearchExtensionTest):
Replaced shallow directory cleanup in WebSearchExtensionTest::cleanStaleChromeDirs with recursive tree deletion (removeTree), preventing rmdir(): Directory not empty PHP warnings during Chrome temporary profile teardown on CI test runners.
Release v0.5.12 of pig. Install via composer global require pigagent/pig:0.5.12 or view on GitHub.
New Features
MCP Stdio Transport Support (--mcp-stdio, McpStdio):
Implemented JSON-RPC 2.0 line-delimited communication over standard input/output for host environments that spawn MCP servers as subprocesses (e.g. claude mcp add pig -- pig --mode mcp --mcp-stdio).
Extracted shared dispatcher logic into McpDispatcher serving both Streamable HTTP and Stdio transports.
Concurrent ask Tool Call Serial Queue (McpDispatcher):
Automatically queued concurrent incoming ask tool calls in order of arrival instead of rejecting them with busy errors, executing turns sequentially while continuously sending HTTP : keep-alive frames during wait states.
Added
Added --session / -c support documentation and test verification for --mode mcp, allowing external clients to attach to existing session histories.
Changed
Changed HTTP transport response protocol negotiation to dynamically select JSON or SSE streaming based on resolution timing (synchronous dispatch returns JSON, asynchronous turns open SSE streams).
Release v0.5.11 of pig. Install via composer global require pigagent/pig:0.5.11 or view on GitHub.
Added
Added mcp as a value of a hook's $ctx->mode(), allowing extensions and hooks to identify MCP callers; --mode mcp sets this mode.
Recognized PI_PROGRAM_STATUS=1|0 as well as PIG_PROGRAM_STATUS to force or silence OSC 7501 program status reporting.
Changed
Extracted the repetitive twelve-closure hook initialization across PrintMode, RpcMode, InteractiveMode and McpMode into HookRunner::wire($session, $ui).
Aligned loop failure handling with upstream pi HEAD: emitting message_start -> message_end -> turn_end -> agent_end sequence upon uncaught loop errors, ensuring failing turns are persisted to session history and rendered in TUI/RPC instead of vanishing silently.
AST Unresolved Class Name Static Linting (test/lint.php):
Added AST tokenizer analysis checking all class references across new, instanceof, catch, return types, and parameter type hints to catch unimported class names at build time.
Missing Class Imports in Interactive, Print, and Web Modes:
Fixed missing use statements in InteractiveMode (CustomTool), PrintMode / RpcMode (Model), TcpConnection (Throwable), and HttpServer (Http).
Release v0.5.9 of pig. Install via composer global require pigagent/pig:0.5.9 or view on GitHub.
Fixed
Resilient Polling in Theme Watcher Test (ThemeWatcherTest):
Replaced rigid 0.8s sleep in ThemeWatcherTest with runUntil() predicate polling and an expanded timeout, preventing false-positive test failures caused by scheduling jitter on busy CI virtual machines.
Release v0.5.8 of pig. Install via composer global require pigagent/pig:0.5.8 or view on GitHub.
Fixed
Changelog Release Entry Bracket Assertion in CI (UpdateCheckTest):
Aligned testTheChangelogHasAnEntryForAReleasedVersion to recognize bracketed version headers (## [x.y.z]) matching the Keep a Changelog standard format, fixing tag-triggered CI test runner failures.
Supported upstream !glob, +path, and -path resource filters and autoload: false delta overrides.
Implemented package update commands (update , --extensions, --all, --extension ) with asynchronous git ls-remote version checks (PackageUpdateCheck).
Added interactive pig config [-l] resource toggle screen for browsing and customizing package resources.
Added
Added scripts/bench-tui.php standalone benchmarking script for measuring frame render latencies, byte throughput, and peak memory consumption across real session transcripts.
npm: and composer: sources are refused by name; pig runs no package manager inside a package and requires a package's own vendor/autoload.php when present.
pig update without a target updates pig only and says packages were skipped, as upstream does (it used to also refresh the bundled extensions; that is --extensions now).
pig config [-l] — upstream's resource screen: a package's extensions, skills, prompts and themes switched on and off, in the user's settings or as project overrides (Tab switches), writing +path / -path filters.
-e (--extension) takes a package source for one run — pig -e git:github.com/user/repo clones it under tmp/extensions and writes nothing to the settings — as well as a file or directory as before.
Local package paths are written to the settings relative to the settings file (../tools), so a committed .pig/settings.json works on every checkout.
Fixed
A quota wall no longer shows the bug-report hint: BugReport::worthReporting() excludes isProviderLimitError() as well as the retryable errors, since v0.5.4 classifies "quota reached" as a limit for the fallback models rather than a retryable error.
Release v0.5.5 of pig. Install via composer global require pigagent/pig:0.5.5 or view on GitHub.
Added
Bound upstream's app.message.copy (ctrl+x): in fullscreen with fullscreenCopyOnSelect off it copies the mouse selection, otherwise the last answer, with a Copied! flash in fullscreen.
Changed
Transcript spacing and the two padding settings, as upstream has them:
A typed !cmd / !!cmd is drawn by a new BashExecutionComponent (upstream's bash-execution.ts): rule, bold command, last 20 lines, loader, status parts, rule; !! in dim. The Not added to the conversation note is gone with it.
/hotkeys and /help draw in the changelog's framed block with a bold *Keyboard Shortcuts* title; /new says ✓ New session started with a blank row under it; *What's New* has upstream's spacer under the title; every overlay list has a blank row under it.
Added the outputPad (0/1) and editorPaddingX (0–3) settings with their /settings rows *Output padding* and *Editor padding*, threaded through every message, tool, command and error component and the editor.
Release v0.5.4 of pig. Install via composer global require pigagent/pig:0.5.4 or view on GitHub.
New Features
Automatic model fallback at a quota wall (fallbackModels):
A turn that ends on a quota / billing limit error now moves on to the next entry of fallbackModels and is sent again there, instead of ending the run. The switch is kept for the session like a /model typed by hand, not written to defaultModel; :level on an entry sets the thinking level, otherwise the current one carries over.
Added ModelFallbackEvent (RPC model_fallback with from, to, error) and a transcript line in the terminal.
Added Retry::isProviderLimitError(), the quota / billing half of the retry classifier, with pi-antigravity's Quota reached. wording recognised as a limit.
Added AssistantMessage::$thinkingLevel stamped on every streamed response via AgentLoop::streamAssistantResponse() matching upstream pi.
Persisted thinking level in .jsonl session files via MessageJson, allowing virtual model routers to inspect previous response thinking levels on continuation turns (RoutedModel::$thinkingLevel).
Added fallbackModels setting allowing users to configure an ordered list of fallback model patterns (e.g. google/gemini-3.8-flash:medium) for automatic switching when a primary model encounters quota depletion.
Changed
Flat Architecture for Virtual Model Contracts:
Moved VirtualModelRegistry, VirtualModelDefinition, ModelRouteRequest, ModelRoute, and RoutedModel into the root Pig\CodingAgent namespace alongside McpServerRegistry for consistent package design.
Fixed
Pre-emptive Offline Guard for Auth Token Renewal (Auth::fresh):
Added upfront \Fiber::getCurrent() === null check before initiating OAuth refresh connections, preventing startup and session restore operations in offline or DNS-less environments from failing with socket connection errors.
Provider Key Isolation for New Built-in Providers (WithoutProviderKeys):
Added environment variable clearing for DeepSeek, Azure, Mistral, and all newly supported provider endpoints in test isolation fixtures.
Added $pi->registerVirtualModel() and unregisterVirtualModel() to ExtensionApi: virtual models appear in the model selector (api: pi-virtual) and resolve dynamically on every request right before dispatch via AgentLoopConfig::$prepareRequest.
The virtual model router inspects the request reason (user, continuation, retry, direct), previous responses, and failed responses, clamping thinking levels with ThinkingLevel::clampedFor().
Persisted router state on session branches as pi.virtual-model-state custom entries; the footer and UI display routed physical models (e.g. auto • high → gpt-5.6-luna), and providers composed solely of virtual models require no API key.
Release v0.5.0 of pig. Install via composer global require pigagent/pig:0.5.0 or view on GitHub.
New Features
New Native Protocol Implementations (AzureOpenAiResponses, OpenAiCodexResponses, PiMessages):
Added native support for azure-openai-responses and Azure Chat Completions (Providers\Azure) with automatic endpoint normalization and deployment routing.
Added native support for openai-codex-responses (ChatGPT Codex backend) with full OAuth PKCE and device code authorization (Utils\Oauth\OpenAiCodex, DeviceCodeFlow).
Added native support for pi-messages wire protocol powering the Radius gateway (Providers\PiMessages, PiMessagesEventConverter, RadiusConfig).
Non-Chat Model Architecture (ModelType, ClassifierModel, ImageModel, FauxProvider):
Introduced ModelType (chat, classifier, image), supporting classification models (Models::classify() via System One, Cloudflare Workers AI, and LlamaCpp) and image generation models (Models::generateImages() via OpenRouter).
Added FauxProvider for deterministic offline provider stream testing.
Full Catalog Provider Coverage (25+ Providers Aligned with Upstream pi 1.1.0):
Added official model catalog definitions and metadata across 25+ major providers: DeepSeek, OpenRouter, Vercel AI Gateway, Together, Fireworks, Baseten, Hugging Face, NVIDIA, MiniMax, Moonshot, Kimi For Coding, Meta, OpenCode, Qwen Token Plans, Z.ai Coding Plan, and Ant Ling.
Sourced Cloudflare Workers AI and AI Gateway models (Providers\Cloudflare).
Routed xAI models natively to Api::OpenAiResponses with full reasoning support.
Dynamic Antigravity Model Catalog Discovery & Grouping (Discovery, Grouping):
Implemented background catalog hydration and TTL-cached discovery against Google endpoints (Discovery), updating local models-store.json and grouping models (Grouping) without requiring full restarts.
Aligned status indicators for /compact, threshold compaction, overflow compaction, and branch summarization with upstream pi, allowing graceful cancellation via escape key with localized key labels.
Release v0.4.36 of pig. Install via composer global require pigagent/pig:0.4.36 or view on GitHub.
New Features
Amazon Bedrock & Google Vertex AI Zero-Dependency Native Emulation (Providers\Bedrock, Providers\GoogleVertex, Utils\Aws, Utils\GoogleAuth):
Implemented pure PHP native protocol support for Amazon Bedrock and Google Cloud Vertex AI without external SDK packages, verified byte-for-byte against upstream pi test fixtures recorded via Node.js oracle runners.
Implemented SigV4 signing engine (SignatureV4), AWS binary event framing (EventStream), AWS default credential chain (CredentialChain, covering environment, ~/.aws profiles, STS AssumeRole, WebIdentity, and IMDS), and Google ADC credential discovery with RS256 JWT tokens.
Transcript Context Architecture with First-Class SystemMessage (TranscriptContext, SystemMessage, AgentLoop, AgentSession):
Aligned context architecture with upstream pi: embedded system prompts and tools into conversation history via initial SystemMessage instances and incremental delta updates (toolsAdded, toolsRemoved, prompt section diffs), guaranteeing consistent compaction and replay across sessions.
Automatically re-requested empty responses up to twice with backoff, supported runtime model fallback to older designations on 404, and aligned error diagnostic text with pi-antigravity.
Fully ported upstream pi's mistral-conversations.ts, completely decoupling Mistral from OpenAiCompletions.
Added native thinking stream chunk decoding, automatic 9-character alphanumeric tool call ID generation, runtime reasoning_effort versus prompt_mode: "reasoning" dispatch based on thinkingLevelMap, and native error formatting (Mistral API error (): ).
Removed deprecated requiresMistralToolIds and mistral.ai host quirks from OpenAiCompat.
StopReason::Deferred Support across Agent & Session Persistence (StopReason, AssistantMessage, MessageJson):
Added StopReason::Deferred and AssistantMessage::$deferred handle tracking for deferred turns, persisting handles across .jsonl session storage and TransformMessages history replay.
Upstream Model Generator Parity for Copilot, Google, and Z.ai (generate-models.php, Models):
Applied GITHUB_COPILOT_EXTENDED_CONTEXT_MODELS (1,000,000 context window) across all eligible Copilot models and populated models.dev list pricing.
Built official thinkingLevelMap instances for Google (including Gemma 4 two-tier thinking) and Mistral models.
Configured Z.ai models from zai-coding-plan with zaiToolStream: true.
Re-architected item stream dispatching using output_index slots, eliminating delta cross-talk and corruption during interleaved reasoning and parallel tool calling outputs.
Standardized error formatting via Pig\Ai\Utils\ErrorBody matching upstream pi's formatProviderError().
Converted unannounced stream drops lacking finish_reason in completions or finishReason in Google into explicit provider errors (Stream ended without finish_reason / Google stream ended without a finish reason).
Integrated JsonRepair::parse() for Anthropic SSE events to repair control-character malformations and surface parse errors with full event debugging context instead of silently dropping chunks.
Aligned model generation overrides for OPENAI_SHORT_CONTEXT_CAPPED_MODEL_IDS (gpt-5.4, gpt-5.5, GPT-5.6, GPT-6, 6.1 Sol), capping context windows at 272,000 (output 128,000) to trigger compaction before OpenAI's expensive long-context pricing threshold.
Implemented withOpenAiLongContextPricing() for OPENAI_LONG_CONTEXT_PRICING_MODEL_IDS (2x input/cache, 1.5x output past 272k) and set gpt-5-pro max output tokens to 128,000.
Transmitted prompt_cache_key on api.openai.com endpoints and x-session-id on affinity-enabled providers (e.g. OpenRouter).
Applied Anthropic cache_control markers on system prompt, final tool, and final user block when cacheControlFormat is anthropic.
Strict Custom Model Pricing Tier & Limit Validation (CustomModels):
Implemented TypeBox-compatible schema validation for cost.tiers, inputLimits, and promptCache in models.json, rejecting malformed numeric fields with diagnostic path errors instead of silently falling back to zero rates.
Initialized stream builder stop reasons as StopReason::Pending.
Converted uncompleted streams that terminate without message_stop / stop_reason or Responses terminal events into explicit provider errors (Anthropic stream ended without a stop reason, OpenAI Responses stream ended before a terminal response event) rather than misrepresenting aborted turns as successful completions.
Backfilled encrypted reasoning payloads from response.completed.response.output for endpoints (such as Azure) that omit encrypted content from delta items.
Replaced partial arguments and dispatched missing deltas upon receiving function_call_arguments.done.
Detected proxy disconnections occurring without terminal done or error events, throwing Connection closed by proxy server before the response completed.
Relayed providerThinkingLevel and updated final tool call snapshots on toolcall_end.
Introduced Pig\Ai\Utils\Estimate to calculate approximate token consumption from message character counts (~3.5 UTF-16 characters per token).
Implemented upstream pi's clampMaxTokensToContext() and adjustMaxTokensForThinking(): automatically clamping maxTokens to the context window headroom and expanding budget-thinking allocations up to model ceilings while safeguarding 1,024 tokens for final responses, preventing Anthropic 400 budget-exceed errors.
Injected ephemeral cache breakpoints across system prompt, the final tool declaration (when supported), and the final user block, supporting 1-hour cache retention (cacheRetention: long / PI_CACHE_RETENTION=long).
Propagated active session file IDs through Agent into stream options, transmitting x-session-affinity / x-session-id headers and Responses prompt_cache_key for sticky provider caching.
Comprehensive Upstream Thinking Level Maps for Claude & GPT Models (Models, ThinkingLevel):
Fully populated thinkingLevelMap across Anthropic, OpenAI, and Copilot GPT models matching upstream pi's generator (applyThinkingLevelMetadata()), unlocking xhigh on capable models (Opus 4.7+, gpt-5.2+, GPT-6) and properly respecting off: null restrictions on non-disableable reasoning models.
Full-Fidelity Gateway Context & Model Serialization (StreamProxy, PricingTier):
Serialized context as upstream transcripts (system message with prompt and toolsAdded) with complete tool definitions, forwarding model thinkingLevelMap, PricingTier pricing tiers, and session parameters over StreamProxy.
Fixed
Authoritative OpenAI Responses Thinking & Incomplete Status Mapping (OpenAiResponses, Models):
Replaced legacy # Juice: 0 prompt hack with official reasoning: {effort: map.off ?? "none"} matching upstream thinkingLevelMap definitions.
Enforced a minimum max_output_tokens of 16, avoiding API rejections on minimal budgets.
Mapped only max_output_tokens incomplete statuses to StopReason::Length, while treating other truncation causes as actionable Response incomplete: errors.
Anthropic Refusal, Sensitive, and Unknown Stop Reason Handling (Anthropic):
Correctly intercepted refusal and sensitive stop reasons, converting them to error events with full explanatory details rather than letting sessions silently succeed with missing turns.
Implemented the grammar half of upstream pi's constrained sampling (resolveGrammarConstrainedSampling, createGrammarToolInputProperties, getGrammarToolInput, and appendGrammarToolInputJsonDelta), supporting custom tools with Lark or regex grammars on compatible endpoints (e.g. OpenAI supportsOpenAIGrammarTools).
Added streaming support for response.custom_tool_call_input.delta and .done in OpenAiResponses, translating custom tool text into JSON argument deltas and replaying custom_tool_call and custom_tool_call_output in conversation history.
TypeBox Value.Convert Parity for Built-in Tools (Tool::$typeBox, ToolArguments::valueConvert()):
Added typeBox: true flag to all built-in tools (bash, edit, find, grep, ls, read, write), running valueConvert() matching upstream typebox 1.3.27 behavior (converting "path": null to "null", "" for numbers to 0, "1"/"TRUE" to booleans, and scalar wrapping for array properties) prior to standard schema coercion.
Anthropic Protocol Parity & Managed-Effort Support (Anthropic, AnthropicCompat, AssistantMessage):
Extended AnthropicCompat with supportsTemperature, supportsEagerToolInputStreaming, and supportsMidConvoEffort, mapping models via AnthropicCompat::forBuiltIn().
Added support for managed-effort Claude models (Opus 5, Opus 5.5, Sonnet 5.5, Haiku 5.5, Fable 5.1): enforcing adaptive thinking with block_binding, sending managed-effort betas, persisting providerThinkingLevel on AssistantMessage and MessageJson, and inserting effort-only system messages across historical turns.
Aligned header generation with upstream: omitting temperature when thinking or on temperature-unsupported models (Opus 4.7+), sending tools with eager_input_streaming: true (using fine-grained-tool-streaming only when unsupported), and appending anthropic-dangerous-direct-browser-access: true.
Fully populated Models::anthropicThinkingLevelMap() including xhigh, max, and 5.5 overrides matching upstream's generator.
Copilot Claude Model Routing & Token Endpoint Alignment (Models, generate-models.php, Anthropic):
Updated generator pattern needsResponsesApi to match gpt-, grok-, oswe, and mai-, while routing all Copilot Claude 4.x/5.x models to anthropic-messages.
Nested Empty Objects Preservation in Model Routing (CustomModels::keepRoutingObjects()):
Maintained nested empty objects as stdClass instances in openRouterRouting and vercelGatewayRouting so wire payloads serialize as {} instead of [].
Implemented upstream pi's coerceWithJsonSchema(): automatically coerced stringified numeric arguments ("10" -> 10), string booleans ("true"/"false" -> true/false), primitive string conversions, and required null primitives to type zero values ("", 0, false) before JSON schema validation, eliminating tool rejections caused by LLM argument type hallucinations.
Anthropic Thinking Control & Summarized Output Parity (Anthropic, AnthropicOptions, Models):
Explicitly emitted thinking: {type: "disabled"} when reasoning is switched off unless model metadata indicates off: null (such as Fable 5 and managed-effort Claudes), preventing adaptive models from silently executing thinking loops and billing.
Defaulted thinking.display to "summarized" across budget and adaptive modes (overridable via AnthropicOptions::$thinkingDisplay), ensuring reasoning text streams consistently on newer Claude models (such as Opus 4.7+).
GitHub Copilot Claude Protocol Routing Alignment (Models, Anthropic, generate-models.php):
Routed Copilot Claude 4.x/5.x models to anthropic-messages via copilotApi() matching upstream pi.
Implemented Bearer token authorization, dynamic host selection from token proxy-ep, Copilot dynamic telemetry headers, and adaptive thinking metadata in Anthropic provider for github-copilot.
Supported openRouterRouting and vercelGatewayRouting in models.json compat blocks, merging provider and model settings and relaying preferences through proxy and client requests.
Added $constrainedSampling to CustomTool and forwarded it in WrappedCustomTool::definition(), allowing extension tools to leverage strict tool sampling.
Fixed
OpenAI Responses Tool Result Inline Images (OpenAiResponses):
Aligned convertToolResultOutput() with upstream pi by embedding tool result images directly inside function_call_output.output (input_text + input_image), removing separate synthetic user turns that confused models.
Configured built-in tools (bash, edit, read, write) with ['type' => 'json_schema', 'strict' => 'prefer'], enabling strict schema enforcement on capable endpoints (Anthropic with supportsStrictTools, OpenAI with supportsStrictMode, Gemini 3+ parametersJsonSchema).
Implemented upstream pi's normalizeOptionalNulls() in ToolArguments::validate(), dropping unrequired null arguments whose schemas reject null prior to schema checking, preventing spurious limit: must be number validation rejections when models omit optional parameters under strict sampling.
Replaced ad-hoc model ID string pattern checks with declarative AnthropicCompat metadata (forceAdaptiveThinking, supportsStrictTools), properly identifying Opus 4.6, Sonnet 4.6, Opus 5, and related adaptive models without warnings or missed adaptive configs.
Omitted interleaved-thinking beta headers on non-thinking turns and adaptive thinking runs.
OpenAI Completions Thinking Format Architecture (OpenAiCompat, OpenAiCompletions):
Added support for diverse thinking formats matching upstream pi: deepseek (thinking: {type} + reasoning_effort), zai (thinking: {type, clear_thinking: false}), openrouter (reasoning: {effort}), together (reasoning: {enabled}, reasoning_effort), qwen, chat-template, and baseten with template argument interpolation.
Fully aligned OpenAiCompat::detect() with upstream detectCompat(), matching both provider IDs and lowercased URLs for DeepSeek, z.ai, Moonshot, Together, NVIDIA, Cloudflare, Chutes, Cerebras, and OpenRouter.
Enhanced OpenAiCompat::resolve() to merge compat settings key-by-key over detected settings, enabling model-level and provider-level compat overrides from models.json.
Fixed
Authoritative Responses API Thinking Text Reconstruction (OpenAiResponses):
Reconstructed reasoning text from finished output_item.done items (joining summary parts, then content raw reasoning text, falling back to streamed deltas), preventing trailing newlines from summary part delimiters and retaining raw reasoning text.
Accurate Tool Result Output Placeholders (OpenAiCompletions, OpenAiResponses, Google):
Output (see attached image) only when images are present without text, and emit (no tool output) or "" for empty results, eliminating bogus image references.
Fully ported upstream pi's strict JSON schema transformation engine (makeStrictJsonSchema), enforcing additionalProperties: false, required property backfilling, and optional-to-null union expansion for strict tools on supported models (e.g. Gemini 3+ parametersJsonSchema).
Added Tool::$constrainedSampling supporting json_schema strict sampling configurations (prefer vs require).
Fixed
OpenAI Responses API Refusal and Finished Output Text Reconstruction:
Reconstructed complete assistant text from response.output_item.done items, combining both output_text and refusal segments and preventing refusal messages from being dropped.
Graceful Image Downgrade for Text-Only Models (TransformMessages):
Implemented downgradeUnsupportedImages() in TransformMessages::apply(): automatically replaced images in user messages and tool results with structured placeholder notes ((image omitted: model does not support images) / (tool image omitted: model does not support images)) when targeting models without vision input, coalescing adjacent images into single lines.
DeepSeek Reasoning Content Filler (OpenAiCompat):
Added requiresReasoningContentOnAssistantMessages compatibility detection for DeepSeek endpoints, automatically populating reasoning_content: "" on replayed assistant turns without reasoning content and eliminating 400 parameter errors.
Release v0.4.27 of pig. Install via composer global require pigagent/pig:0.4.27 or view on GitHub.
Fixed
Fixed Linux / Ubuntu dash Incompatibility in RPC Client Child Launcher (RpcClient):
Replaced hardcoded /bin/sh in RpcClient::withoutInheritedFds() with preferred /bin/bash (falling back to /bin/sh max fd 9).
Eliminated fatal exit code 127 (exec: 10: not found) on Debian/Ubuntu systems where /bin/sh links to dash and rejects multi-digit file descriptor redirects, enabling RpcClient and WebMode sub-processes to spawn cleanly on Linux.
Fixed Linux Extension Module Availability in Codemode Sandbox (Sandbox):
Removed -n (no configuration files) from Sandbox::command(), ensuring shared extensions (like ext-mbstring on Ubuntu CI runners) load properly while retaining strict -d security overrides (disable_functions, open_basedir, and memory_limit).
Added explicit $result['ok'] assertion in CodemodeTest to prevent array key warnings on unexpected execution failures.
Robust Child Session Binding Assertion in Web Mode Test (WebModeTest):
Added safety assertion verifying session_bound before array indexing on SessionPool::all(), eliminating undefined array key warnings.
Release v0.4.26 of pig. Install via composer global require pigagent/pig:0.4.26 or view on GitHub.
Fixed
Google / Gemini Thinking Configuration and Level Model Compatibility (GoogleShared, Stream):
Aligned Google thinking mode selection with upstream pi's usesGoogleThinkingLevel(): correctly matched Gemini 3.x, -latest aliases, and Gemma 4 models to named thinking levels rather than falling back to -1 token budgets.
Implemented disabledGoogleThinkingConfig($model): prevented 400 errors ("Budget 0 is invalid. This model only works in thinking mode") on models without an off level by clamping to their lowest supported level.
Aligned Gemini 2.5 thinking token budget tables across 2.5 Pro, 2.5 Flash, and 2.5 Flash-Lite.
Ported upstream's TextSignatureV1 encoding ({"v":1,"id":...,"phase":...}), preserving message IDs and reasoning phases (commentary / final_answer) across multi-turn interactions.
Chat Completions Reasoning Streaming and OpenRouter reasoning_details Parity:
Merged streaming reasoning.text, reasoning.summary, and reasoning.encrypted deltas into thinking block signatures for OpenRouter reasoning models, echoing them back as reasoning_details.
Read only the first non-empty reasoning delta field, eliminating duplicate thinking text on endpoints (such as chutes.ai) that send multiple reasoning keys.
Release v0.4.25 of pig. Install via composer global require pigagent/pig:0.4.25 or view on GitHub.
Fixed
Provider-Driven Tool Call ID Normalization (TransformMessages, ShortHash):
Fully ported upstream pi's per-provider normalizeToolCallId architecture: decoupled call ID rewriting from TransformMessages and delegated rule definitions to each target provider.
Aligned Anthropic ID sanitation: restricted IDs to [a-zA-Z0-9_-] and truncated to 64 characters, renaming the corresponding toolResult to match.
Aligned Chat Completions ID sanitation: transformed Responses API call_id|item_id pairs into call_item (with 40-character prefix + 8-char short hash fallback), preserving distinct call references across turn boundaries.
Aligned Responses API ID sanitation: converted foreign item IDs to fc_ for supported providers (openai, openai-codex, opencode) and omitted id when switching models of the same provider to avoid OpenAI 400 errors.
Aligned Google / Gemini tool call ID requirements: included id in functionCall and functionResponse only for models that require tool call IDs (requiresToolCallId(): Claude, gpt-oss, and Gemini 3+).
Ported upstream pi's 32-bit UTF-16 deterministic ShortHash utility with dedicated unit test suite ShortHashTest.
Release v0.4.24 of pig. Install via composer global require pigagent/pig:0.4.24 or view on GitHub.
Fixed
Dropped Errored / Aborted Assistant Turns from Future Model Replays (TransformMessages):
Aligned turn pruning with upstream pi: assistant turns ending in StopReason::Error or StopReason::Aborted are completely excluded from outgoing history replays.
Eliminated OpenAI Responses API 400 error reasoning was provided without its required following item when continuing from interrupted thinking turns.
Ensured dangling tool calls from prior completed turns are closed while calls originating from aborted turns are cleanly skipped without generating synthetic tool results.
Google / Gemini Base64 Signature Validation and Untagged Cross-Model Thinking (GoogleShared):
Added strict base64 validation (isValidThoughtSignature) on thoughtSignature before sending to Google API, avoiding 400 parameter errors caused by non-base64 tokens.
Maintained thoughtSignature on empty text parts when present, preserving Gemini's reasoning continuity.
Sent cross-model reasoning as untagged plain text, preventing models from mimicking thinking tags.
Moonshot / Kimi Choice-Level Usage Fallback (OpenAiCompletions):
Added fallback to inspect choices[0].usage when chunk root lacks usage, fixing zero-token accounting across Moonshot endpoints.
Release v0.4.23 of pig. Install via composer global require pigagent/pig:0.4.23 or view on GitHub.
Fixed
Accurate Model Signature Scrubbing Across Model Changes (TransformMessages):
Aligned cross-model message sanitization with upstream pi's isSameModel rule: signatures (thinking signatures, text signatures, and tool thought signatures) are only preserved when provider, API, and model ID all match identically.
Converted thinking blocks into clean plain text without synthetic tags when switching models, preventing models from mimicking tag structures.
Automatically stripped redacted thinking blocks and empty thoughts when switching to a different model.
Accurate Token Usage and Prompt Cache Accounting (OpenAiCompletions, GoogleShared):
Fixed duplicate reasoning token counting in OpenAI-compatible completions by treating completion_tokens as the complete output figure and tracking reasoning_tokens strictly as a breakdown subset.
Added support for provider-specific prompt cache hit keys: DeepSeek (prompt_cache_hit_tokens), Kimi (cached_tokens), and OpenRouter (cache_write_tokens).
Subtracted cachedContentTokenCount from promptTokenCount in GoogleShared::usage() so cached tokens are accurately priced at the cache rate without double-billing.
Release v0.4.22 of pig. Install via composer global require pigagent/pig:0.4.22 or view on GitHub.
Fixed
Anthropic redacted_thinking Block Support & Multi-Turn Continuation Integrity:
Parsed redacted_thinking content blocks from Anthropic into ThinkingContent::$redacted, keeping encrypted reasoning payloads intact within thinkingSignature and avoiding protocol dropouts on multi-turn reasoning conversations.
Aligned TransformMessages to preserve redacted blocks across identical provider/model requests while stripping them across model changes without inventing fake thinking text.
Full Assistant Response Metadata & Extended Token Accounting:
Added optional response metadata fields to AssistantMessage matching upstream pi: responseId, responseModel, endTurn, and diagnostics (AssistantMessageDiagnostic, DiagnosticErrorInfo).
Added reasoning token tracking to Usage across all providers reporting thinking output tokens.
Supported Anthropic 1-hour cache write tracking (Usage::$cacheWrite1h) and differential pricing calculation (2x base input rate).
Release v0.4.21 of pig. Install via composer global require pigagent/pig:0.4.21 or view on GitHub.
Added
Raw Provider Stop Reasons (AssistantMessage::$rawStopReason):
Added rawStopReason property across AssistantMessage, AssistantMessageBuilder, and session persistence layer (MessageJson), recording unmapped provider-specific stop indicators.
Recorded exact provider stop tokens: Anthropic (stop_reason), Google/Gemini (finishReason), OpenAI Completions (finish_reason), and OpenAI Responses (status / incomplete_details.reason).
Included rawStopReason in /bug diagnostics reports to instantly differentiate Gemini MALFORMED_FUNCTION_CALL from safety blocks without requiring full transcript attachments.
Transparently preserved rawStopReason during message transformations, model switches, and session resolution.
Release v0.4.20 of pig. Install via composer global require pigagent/pig:0.4.20 or view on GitHub.
Fixed
Google / Gemini Stop Reason Mapping and Truncated Tool Call Handling:
Aligned stop reason priority with upstream pi's google-generative-ai.ts: mapped finish reasons prior to inspecting tool calls, ensuring only STOP finish reasons accompanied by tool calls transition to StopReason::ToolUse.
Prevented truncated or corrupted tool calls from executing: calls cut off by MAX_TOKENS remain StopReason::Length, and calls carrying MALFORMED_FUNCTION_CALL remain StopReason::Error.
Aligned Google raw stop reason error messages to upstream's format: Provider stopped with: .
Added regression unit tests testACallCutOffByTheTokenLimitIsALengthNotAToolUse and testAMalformedCallIsAnErrorEvenWithACallPartInIt in GoogleTest.php.
Release v0.4.19 of pig. Install via composer global require pigagent/pig:0.4.19 or view on GitHub.
Changed
Official @xterm/xterm 6.0.0 and @xterm/addon-fit 0.11.0 Standard Vendoring:
Replaced the previously bundled unofficial xterm re-bundle with official npm package builds (xterm.mjs, xterm.css, and addon-fit.mjs), copied byte for byte without modification.
Eliminated minification-induced parser crashes in WebTerminal and NodeWorkbench.
Added VendoredXtermTest with SHA-256 integrity verification to prevent bundle tampering and regressions.
Release v0.4.18 of pig. Install via composer global require pigagent/pig:0.4.18 or view on GitHub.
Fixed
Fixed Leaked Inherited File Descriptors and Port Lingering in PTY Child Processes:
Closed all inherited file descriptors past stdio (fd > 2) inside PtyProcess::launcher() prior to execing the target shell, preventing child processes from holding copies of server listening sockets and the pty master descriptor.
Eliminated process hangup failure where shell processes remained running after terminal closures and retained port bindings.
Fixed PHPUnit test hang in PtyTest caused by child processes holding open pipes.
Dedicated Slave Device Discovery via Pipeline Reporting (fd 3):
Added dedicated pipeline reporting (fd 3) in PtyProcess::launcher() to send the exact slave pty device path back to the server once the initial size is applied.
Replaced heuristic lsof / /proc polling in the parent process, preventing race conditions from misidentifying the server's own controlling terminal during fork and avoiding unexpected console resizes.
Automatically queues and applies early window resize requests once the launcher reports ready.
Release v0.4.17 of pig. Install via composer global require pigagent/pig:0.4.17 or view on GitHub.
Fixed
Fixed Premature agent_settled Event Emissions During Active Prompt Runs:
Aligned prompt lifecycle architecture with upstream pi's _runAgentPrompt(): moved retry handling (prepareRetry()), overflow compaction (compactForOverflow()), and follow-up/steering queue execution into the main post-run loop of the caller's fiber rather than resolving on individual runs.
Ensured emitAgentSettled() fires strictly in runAgentPrompt()'s finally block, firing exactly once per user prompt and eliminating bogus "Task Completed" desktop notifications while the agent is still actively working or retrying.
Aligned AgentSession::isStreaming() to track the entire active prompt lifecycle matching upstream's _isAgentRunActive.
Added dedicated unit tests in AgentSettledTest.php.
Fixed WebTerminal PTY Process Isolation, Vim Rendering, and Job Control:
Implemented PtyProcess::launcher() executing posix_setsid(), opening slave devices as the session's controlling terminal (forkpty semantics), applying initial stty rows/cols, and executing shells under true job control.
Enabled Ctrl+C (SIGINT), Ctrl+Z (SIGTSTP), and SIGWINCH window resizing for foreground child processes (e.g. Vim, less).
Fixed UTF-8 chunk fragmenting across WebSocket text frames by buffering partial multibyte sequences in PtyProcess::flushOutput() and enforcing JSON_INVALID_UTF8_SUBSTITUTE in Websocket::encode().
Replaced the vendored xterm.js (an unofficial re-bundle of 5.5 + FitAddon whose minifier broke requestMode(), throwing a ReferenceError on the DECRQM cursor blink query ?12$p Vim sends at launch) with the official @xterm/xterm 6.0.0 xterm.mjs / xterm.css and @xterm/addon-fit 0.11.0 addon-fit.mjs, copied byte for byte.
Fixed EIO read handling on Linux when slave closes, avoiding 100% CPU busy loops.
Added dedicated test suites in PtyProcessTest.php and VendoredXtermTest.php.
Release v0.4.16 of pig. Install via composer global require pigagent/pig:0.4.16 or view on GitHub.
New Features
Upstream Pi Standard Resource Loading Layout & Issue Diagnostics (showLoadedResources()):
Aligned startup resource display into dedicated loadedResourcesContainer under builtInHeader, rendering modular collapsible sections for [Context], [Skills], [Prompts], [Extensions], and [Tools].
Added structured diagnostic warning blocks for [Skill conflicts] and [Extension issues] rendering file paths and error details when conflicts occur.
Added
Extension UI Theme Management Parity:
Aligned HookUi::setTheme() returning structured array{success: bool, error?: string} and accepting either a theme name string or a Theme instance.
Aligned HookUi::getAllThemes() returning rich list with path metadata.
Added McpManagerViewTest verifying MCP server authorization URL and action rendering.
Reset $this->stylePrefix on Markdown::invalidate() so dynamic theme switching accurately re-samples text style prefixes without leaking stale palette escape sequences across inline spans.
Release v0.4.15 of pig. Install via composer global require pigagent/pig:0.4.15 or view on GitHub.
Added
Interactive Dynamic Text Components (ThemedText, ExpandableText):
Ported upstream pi's ThemedText for lazy theme-evaluated text rendering that dynamically repaints when the active palette shifts without manual string reconstruction.
Ported ExpandableText providing built-in collapsed/expanded toggling for startup banners and header announcements.
Added dedicated unit tests in ThemedTextTest.php.
Changed
Interactive Component Mouse Handling Parity:
Aligned mouse click and wheel dispatching across interactive widgets (Editor, SelectList, SettingsList, Box, BorderedLoader, CustomEditor), allowing clicking to focus and select rows directly via mouse input.
Enhanced TuiMouseDispatchResult and TuiMouseEventResult supporting target delegation and custom focus routing.
Added full perceptual color space conversions (Oklab, OklchChannels, OkhslChannels, RgbColorValue, IndexedColor) with perceptual lightness blending and color mixing.
Ported system theme dynamic terminal background detection (SystemTheme, SystemThemeColors) adapting UI accents to dark and light terminal backgrounds automatically.
Fully ported upstream pi's Kitty image graphics protocol with image placement tracking, placement row extraction, off-screen cache eviction, and WezTerm z-order redraw handling.
Implemented TerminalCapabilities detection and override system (KITTY_WINDOW_ID, GHOSTTY_RESOURCES_DIR, WEZTERM_PANE, ITERM_SESSION_ID) with iTerm2 and Kitty protocol negotiation.
Added dynamic terminal color palette negotiation (TerminalColors, PendingTerminalColorQuery) via OSC 4/10/11 color reporting.
Added
Image Dimension & Cell Ratio Calculations (CellDimensions, ImageCellSize, ImageRenderOptions):
Implemented accurate aspect-ratio-preserving cell rows and columns calculation against terminal cell pixel sizes.
Added dedicated test suites TerminalColorsTest and TerminalImageTest.
Changed
Standardized Terminal Capability & Color Models:
Replaced legacy Images\Capabilities and Images\CellSize with TerminalCapabilities and CellDimensions.
Updated Image and Markdown components to consume structured ImageOptions and ImageRenderResult.
Release v0.4.12 of pig. Install via composer global require pigagent/pig:0.4.12 or view on GitHub.
New Features
Live TUI Mode Switching (switchTuiMode()) & Fullscreen Exit Transcript Replay:
Implemented in-session live switching between regular (streaming scrollback) and fullscreen (AltScreen viewport) via /settings without restarting the process.
Aligned fullscreenExitOutput behavior with upstream pi: when quitting fullscreen mode with fullscreenExitOutput: "transcript" (the default), the entire conversation transcript is seamlessly rendered into the terminal scrollback buffer.
Ported upstream's createInteractiveTuiReference(), allowing components, extensions, and loaders to hold a stable TUI reference while InteractiveMode hot-swaps active renderers under the hood.
Added unit tests covering dynamic mode switching, listener preservation across renderer migration, and exit transcript output formatting.
Changed
Clean Terminal Extension Listener Rebinding:
Automatically rebinds all extension terminal input listeners via TerminalUi::rebindTerminalInputListeners() upon renderer migration.
Replaced ad-hoc exit handling with structured stopInteractiveTui(), ensuring overlays are dismissed and terminal state is cleanly restored.
Release v0.4.11 of pig. Install via composer global require pigagent/pig:0.4.11 or view on GitHub.
New Features
Fullscreen Transcript Search (AltScreen Search via Ctrl+Shift+F / Ctrl+F):
Ported upstream pi's AltScreenSearchIndex, AltScreenSearch, and AltScreenSearchComponent.
Supports live regex/substring incremental search across rendered transcript lines with case-folding, match segment mapping, and real-time highlighted matches.
Interactive navigation: Enter / Ctrl+G (next match), Shift+Enter / Ctrl+Shift+G (previous match), Escape (dismiss search), with viewport auto-scroll tracking the selected result.
Added
Full Mouse Interaction & Region Dispatch Engine (Mouse, MouseHandler, MouseRegion, TuiMouseEvent):
Implemented component-level mouse dispatching, mouse tracking, region hit-testing (MouseRegion), and target capture for interactive elements.
TUI Overlay System (OverlayBounds, OverlayHandle, OverlayOptions, OverlayStackEntry):
Added floating overlay stack support with anchored bounds calculation (top-left, top-right, bottom-left, bottom-right, center) and margin constraints.
Replaced ad-hoc caret interface with upstream's standard Focusable contract (focus(), blur(), isFocused()), aligning focus lifecycle across all interactive widgets.
Added VirtualTerminal in test suite for deterministic VT sequence simulation and exact terminal screen assertions.
Added TuiMainScreenTest unit test suite covering full TuiMainScreen rendering, differential line updates, shrink handling, and terminal lifecycle.
Changed
Standardized TUI Class Names and Component Hierarchy:
Renamed Pig\Tui\Tui to uppercase Pig\Tui\TUI matching upstream TypeScript export conventions.
Unified input caret mapping and focus delegation through Container::focusPath() and LayoutContext.
Refactored Editor and Input to implement Focusable, ensuring cursor positioning and IME composition anchor correctly in both main screen and alt-screen layouts.
Implemented ViewportTUI interface and TuiRenderer proxy with dynamic mode switching (switchTuiMode) between fullscreen and regular without restarting the session.
Added
Scrollbar Geometries & Viewport Hit-Testing:
Added ScrollbarGeometry with support for track/thumb drag-and-drop, track click-to-jump, and hover tracking.
Added full test suites LayoutTest, WheelScrollAcceleratorTest, and comprehensive TuiAltScreenTest covering all lifecycle events.
Fixed
Fixed Fullscreen Viewport Dock Separation & Clean Terminal Restoration:
Decoupled ChatViewport into flex-dock layout with VStack, ensuring editor prompt, status bar, and footer remain permanently locked at the terminal bottom without being displaced during scrolling.
Preserved terminal state and clean mouse unbinding upon exit (DISABLE_MOUSE, ENABLE_AUTOWRAP, EXIT_ALT_SCREEN).
Added WheelScrollAccelerator matching upstream pi's wheel-scroll.ts to support smooth trackpad gesture inertia and velocity acceleration (up to 6 lines/event on non-accelerating transports, or 15 lines/event with Alt/Option).
Added AltScreenFlashContainer to support ephemeral overlay notifications and flash confirmations (Copied!).
Added full mouse text selection across the fullscreen viewport with click-and-drag, double-click word selection, triple-click line selection, auto-scroll at viewport edges, and automatic clipboard copying (copyOnSelect).
Added TuiAltScreenTest unit test suite covering AltScreen lifecycle, SGR mouse reporting, wheel event batching, and text selection.
Fixed
Fixed Fullscreen Viewport Dock Eviction and Terminal Rolling:
Switched AltScreen rendering from relative cursor movements to absolute row addressing (\x1b[;1H\x1b[2K), completely eliminating unintentional \r\n terminal rolling that pushed the bottom input dock and status footer off the screen during scroll.
Added batch and stream parsing for SGR mouse sequences (\x1b[<...M) and traditional X10/XTerm mouse sequences (\x1b[M...), resolving an issue where macOS trackpad gestures with multiple queued wheel events failed strict regex matching and were silently dropped.
Fixed terminal dimension measurement guard in ProcessTerminal to preserve valid dimensions when transient resize events report width <= 3, preventing checkWidth crash loops.
Enhanced ProcessTerminal::stty with automatic fallback to process input descriptor if direct /dev/tty opening fails, avoiding startup crashes (Could not run stty -g).
Aligned fullscreenExitOutput behavior to dump the full transcript back to the main terminal screen buffer on exit, allowing users to scroll through past history in their terminal scrollback after quitting.
Release v0.4.7 of pig. Install via composer global require pigagent/pig:0.4.7 or view on GitHub.
Fixed
Fixed Vim and interactive full-screen TUI applications in Web PTY Terminals:
Added COLORFGBG=15;0 to the PTY environment so macOS and Linux Vim correctly recognize dark backgrounds, rendering clear white text and bright tildes instead of invisible black-on-black text.
Centralized PtyManager in HttpServer with dynamic terminal-to-connection routing, ensuring active PTY processes and Vim sessions survive WebSocket reconnects rather than being killed when a connection drops.
Added container click-to-focus listeners in WebTerminal.js and NodeWorkbench.js so clicking anywhere in the terminal drawer immediately focuses xterm.js input.
Initialized terminal instances with visible display before fitting so FitAddon measures real pixel dimensions (cols and rows) rather than defaulting to 80x24.
Release v0.4.5 of pig. Install via composer global require pigagent/pig:0.4.5 or view on GitHub.
New Features
Fullscreen Chat Viewport with Fixed Bottom Dock & Scroll-to-End Indicator (ChatViewport, ScrollView, TuiAltScreen):
Aligned with upstream pi 0.85+ ~ 1.0 architecture: splits the terminal into an upper scrollable transcript viewport and a fixed bottom dock containing Pending Queue, Status, Overlay, Editor, and Footer.
Bottom dock remains firmly pinned to the bottom of the terminal window, preventing the editor prompt and telemetry status lines from drifting off-screen during long conversations.
Smart follow-end behavior: automatically scrolls to latest output; when scrolled up via PageUp, Shift+Up, or mouse wheel, detaches from the end and displays a centered floating indicator pill: ↓ Jump to latest message · Ctrl+End .
Seamless jump-to-bottom: supports clicking the floating indicator with mouse left-click, pressing Ctrl+End (or End / Fn + → on MacBook keyboard without Mission Control conflicts), or scrolling back to the bottom to instantly resume end-following and dismiss the pill.
Added
Added tui.mode configuration setting in Settings.php (default: fullscreen, with regular fallback support).
Added tui.altScreen.top (ctrl+home), tui.altScreen.bottom (ctrl+end), tui.altScreen.pageUp (pageup), and tui.altScreen.pageDown (pagedown) keybindings in Keybindings.php.
Changed
System Prompt File Operations Alignment:
Corrected guideline in SystemPrompt.php from Use bash for file operations like ls, grep, find to Use bash for file operations like ls, rg, find, 100% matching upstream pi's guideline.
Guides LLMs like Gemini to prioritize fast parallel rg over slow unindexed POSIX grep -rn across large build caches and binary directories.
Ported upstream pi's duration formatter and timer from core/tools/renderers/bash.ts into ToolExecutionComponent.
Renders real-time Elapsed X.Xs / Xm Ys during bash command execution, and clean muted Took X.Xs / Xm Ys upon completion.
Web UI Language Switcher Redesign:
Replaced the static header button label "中 / EN" with an internationalized "🌐 语言" (in Chinese) / "🌐 Language" (in English) prefixed with the global icon.
Aligns with pig's full multi-language architecture, providing clear and elegant visual language indicators matching the theme and other action buttons.
Fixed
59x Speedup for test/lint.php via Chunked Batch Execution:
Refactored php -l execution from serial per-file exec() subprocess launches (637 individual process starts) to chunked batches (array_chunk($files, 100)).
Execution time dropped from 53.1s to 0.8s while preserving granular syntax error reporting and failure line locations.
SGR Mouse Protocol Click Parsing:
Implemented SGR mouse sequence decoding (\x1b[
Dock Top Spacing in Chat Viewport:
Restored Spacer(1) padding in ChatViewport above the editor dock, ensuring a clean vertical separation between the transcript tool output boxes and the ── ⠋ Working... ── top border.
Release v0.4.4 of pig. Install via composer global require pigagent/pig:0.4.4 or view on GitHub.
Fixed
Fixed PHP Warning: Undefined array key in PtyManager::input() and PtyManager::resize():
Accessing $this->terminals[$id]?->... triggered PHP undefined array key warnings when frontend xterm.js resize listeners or lingering keystrokes arrived after a terminal session had exited and been unset.
Replaced with null-coalescing $this->terminals[$id] ?? null access to safely ignore input and resize operations on terminated or unknown terminal sessions without leaking warnings.
Release v0.4.2 of pig. Install via composer global require pigagent/pig:0.4.2 or view on GitHub.
Added
Added dynamic elapsed timer to TUI working, compaction, and branch summary status indicators:
Loader::withTimer() automatically calculates and formats elapsed duration in the top border: ⠋ Working... · 16s (esc to interrupt) (or · 1m15s after 60s).
Provides clear real-time feedback that long-running operations (deep model reasoning, large codebase searches, slow network API calls, and context compactions) are actively executing rather than frozen.
Enabled during turns (Working...), manual /compact, tree branch summarization, and auto-compaction, while preserving retry countdowns untouched.
Release v0.4.1 of pig. Install via composer global require pigagent/pig:0.4.1 or view on GitHub.
Added
Added automatic browser launch on in-session /web command:
Running /web or /web [port] in the interactive TUI starts the web interface and automatically opens the user's default system browser at http://127.0.0.1:.
Re-running /web while the server is already running opens the browser at the existing server URL.
Background daemon and status commands (/web start, /web stop, /web status, /web restart) operate strictly in the terminal without opening unwanted browser windows.
Release v0.4.0 of pig. Install via composer global require pigagent/pig:0.4.0 or view on GitHub.
New Features
Interactive Local PTY Terminals & Web Terminal Drawer (PtyProcess, PtyManager, WebTerminal.js):
Native Unix pseudo-terminal execution using PHP's proc_open with ['pty'] descriptor on macOS/Linux with zero external C-extensions.
Non-blocking I/O integrated into Pig\Async\Loop, 16ms output micro-batching to prevent WebSocket frame storms, and slave PTY device detection (lsof on Darwin, /proc/$pid/fd/0 on Linux) with window resizing via stty + SIGWINCH.
Frontend integration with xterm.js and FitAddon multi-tab terminal drawer (accessible via Ctrl+\ / Cmd+\` or the top navigation terminal icon), with 200KB scrollback buffering and full support for interactive TUI tools (vim, nvim, nano, htop, tmux, less`).
Persistent node inventory in ~/.pig/agent/nodes.json and credentials in ~/.pig/agent/nodes-secrets.json (chmod 0600).
SHA-256 host key fingerprint detection (ssh-keyscan + ssh-keygen -lf) with verification and trust prompts.
Automatic OpenSSH ~/.ssh/config host discovery and one-click import.
Remote interactive SSH terminal streaming via PTY (ssh -tt) and SFTP remote directory listing, navigation, and file reading/writing (capped at 512 KiB).
Multi-Session Tab Multiplexing Architecture & Web Daemon:
Multiplexed multi-session tabs over a single physical WebSocket connection with per-tab chat scroll areas, background streaming indicators, and state recovery on reload.
Isolated pig --mode rpc child processes per cwd::sessionFile with 60s idle reaping and zero cross-session interference.
Native zero-dependency daemon management via pig web start|stop|status|restart [-d] and in-session /web restart, /web status, /web stop controls.
Telegram-style Language Packs & Client-Side i18n Engine:
Full bilingual client-side I18N dictionary with 101 symmetric keys (defaulting to zh-CN), instant zero-refresh language modal (#lang-btn), Telegram-style JSON import/export, and $pig->registerLocale() on ExtensionApi with /api/locales aggregation.
Added
Added externalEditor setting and intelligent fallback for Ctrl+G external prompt editing (aligned with upstream pi getExternalEditorCommand): precedence follows settings.externalEditor > $VISUAL > $EDITOR > platform fallback (notepad on Windows; nano / vim / vi on POSIX).
Added ExtensionApi Phase 2 parity: EventBus, lifecycle hooks, tool loadout, context/session control, UI capabilities, and cross-handler state sharing via $ctx->set(), $ctx->get(), and $ctx->has().
Added provider traffic hooks (before_provider_request, after_provider_response, before_retry) and dynamic provider registration (registerProvider), cleanly decoupling Google Antigravity into a standalone pure PHP extension.
Added session title telemetry and speed meter integration in FooterComponent (pwd (branch) • ), session_info JSONL persistence, and /name slash command.
Added model selection persistence control: session switches default to persistAsDefault: false (matching upstream pi), and Ctrl+S (app.models.save) explicitly saves the chosen model as global default.
Changed
Enhanced SessionManager::open() and SessionManager::describe() to use streaming line-by-line reading (fopen + fgets), reducing memory consumption on 70MB+ session files from >150MB to <10MB and preventing 128MB OOM crashes.
Optimized session tree backtrace (SessionManager::pathTo()) by replacing O(N) array_unshift with O(1) append + single array_reverse, speeding up 28,000-node tree traversal from 718ms to 3ms (230x speedup).
Optimized SessionManager::latestPathFor() with lightweight first-line sniffing, reducing pig -c session resume latency from 2275ms to 489ms.
Optimized LRU cache eviction in Width::visible() from O(N) array_shift to O(1) hash eviction (unset), speeding up cache updates by 5.0x with capacity expanded to 2048.
Aligned TextWrap::tokenize() with upstream pi's cjkBreakRegex for clean hyphenation and natural wrapping in mixed Chinese/English sentences.
Updated Chars::isPunctuation() with Unicode punctuation matching (^[\p{P}\p{S}]\z/u) to recognize CJK punctuation as word boundaries for Ctrl+W / Alt+Backspace.
Fixed
Fixed background fibers and subprocesses continuing to run on /quit while working: AgentSession::dispose() now cleanly aborts in-flight LLM streams, retries, compactions, and bash commands.
Fixed Broken pipe and SSL zero-write loops on non-blocking OpenSSL transport failures: expanded Retry::WORDS regex to catch native SSL, handshake, and connection errors, and encapsulated fwrite/fread in warning-capturing error handlers.
Fixed background process (&) pipe inheritance deadlock: added process state polling in Run::wait() to exit gracefully once the parent shell process terminates.
Fixed silent LLM turn failures in Web mode: serialized lastError in AgentEndEvent and enhanced client-side error rendering with automatic input restoration.
Fixed long quota reset errors displaying raw provider text: normalized to pi-style action guidance messages.
Fixed top-level symbol redeclaration crashes on /reload and guarded extensions with tokenized symbol checks.
Release v0.3.65 of pig. Install via composer global require pigagent/pig:0.3.65 or view on GitHub.
Added
Added externalEditor setting and intelligent fallback for Ctrl+G external prompt editing (aligned with upstream pi getExternalEditorCommand):
Added Settings::externalEditor() and setExternalEditor(?string) to support "externalEditor": "vim" (or "nvim", "code --wait") in ~/.pig/agent/settings.json.
Resolution precedence: settings.externalEditor > $VISUAL > $EDITOR > platform fallback (notepad on Windows; nano / vim / vi on POSIX).
Eliminates the previous hard failure Warning: No editor configured. Set $VISUAL or $EDITOR. when environment variables were not exported.
Release v0.3.64 of pig. Install via composer global require pigagent/pig:0.3.64 or view on GitHub.
New Features
Ported Interactive Local PTY Terminals, SSH Node Workbench, and SFTP File Explorer (aligned with youweichen/pi-web-ui / omp-web-ui):
Local PTY Terminal Engine (PtyProcess & PtyManager): Native pseudo-terminal execution using PHP's proc_open with ['pty'] descriptor on macOS/Linux with zero external C-extensions. Non-blocking I/O integrated into Pig\Async\Loop, 16ms output micro-batching to prevent WebSocket frame storms, slave PTY device detection with window resizing via stty + SIGWINCH, and 200KB scrollback buffering.
SSH Node Workbench (NodeProfile & NodeManager): Persistent inventory in ~/.pig/agent/nodes.json and credentials in ~/.pig/agent/nodes-secrets.json (chmod 0600), SHA-256 host key fingerprint detection (ssh-keyscan + ssh-keygen -lf) with verification and trust prompts, OpenSSH ~/.ssh/config discovery, remote PTY terminal streaming (ssh -tt), and SFTP remote directory listing/reading/writing (capped at 512 KiB).
Web UI Integration: Embedded xterm.js and FitAddon multi-tab terminal drawer (WebTerminal.js), #nodes-btn in header and mobile drawer, full-featured NodeWorkbench.js modal with remote terminal tabs and SFTP file explorer/editor, and bilingual i18n support.
Release v0.3.63 of pig. Install via composer global require pigagent/pig:0.3.63 or view on GitHub.
Fixed
Fixed startup model resolution ignoring extension-provided default providers: CodingAgent::session() resolved the startup model before loading extensions, so when settings.json configured an extension provider as defaultProvider (e.g. antigravity), resolution failed to find the unregistered provider and fell back to direct built-ins (e.g. google/gemini-3.8-flash). Extensions and custom providers are now loaded before model resolution runs.
Release v0.3.62 of pig. Install via composer global require pigagent/pig:0.3.62 or view on GitHub.
Fixed
Fixed model and thinking level switches in a session clobbering the user's persistent default model: setModel() and setThinkingLevel() previously defaulted persistAsDefault to true, so typing /model , selecting a model with Enter, or cycling with Ctrl+P/Shift+Tab silently overwrote defaultModel and defaultProvider in ~/.pig/agent/settings.json, causing the next new session to open on the switched provider instead of restoring the configured default. Session switches now default to persistAsDefault: false (matching upstream pi). The model picker supports Ctrl+S (app.models.save) to explicitly set the selected model as the persistent default, and /settings continues to persist changes.
Release v0.3.61 of pig. Install via composer global require pigagent/pig:0.3.61 or view on GitHub.
Fixed
Fixed working status border lines and editor borders to match upstream pi's thinking level colors: paintBorder() was not called on startup, leaving the editor's top and bottom border rules and the dashes surrounding the working indicator (── ⠋ Working... ───) stuck on borderMuted (gray #768186) instead of matching the active thinking level (e.g. thinkingMedium#6185cc). Startup, showLoader(), and hideLoader() now consistently synchronize the editor border to borderColour().
Release v0.3.60 of pig. Install via composer global require pigagent/pig:0.3.60 or view on GitHub.
Added
Inter-extension event bus — $pi->events(), upstream's pi.events: pub/sub channels (on() returning an unsubscribe closure, emit(), clear()) shared across all extensions of a load, with error isolation so one handler throwing does not break others.
Full lifecycle hook events — tool_execution_start, tool_execution_update (streaming tool deltas), tool_execution_end, session_compact_failed (with reason, abort flag, and error message), user_bash (intercepting typed !command), and input (intercepting user input before skill/template expansion).
Input transform & interception — InputEvent & InputEventResult (continue, transform, handled), fired before prompt expansion and during queue steering/follow-up, chaining text/image modifications across extensions.
User bash command interception — UserBashEvent & UserBashEventResult: extensions can execute commands on remote hosts/containers and return BashExecution without falling back to local execution.
Active tool loadout management — ToolLoadout, unifying tool filtering across session creation, /reload, and runtime; $pi->setActiveTools(), $pi->getActiveTools(), and $pi->getAllTools().
Extension tool execution — $ctx->executeTool($name, $args): runs tools on an extension's behalf through schema validation and tool_call permission guards.
Context usage and session control on $ctx — $ctx->getContextUsage() (ContextUsage with tokens, contextWindow, and percent), $ctx->getSystemPrompt(), $ctx->isProjectTrusted(), $ctx->mode(), $ctx->thinkingLevel(), $ctx->compact(), and $ctx->shutdown().
Extension keyboard shortcuts — $pi->registerShortcut($key, $handler, $desc): custom shortcuts bound on the editor, executed in a fiber with context, and displayed in /help.
Markdown transformers — $pi->registerMarkdownTransformer($transformer): transforms user and assistant Markdown before rendering in transcript.
Tool renderers — $pi->registerToolRenderer($resolver): onion-middleware chain allowing extensions to customize call and result rendering for both built-in and custom tools.
Custom entry renderers — $pi->registerEntryRenderer($customType, $renderer): draws custom session tree entries in the transcript.
Fixed
Fixed /reload silently dropping the --tools / --exclude-tools filter: reload now preserves active tool loadout states through ToolLoadout.
Fixed permission gate false positives: anchored dangerous system commands to command position and blanked non-shell quoted strings.
Release v0.3.59 of pig. Install via composer global require pigagent/pig:0.3.59 or view on GitHub.
Fixed
Fixed socket writes to a peer that accepts a connection but stops reading: the internal one-second writable wait slice was treated as the whole write timeout, so a stalled write failed after about one second even when the caller allowed longer. The write loop now waits only for the remaining overall timeout and has a regression test for the non-reading peer case.
Fixed TUI compaction, branch-summary and hook-message blocks to use the same padded transcript shape, theme tokens and folding behaviour: compactions show [compaction] plus Compacted from tokens, branch summaries and hook messages share the same custom-message background, and expanded text stays inside the block.
Fixed Web transcript replay for app messages and tool details: hook messages now cross SessionCodec as role: "custom", automatic compaction summaries render in the chat and de-duplicate against the following message_end, historical !command executions draw as bash cards, and tool results keep details.diff, truncation notices and full-output paths.
Fixed long quota resets to match pi's actionable error: a model quota that resets hours later now says Quota reached. Please wait … Next: switch models or try again after reset. instead of leaving the provider's raw 429/JSON in the transcript. Antigravity's Resets in … wording is recognised too, and the TUI no longer prints the same failed assistant turn twice.
Release v0.3.58 of pig. Install via composer global require pigagent/pig:0.3.58 or view on GitHub.
New Features
Extensions can bring a provider — ExtensionApi::registerProvider(new Provider(...)), pi's registerProvider(): models, a wire protocol (Pig\Ai\Extension\StreamApi), a sign-in (OauthFlow), the environment variables that carry its key, and whether it resells other providers' ids. The models land in the registry, the protocol behind Api::Extension, the sign-in in /login, pig-ai list and /doctor. unregisterProvider() and /reload take it back.
Antigravity is an extension, not a core provider. Everything about it — AntigravityApi, AntigravityOauth, Routing, the model table, Accounts, Catalog, QuotaClient, ImageGenerator — lives under extensions/pig-antigravity/src/ and registers itself; nothing Antigravity-shaped is in packages/ any more, which is the move pi made in 0.71 and the community's pi-antigravity extension answered. The row in /login is there only while the extension is loaded.
Provider-traffic hooks: before_provider_request (rewrite headers or body; chained), after_provider_response (status and headers before the body is read), and before_retry — pig's own — which lets an extension change the wait, reset the attempt count or cancel. The Antigravity 429 account failover is a before_retry handler now rather than a special case inside AgentSession.
More of pi's ExtensionAPI: registerFlag()/getFlag() (--my-flag declared by an extension), getSettings(), getModel()/setModel(), getThinkingLevel()/setThinkingLevel(), sendUserMessage(text, 'steer'|'followUp'), setLabel(), getCommands(), and the model_select / thinking_level_select events.
registerHttpRoute() — an extension answers /api//... in pig web from a fiber; the Antigravity accounts panel is served this way instead of from HttpServer.
Auth::useSecondStore() — a provider that keeps several accounts beside auth.json tells Auth where to read when the file has nothing and where to write a renewal.
Changed
The default model is claude-sonnet-4-5 (CodingAgent::DEFAULT_MODEL), as both READMEs have said; it had been antigravity/gemini-3.8-flash, a provider that only exists once an extension has loaded.
bin/pig loads the extensions before --list-models, so a provider an extension brings is listed, and hands the one load to the session rather than loading twice.
Auth::credentials(), setCredentials() and freshCredentials() take a provider name as well as the built-in enum.
The two network-reaching tests no longer touch a provider: SocketTest's TLS check goes to example.com, and AnthropicTest::testAgainstTheRealApi wants PIG_LIVE_ANTHROPIC=1 on top of PIG_NETWORK_TESTS=1, so turning network tests on for the proxy does not spend a request on somebody's Anthropic account.
Removed
Api::Antigravity, Models::ANTIGRAVITY_MODELS, Oauth\Provider::Antigravity, Providers\Antigravity, Oauth\Antigravity, Ai\Antigravity\Routing, CodingAgent\Antigravity\*, Auth::accounts()/rotateAntigravityAccount()/activateAntigravityAccount()/removeAntigravityAccount()/antigravityClient(), and HttpServer's /api/accounts handlers — all moved into the extension.
Release v0.3.57 of pig. Install via composer global require pigagent/pig:0.3.57 or view on GitHub.
Fixed
Fixed every transcript entry carrying an extra blank row under its last line. Markdown::block() added a block's trailing blank line after the last block too, where upstream guards each one with nextTokenType && … — so a one-line user message sat on two empty rows of background where pi draws one, and every assistant message and tool result was one row taller than its content. The last block leaves no blank now; the gap after a message belongs to whoever placed it (Spacer, or the component's own paddingY).
Release v0.3.56 of pig. Install via composer global require pigagent/pig:0.3.56 or view on GitHub.
New Features
Anthropic sign-in brought up to pi 1.0.3 — /login with Claude Pro/Max now asks which way in: a browser that comes back to a loopback on localhost:53692/callback (the default), with the paste box open beside it for a browser on another machine; or copying the code off Anthropic's page for a headless setup. The endpoints are platform.claude.com (the anchor's console.anthropic.com callback page is a 301 to it), the scopes are pi's six, and a token goes out as Claude Code's: both betas (claude-code-20250219,oauth-2025-04-20), user-agent: claude-cli/2.1.280, x-app: cli, and tool names spelled Claude Code's way (read → Read) on the way out and mapped back on the way in (Pig\Ai\Providers\ClaudeCode).
--tools takes * patterns and --exclude-tools takes them away — --tools read,codemode,'mcp__gh__*', as pi does. An MCP tool is kept unless an entry starts with mcp__, so --tools read does not silently disconnect every server; --exclude-tools has no such exception. A typo (--tools raed) is refused by name with the whole list, custom tools included, which is why the check moved from bin/pig into CodingAgent::session(). The filter is kept on CustomToolSet so a server connecting after startup is filtered too (CustomToolSet::keep(), Tools\ToolSelection).
--no-mcp — start without loading the MCP extension at all (ExtensionLoader::load(disabled:), by directory name).
Changed
The token-speed meter (⚡ 90.8 tok/s · TTFT 8ms) is drawn on the footer's top line after the session name — ~/pig (main) • • ⚡ … — rather than as a third footer line that appeared and vanished with every turn. FooterComponent treats the token-speed status key as inline; every other key still gets the hooks' own line.
/login and /logout label a provider as not configured or subscription configured, pi 1.0's wording (Oauth\Provider::isSubscription()).
A pasted authorization code is accepted in every shape pi accepts: the whole redirect URL, a code=…&state=… query, code#state, or a bare code; and a pasted state that is not the verifier is refused (Anthropic::parseAuthorizationInput()).
Oauth\CallbackServer names the provider it listens for in its two messages, since Anthropic's flow uses it as well as Google's.
Fixed
The Claude browser sign-in no longer crashes pig once the tokens have arrived: a browser's speculative second connection, never written to, was closed under an armed reader (Reader r505 watches a closed stream). CallbackServer::close() cancels every reader before closing, and a reader at EOF lets its connection go.
/antigravity.usage, /antigravity.models, /antigravity.image and the rest of the Antigravity extension's commands answered 401 Request had invalid authentication credentials from the second hour after signing in: they read the stored access token raw, and only Auth::apiKey() knew to renew an expired one. Auth::freshCredentials() is that renewal for a caller that needs the token and the project apart, and the extension goes through it.
Selected model is at capacity is retried rather than ending the turn (pi 1.0.1, #10278).
z.ai's CN endpoint's Prompt exceeds max length is recognised as a context overflow and compacted rather than retried (pi 0.99.2, #10208).
The file a truncated command's output is spilled to is readable by the user alone (0600), as pi 1.0.3 makes its output files.
Shift+Enter in Apple Terminal sent the prompt instead of breaking the line. That terminal sends \e\r for Shift+Enter (measured), which Keys::isAltEnter() also accepted as Alt+Enter's legacy form — so app.message.followUp claimed the key before the editor saw it. \e\r is a new line now; Alt+Enter is its kitty form \e[13;3u only, and command+enter is bound to the same follow-up action.
The screen no longer scrolls up by the number of rows the frame shrank by at the end of every turn, which left blank rows under the footer. The erase of vanished rows moves the cursor down with \e[B rather than \r\n — a newline on the terminal's last row scrolls. Measured on a real pty through a VT emulator (PIG_TUI_TRACE= records every byte written to the terminal, for exactly this).
Release v0.3.55 of pig. Install via composer global require pigagent/pig:0.3.55 or view on GitHub.
Added
test/lint.php sweeps closures for uncaptured variables (uncapturedClosureReads()): a variable read inside a closure body that is not a parameter, not in its use list, not $this (for a non-static closure), not a superglobal and not assigned in the body is reported with its line. This is the class of bug behind Undefined variable $pi in an extension handler — php -l cannot see it; PHP's own tokens can. Zero hits across 618 files; putting the bug back turns it red.
lint.php takes extra directories as arguments (php test/lint.php ~/.pig/agent/extensions), and now sweeps the repository's extensions/ by default.
Fixed
Three @ error suppressions that had survived in extensions/ because that directory was never linted (pig-computer health probe, pig-web-search profile cleanup) and one new in this session (HttpServer tab completion) — each replaced with a scoped error handler or a precondition check.
HeadlessBrowser::remove() now covers scandir() as well as rmdir() with its handler: a browser still writing into its profile warned from the first and only the second was guarded.
Release v0.3.54 of pig. Install via composer global require pigagent/pig:0.3.54 or view on GitHub.
Fixed
"Cannot reach pig: the conversation: limit is not defined" when opening any session containing a ranged read (offset/limit). ToolCard built the read a.php:10-39 title with Number(limit) instead of Number(args.limit) — a free variable that parsed fine and threw on first use, taking the whole conversation replay down with it.
Regression guard: WebModeTest::testToolCardRendersEveryToolItKnowsWithoutThrowing runs ToolCard and ThinkingBlock under Node against a minimal DOM over 17 argument shapes a real session replays. node --check cannot see an undefined name; executing the component can — putting the typo back fails the test with the exact message the user saw.
Release v0.3.53 of pig. Install via composer global require pigagent/pig:0.3.53 or view on GitHub.
Added
Web UI !command / !!command now run exactly as in the TUI — pig executes them directly, deterministically, with zero model tokens, and ! output joins the conversation as a BashExecution for the model to read next turn (!! runs and remembers nothing). Before this the Web prompt sent !cmd to the model as plain text and left it to decide whether to call the bash tool.
bash_output RPC event: RpcMode::bash() now streams a command's output as it arrives, each event carrying the command's id so a host can find the card. A flutter run or npm run dev shows its log live instead of nothing until it is stopped.
Stop works for !command in the Web UI: the Stop button sends abort_bash while a bash card is in flight (abort otherwise), so a resident process can be ended from the browser — verified to leave no stray process behind.
Release v0.3.52 of pig. Install via composer global require pigagent/pig:0.3.52 or view on GitHub.
Fixed
Web UI stuck on "Loading session…" after v0.3.50: a stray }); left behind by the Command HUD edit made app.js fail to parse, so the module never ran and the page never bound to a session. Removed.
Regression guard: WebModeTest::testEveryServedJsAssetParses now runs node --check over every JS module under Web/assets/js/, so a syntax error in any served script fails the suite instead of shipping.
Fixed an issue in the terminal (TUI) where holding Shift + Command (e.g. macOS Shift + Command + 4 screenshot shortcut) still triggered the Command Shortcuts HUD overlay.
Root Cause: The native macOS CoreGraphics event monitor (CGEventSourceFlagsState) previously only checked for the kCGEventFlagMaskCommand (0x00100000) bit, ignoring co-pressed modifiers.
Strict Solo Command Detection: Introduced InteractiveMode::isSoloCommand(), which validates the Command bit is set while ensuring the Shift (0x00020000), Control (0x00040000), and Option/Alt (0x00080000) bits are all unset.
Threshold Alignment: Increased the TUI long-press hold threshold from 480ms to 850ms, matching the Web UI and iPadOS/Blink Shell standards.
Fixed an issue where taking a screenshot on macOS (Shift + Command + 4) prematurely triggered the Shortcuts HUD, blocking the screen capture area.
Strict Solo-Modifier Validation:
Enforced !e.shiftKey && !e.altKey && !e.ctrlKey on Meta keydown; if Shift is already pressed (typical screenshot posture), the HUD timer is never started.
Threshold Adjustment: Increased the hold duration threshold from an aggressive 450ms to the industry-standard 850ms, safely bypassing the human keystroke hesitation window.
Combination Abort & System Blur Guard: Any subsequent keypress immediately marks the sequence as a combo and cancels the HUD timer, and window blur (when screencapture takes system focus) unconditionally closes the modal.
Release v0.3.49 of pig. Install via composer global require pigagent/pig:0.3.49 or view on GitHub.
Added
Web Terminal Tab Intelligent Auto-Completion (Bash/Zsh Parity for Commands & Paths):
Full Tab Completion Engine: Pressing Tab inside the Web Terminal provides an authentic shell experience for completing both command names and filesystem paths.
Command Name Completion: When completing the first token, matches common CLI utilities (git, composer, php, docker, npm, grep, find, pig, etc.) and executables.
Filesystem Path & Directory Traversal:
Automatically autocompletes relative paths, absolute paths, and subdirectories (e.g. cd pac + Tab autocompletes to cd packages/ with trailing slash);
Supports deep multi-level path completion and hidden dotfiles when prefixed with .;
Common Prefix Expansion & Candidate Grid:
Expands input directly when a single match is found (adding space for commands/files or slash for directories);
Expands up to the longest common prefix when multiple matches exist, while echoing the candidate list into the terminal output area with directory color differentiation matching real shell behavior.
High-Performance Non-Blocking Endpoint (/api/terminal/complete): Direct filesystem resolution in HttpServer.php with sub-millisecond response times.
Release v0.3.48 of pig. Install via composer global require pigagent/pig:0.3.48 or view on GitHub.
Fixed
Chinese IME Composition Enter Protection (No More Accidental Message/Command Submissions):
Fixed an issue where pressing Enter to confirm Chinese Pinyin composition or select a candidate word prematurely triggered prompt submission or terminal command execution.
Implemented an industrial-standard 60ms cooldown window on compositionend alongside isComposing and keyCode === 229 guards across the main chat prompt input, the Web Terminal interactive input, and the Slash Autocomplete popup.
Mobile Web Terminal Prompt Auto-Compactness & Pixel-Perfect Cursor Alignment:
Fixed an issue where long hostnames and deep directory paths caused the terminal prompt prefix to break across multiple lines on mobile screens, resulting in detached, vertically misaligned floating cursors.
Responsive Prompt Compactness: On narrow mobile screens (<= 640px), the lengthy hostname is automatically hidden and long paths are abbreviated to ~/.../folder without breaking.
Baseline Lock & Wrap Prevention: Enforced white-space: nowrap; flex-shrink: 0; and locked align-items: baseline with matched 20px line heights, ensuring the input caret is permanently glued directly after the $ prompt symbol across all mobile screen sizes.
Release v0.3.47 of pig. Install via composer global require pigagent/pig:0.3.47 or view on GitHub.
Added
Web UI Embedded Web Terminal Component (components/WebTerminal.js & /api/terminal/exec):
Top-Right Terminal Entry:
Added a modern >_ Terminal icon button in the top navigation bar and mobile dropdown;
Supports click or global shortcut Ctrl + \` to toggle terminal drawer instantly.
Active CWD & Directory Tracking:
Automatically initializes in the active conversation's working directory (active.cwd);
Displays interactive path capsule (~/path), with click-to-copy;
Built-in cd tracking that dynamically updates the terminal's working directory and prompts across sessions.
Rich Interactive Console:
Authentic command line prompt (user@hostname:path $ ) with monospace JetBrains typography;
Command history navigation with ArrowUp / ArrowDown;
Fast ANSI color code parser rendering git status, diff, ls, and test suites in full terminal fidelity;
Quick-action chips (git status, ls -la), clear screen (🧹 / Ctrl+L), and full-screen drawer toggling (⛶).
Zero-Dependency Non-Blocking Execution Engine:
Powered by Process::runAsync in HttpServer.php, executing bash commands with sub-millisecond dispatch and 120s timeout without blocking the event loop.
Release v0.3.46 of pig. Install via composer global require pigagent/pig:0.3.46 or view on GitHub.
Added
Web UI Slash Command Autocomplete Component (components/SlashAutocomplete.js):
Implemented an ambient floating popup that automatically triggers when typing / into the prompt input;
Smart Command Filtering & Curation:
Safely excluded pure TUI-specific or destructive commands (web, hotkeys, exit, quit, tree, label, resume, copy, login, logout) that are either redundant in a browser or risk killing backend child processes;
Retained and curated all 21 high-value commands with bilingual descriptions (/compact, /export, /diff, /commit, /model, /thinking, /name, /session, /doctor, /accounts, /antigravity.*, etc.);
Fluid Keyboard & Mouse Navigation:
Real-time fuzzy filtering as the user types (e.g. /co filters down to /compact, /commit, /accounts);
Full keyboard control with ArrowUp / ArrowDown navigation, Enter / Tab completion, and Escape dismissal;
Complete theme styling across Dark, Light, and Labra themes.
Release v0.3.43 of pig. Install via composer global require pigagent/pig:0.3.43 or view on GitHub.
Changed
Web UI Native ES Modules Architecture Refactoring (Zero-Build Frontend Modularization):
Eliminated the monolithic ~5,000-line index.html in favor of a modern, clean, browser-native ES6 Module architecture with zero build tools, zero bundlers, and zero external dependencies.
Modular Component Separation:
index.html: Streamlined from ~5,000 lines down to a pristine ~120-line HTML skeleton.
css/style.css: Extracted all dark, light, and labra theme styles, responsive layouts, and animations.
js/utils.js: Reusable modal dialogs (openModal), HTML sanitization, and title/filename formatters.
js/i18n.js: Telegram-style dictionary engine, dynamic language pack loader, and modal.
js/theme.js: Complete theme switcher with swatch preview modals and system persistence.
js/network.js: Multiplexed shared WebSocket transport, heartbeat, and exponential reconnect.
js/markdown.js: Fast native Markdown parser, code block copying, and Git unified diff view.
js/accounts.js: Antigravity account management and Claude iOS style quota card renderer.
Native Asset Serving: HttpServer.php now serves /assets/ with strict path traversal verification and accurate MIME types while preserving instantaneous local live-reloading.
Release v0.3.41 of pig. Install via composer global require pigagent/pig:0.3.41 or view on GitHub.
Changed
Web UI Prompt Input Minimalist Placeholder & Design Discipline:
Eliminated bloated shortcut instructions from the main textarea placeholder, streamlining it from Ask pig a question or paste images... (Enter to send, Shift+Enter for new line) to concise Ask pig a question (English) and 向 pig 提问... (Chinese).
Codified the UI Placeholder Minimalist Convention in CLAUDE.md: strictly prohibiting dumping functional instructions and keybindings into primary interactive controls to maintain a clean, distraction-free aesthetic.
Release v0.3.40 of pig. Install via composer global require pigagent/pig:0.3.40 or view on GitHub.
Fixed
Web UI Mobile "More Options" Icon Pixel-Perfect Vertical Centering:
Replaced the baseline-sensitive Unicode ⋯ character and bottom padding with a native 16x16 vector SVG icon (cy="8" geometric center).
Ensured mathematical and visual vertical/horizontal centering for the three dots across all device densities, system fonts, and zoom levels, aligning seamlessly with the adjacent sidebar toggle icon.
Release v0.3.39 of pig. Install via composer global require pigagent/pig:0.3.39 or view on GitHub.
Added
Web UI Mobile Responsive "More Options" Overflow Menu:
Solved top-header layout congestion on mobile screens where packing 4 wide buttons (Theme, Language, Accounts, Toggle Sidebar) caused button text wrapping, vertical collisions, and severely squished the session title and badge.
Responsive Overflow System:
Mobile Viewport (<= 768px): Seamlessly collapsed secondary actions into an elegant ⋯ ("More options") pill button, leaving only [ ⋯ ] and [ ‹ ] on the right and reclaiming 170px+ of horizontal space for directory and session title displays.
Desktop Viewport (> 768px): Retained direct desktop header action buttons for quick one-click access.
Frosted Dropdown Interaction: Clicking ⋯ opens a native-feeling floating action menu with icons (🎨 Theme, 🌐 Language, 🔑 Accounts), featuring single-line non-wrapping text, outside-click auto-close, and seamless integration with existing modal dialogs.
Release v0.3.38 of pig. Install via composer global require pigagent/pig:0.3.38 or view on GitHub.
Changed
Web UI & RPC Delayed Persistence State & Real-time Auto-naming Alignment:
Aligned Web UI with TUI delayed persistence lifecycle: a new session does not write any empty .jsonl file to disk until the first assistant message arrives.
Added isPersisted boolean flag to RpcMode::state(). Web UI displays 📄 (内存暂存) / (in-memory) for draft sessions, eliminating misleading ghost filenames before the first prompt.
Supported real-time session_info_changed broadcasting over RPC: SessionInfoChangedEvent now implements AgentEvent and is announced to RPC subscribers; RpcEvents::encode translates it so Web UI automatically updates top bar title, session tab label, and sidebar list when smart-session generates a title.
Release v0.3.37 of pig. Install via composer global require pigagent/pig:0.3.37 or view on GitHub.
Fixed
Web UI Light & Labra Theme Button Contrast & Legibility:
Fixed hardcoded #182232 dark background on .mini-btn, which caused Rotate, Refresh, Remove, and dialog action buttons to appear as pitch-black illegible blocks in Light theme.
Aligned theme overrides with [data-theme="light"] and [data-theme="labra"] selectors:
Light Theme: Transformed buttons to modern soft-gray pills (#f1f5f9 bg, #cbd5e1 border, #334155 text) with clear contrast and subtle elevation; dangerous actions (Remove) styled with soft-rose background and crimson text.
Labra Theme: Seamlessly integrated with deep cyberpunk olive and hot-pink hover states.
Release v0.3.36 of pig. Install via composer global require pigagent/pig:0.3.36 or view on GitHub.
Changed
Web UI Quota Cards Claude iOS Layout Alignment:
Replaced the cramped 3-column horizontal table with Claude's official iOS Usage vertical card design for Antigravity quota display.
Header Row: Model and limit name on the left with prominent weight, remaining percentage right-aligned.
Full-Width Progress Bar: 100% full-width rounded pill progress bar with dynamic status colors (normal cyan/blue, warning amber when <20%, alert red when empty).
Dedicated Reset Row: Reset timer (e.g. 44 小时 7 分后重置 / resets in ...) now occupies its own dedicated row below the progress bar, completely eliminating mobile line wrapping and layout tearing.
Release v0.3.35 of pig. Install via composer global require pigagent/pig:0.3.35 or view on GitHub.
Added
100% Upstream Theme Tokens Parity (56/56 Tokens):
Augmented built-in palettes (DARK, LIGHT, and LABRA) with all 7 remaining theme tokens: scrollbarTrack, scrollbarThumb, searchMatchBg, searchMatchText, syntaxOperator, syntaxPunctuation, and thinkingMax.
Verified 100% byte-for-byte hex color parity with upstream @earendil-works/pi-coding-agent's getResolvedThemeColors("dark") and getResolvedThemeColors("light") with 0 diffs.
Expanded PaletteTest::NAMES to validate all 56 color tokens across all built-in themes.
Release v0.3.34 of pig. Install via composer global require pigagent/pig:0.3.34 or view on GitHub.
New Features
Frosted Glass Theme Settings Modal (Web UI):
Upgraded theme selection in Web UI to a centered frosted-glass Theme Settings modal dialog matching the Language Settings modal architecture.
Displays each palette (Dark, Labra, Light) with 4-color swatch preview pills, clear descriptive subtitles, and active checkmarks with instant zero-refresh switching and localStorage persistence.
Eliminated jarring black/white contrast tears where tool execution cards, prompt input wrappers, dropdown selectors, and action buttons remained pitch black in light mode.
Abstracted all hardcoded component colors into theme-aware CSS variables (--card-bg, --card-header-bg, --tool-body-bg, --input-bg, --select-bg, --dropdown-bg, --thinking-bg, --btn-send, --btn-send-text).
Redesigned Light mode into an elegant, high-contrast palette inspired by modern GitHub/Linear themes: soft daylight gray-white background (#f8fafc), pure white cards with soft shadow elevation, deep slate text (#0f172a), and crystal blue send buttons (#0284c7).
Fixed /theme command only changing the editor border by triggering a full interface replay ($this->chat->clear(); $this->replay()), updating $this->banner, updating $this->footer->setPalette(), and repainting borders with $this->paintBorder(). All past messages, diffs, tool outputs, and status lines now instantly repaint in the new theme colors.
Updated /theme description in COMMANDS table from legacy "Switch between dark and light" to "Switch themes (dark, light, labra, or custom) (/theme [name])", ensuring autocomplete and /help accurately surface the Labra theme and custom theme capabilities.
Enhanced theme switch confirmation notice to list all currently available themes: (Available themes: dark, light, labra...).
Release v0.3.32 of pig. Install via composer global require pigagent/pig:0.3.32 or view on GitHub.
Changed
Web UI Enter Key Direct Send Aligned with Terminal TUI:
Aligned Web UI keyboard behavior with terminal TUI: pressing Enter directly submits and sends the prompt (with robust IME composition guards preventing accidental sends during candidate word selection).
Shift+Enter naturally inserts a newline with smooth auto-expanding textarea height.
Maintained ⌘+Enter and Ctrl+Enter as secondary send shortcuts for user convenience.
Updated input placeholder hints, send button titles, and HUD shortcut cheatsheet to reflect Enter as the primary submit key.
Release v0.3.31 of pig. Install via composer global require pigagent/pig:0.3.31 or view on GitHub.
New Features
Cyberpunk Dark Olive & Hot Pink Built-in Theme labra:
Added official built-in labra theme faithfully matching HANCORE-linux/omarchy-labra-theme color philosophy (deep green-black background #040704, linen white foreground #d3d7b5, hot pink accent #e33d84, and dark olive gold borders #89974a).
Palette::customThemes() now automatically discovers custom theme JSON files from ~/.pig/agent/themes/*.json, ~/.pi/agent/themes/*.json, and /.pig/themes/*.json.
Parsed theme objects safely merge with default dark tokens so incomplete theme definitions will never crash the renderer.
Web UI Instant Theme Toggling:
Added 🎨 Theme button in Web UI header providing instant zero-refresh toggling across Dark, Labra, and Light palettes with localStorage persistence.
Added
Enhanced /theme [name] Slash Command:
/theme without arguments cycles smoothly across all installed themes (dark -> light -> labra -> ...).
/theme directly switches to the specified theme, with clear validation and available theme suggestions on typos.
/settings dynamically adapts its Theme row to cycle through all discovered themes.
Release v0.3.30 of pig. Install via composer global require pigagent/pig:0.3.30 or view on GitHub.
Fixed
Web UI Non-Existent Session Auto-Recovery & Strict Port Binding:
Fixed HttpServer passing --session for nonexistent, deleted, or missing session files, gracefully falling back to a clean new session and preventing child RPC processes from crashing with exit(1) and causing endless no active session reconnect loops.
Eliminated silent port jumping (port + 1) in WebMode.php, ensuring the daemon strictly binds to the requested port without port discrepancy between printed URL and listening socket.
Guarded pigUnreachable in web frontend to avoid showing misleading reconnection banners when the child process has already signaled exit.
Added unit test testDefaultSpawnDoesNotPassSessionForNonExistentFile verifying graceful fallback.
Unified /web slash command inside interactive TUI sessions to manage both in-process listeners and background WebDaemon processes.
Added support for /web restart [--port=N], allowing developers to restart and reload the web server without leaving their current terminal conversation.
Added /web status command to view web server running status, PID, and listening URL directly inside the terminal.
Enhanced /web stop to seamlessly stop background web daemons as well as foreground listeners.
Added unit test testSlashWebStatusAndRestartCommand verifying in-session web lifecycle controls.
Release v0.3.27 of pig. Install via composer global require pigagent/pig:0.3.27 or view on GitHub.
New Features
Telegram-style Language Pack Import/Export & Extension Registration:
Implemented Telegram-inspired language pack management for Web UI with instant JSON import and template export.
Added ExtensionApi::registerLocale() allowing extensions to register custom language translations (e.g. ja, es, zh-TW).
Added /api/locales endpoint in HttpServer to serve extension-provided locales.
Added centered Language Settings modal (#lang-btn) with one-click language selection, custom language deletion, file drag-and-drop import, and zero-refresh tab/badge re-rendering.
Resolved local variable shadowing on translation helper __t().
Release v0.3.26 of pig. Install via composer global require pigagent/pig:0.3.26 or view on GitHub.
New Features
Web UI full bilingual multi-language architecture:
Implemented client-side I18N dictionary framework inspired by smart-book's Lang architecture with fallback resolution and {param} interpolation.
Added seamless Chinese (zh-CN) and English (en) support with automatic locale detection via navigator.language and persistence in localStorage.
Added header language toggle button ([中 / EN]) enabling instant zero-refresh UI language switching.
Fully localized all static elements and dynamic dialogs: sidebar workspaces, session drawers, rename/delete modals, accounts & quota popup, shortcut HUD, tool execution status cards, and live telemetry badges.
Release v0.3.25 of pig. Install via composer global require pigagent/pig:0.3.25 or view on GitHub.
Fixed
Socket write delay synchronization safety:
Guarded adaptive write-delay in Socket::write() to check Fiber::getCurrent() !== null, falling back to usleep(10000) outside coroutines to prevent Future::await() exceptions in non-coroutine contexts.
Release v0.3.24 of pig. Install via composer global require pigagent/pig:0.3.24 or view on GitHub.
Fixed
TLS non-blocking socket stall false alarm:
Replaced the brittle 10-iteration loop limit in Socket::write() with wall-clock timeout stall detection, preventing normal non-blocking zero-byte writes from prematurely killing connections on large payloads.
Sliced outgoing data in standard 16KB TLS-record chunks (substr($data, $offset, 16384)), complying with RFC 8446 to prevent OpenSSL buffer rejections.
Added slight adaptive delay (Async::delay(0.01)) after consecutive zero writes to allow the OS network stack to flush buffers and process incoming TCP ACKs.
Session title telemetry pollution & manual name protection:
Fixed smart-session extension persisting transient speed metrics ( • ⚡ ...) into session_info titles. Session titles are now strictly clean business labels (e.g. 京东加购人体工学椅), with speed telemetry rendered purely in UI runtime status.
Added SessionManager::cleanSessionName() to automatically sanitize historical dirty titles across session loading, describing, and editing.
Added
Unified mobile-friendly Modal system for Web UI:
Extracted common openModal() dialog architecture matching the Account popup design, with centered positioning, frosted backdrop blur, responsive touch button layouts, and Esc/Enter keyboard handling.
Refactored sidebar session renaming into a centered modal dialog with pre-filled clean session titles, eliminating awkward inline input clipping on mobile devices.
Replaced native window.confirm() with a unified modal confirmation for session deletions.
Release v0.3.23 of pig. Install via composer global require pigagent/pig:0.3.23 or view on GitHub.
Changed
Eliminated unwanted automatic browser popups:
Removed automatic open $url invocations from /bug command in InteractiveMode; bug reports are saved locally, copied to clipboard, and display a clickable prefilled GitHub issue URL in terminal without unexpectedly popping up the OS browser.
Removed automatic browser launching from /web command and disabled openBrowser default in WebMode, preventing phpunit test runs and CLI executions from intrusively opening browser tabs.
In TUI mode: holding the Command (⌘) key for ~480ms on macOS automatically pops up a sleek CommandHudComponent cheat sheet card in the overlay area, displaying all core keyboard shortcuts. Releasing Command immediately dismisses it, matching the native iPadOS and Blink Shell experience with zero CPU overhead (0.5µs native FFI checks).
In Web UI: holding the Command / Meta key for ~450ms pops up a centered frosted-glass blur HUD modal card (#command-hud-modal), automatically fading out on key release.
Release v0.3.21 of pig. Install via composer global require pigagent/pig:0.3.21 or view on GitHub.
Changed
TUI keybinding & modifier architecture alignment:
Restored Shift+Enter strictly to newline insertion in TUI editor across all states (both idle and during streaming), eliminating accidental message submission or queueing.
Added macOS native modifier fallback in ProcessTerminal via CGEventSourceFlagsState FFI (0.5µs zero-latency), accurately resolving bare \r sent by Apple_Terminal (Terminal.app) to Shift+Enter (\x1b[13;2u) or Command+Enter (\x1b[13;9u).
Added SUPER = 8 modifier support to Keys.php and Keybindings.php, recognizing command+enter, cmd+enter, and super+enter.
Rebound queueing messages into the processing queue (app.message.followUp) to command+enter (with alt+enter as fallback).
Supported Command+Enter to submit messages directly when idle.
Release v0.3.20 of pig. Install via composer global require pigagent/pig:0.3.20 or view on GitHub.
Changed
Web UI keybinding refinement:
Rebound message submission in Web UI to Command+Enter (macOS) / Ctrl+Enter (Windows/Linux) to prevent accidental sends while drafting complex prompts or code.
Restored Shift+Enter and plain Enter to natural newline insertion inside the textarea with auto-resizing height.
Release v0.3.19 of pig. Install via composer global require pigagent/pig:0.3.19 or view on GitHub.
Added
Startup asynchronous extension update check and notifications matching upstream pi:
Implemented PackageUpdateCheck::checkForUpdates() to asynchronously scan user extensions against core package releases and git updates.
Implemented InteractiveMode::sayPackageUpdates() rendering the official Package Updates Available banner with instructions to run pig update --extensions.
Wired into bin/pig startup flow, alerting users seamlessly without delaying the initial frame.
pig update now updates both pig itself and all installed extensions by default.
Added --extensions option to update installed extensions across ~/.pig/agent/extensions/ (runs git pull for git repos, composer update for composer packages, and pure PHP recursive增量同步 for core built-in extensions pig-antigravity, pig-mcp, pig-web-search, pig-codemode, pig-computer).
Self-healing autoloader in scripts/generate-models.php for global and local environments.
Release v0.3.17 of pig. Install via composer global require pigagent/pig:0.3.17 or view on GitHub.
Changed
Brand title refined to pig — PHP AI Agent: Aligned the title with the core acronym behind pig (PHP AI aGent) across English and Chinese README documentation.
Release v0.3.15 of pig. Install via composer global require pigagent/pig:0.3.15 or view on GitHub.
Added
Unified zero-dependency Pig\Logger (aligned with smart-book OmniPHP\Logger specification):
Five-tier logging API with ANSI terminal coloring: Added Logger::verbose (blue), debug (cyan), info (green), warning (yellow), and error (red), prioritizing ERROR(4) > WARNING(3) > INFO(2) > DEBUG(1) > VERBOSE(0).
Dynamic level filtering: Controlled via PIG_LOG_LEVEL or LOG_LEVEL environment variable (defaults to INFO).
Daily file rotation and retention: Automatically persists logs to ~/.pig/agent/logs/pig-YYYY-MM-DD.log with automatic cleanup of files older than 5 days (PIG_LOG_KEEP_DAYS).
TUI-safe console toggling: Added setConsoleOutput(false) during interactive TUI execution to prevent background log writes from polluting raw terminal rendering, while keeping persistent disk logs active.
Performance and debugging helpers: Included Logger::dump(), Logger::time(), and Logger::timeEnd(). Accessible via both Pig\CodingAgent\Logger and global alias Pig\Logger.
TcpConnection & HttpServer protocol protection: Added $onError connection callback and wrapped framing/dispatching (decode & onMessage) in structured error guards. Malformed client payloads or handler errors return standard 500 JSON or WebSocket error frames without crashing the web daemon. Registered Loop::setErrorHandler in HttpServer::start() to guard background timers and event loop callbacks.
RpcMode command boundary guard: Wrapped line() command execution to guarantee uncaught exceptions are safely returned as structured JSON-RPC error responses ({"id": ..., "type": "response", "success": false, "error": ...}) rather than aborting child agent processes. Safe write protection on RpcMode::send().
Zero-write loop & EOF protection in Socket::write(): Added pre-write feof() validation and consecutive zero-byte write circuit breaker (>10 attempts) to prevent rapid CPU spin loops when an OpenSSL stream is disconnected by the peer.
Suppressed fclose() SSL close_notify warnings: Wrapped fclose($stream) in capturingWarnings() within Socket::close(), silencing raw PHP warnings triggered when attempting TLS shutdown over a broken connection.
Comprehensive auto-retry pattern matching: Expanded Retry::WORDS to recognize native PHP transport errors (ssl.*operation failed, tls.*handshake.*failed, write failed, read failed, cannot connect, network.*unreachable, host.*unreachable, socket.*closed), ensuring transient network blips and SSL drops trigger automatic retry rather than aborting turns.
Release v0.3.12 of pig. Install via composer global require pigagent/pig:0.3.12 or view on GitHub.
Changed
Sub-500ms startup for pig -c via SessionManager::latestPathFor(): Added latestPathFor() matching upstream pi's findMostRecentSession() to discover the newest session file path by mtime and single-line header verification. Eliminates redundant full-file describe() passes prior to SessionManager::open(), cutting discovery latency from 206ms down to 1.6ms (128x speedup) and reducing overall pig -c time-to-first-frame from 630ms to 489ms.
Release v0.3.11 of pig. Install via composer global require pigagent/pig:0.3.11 or view on GitHub.
Added
Sidebar session rename and deletion with hover actions in Web UI:
Inline session renaming: Added an edit icon (✏️) on hover (and touch-persistent on mobile) to rename sessions directly from the sidebar. Saves via POST /api/sessions/rename and immediately synchronizes the active tab and header titles.
Session deletion with confirmation: Added a delete icon (🗑️) to remove .jsonl files from disk via POST /api/sessions/delete with strict path validation inside session roots. Automatically closes open tabs and terminates associated child processes in SessionPool.
Mobile touch optimization: Actions are rendered persistently with comfortable touch targets on touchscreens (<768px), ensuring full mobile parity.
Release v0.3.10 of pig. Install via composer global require pigagent/pig:0.3.10 or view on GitHub.
Fixed
New session workspace resolution in Web UI: Fixed an issue where clicking + New Session inside a selected workspace drawer (e.g. GCamAGC) created the session in the previously active tab's project (pig) instead of the selected workspace. startNewSession() now prioritizes selectedWorkspace.path, safely handles MouseEvent listener bindings, and automatically closes the mobile drawer upon session creation.
Release v0.3.9 of pig. Install via composer global require pigagent/pig:0.3.9 or view on GitHub.
Changed
Startup acceleration for pig -c on massive sessions (from 2.28s down to 0.63s):
Eliminated O(N^2) memory reallocation in SessionManager::pathTo(): Replaced loop-time array_unshift with O(1) appends followed by a single array_reverse, cutting traversal on large 28k-node session trees from 718ms to 3ms (230x speedup).
Instant reverse search in SessionManager::settings(): Replaced forward whole-tree scans with leaf-to-parent reverse lookups that terminate immediately once the latest model and thinking level are found, dropping execution time from 725ms to 0.6ms (1200x speedup).
Zero-allocation array append in SessionManager::resolve(): Replaced loop-time array unpacking ([...$messages, ...]) with direct element appending.
Single-file inspection in SessionManager::latestFor(): Updated latestFor() to inspect only the newest matching session file rather than parsing up to 30 history files on disk, cutting session discovery latency by nearly 50%.
Deferred timestamp parsing in SessionEntries::decode(): Skipped expensive strtotime and regex extraction on message entries, saving over 50ms during large JSONL file loads.
Release v0.3.8 of pig. Install via composer global require pigagent/pig:0.3.8 or view on GitHub.
Added
Active session file badge with smart truncation in Web UI: Added an interactive session file indicator in the top header displaying the active tab's underlying .jsonl session file upon switching tabs.
Smart filename truncation: Long 60+ character session filenames are cleanly truncated to date-time prefix plus UUID tail (2026-10-04T11-03…0b0e.jsonl), preserving full timestamp and file identification without breaking UI layouts.
Click-to-copy & responsive mobile styling: Clicking the badge copies the full absolute session path to the clipboard with an instant feedback animation (Copied!). Styled with responsive constraints (max-width: calc(100vw - 120px)) ensuring zero overflow or wrapping on 375px mobile screens.
Release v0.3.7 of pig. Install via composer global require pigagent/pig:0.3.7 or view on GitHub.
Fixed
Broken pipe Warning capture in Socket::write() and read(): Wrapped fwrite() and fread() in Socket::capturingWarnings() to prevent PHP's native OpenSSL warnings (error:80000020:system library::Broken pipe) from leaking into stdout/stderr and corrupting TUI/CLI renders when the remote peer disconnects or times out.
Accurate socket failure reason and auto-retry triggering: Included the underlying warning message in SocketError (e.g. Write failed: ... Broken pipe) and closed the failed stream, allowing Retry::worthRetrying() to recognize the broken pipe failure and automatically trigger seamless session retries.
Release v0.3.6 of pig. Install via composer global require pigagent/pig:0.3.6 or view on GitHub.
Changed
Lifecycle guidance on interactive /web startup: Added a clear startup guidance note to /web output explaining that the temporary browser server runs for the current terminal session, pointing users to pig web start -d when permanent background daemon operation is desired.
Added
Interactive /web test coverage: Added testSlashWebShowsUrlAndDaemonHint verifying /web startup output, port binding, and clean shutdown via /web stop.
Release v0.3.5 of pig. Install via composer global require pigagent/pig:0.3.5 or view on GitHub.
Fixed
Session resolution for bare .jsonl filenames (SessionManager::find()): Fixed an issue where passing a bare session filename (ending in .jsonl without path separators, e.g. 2026-10-04...jsonl) caused find() to check only ./filename.jsonl and immediately return null without checking the project's session storage directory (~/.pig/agent/sessions/... or ~/.pi/agent/sessions/...). This caused Web UI tabs to fail with No session found matching '...' upon reload or resume.
Session path pre-resolution in HttpServer: Canonicalized $sessionFile to its full absolute path via SessionManager::find($cwd, $sessionFile) prior to spawning RpcClient subprocesses, ensuring reliable resumption under all environment conditions.
Release v0.3.4 of pig. Install via composer global require pigagent/pig:0.3.4 or view on GitHub.
Fixed
Missing Async import in HttpServer: Added use Pig\Async\Async; to HttpServer.php. Previously, requesting /api/accounts/usage (such as opening the Antigravity Accounts panel in Web UI) threw Error: Class "Pig\CodingAgent\Web\Async" not found when attempting to spawn the asynchronous quota check.
Accounts endpoint test coverage: Added unit tests in WebModeTest verifying that /api/accounts/usage executes Async::spawn() cleanly without fatal un-imported class errors.
Release v0.3.3 of pig. Install via composer global require pigagent/pig:0.3.3 or view on GitHub.
Fixed
Crash on session resume (bin/pig -c) with expired OAuth tokens: Fixed a fatal Future::await() must be called inside a coroutine crash when resuming a conversation that used an expired OAuth credential (e.g. Antigravity or Anthropic OAuth). Auth::fresh() now prevents attempting async network token renewal outside of a coroutine, and AgentSession::restoreSettings() uses non-network peeking (hasKeyFor()) to verify model availability safely.
Streaming session file parser (SessionManager::open()) to prevent 128MB OOM on large files: Replaced full-file file() array reads with incremental line-by-line stream decoding (fopen + fgets). Opening 50MB+ conversation sessions (tens of thousands of lines) now consumes under 10MB of memory instead of exhausting the PHP default 128MB memory limit.
Release v0.3.2 of pig. Install via composer global require pigagent/pig:0.3.2 or view on GitHub.
Changed
Single-connection WebSocket multiplexing for Web UI: Replaced per-tab physical WebSocket connections with a single shared WebSocket connection for the entire browser window. All conversation tabs multiplex their traffic over this single wire using tabId tagging:
SessionPool: Upgraded subscription mapping from 1:1 connection binding to multi-tab subscription keys ("$connectionId:$tabId"), tracking client tab subscriptions per managed session and resolving boundTo($connectionId, $tabId) on command relay.
HttpServer: Encoded outgoing RPC events, responses, and termination notices with tabId, routing messages strictly to the relevant tab.
Frontend Web UI: Introduced SharedNetwork singleton with global heartbeat, window-level reconnect with jitter, and automatic bulk resubscription of all active tabs upon connection establishment.
Resource optimization: Physical TCP connections remain constant at 1 regardless of tab count (1, 10, or 50 tabs), eliminating connection storms, browser socket limits, and reverse-proxy long-poll quotas while fully preserving full-time background stream rendering across tabs.
Release v0.3.1 of pig. Install via composer global require pigagent/pig:0.3.1 or view on GitHub.
Fixed
Silent prompt failure in Web UI without error messages: Fixed a critical issue where failed turn generations (e.g. invalid API keys, 401/403/500 provider errors, rate limit exhaustion, or unselected models) completed with no visible error in the browser:
RpcEvents: Encoded error directly onto agent_end events by extracting lastError from failing AssistantMessage instances, and included $event->error->errorMessage in ErrorEvent deltas.
RpcMode: Preserved $id on asynchronous prompt failure responses so error rejections correlate properly.
Frontend Web UI: Displayed errors upon retry_end failure (succeeded === false), rendered unmatched or asynchronous failure responses via appendErrorMessage(), extracted fallback errors from agent_end.messages, and restored input text on connection or prompt dispatch failure instead of losing user typing.
Release v0.3.0 of pig. Install via composer global require pigagent/pig:0.3.0 or view on GitHub.
New Features
Multi-session Web UI tabs via pig --mode rpc process pool: Rebuilt web mode on upstream pi-web's architecture. The browser shell (HttpServer) now coordinates a managed child process pool (SessionPool) where each conversation tab is backed by an isolated pig --mode rpc process. Multiple tasks run concurrently in parallel tabs without interfering with each other's stream, tool execution, or thinking state.
Background daemon management (pig web start|stop|status|restart [-d]): Native double-fork and posix_setsid() process daemonisation with pidfile and log output management under $PIG_HOME/web.pid and web.log.
Added
Per-tab WebSocket connection & independent state machine: Each frontend tab maintains its own WebSocket connection, chat scroll area, and RPC request dispatch. Reconnecting or reloading recovers all opened tabs and re-attaches to existing child sessions without restarting turns.
RPC slash command parity: Added /doctor, /diff, /bug, and export_markdown commands to RpcMode, giving Web and RPC clients full parity with terminal slash command diagnostics.
FD leak mitigation in RpcClient: Added withoutInheritedFds() to close leaked file descriptors (fds 3-255) prior to spawning child processes, avoiding deadlocks where children inadvertently held server sockets open.
Fixed
Infinite hang in Run::wait() when commands spawn background grandchildren: Fixed a critical hang where running background jobs (such as (cmd) & or background daemons) caused Run::wait() to block indefinitely waiting for pipe EOF because child processes inherited stdout/stderr descriptors. Run now periodically polls proc_get_status() and promptly completes after the primary shell exits.
Model resolution in RpcMode::setModel(): Fixed a bug where RpcMode::setModel() stripped the provider parameter and fell back to direct providers via Models::RESOLD, causing resold models (such as antigravity/* or github-copilot/*) to switch to incorrect providers.
SessionPool path canonicalization: Canonicalized directory paths via realpath() to resolve differences between symlinked paths (such as /tmp vs /private/tmp on macOS), preventing duplicate child process spawns on reload.
Release v0.2.49 of pig. Install via composer global require pigagent/pig:0.2.49 or view on GitHub.
Added
pig web start|stop|status|restart [-d] [--port N] [--host H] — the browser UI as a daemon.start -d double-forks, setsid()s, redirects the standard streams to ~/.pig/agent/web.log and execs pig --mode web, so a daemonised server runs byte-identical code to a foreground one. The pid file lives under $PIG_HOME; status trusts it only after kill -0 and clears a stale one; stop is SIGTERM, a bounded wait, then SIGKILL; a second start while one runs is refused rather than binding the next port up. --web-host and --web-port are new --mode web options underneath. No framework: this is pcntl plus two posix calls, and the two files that would have been redundant under Workerman (HttpServer, Protocols\*) stay as they are. Step ① of three toward pi-web's process model — the decision and the other two steps are written up in CLAUDE.md under "Three ways in".
Fixed
The daemon's exec named the binary relative to a directory it had just left.$argv[0] is bin/pig from a checkout and the grandchild chdir('/')s before exec, so the first live start -d printed ✔, failed on /bin/pig, and status said "not running" two seconds later. The binary is realpath()ed at construction; and the parent now waits 300ms and asks the kernel whether the daemon survived its exec before claiming success, reporting the log's last line when it did not.
The daemon's session belonged to /. Same chdir('/'); --cwd is now pinned to where pig web start was typed.
Release v0.2.48 of pig. Install via composer global require pigagent/pig:0.2.48 or view on GitHub.
Added
Custom dropdown menu for the provider / model / thinking selectors on desktop. A native opens its list wherever the OS decides — macOS anchors it on the *selected* row, so with the sixth of seven providers chosen the menu floated a hundred pixels above the pill with nothing between. The menu is now a DOM element anchored flush above the pill (6px gap, whatever is selected), in the page's own dark theme, with hover/active rows, a ✓ on the current one, and full keyboard support (↑↓ to move, Enter/Space to pick, Esc to close, Tab closes). The stays as the source of truth — its options, its value, its change event — so the three cascading handlers are untouched. Touch devices keep the native picker: iOS's bottom wheel is the better control there.
Fixed
Switching model from the Web UI ignored the provider and switched to the direct one./api/model and the WebSocket set_model built "provider/id" and handed it to Models::get(), which compares *bare* ids — so the lookup missed, the ?? Models::get($modelId) fallback resolved the bare id to the direct provider by Models::RESOLD, and a pick of antigravity / gemini-2.5-flash switched the session to Google's publicgemini-2.5-flash on a different bill and quota, with ok: true. Both paths go through resolveModel() now, which uses the keyed Models::find() when a provider is named and also accepts a combined provider/id string.
A model switch that did not happen answered ok: true. The HTTP handler swallowed every failure — no such model, no API key — and returned 200 with the old model in state, so the dropdowns redrew as though the pick had taken. It answers 400 with the reason now, and the page shows it.
Every model pick ran setModel() twice.sendModelChange() sent the switch over the WebSocket *and* then POSTed it, which wrote two model_change lines into the session file per pick. One request, over HTTP, because its answer carries the state the dropdowns redraw from.
Release v0.2.47 of pig. Install via composer global require pigagent/pig:0.2.47 or view on GitHub.
Fixed
Added missing TcpConnection::isClosed() getter. In HttpServer::armHeartbeat(), WebSocket ping heartbeat check invoked $wsClient->isClosed(). TcpConnection had protected bool $isClosed but lacked the public isClosed(): bool getter method, causing a fatal error (Call to undefined method Pig\CodingAgent\Web\Connection::isClosed()) when the 25-second heartbeat timer fired. Added public getter to TcpConnection.
Release v0.2.46 of pig. Install via composer global require pigagent/pig:0.2.46 or view on GitHub.
Added
Official pig mascot SVG favicon for Web UI (/favicon.ico & /favicon.svg). Browsers requesting /favicon.ico previously returned a 404 error. HttpServer now directly serves the official cute pink piglet vector icon (HttpServer::FAVICON_SVG), and index.html registers both and /favicon.ico fallback with 24-hour client caching (Cache-Control: public, max-age=86400).
Release v0.2.45 of pig. Install via composer global require pigagent/pig:0.2.45 or view on GitHub.
Changed
Custom SVG dropdown chevron for model & provider selectors (.select-pill). Replaced clumsy native browser dropdown arrows (which rendered with inconsistent offsets, uneven line thickness, and oversized glyphs across WebKit and Blink) with a clean, centered vector chevron (stroke-width: 1.5, #94a3b8) via appearance: none and SVG background. Added balanced right padding (padding-right: 24px on desktop, 20px on mobile) so text never collides with the arrow.
Release v0.2.44 of pig. Install via composer global require pigagent/pig:0.2.44 or view on GitHub.
Added
Mobile responsive layout & touch UX adaptation (< 768px). Comprehensive optimization for iOS Safari and mobile browsers:
Dynamic Viewport Height (100dvh) & Safe Areas: Switched main layout height to 100dvh and added env(safe-area-inset-bottom) padding to prevent mobile bottom bars and home indicators from obscuring input controls.
Slide-out Drawer with Blur Backdrop: Converted sidebar into an overlay drawer covering up to 85vw on mobile, complete with backdrop blur tap-to-close (.sidebar-backdrop) and auto-closing on session selection.
iOS Safari Auto-Zoom Prevention: Set prompt input font size to 16px on mobile viewports so tapping the textarea does not trigger iOS Safari's default page zoom.
Touch Target Sizing: Enlarged action buttons (#send-btn, #attach-btn, #stop-btn) to minimum 44px touch targets conforming to Apple HIG.
Adaptive Selectors & Header: Wrapped model/provider/thinking selectors and status telemetry into flexible responsive rows, ensuring no layout breaks or text clipping on narrow screens.
Release v0.2.43 of pig. Install via composer global require pigagent/pig:0.2.43 or view on GitHub.
Added
RFC 6455 Ping/Pong standard protocol keep-alive. Implemented Websocket::ping() and added periodic server-initiated Ping heartbeats (every 25 seconds) in HttpServer across all active WebSocket clients. Handled client Pong responses quietly in Websocket::decode(), ensuring standard protocol keep-alive without payload overhead.
Changed
Telegram-style WebSocket auto-reconnect with exponential backoff & fresh connection isolation. Web UI frontend (index.html) now implements robust reconnection:
Completely closes, detaches listeners, and discards previous dead connection instances before spawning a fresh new WebSocket(wsUrl) connection, matching Telegram's clean connection handover.
Implements exponential backoff with jitter (1s base up to 10s maximum) on network drops.
Displays non-intrusive status banner ("Connecting to server...") while disconnected, automatically dismissed on reconnection.
Listens to window.online and document.visibilitychange to trigger immediate reconnect without waiting for retry timers when the user switches tabs or regains network connectivity.
Release v0.2.42 of pig. Install via composer global require pigagent/pig:0.2.42 or view on GitHub.
Fixed
Suppressed fwrite() Broken pipe / Connection reset warnings in TcpConnection. In TcpConnection::sendRaw() and the writable loop callback, writing to a client socket that abruptly closed or refreshed caused PHP to emit notices (fwrite(): Send failed with errno=32 Broken pipe / errno=54 Connection reset by peer). Wrapped both fwrite invocations in scoped set_error_handler / restore_error_handler blocks following project conventions (zero @ error suppression), ensuring client disconnects close cleanly without spewing warnings.
Release v0.2.41 of pig. Install via composer global require pigagent/pig:0.2.41 or view on GitHub.
Fixed
Web UI tool cards squished into 2px hairline strips by flexbox (flex-shrink: 0). In index.html, #chat-scroll uses display: flex; flex-direction: column. Because default flexbox items have flex-shrink: 1, when a conversation accumulates dozens or hundreds of tool calls, Chrome and WebKit aggressively shrink all non-text children down to their borders (offsetHeight: 2px). Added flex-shrink: 0 to .tool-card, .msg-block, .thinking-box, and .compaction-box, allowing all tool cards to retain their full height, headers, and click-to-expand capabilities inside the scroll container.
Release v0.2.40 of pig. Install via composer global require pigagent/pig:0.2.40 or view on GitHub.
Added
Web UI compaction and branch summary support.HttpServer::getMessagesPayload() now exports CompactionSummary (role: "compaction"), BranchSummary (role: "branch_summary"), and HookMessage (role: "hook_message"). Web UI renders clean collapsible summary cards (⊙ Compacted · N earlier messages summarised and ⑂ Branch summarised), enabling inspection of conversation summaries without breaking turn layout.
Changed
Upgraded Web UI tool cards with type-colored borders, icons, and status indicators. Aligned .tool-card styling with terminal TUI standards:
Color-coded left accents: sky blue for bash, emerald green for read, purple for edit, orange for write, yellow for grep/find, blue for web tools, rose for computer.
Added explicit interactive expand/collapse chevrons (▶ / ▼) and status icons (⏳ Running..., ✔ Done, ✖ Failed).
Auto-expands failed tool calls for instant debugging visibility.
Fixed
Web UI tool cards appearing as blank/flattened strips. Resolved CSS layout issue where tool card headers and empty pre-execution bodies compressed into indistinguishable borders during high-frequency sequential tool invocations.
Release v0.2.39 of pig. Install via composer global require pigagent/pig:0.2.39 or view on GitHub.
Fixed
Web UI tool calls not rendering on history replay (camelCase vs snake_case mismatch). In Web UI loadMessages(), history entries from .jsonl session files store type: "toolCall" and role: "toolResult". The frontend only checked snake_case c.type === "tool_call" and m.role === "tool_result", which caused all tool call cards and execution diffs to be completely skipped when loading or refreshing conversations. Added support for both toolCall / tool_call and toolResult / tool_result.
Release v0.2.38 of pig. Install via composer global require pigagent/pig:0.2.38 or view on GitHub.
Added
Complete tool execution UI coverage for Web UI. Aligned createToolCard and updateToolCard across all core and extension tools (write, edit, read, bash, find, grep, ls, web_search, fetch_web_page, browse_web_page, computer):
Release v0.2.37 of pig. Install via composer global require pigagent/pig:0.2.37 or view on GitHub.
Changed
Standardized Web UI English UI copy to professional title case. Corrected lowercase buttons and labels in packages/coding-agent/src/Web/assets/index.html:
Release v0.2.35 of pig. Install via composer global require pigagent/pig:0.2.35 or view on GitHub.
Fixed
Web UI input composition handling (IME Chinese typing). In Web UI (packages/coding-agent/src/Web/assets/index.html), pressing Enter to confirm Chinese pinyin candidates in the prompt input or hook dialogs previously triggered immediate message submission. Added compositionstart / compositionend event listeners and e.isComposing / keyCode 229 guards so Enter only confirms candidate selection while composing text.
Release v0.2.34 of pig. Install via composer global require pigagent/pig:0.2.34 or view on GitHub.
Fixed
Crash on undefined method SystemClipboard::default(). When executing /bug or exporting PR descriptions, InteractiveMode called SystemClipboard::default()->write(...) which threw Call to undefined method Pig\Tui\Clipboard\SystemClipboard::default(). Fixed by using injected $this->clipboard->write(...) in InteractiveMode and adding SystemClipboard::default() convenience factory method.
Release v0.2.33 of pig. Install via composer global require pigagent/pig:0.2.33 or view on GitHub.
Changed
Theme palette aligned with upstream pi OKHSL color tokens. Updated DARK and LIGHT palettes in Palette.php to match upstream's perceptual OKHSL design space. Calibrated dim (#7e888e), muted (#9da5a9), accent (#a798d7), border (#5fa8cc), and thinking* gradients, ensuring identical contrast, status output, and code block highlight colors between pig and pi.
Fixed
Context token double counting in Footer and Web UI. In Google / Gemini / Antigravity usage accounting where input already subsumes prompt cache hits, FooterComponent and HttpServer previously added cacheRead back onto input, erroneously reporting context percentages exceeding 100% (e.g. 145.6% vs pi's 72.6%). Unified calculation to use $session->contextTokens(), which prioritizes provider totalTokens and matches compaction triggers.
Suppress browser launching during PHPUnit test runs. In McpExtensionTest, OAuth authorization URL generation previously invoked system open / xdg-open subprocesses, causing unwanted browser tabs to pop up during test suites. Added PIG_TESTING guard in extensions/pig-mcp/index.php and McpCli.php to keep tests completely headless.
Release v0.2.32 of pig. Install via composer global require pigagent/pig:0.2.32 or view on GitHub.
Added
Domain-specific Cookie files support (~/.pig/agent/.cookies.json).pig-computer and the browser Docker container now support isolating cookies per domain (e.g. jd.com.cookies.json, taobao.com.cookies.json) in addition to the unified cookies.json.
Each site's cookies can be cleanly exported, saved, and updated independently without risking accidental cross-site overwrites.
Priority fallback: ~/.pig/agent/.cookies.json is checked first, falling back to ~/.pig/agent/cookies.json.
Updated /computer cookies to list and report all discovered domain cookie files and expiration status.
Release v0.2.31 of pig. Install via composer global require pigagent/pig:0.2.31 or view on GitHub.
Added
Pre-flight authentication & Cookie validation in pig-computer for e-commerce platforms. When navigating to domains requiring login sessions (such as jd.com, taobao.com, tmall.com, douyin.com, amazon.com), pig-computer now pre-checks ~/.pig/agent/cookies.json before sending requests. If the file is missing, invalid, lacks domain cookies, or has expired key session cookies (e.g. pt_key, _m_h5_tk, sessionid), it terminates the turn immediately with detailed guidance on how to export and save cookies, avoiding blind loops or dead-end redirect cycles.
Added /computer cookies slash command to inspect loaded domains and cookie counts from ~/.pig/agent/cookies.json.
Release v0.2.30 of pig. Install via composer global require pigagent/pig:0.2.30 or view on GitHub.
Fixed
Crash when rendering fallback label for ImageContent with inverted parameters. In pig-computer, new ImageContent('image/png', $base64) passed arguments in the inverted order ($data, $mimeType). On terminals with image drawing disabled or falling back, TerminalImage::fallback() received the 900KB raw base64 string as the $mimeType, generating a single line over 919,383 columns wide that crashed Tui::checkWidth(). Corrected parameter order to new ImageContent($base64, 'image/png') and added defensive length bounding in TerminalImage::fallback().
Release v0.2.29 of pig. Install via composer global require pigagent/pig:0.2.29 or view on GitHub.
Fixed
PHP 8.5 curl_close() deprecation warning in pig-computer extension. In PHP 8.0+, curl_init() returns a CurlHandle object that is automatically closed on destruction; in PHP 8.5, calling curl_close() is deprecated and emitted a runtime deprecation warning mid-stream during tool execution. Replaced with unset($ch) across pig-computer.
Release v0.2.28 of pig. Install via composer global require pigagent/pig:0.2.28 or view on GitHub.
New Features
Computer Use & Anti-Detection Browser Automation Suite. Added docker/browser/ and extensions/pig-computer/ for true OS-level / browser-level automation.
Docker container based on puppeteer-real-browser + Xvfb (1920x1080 virtual display) with anti-detection fingerprint injection to bypass Cloudflare Turnstile, Baidu, and Google anti-bot challenges.
Automatically loads and mounts ~/.pig/agent/cookies.json and persistent browser profile, enabling automated authenticated actions on e-commerce sites (e.g. JD.com, Taobao) without re-login.
Release v0.2.27 of pig. Install via composer global require pigagent/pig:0.2.27 or view on GitHub.
Added
Git-modified files priority ranking in @ file picker. When typing @ in the prompt, files modified or untracked according to git status --porcelain -u are automatically scored higher and prioritized at the top of the autocomplete list with a modified · indicator badge, greatly accelerating navigation during iterative bug fixing and code reviews.
Argument completions for /theme. Typing /theme now automatically autocompletes available built-in themes (dark, light) with descriptions instead of falling through to the filesystem picker.
Release v0.2.26 of pig. Install via composer global require pigagent/pig:0.2.26 or view on GitHub.
Fixed
Pig mascot logo split vertically on narrow terminals. Previously, the 2-line pig logo placed the 84-column summary text (escape interrupt · ctrl+c/ctrl+d clear/exit · / commands · ! bash · ctrl+o more) directly to the right of the bottom logo line ($bottomLogo $summaryStr). In standard terminals narrower than 85 columns (such as 80-column splits), the summary text wrapped onto a new line, inserting an extra row between the logo's top half and bottom half and breaking the mascot. Now, the 4-cell mascot logo sits compactly beside the version label, with the summary text rendered cleanly on its own dedicated line below.
Release v0.2.25 of pig. Install via composer global require pigagent/pig:0.2.25 or view on GitHub.
Added
/bug server upload integration./bug in interactive mode now automatically uploads the diagnostic report to https://pigagent.dev/api/bug-reports, prints the permanent online report URL (e.g. https://pigagent.dev/bug-report/{id}), and continues to copy the report to the clipboard and open the GitHub prefilled issue URL.
Added BugReport::upload() to submit diagnostic bundles via non-blocking HttpClient.
Release v0.2.24 of pig. Install via composer global require pigagent/pig:0.2.24 or view on GitHub.
Changed
Default model is now (antigravity) gemini-3.8-flash • medium. When no model is typed, set in the environment, remembered from last time or chosen in the settings, pig opens on Antigravity's Gemini 3.8 Flash at medium reasoning instead of Anthropic's Claude Sonnet 4.5 at off. Explicit --model, PIG_MODEL, settings and resumed sessions are untouched.
Release v0.2.23 of pig. Install via composer global require pigagent/pig:0.2.23 or view on GitHub.
Fixed
/bug failed the moment it was typed with Undefined property: InteractiveMode::$terminalUi — the field is $ui, and the one command that exists for reporting a fault was the one command nothing drove through the screen. /commit's confirm read the same name. Both read $ui now, /bug has a test that types it, and test/lint.php sweeps every class for a $this->name with no property called name — which is how a misspelled field gets past php -l, and which found exactly this one.
Release v0.2.22 of pig. Install via composer global require pigagent/pig:0.2.22 or view on GitHub.
Fixed
A trust.json with a null in it stopped pig from starting. pi's trust store takes true, false or null — null is what its "forget this path" writes — and pig's reader refused anything but a boolean, so a file pi had written could crash pig before any screen existed. A null is walked past to the nearest real decision above it, as upstream's findNearestTrustEntry() walks past it. A value that is none of the three is still refused, and the message now says what to do about it.
Release v0.2.21 of pig. Install via composer global require pigagent/pig:0.2.21 or view on GitHub.
Added
A tool result with pictures in it reaches a codemode script as image blocks.read on a PNG or generate_image used to answer the script its text alone — Saved image to … — and the script had to read the file again to show it. It answers ['text' => …, 'images' => [['type' => 'image', 'data' => , 'mimeType' => …], …]] now, MCP-shaped, so image($r['images'][0]) shows it as it is. The same shape upstream's models.generateImages() hands back, reached through the tools pig already has rather than a models API over a provider pig does not carry.
Fixed
agent_settled fired once per run and not once per prompt, so a hook that notifies on it — the desktop notification extension — said "task complete" on every failed attempt a retry was about to repeat, and on the run an auto-compaction summarised, while the task was still going. It was emitted beside agent_end, which is the end of a *run*; upstream emits it once, after the retry loop, when pi will not continue on its own. pig emits it from the one place that means "nothing more is coming" now, whichever ending the prompt had. system-notify.php listens on agent_settled as pi's does; a notification hook on agent_end will keep firing per run, which is what that event means.
Release v0.2.20 of pig. Install via composer global require pigagent/pig:0.2.20 or view on GitHub.
Changed
codemode costs ~60% fewer prompt tokens. The tool's description was a full reference — every helper spelled out, ~830 tokens on every request before a single nested tool was listed. It is upstream 1.0's shape now: the intro, one line per global, and the path of extensions/pig-codemode/CODEMODE.md, the reference the model reads when it needs a detail (~300 tokens; with two MCP tools listed 929 → 395). The system prompt's snippet and guideline are upstream's shorter ones, and a namespace heading says (some tools not listed) rather than counting.
codemode errors say how to recover, upstream 1.0's guard(): $tools->readTextFile() is answered with does not exist. Did you mean $tools->read_text_file()? — names compared with case and punctuation removed, then by containment, then the whole list when it is short — instead of Unknown tool. An oversized store() value says what the store is for and where large data goes instead.
MCP OAuth credentials are stored per server name and URL, so two servers at one URL can be two accounts (upstream's #10252). An entry stored by URL alone is taken over by the first server that loads it.
Added
oauth.authServerMetadataUrl for an MCP server that advertises the wrong authorization server or none (upstream's #10172): the document decides, and it is read every time so a changed URL applies at once. pig mcp add --oauth-auth-server-metadata-url.
Fixed
An MCP OAuth code whose iss names another authorization server was exchanged anyway. The callback read iss and nothing checked it. Refused before the exchange now (RFC 9207), and a server whose metadata promises iss on every response is not believed without one.
A server asking for more scope asked for ever.insufficient_scope may name only the missing scopes, and the new sign-in requested only those, so the new token lost what the old one had and the server asked again. The step-up asks for the granted scope plus the missing one; a token response without scope is recorded as having granted what was requested (RFC 6749 §5.1) so there is something to keep.
An MCP token response with "scope": "" — or any empty optional field — was refused as invalid, throwing away a sign-in that had worked (upstream's #10266).
store() past its size limit threw Class "RangeError" not found: PHP has no such class, so the limit had never been reachable. LengthException.
Release v0.2.19 of pig. Install via composer global require pigagent/pig:0.2.19 or view on GitHub.
Added
Alt+Enter queues a follow-up and Alt+Up takes the queue back, upstream's app.message.followUp and app.message.dequeue. Typing while the model works had one door: Enter, which steers — the message goes in after the tool that is running. Now there are upstream's two: Enter steers and Alt+Enter (Option+Enter on a Mac) waits for the turn to end, which is the key for "and after that, do this" as against "no, the other file". What is waiting is drawn above the prompt as Steering: or Follow-up: rather than one Queued: for both, with ↳ Option+Up to edit all queued messages under it — the way back out, named, since a queued line that cannot be taken back is one nobody dares to queue. Alt+Up pulls everything queued into the editor in front of whatever is half typed and leaves the turn running; escape still does the same on its way to stopping it. From an idle prompt Alt+Enter is Enter, as upstream has it. Both keys move in keybindings.json like the rest, and AgentSession::queuedByKind() is what the screen reads. A file command typed mid-turn steers too, where it used to follow up — the one place the two queues were still swapped.
Release v0.2.18 of pig. Install via composer global require pigagent/pig:0.2.18 or view on GitHub.
Fixed
Widening the window left its right-hand side blank for most of a second on a long session. Measured on a resumed 1,144-message conversation at 169 columns against pi on the same file: pi's redraw began 125ms after the signal, pig's 823ms. Four things, all in the frame and none in the terminal. BashOutputComponent wrapped the whole of a command's output to keep its last five rows — a 50KB build log collapsed to five rows cost a full wrap at every new width, 280 of them in that session, 460ms of the frame; it wraps from the end now and stops once the rows are in hand, with TextWrap::rows() counting what the dropped head would have made. Width::visible() sent every *styled* line of printable ASCII — which is every line of a transcript — through grapheme segmentation, because the escape in it failed the plain-ASCII fast path; 12,800 lines measured before writing were 236ms, and a styled ASCII line is one column a byte once the codes are gone, as upstream's asciiVisibleWidth has it. TextWrap::breakWord() cut a 46KB minified line grapheme by grapheme (10ms a line, at every width); a word of printable ASCII is cut by bytes now, held byte-identical to the grapheme walk over 3,000 random styled words. And ProcessTerminal::write() handed fwrite() the whole remainder of the frame each time the tty took a kilobyte of it — 2,400 copies of 2.5MB, 72ms of memcpy; it hands over 64KB slices. First byte of the redraw is 194ms after the signal now, against pi's 125, and the whole frame is on screen in 227ms against pi's 146 — what is left is 2.5MB against pi's 2.2MB going through the tty.
The editor's two horizontal rules were styled per character — 280 escape sequences and 3,360 bytes per 140-column rule, two rules a frame — and are one styled string now. The whole-frame clear is \e[2J\e[H\e[3J, screen first and scrollback last, which is upstream's order.
Release v0.2.17 of pig. Install via composer global require pigagent/pig:0.2.17 or view on GitHub.
Changed
A confirm dialog has Yes first, as upstream's showExtensionConfirm() has it (["Yes", "No"]): Enter alone confirms, and Escape is still the no. pig had No first and called it the safe direction; the safe answer has not moved — it is one key further from the cursor.
Fixed
Dragging the window stuttered, three ways at once. The SIGWINCH handler ran stty size — a 4ms fork — on every signal, and a drag delivers one per pixel; it marks the size stale now and the next frame measures once. Every signal asked for a frame, and a signal that landed on the same cell size redrew the whole screen with the scrollback cleared for nothing; a resize-only request that changed neither dimension draws nothing. Frames are at most 16ms apart (upstream's MIN_RENDER_INTERVAL_MS), so a burst becomes one frame. And a SIGWINCH arriving while a frame was half written interrupted the select() in ProcessTerminal::write() with EINTR, which PHP reports as a warning — printed straight into the raw terminal mid-frame as stream_select(): Unable to select [4]: Interrupted system call. Measured on a 60Hz drag over 30 widths: 30 frames either way, but the first one 37ms after the first signal rather than 51, and no warnings in the output.
HOME unset by a test's tearDown blinded every later test that looks under ~ (fd is not installed, fourteen skips); it is restored now.
Release v0.2.16 of pig. Install via composer global require pigagent/pig:0.2.16 or view on GitHub.
New Features
codemode, in PHP — upstream's extensions/codemode and pi-codemode, as Pig\Codemode (packages/codemode/) and extensions/pig-codemode/. The model writes a PHP script; the script calls nested tools as $tools->name([...]), fans independent calls out with parallel([...]) / parallel_settled([...]) (each arm a Fiber, every call on the pipe before any answer, so three slow tools cost one), chains dependent ones, filters what came back and returns only what it needs — the half of the MCP story deferred did not cover: the tool results go through the script, not the model. The sandbox is a child php -n with disable_functions naming every process, file, stream, network and host-reading function, open_basedir pointing at nothing, a 256MB memory_limit, no php.ini and an empty PATH, speaking one JSON line per message over the pipe; upstream's is QuickJS in wasm, and the difference is stated on Sandbox: a blacklist for a model's mistakes, not a whitelist for an adversary's. text(), image(), exit_script(), store()/load() (persisted as upstream's codemode-store entry in the session file), ALL_TOOLS, search_tools() (BM25), describe_tool(), // @options: {"max_output_tokens", "timeout_ms"}, the middle-cut output budget, the Script completed / Wall time / Output: header, and the renderer that shows the script, each nested call with ✓/✗/⊘ and its duration, and the output. Nested calls to the agent's own tools go through the hooked tool, so the permission gate reaches bash from a script exactly as from the model.
MCP's codemode exposure is codemode now. Upstream's default exposure: a server with no exposure has its tools not declared to the model but put in Pig\Codemode\Registry, where the codemode tool lists them (grouped by server, within a 3000-token catalog budget, OpenCode's round-robin selection) and scripts call them; registering one is what activates codemode, as upstream's ensureDiscoveryActive() does. codemode-deferred leaves them out of the catalog for search_tools() to find. /mcp describes all five exposures in upstream's words. codemode.enabled: true in the settings turns the tool on with no server; codemode.inlineBudget sizes the catalog.
A tool can speak in the system prompt — upstream's promptSnippet and promptGuidelines, on CustomTool, collected by CustomToolSet::promptContributions() and written into "Available tools" and "Guidelines" by SystemPrompt::build(), re-built when the tool set changes. codemode's line and its guideline ("Use codemode to batch or chain several tool calls…") are the first users; without the guideline a model knows the tool exists and does not reach for it.
Added
AgentLoopConfig-level: AgentError carries $details, so a tool that failed half way still shows the UI the half that ran (codemode's nested calls on a failed script).
ToolSearch moved from extensions/pig-mcp to Pig\Codemode, since tool_search and search_tools() share it.
Fixed
HookRunner::setSession() existed and nothing called it, so $ctx->session was null in every handler — a documented HookContext field wired at one end only. AgentSession attaches itself now, in its constructor and in setHooks().
Release v0.2.15 of pig. Install via composer global require pigagent/pig:0.2.15 or view on GitHub.
Added
MCP resources — upstream's extensions/mcp/resources.js: the three tools Codex and opencode use, list_mcp_resources, list_mcp_resource_templates and read_mcp_resource, registered once a connected server offers resources, with the widest exposure among those servers (declared when one is direct, behind tool_search otherwise, gone when none has any). Listings are Codex's JSON shape, one page with a cursor for one server or every page of every server; MCP App resources (ui://, profile=mcp-app) and icons are left out; a read resource reaches the model as text or an image, a binary one as a saved file, several contents labelled by URI. A resource link in a tool result names read_mcp_resource only while those tools are on the model. pig mcp list reports resources: N, URI templates: M. Verified live against @modelcontextprotocol/server-everything.
The MCP server log — upstream's log.js: what a server says with notifications/message is appended to ~/.pig/agent/mcp.log (, continuation lines indented), rotated to mcp.log.1 past 5MB. Best effort: a log that cannot be written never fails a tool.
Release v0.2.14 of pig. Install via composer global require pigagent/pig:0.2.14 or view on GitHub.
Added
OAuth sign-in for remote MCP servers — upstream's pi-mcp/oauth (as Pig\Mcp\Oauth) and extensions/mcp/oauth.js (as McpOauth): RFC 9728 / RFC 8414 discovery, dynamic client registration, the authorization code flow with PKCE against a loopback callback on a free port, token refresh before expiry and after a 401, invalid_grant → tokens dropped and the browser flow again, insufficient_scope → a new sign-in with the scope merged in. An HTTP server with no Authorization header of its own uses it: a 401 with nothing to refresh is the state needs-auth (not failed), the startup report says run /mcp login , the manager offers Sign in (with a box for the pasted redirect URL when the browser runs on another machine) and Sign out, and /mcp login [server], /mcp logout [server], pig mcp login [--timeout s], pig mcp logout do the same from the prompt and the shell. Credentials live in ~/.pig/agent/mcp-auth.json, keyed by server URL, 0600. pig mcp add --url … [--oauth-client-id --oauth-client-secret --oauth-callback-port] for a pre-registered client. Not ported: the cross-process refresh lock (proper-lockfile) — two pigs refreshing one rotating token in the same instant lose the grant, which is the cost a lost lock has upstream too.
HookUi::input() takes an optional AbortSignal, upstream's { signal }: a prompt raced against something that may answer first is closed from outside with null. TerminalUi closes the dialog, RpcUi tells the host the question is withdrawn.
Fixed
FakeHttpMcpServer (test helper) speaks OAuth, so the flow is tested end to end against the same server the transport is.
Release v0.2.13 of pig. Install via composer global require pigagent/pig:0.2.13 or view on GitHub.
Added
/mcp is a manager now, where there is a terminal — upstream's McpManagerView: a list of servers that redraws by itself as they connect (the ones needing attention first), and per server its transport, state and error, the tools it offers with their exposure, Reconnect, Exposure (saved to the mcp.json it came from; switching to deferred moves the declared tools behind tool_search at once) and Enable/Disable (saved too, and the connection closed or opened). Without a terminal it prints the status as before.
pig mcp add | remove | list — upstream's extensions/mcp/cli.js: add [--env K=V] [--cwd dir] [--exposure mode] -- [args], add --url [--header K=V] [--bearer-token-env-var NAME], -l for the project file (which says so when the project is not yet trusted), remove naming the other scope when the server is defined there, and list [--json] that connects to every enabled server and exits 1 if one failed. Verified against GitHub's streamable-HTTP endpoint (46 tools) and server-filesystem.
Fixed
A server whose exposure changed from direct to deferred kept its already-declared tools declared: registerTools() compared the new list against the names it *owned* rather than the names it had *declared*, so nothing was taken away.
Release v0.2.12 of pig. Install via composer global require pigagent/pig:0.2.12 or view on GitHub.
New Features
MCP servers — upstream's built-in mcp extension, as extensions/pig-mcp/. Servers declared in ~/.pig/agent/mcp.json or /.pig/mcp.json (upstream's file and keys, so a mcp.json written for pi works unchanged; the project file is gated by /trust like every other .pig/ resource) are connected when a session starts, in the background, and their tools reach the model as mcp____ through the same pipeline as bash — so tool_call hooks and the permission gate apply to them too. Stdio and streamable HTTP, ${VAR} and !command in env/headers, toolExposure patterns with hidden, lazy reconnect on a dropped connection, a 20KB middle truncation with the whole result saved to a file, /mcp for status and /mcp reconnect . The first prompt waits up to ten seconds for the startup connections. Verified end to end against @modelcontextprotocol/server-filesystem. codemode exposure is not ported — it is a JavaScript sandbox — and a server asking for it is told so once and declared directly; A deferred tool is not declared to the model until tool_search finds it — upstream's BM25 ranker over tool names, descriptions, schemas and the server's instructions, ported arithmetic for arithmetic; the tool appears as soon as a connected server has a deferred tool, lists the servers it can search, and a loaded tool reaches the model on its next call of the same run. /mcp says how many are waiting. OAuth, resources and pig mcp add/remove/list are the steps after this one.
Added
AgentLoopConfig::$getTools: the loop asks for the tool list before every model call instead of keeping the snapshot it started with, so a tool registered from inside a tool call — tool_search loading one — is declared on the next request rather than the next prompt. Upstream refreshes context.tools from agent.state.tools in prepareRequest for the same reason.
ExtensionApi::registerTool() works after load, and removeTools() beside it: the loader used to copy an extension's tools once at startup, which is right for a tool that exists at startup and wrong for one that arrives when a server connects. CustomToolSet::adopt() follows an extension's list, and the agent's tool set is rebuilt when it changes.
Pig\Mcp (packages/mcp/), the first half of MCP support — upstream's pi-mcp package ported file for file: JSON-RPC 2.0 shapes and error codes, McpClient (handshake, paginated tools/list / resources, tools/call, progress notifications that reset the request timeout, cancellation sent to the server, server-initiated ping and roots/list), and three transports — in-memory (for tests), stdio (a child on the loop, the spec's three-step shutdown with Process::killTree() where upstream uses a process group) and streamable HTTP (JSON or SSE replies, Mcp-Session-Id, a standing GET stream reconnected with backoff, Last-Event-ID resumption of a cut reply stream, a 401 handed to an AuthProvider once). Nothing uses it yet: the extension that reads mcp.json is the next step.
Fixed
Gemini refused every request with Unknown name "$schema" the moment an MCP server was connected: its parameters is an OpenAPI 3.0 schema and the TypeScript MCP SDK puts $schema and $defs on every tool. Upstream's sanitizeForOpenApi() is ported into GoogleShared — no built-in tool carries a meta-declaration, which is how it went unported.
Loop::runQueue(): a throw out of one deferred callback dropped the callbacks queued behind it in the same tick. Found through McpClient — the root fiber failing on a timeout and the in-memory transport's deferred notifications/cancelled shared a snapshot, and the server never heard the cancellation.
Process::killTree() moved from coding-agent's Shell to pig/tui beside the other subprocess primitives, taking the signal as an argument; Shell::killTree() delegates.
Release v0.2.11 of pig. Install via composer global require pigagent/pig:0.2.11 or view on GitHub.
Fixed
A tool_call hook can now change a call rather than only refuse it: ToolCallEvent::$input is writable and the tool runs with what the hooks left in it (upstream: "to modify arguments, mutate event.input in place"). The event was readonly, so the permission gate's rm → trash rewrite edited a copy and rm ran as typed.
A dialog taller than the terminal no longer makes the screen flash: a change in the scrollback above the window (the working spinner, pushed up by the overlay, ticking twelve times a second) is left alone instead of forcing a full redraw with the scrollback cleared on every tick. A change the new frame brings back into the window is still redrawn, as upstream does.
Release v0.2.10 of pig. Install via composer global require pigagent/pig:0.2.10 or view on GitHub.
Fixed
/reload no longer warns extension /copy.php (load): not a readable file for every extension: it was handing the loader the banner's display labels as if they were --extension paths. The reload also applies the project-trust gate the startup applies, so an untrusted project's .pig/ cannot come in through /reload.
Typing / and deleting it no longer pops the whole directory listing under an empty prompt: an empty line is not a path context (upstream's own rule — "Empty text should not trigger file suggestions"), while Tab on an empty line still lists files.
Release v0.2.9 of pig. Install via composer global require pigagent/pig:0.2.9 or view on GitHub.
Added
pi's session format v3: context_edit entries are read (the latest edit per target on the active branch omits or replaces what the model is shown, leaving the file, tree and totals untouched — pi's buildSessionProjection()) and written (a retry now records that it took the failed turn off the context, so --resume no longer puts it back). pig writes version: 3; a v2 file is brought to v3 the way pi's migrateV2ToV3() does, without re-id'ing anything.
Release v0.2.8 of pig. Install via composer global require pigagent/pig:0.2.8 or view on GitHub.
Added
~/.pig/agent/keybindings.json (upstream's keybindings.ts, the app.* half): the eleven keys the terminal takes can be moved under pi's action names and key spelling ("app.model.select": "ctrl+m", lists allowed, [] unbinds). Keys::matchesName() is upstream's matchesKey(); CustomEditor claims whatever the bindings say and binds by action, so a moved key frees the old one for the text field or tmux; /help shows the keys in force; a wrong key or action is named on the shell at startup and a line that was only typos leaves the default standing.
Hooks and custom tools are wired in --mode web: a hook's confirm/select/input/editor opens a dialog in the page over the RPC hook_ui_request line, notify and setStatus reach the banner and the telemetry bar, hook_error/tool_error are shown. Standalone web mode previously gave hooks NoUi, so a tool_call guard refused every tool call without a word.
Fixed
A hook's question id is unique per process (ui--): a browser tab left over from an earlier pig that reconnected could hold a dialog with the same ui-1 as the new server's first question and cancel it, refusing a tool call nobody was asked about (one run in two, measured). The page also ignores a repeat of the same question id and closes its SSE fallback once the WebSocket is up, so an event never arrives twice.
The Web UI says when it cannot reach pig (Cannot reach pig for the session state: … — retrying…) instead of showing Loading session... for ever; every loader used to swallow its failure.
The trust prompt now says *what* it found (It has: extensions/pig-antigravity/index.php, …) — a project with no visible .pig/ but PHP under extensions/ was being asked with no reason on screen — and its options are no longer cut at 30 columns, so "Trust parent folder (…)" shows the whole path.
Release v0.2.7 of pig. Install via composer global require pigagent/pig:0.2.7 or view on GitHub.
Added
Web UI session tabs: every conversation opened in the browser gets a tab above the chat (labelled by its /name or first line, live one marked, × to close, + for new), kept in localStorage per server. /api/state now carries sessionPath, opening and cwdPath; the server broadcasts session_switch and session_info_changed so the page follows a switch made in the terminal.
Web UI accounts panel (accounts button, /accounts): the Antigravity sign-ins with token expiry, use / remove / rotate, and the live account's quota pools with reset times. GET /api/accounts, GET /api/accounts/usage, POST /api/accounts/{activate,remove,rotate}; Auth::activateAntigravityAccount() / removeAntigravityAccount() are the one implementation the panel and /antigravity.accounts share.
browse_web_page in pig-web-search: renders a page in the locally installed Chrome (headless, --remote-debugging-port=0) through a pure PHP DevTools Protocol client over a masked-frame WebSocket on pig's own Socket, waits for the load event, strips nav/header/footer/scripts and returns the live DOM's text — for single-page apps that fetch_web_page returns as an empty shell. Chrome is optional; its absence is named. ~2.7s per page, profile cleaned up after.
Fixed
/api/session/switch and /api/session/new answered before the switch had happened (and new reported the *old* session's state); both now answer from inside the switch, a missing file is a 404, and a hook declining to leave is a 409.
Release v0.2.6 of pig. Install via composer global require pigagent/pig:0.2.6 or view on GitHub.
Fixed
Gemini 3.x on Google's public endpoint: every 3.x model is now asked for a thinking *level* (upstream's 3-pro/3-flash check matched only gemini-3-flash-preview, so 3.1/3.5/3.8 silently ignored --thinking), and the levels a model refuses — measured per model — live in its registry row, so thinking *off* on gemini-3.1-pro-preview / gemini-3.5-flash-lite no longer fails every turn with Budget 0 is invalid, and MINIMAL is never sent to a model that answers 400 to it. Model catalogue regenerated from models.dev.
Added
Crash log, ported from upstream pi's crash-log.ts: an uncaught throw and a throw the event loop caught are both written to ~/.pig/agent/crashes.json (last five), the next start says so once, and /bug attaches them — then clears the file once the report is written.
Project trust (/trust), ported from upstream pi's trust-manager.ts/project-trust.ts: a project's own .pig/ (settings, hooks, tools, extensions, skills, commands) and extensions/ are not loaded until the person says so. The first time pig opens such a project it asks — Trust / Trust parent folder / this session only / Do not trust — and remembers the answer in ~/.pig/agent/trust.json, nearest ancestor winning. An untrusted project says so on screen and in -p's stderr; with no terminal to ask on, an undecided project is untrusted, so a script run in a stranger's repository cannot run that repository's hooks. Projects with nothing under .pig/ are never asked.
Release v0.2.5 of pig. Install via composer global require pigagent/pig:0.2.5 or view on GitHub.
Added
Bug reporting (/bug [what went wrong]) — Ported from upstream pi's /bug, adapted for an open-source project with no upload server: writes a Markdown report (pig/PHP/OS versions, model and provider without keys, the last provider error, /doctor findings, and an opt-in transcript) to ~/.pig/agent/bug-reports/, copies it to the clipboard, and opens a GitHub issue with it prefilled. Available in TUI and Web UI (/api/bug).
After a non-retryable, non-aborted provider error the TUI now says once per session: If this looks like a pig bug, /bug writes a report and opens a GitHub issue for it. A 429 quota wall is retryable and deliberately does not trigger it.
Release v0.2.4 of pig. Install via composer global require pigagent/pig:0.2.4 or view on GitHub.
New Features
Pull Request description generator (/export pr) — Automatically extracts session context, file changes, and git diff statistics to generate structured, professional GitHub PR descriptions formatted in GitHub Markdown (Summary, Key Changes, Modified Files, Verification), with automatic clipboard copying and file saving.
Pure Markdown conversation exporter (/export md [file]) — Cleanly exports the complete conversation with user turns, assistant responses, thinking blocks, and tool results formatted as GitHub Markdown.
System health and environment diagnostics (/doctor) — Added built-in diagnostic inspector checking PHP runtime, required extensions, external tooling (stty, git, fd, rg, clipboard), provider credentials with OAuth expirations, proxy connectivity, and active session health. Accessible via /doctor in TUI and Web UI (/api/doctor), or CLI.
Git development workflow commands (/diff and /commit [message]) — Added /diff to inspect working tree changes with colorized diffs in both TUI and Web UI, and /commit [message] with automatic Conventional Commits message generation from diffs and interactive confirmation.
Added
Added + New Session button in Web UI sidebar and /api/session/new endpoint for instant standalone session creation.
Added direct /diff inspection rendering in Web UI with unified diff cards.
Code block copy buttons (Copy / Copied! ✓) with language tags across all Markdown code outputs in Web UI.
Smart auto-scroll and reading-pinning in Web UI: preserves scroll position when user scrolls up to read history without jarring forced auto-scroll, with floating ↓ New messages return button.
Antigravity multi-account automatic 429 failover — Automatically rotates to the next available account in antigravity-accounts.json when encountering 429 Rate Limit / Quota Exceeded errors, seamlessly continuing active turns with zero manual intervention.
Added /antigravity.accounts rotate slash command to manually cycle to the next linked Google account.
Changed
Enforced strict release tagging rule in CLAUDE.md: every release strictly increments SemVer tag without force-pushing over existing tags.
Release v0.2.3 of pig. Install via composer global require pigagent/pig:0.2.3 or view on GitHub.
New Features
Workerman-inspired protocol decoupling and RFC 6455 pure PHP WebSocket engine — Decoupled network I/O from wire protocols with ProtocolInterface (input, decode, encode). Implemented pure PHP Websocket protocol supporting handshake, masking/unmasking, ping/pong keepalive, and full-duplex RPC streaming for Web UI (--mode web & /web).
Built-in Web UI mode (--mode web & /web) — 1:1 pixel-level TUI replica matching pi-web with two-level workspace directory and session drawer, telemetry status, thinking blocks, and tool execution views.
Pure PHP web search extension (extensions/pig-web-search/) — Added standalone, zero-dependency web search extension providing web_search (DuckDuckGo HTML scraping), fetch_web_page (clean documentation text extraction), and /search slash command. Keeps core tools 1:1 pure with upstream pi while enabling real-time web retrieval.
Added
1:1 aligned 3-level cascading selectors in Web UI ([provider ˅] ➔ [model ˅] ➔ [thinking ˅]), dynamically fetching authorized models and constraining thinking levels per model.
1:1 aligned Web UI event dispatch with TUI: added streaming tool execution updates (ToolExecutionUpdateEvent), retry countdowns (RetryStartEvent & RetryEndEvent), and compaction alerts (AutoCompactionStartEvent & AutoCompactionEndEvent) with real-time console scrolling and top notification banners.
Render standalone tool execution cards in Web UI matching pi-web: display $ command headers and terminal console boxes for bash commands, and git-style unified diffs (+ green, - red) for edit operations.
Added multimodal image support to Web UI: clipboard paste (Ctrl+V / Cmd+V), drag-and-drop, attachment button (📎), thumbnail preview with deletion, and rendering of sent images.
Added two-level workspace browser and per-directory session navigation in Web UI matching pi-web, allowing users to explore all projects with session histories and switch sessions across workspaces.
Added pure PHP RFC 6455 WebSocket protocol (Pig\CodingAgent\Web\Protocols\Websocket) and HTTP/1.1 framing protocol (Pig\CodingAgent\Web\Protocols\Http).
Added adorable pig mascot icon (Pig\CodingAgent\Interactive\PigLogo) to startup banner, matching upstream pi's 4-cell half-block header icon with a custom pink piglet.
Changed
Switching models and thinking levels in Web UI now exclusively affects the active session without overwriting global settings.json defaults, matching upstream pi behavior.
Decoupled thinking level from model switching in Web UI: user thinking preference (e.g. medium / high) is preserved across reasoning models and never reset to off.
Web UI communication upgraded to full-duplex WebSocket RPC streaming with automatic SSE/HTTP fallback.
Aligned mid-run prompt behavior with upstream pi: submitting via Enter while the agent is streaming now steers immediately ($session->steer()) instead of waiting in the follow-up queue until the entire turn finishes.
Fixed
Supported Anthropic Adaptive Thinking protocol for new Claude models (Fable 5, Fable 5.1, Opus 4.7+, Sonnet 5): sending thinking.type=adaptive and output_config.effort to prevent HTTP 400 rejection ("thinking.type.enabled" is not supported for this model).
Fixed Web UI model switching failure caused by passing raw model ID string instead of Pig\Ai\Model instance, and added userIsInteracting lock to eliminate state revert race conditions.
Fixed error hiding in Web UI: broadcast agent_end error state and serialize errorMessage in session history, rendering prominent red error blocks instead of silently failing.
Fixed fatal Allowed memory size of 134217728 bytes exhausted in SessionManager::describe() when reading 10MB+ session files by replacing file() with O(1) memory streaming (fopen/fgets), reducing peak memory consumption by over 93%.
Aligned escape abort message with upstream pi from Aborted to Operation aborted.
Release v0.2.2 of pig. Install via composer global require pigagent/pig:0.2.2 or view on GitHub.
Added
Added CJK break support in TextWrap::tokenize(), matching upstream pi's cjkBreakRegex to naturally wrap Chinese, Japanese, and Korean glyphs without forcibly severing subsequent English words mid-token.
Changed
Standardized extensions on pure PHP (extensions/pig-antigravity), eliminating all npm package, npm registry, and Node.js dependencies to preserve pig's zero-dependency core.
Optimized Width::visible() LRU cache eviction using unset(self::$cache[array_key_first(self::$cache)]) instead of O(N) array_shift, delivering a 5x speedup and expanding cache capacity to 2048.
Optimized Editor layout by caching visual line calculations per frame, eliminating 2-3 duplicate Graphemes::split regular expression passes per keystroke.
Added bypass in Markdown.php to skip wrapping and padding inline image protocol lines (Kitty / iTerm2), avoiding unnecessary parsing overhead on large base64 payloads.
Fixed
Fixed ExtensionLoader duplicate extension warning by deduplicating extensions by name, ensuring project-level extensions cleanly override global ones.
Fixed Chars::isPunctuation() misclassifying multibyte CJK punctuation as word characters, resolving the bug where Ctrl+W / Alt+Backspace deleted entire sentences across Chinese commas and periods.
Release v0.2.1 of pig. Install via composer global require pigagent/pig:0.2.1 or view on GitHub.
New Features
One-command self-update (pig update) — Built-in CLI updater matching upstream pi's pi update to upgrade pig via Composer global update or git pull, plus --models to refresh model catalogs.
Native pig-antigravity extension — Ported pure PHP implementation of the Antigravity extension (extensions/pig-antigravity), eliminating all Node.js and npm package dependencies.
Added
Added session display name to the footer top line (pwd (branch) • ), matching upstream pi's layout and accommodating telemetry extensions like smart-session.
Added SessionInfoEntry (session_info entry type) for persisting custom and auto-summarized session titles in .jsonl files and displaying them in /resume.
Added /name slash command to view or update the current session name on the fly.
Added message_start, message_update, message_end, session_info_changed, and agent_settled hook events to HookApi::EVENTS.
Added $ctx->complete($prompt) and $ctx->apiKey($model) to HookContext for background extensions to execute LLM completions using active session credentials.
Added AgentSession::onSessionNameChanged() to immediately trigger TUI footer re-renders when a session name is updated.
Changed
Aligned update available notification in InteractiveMode::sayNewVersion() with upstream pi, recommending pig update and pointing to the changelog URL.
Updated FooterComponent::where() to append • {$sessionName} beside the git branch, with responsive column-aware truncation.
Fixed
Fixed Antigravity token refresh failure in long-running sessions by automatically falling back to official desktop client credentials.
Fixed silent turn failures where unstreamed error responses (e.g. 400 Bad Request or token renewal errors) exited quietly without showing error text, ensuring Error: is explicitly rendered in red.
Fixed copy extension (/cc) missing code blocks indented inside Markdown lists by updating regex and adding automatic indentation stripping (dedent).
Fixed smart-session real-time token speed meter and auto-naming failure caused by checking non-existent $message->role property instead of instanceof AssistantMessage.
Fixed background title summarization token truncation on reasoning models (e.g. Gemini 3.8 Flash) by raising completion budget to 1000 tokens.
Fixed background title summarization failures on OAuth-backed providers (e.g. Antigravity) by passing active session credentials through HookContext.
Release v0.2.0 of pig. Install via composer global require pigagent/pig:0.2.0 or view on GitHub.
New Features
Antigravity provider & dynamic model routing — Native support for the Antigravity subscription provider (antigravity), featuring multi-tier model routing (gemini-3.8-flash + thinking level to runtime model to endpoint enum), OAuth token support via auth.json, and dynamic thinking budgets.
Extension system (Pig\CodingAgent\Extensions) — Unified extension mechanism porting upstream pi's extension architecture, enabling extensions to bundle slash commands, tools, event hooks, and message renderers in a single directory or file.
Added /reload slash command to live-reload extensions, skills, custom commands, tools, settings, and context files without restarting the agent.
Added /thinking slash command to view or switch reasoning levels on models supporting thinking budgets.
Added /hotkeys slash command to display global and inline editing hotkeys aligned with upstream pi.
Added --session CLI option to resume or create a named session directly from the command line, and print resume instructions on interactive exit.
Added HookState container to HookContext ($ctx->get(), $ctx->set(), $ctx->has()) for sharing middleware state across handlers.
Added AST validation (PhpToken::tokenize) in HookLoader and ExtensionLoader to block top-level function and class declarations that would crash on reload.
Added prompt cache hit rate indicator (CH: %) in the TUI footer to monitor prompt caching.
Added loaded custom tools to the startup banner alongside [Context], [Skills], and [Extensions].
Added interactive fuzzy filtering to SelectList components, allowing keyboard typing to filter model and session selectors.
Changed
Changed TUI differential rendering in Tui::changedLines() to update only lines that actually changed, avoiding erasing down to the bottom of the frame on spinner ticks and reducing update bytes from ~1885 to ~95 bytes/tick.
Optimized BashOutputComponent with line, text, and width caching to eliminate terminal input lag after long command executions.
Optimized AssistantMessageComponent with slot-based component reuse to leverage markdown render caching during streaming.
Consolidated duplicate Fuzzy implementations into Pig\Tui\Fuzzy, standardizing on character-based matching with astral and CJK full-width support.
Retired legacy Gemini CLI provider and unified client OAuth handling under Antigravity.
Changed default provider resolution in CodingAgent to respect the stored defaultProvider, preventing Antigravity models from falling back to public Google endpoints.
Reorganized home directory structure from ~/.pig to ~/.pig/agent and separated downloaded binaries into bin/ instead of tools/.
Fixed
Fixed /quit leaving in-flight LLM streams, background bash commands, retries, and compactions running by ensuring AgentSession::dispose() aborts all background work and clears queues.
Fixed FooterComponent multi-byte truncation crashing macOS Terminal.app by replacing byte-based substr() with grapheme-aware Width::truncate().
Fixed Google Cloud Code RPC 400 errors by serializing empty quota request bodies as {} instead of [].
Fixed 403 errors on personal quota endpoints by omitting the X-Goog-User-Project header on non-project calls.
Fixed startup thinking level defaulting to off on models with a thinkingLevelMap that disallow off (e.g. Antigravity models).
Fixed image generator parameter ordering for ImageContent constructor to avoid fatal argument errors. ## 0.1.1 Nothing about how pig runs changed — no file under packages/*/src is touched. What changed is getting it onto a machine, and what the test suite can see.
install.sh, so curl -fsSL https://pigagent.dev/install.sh | sh is the one line. It runs composer global require pigagent/pig — the one way pig is distributed, so there is still a single answer to "which version am I running" — and adds the two things Composer will not do. It names every missing PHP extension at once *before* anything is installed, where a missing ext-pcntl otherwise surfaces half way through as a platform error that says nothing about what to install. And it offers to put Composer's global bin directory on your PATH, which is the step that turns a successful install into command not found. Every function is defined before the last line calls one, so a download cut off half way does nothing at all rather than half an install.
Both READMEs say how to install it, with that PATH step as a prerequisite rather than a footnote: composer global require on its own really does end in command not found, so the instructions did not work as written.
bin/pig and bin/pig-ai are executable in git. Composer sets the bit when it installs, so this one is for whoever clones the repository.
A mutation sweep over the eight files whose mistakes are not undoable — the four tools that change your files or kill your processes, the arithmetic that decides what the model is shown of them, and the three classes that write the session file pi also reads. 831 mutations, and the tests it asked for are what is in this release. Truncate had no test of its own at all; Escape arriving between the model asking for a write and the write happening was pinned in none of the tools; two write-failure checks could never have fired; a compaction's kept range was not held to ending at the compaction; and every default the session decoders apply to a field pi leaves out was untested. None of it was a behaviour change — each guard was already doing the right thing, and nothing was holding it there. ## 0.1.0 First numbered version, and the first one that can tell you there is a newer one.
A file-by-file port of pi against commit d0a4c37, with zero runtime dependencies beyond PHP itself: the agent loop, a unified LLM API over five hand-written provider protocols, a terminal UI, and the coding agent CLI.
Five providers. Anthropic, both OpenAI shapes, Gemini and Google Code Assist, plus everything that speaks an OpenAI-compatible endpoint — Groq, Cerebras, xAI, z.ai, Mistral, OpenRouter and GitHub Copilot. A model your build has never heard of is reachable by declaring it in ~/.pig/models.json.
Four ways to sign in rather than paste a key: Anthropic, GitHub Copilot, Gemini CLI and Antigravity. The credentials file is pi's own, so signing in once means signing in once.
pi's session file, field for field, in pi's directory layout — a conversation started in either tool opens in the other, --resume lists both, and pi's v1 sessions are upgraded the way pi itself would.
Four modes: a terminal UI, -p for one answer on stdout, --mode json for every event as a JSON line, and --mode rpc for a host driving it.
Hooks and custom tools, loaded from PHP files under ~/.pig/hooks and ~/.pig/tools, with the whole of pi's hook API including the dialogs a hook can open mid-turn.
A proxy that is not optional where pig was written: HTTP CONNECT and SOCKS5, with TLS starting only after the tunnel is open so the proxy carries pig's bytes and can read none of them.
Reaching a provider through a gateway instead (Agent\StreamProxy), HTML and Markdown export, compaction, retries that read the provider's own stated wait, and /tree for going back to an earlier point in the conversation and taking it somewhere else.