Skip to content

pi-python v0.5.0

Choose a tag to compare

@github-actions github-actions released this 13 Oct 07:34
· 142 commits to main since this release
be3f8a8

zypi no longer has an agent of its own. It draws the terminal screen and talks ACP to the Python agent (python -m pi_agent_cli), and that agent is now the only agent. Removed says what went with the Rust agent runtime. Known issues says what does not work yet. This release also has the Phase 6 and Phase 7 changes to the Python packages: project trust, a sandbox for workflow scripts, DeepSeek thinking with tools, and tool annotations.

Added

  • Project trust (Phase 7): a project's own extensions, saved workflows (.pi-python/workflows), .pi/SYSTEM.md, .pi/APPEND_SYSTEM.md and project-relative [skills].paths are now used only once the user has vouched for the project; before, opening a repository imported its extensions and turned its saved workflows into slash commands. [extensions] default_project_trust = "ask" (the default; or "never" / "always") has the ACP client answer a session/request_permission (Don't trust / Trust and remember; no allow_once, so a client that auto-approves tool calls cannot answer it) before anything of the project loads. The answer is saved in ~/.pi-python/agent/trust.json with a sha256: fingerprint of the files, so a git pull that changes them asks again. trusted_projects, trust_project_extensions = true, --trust-project-extensions and PI_TRUST_PROJECT_EXTENSIONS=1 also trust; headless (-p) runs never ask but honour a saved answer that still matches. Extensions read the answer as pi.project_trusted; library users pass AgentHarness(trust_project_extensions=True). Behaviour change: ACP sessions in such projects now ask (default_project_trust = "never" keeps the old silent skip). Not covered: a client may auto-approve the request, files changed after the session started are not re-checked, and AGENTS.md / CLAUDE.md are not gated (as in upstream pi). Design: Phase 7 spec, sections 4.4 and 16.
  • Workflow scripts run in a process of their own, under limits the operating system enforces (Phase 7): scripts used to be exec'd in the host's interpreter, where the narrowed __builtins__ had two known ways out and a while True froze the host's event loop. Each WorkflowRuntime.execute() now starts a child process with an empty environment; the host does everything with an effect (sub-agents, journal, logs, budget) over a JSON-lines pipe and treats the child as hostile. The kernel limits the child (rlimits on POSIX, plus no_new_privs and no fork on Linux; a Job Object and a lowered integrity level on Windows), and WorkflowRuntime(sandbox_limits=SandboxLimits(...)) sets them (an optional wall-clock deadline among them). What this is not: the audit hook is a speed bump, and what the kernel still allows differs per platform (a script can still read the files the user can read and use the network), so run the agent in a container if scripts cannot be trusted. Behaviour changes: values cross the process boundary as JSON, budget in a script is read-only, a run costs a process start (about 0.06 s on Linux, 0.14 s on Windows), Windows needs the default event loop, and execute() raises WorkflowScriptError for a script that raises and a SandboxError for one that is stopped. Design: docs/specs/2026-10-01-workflow-sandbox-design.md.
  • DeepSeek thinking works together with tools (Phase 6): with thinking on, DeepSeek's own API answers 400 to a request with tools unless earlier assistant messages bring their reasoning_content back, which ChatDeepSeek leaves out. The adapter now keeps it and sends it back on every assistant message (adapters/deepseek_replay.py), and it states whether to think (thinking: enabled | disabled, reasoning_effort) instead of leaving it to the API's default (on). Both apply to DeepSeek's own API only (no base_url, or one on deepseek.com), not to gateways serving DeepSeek models. Behaviour change: with the default thinking_level="off", requests now send thinking: disabled; code that relied on the old default to get reasoning blocks must set Model.reasoning=True and a thinking_level. Not verified against the live API (no key). Spec: Phase 6, section 5.5.
  • [model] reasoning in agent.toml (Phase 6): whether the configured model can reason (Model.reasoning); unset, any thinking_level other than off says it can. This is what makes thinking_level take effect through the CLI, which built every model with reasoning=False (the level was dropped on OpenAI and Anthropic). A model that rejects reasoning parameters needs reasoning = false.
  • Tools can declare what they do: ToolAnnotations (Phase 7): MCP's four hints (readOnlyHint, destructiveHint, idempotentHint, openWorldHint; a tool that declares nothing claims nothing). SimpleTool, CodingTool and ToolDefinition take annotations=, from_langchain_tool reads them from tool.metadata, and tool_call hooks receive them as ToolCallEvent.annotations. Built in, read, grep, find, ls, web_search and fetch_url declare themselves read-only, goal_update and goal_complete neither destructive nor open-world, and bash, edit, write and workflow declare nothing, on purpose. The hints are the tool author's word and are not verified; ask mode uses them (see Changed). Design: Phase 7 spec, section 12.
  • The TUI keeps the agent's stderr: zypi points its own stderr at /dev/null and the agent inherited it, so a Python traceback or warning from the agent went nowhere. It is now appended to <home>/logs/agent.stderr.log (mode 0600 on Unix, one --- agent started ... --- line per run, moved to agent.stderr.log.1 once it is over 1 MiB at the next start). zypi -p is unchanged: the agent's stderr stays on the terminal.
  • A sandbox that cannot be put in force says so (TUI): on a kernel without Landlock (Linux before 5.13, or with it disabled) zypi --sandbox <profile> used to start without the file and network limits and without a word; the only trace was an ApplyFailed line in sandbox-events.jsonl. It now prints a warning on stderr at start-up and shows sandbox:<profile> (not enforced) in the welcome page's top bar and the status bar, where the label of an applied profile is drawn. Where the sandbox is applied nothing changes.
  • session/list comes in pages (pi-agent-cli, pi-agent-harness): the agent answers with at most 50 sessions, newest first, and a nextCursor while more follow; the cursor is opaque, carries the position in it (the agent keeps nothing between requests, so it survives a restart) and anything the agent did not issue is invalid_params. The TUI keeps asking until the cursor is gone, so its session picker still lists everything. For library users JsonlSessionRepo.list_page(...) returns one page and JsonlSessionRepo.find(id) reads one session's header instead of the directory. With 1,000 sessions of 120 entries on Windows, the first answer took 2.0 s and a session/load of one of them 2.0 s; reading a file's first line no longer reads the file and a lookup by id no longer lists the directory, which makes them 0.11 s and 0.12 s (scripts/session_list_bench.py; numbers and method in docs/PLAN/archive/PLAN-RUST-AGENT-RUNTIME-REMOVAL-EXECUTION-LOG.md §10.11). updated_at is still the file's mtime and need not follow the list's order, which is by creation time.
  • The agent says which MCP servers a session ignored (pi-agent-cli): the agent connects to no MCP server (a Phase 4 non-goal), which departs from ACP's "an agent MUST support stdio servers"; session/new, load and resume used to drop the list without a word. Each session set up with a non-empty list now logs a warning and sends one agent message naming the servers (names only: env, headers, args and url hold tokens). zypi no longer forwards what it finds in .mcp.json, ~/.claude.json and Cursor's mcp.json, so there the message never shows; it is for other ACP clients, an editor that passes its own servers, say.
  • A client can choose the id of a new session, and the agent says which directory a session works in (pi-agent-cli, pi-agent-harness): zypi --session-id <uuid> has always sent the id in session/new's _meta.sessionId; the agent ignored it and picked its own, so the flag did nothing on the Python agent. It now becomes the session's id. It must be a UUID in any form uuid.UUID reads (kept as lower case with hyphens); anything else is invalid_params, because the id ends up in a file name. An id some session already has is refused with invalid_params, whatever directory that session belongs to, and two requests for the same id at once make one session. session/new, load and resume answer with _meta["pi/cwd"], the directory the session works in; for load and resume the one saved with the session wins over the cwd the client sent. For library users JsonlSessionRepo.has_session(id) says whether an id is taken and opens only the files whose names do not already say they belong to another session (find reads every header for an id nobody has). A free id costs the directory listing: 0.07 s at 1,000 sessions, 0.3 s at 5,000, on Windows and WSL2 alike (scripts/session_list_bench.py). Not yet in the TUI: zypi still checks for a used id in the old session layout, so it never sees the Python agent's sessions; the agent refuses the id and the TUI shows Session creation failed: Invalid params: {...} instead of exiting 1 with a message (scripts/tui_pty/resume_matrix.py, case 11), and nothing reads pi/cwd yet (execution log section 10.11, ADR1 PR 2).
  • A call graph of the TUI workspace (scripts/tui_callgraph.py): it reads the Rust source as text, so it needs no cargo and no network, and it gives the same answer on Windows, Linux and macOS. crates shows the dependency closure of the product crates (78 crates in the workspace, 74 in the closure; --without pi-shell shows what only pi-shell keeps alive). units shows, for one or more crates, the modules that no live code refers to; --ban asks what dies if a module goes. keep writes docs/baselines/tui-support.md, which replaces the hand-written list of examples of what the support crates keep. It says: 305,581 lines of non-test code in the 7 support crates, and 17 modules (6,190 lines, 4,339 of them in pi-hooks) that no live code refers to. A module on that list is a candidate for deletion, not proof, so the list was checked with the compiler. In a copy of tui/, 16 of the 17 modules were deleted, and cargo check passed (also cargo check --workspace --tests, after the test file of the removed pi-hooks modules went too). The 17th, types::error in pi-tools, cannot go: it holds the impl From<…> for ToolError that ? calls, and no path names it. The tool marks such modules "check first". The first version listed 21 modules and 4 of them were live: it did not see a path inside an attribute string (serde(with = "crate::util::serde_base64")) or a path that starts at a child module. Both are fixed. 39 tests; each of 17 changes made to the tool makes a test fail. Nothing was deleted from tui/ (plan item D.8; execution log section 10.14).
  • A check that tui/THIRD-PARTY-NOTICES matches the dependencies (scripts/tui_notices.py): the file came from the upstream project and did not follow Cargo.lock. check finds the packages that ship in zypi (the normal and build dependencies of pi-pager-bin, for five target triples, from crates.io, git or tui/third_party/) and exits 1 if an entry is missing or stale. update --write fixes the file: it removes stale entries, adds missing ones and leaves the hand-written parts and the license texts alone. The license wording of a new entry is copied from the entries with the same SPDX expression; a package with no such entry is listed as needs review. First run: 222 stale entries removed (packages that are not in the binary) and 44 missing entries added, so there are 989 entries for 989 packages, and the file went from 18,898 to 16,548 lines. None of the 44 needed review. This matches the file to Cargo.lock. It is not a legal review: nobody has read the copied wording one entry at a time. check needs cargo. 62 tests.
  • A network audit of zypi (scripts/tui_pty/net_audit.py, Linux): it runs zypi in a pseudo-terminal, plays one turn, and reads the sockets of zypi and of every process below it about every 9 ms (/proc/<pid>/fd joined with /proc/<pid>/net/{tcp,tcp6,udp,udp6}). zypi must hold no connection to a non-loopback address and must listen on none. With the real model, the agent must hold such a connection (the positive control: it shows that the sampler can see a connection). Result: 13 of 13 checks with the mock LLM; 13 of 13 with the whole process tree in an empty network namespace (--no-network, bwrap --unshare-net), and the turn still ends normally; 13 of 13 for one turn with the real model of the machine. The output names no host, address or key, and the key goes to the agent through an environment variable only. A connection that opens and closes between two samples is not seen.
  • A probe for the status line (scripts/tui_pty/status_line_probe.py, status_proxy_agent.py, Linux): it starts zypi on a pseudo-terminal and looks at the row of [ui.status_line] (type = "command" or "builtin"). When it was written, it showed that nothing was drawn with the Python agent and that the command script was not run, because the row came from a session_status notification that only the old Rust agent sent (4 of 4 runs). status_proxy_agent.py runs the real agent and adds that one notification after each turn, as a stand-in for an agent that sends a status. The row is drawn now (see Changed), and the probe checks that: the row is on the screen, and a script gets the facts and no invented number.
  • /model works through ACP session config options (pi-agent-cli, TUI): the agent answers session/new, load and resume with configOptions, one select option with the id model. [model] in agent.toml is the first choice, and each [[models]] table adds one more (agent.example.toml has an example). The client changes the model with session/set_config_option. The choice goes into the session as a model_change entry, and load and resume bring it back. zypi reads the choices from configOptions, and uses session/set_model only for an agent that publishes none.
  • A prebuilt zypi for macOS on Apple silicon (TUI): the release has zypi-macos-arm64 next to zypi-linux-x86_64. The release workflow builds it on a macos-14 runner. It is not signed with a Developer ID and it is not notarized, and nobody has started this build yet: CI only builds it (see Known issues). If macOS refuses to open a file that a browser downloaded, remove the quarantine flag with xattr -d com.apple.quarantine <file>. The install steps are in docs/TUI-AND-CODE-AGENT.md.

Fixed

  • A saved workflow whose meta description was not text made every session/prompt fail (pi-dynamic-workflows, Phase 7): the value reached the command list unchecked, AvailableCommand refused it, and the list is re-sent with every prompt until a send succeeds. Now WorkflowStore drops a non-string description / when_to_use, ExtensionAPI.register_command raises TypeError for one (that extension is rolled back like any failed one), and PiAcpAgent leaves out a command the schema rejects, with a warning, and sends the rest.
  • The pi home was resolved differently in different places (Phase 7): only the CLI honoured PI_HOME, and PiAcpAgent(home=) / run_print(home=) did not hand their home on, so a session could read its config from one directory and its extensions, saved workflows and journals from another. One resolver, pi_agent_core.home.pi_home (argument, $PI_HOME, ~/.pi-python), now serves the CLI, ExtensionLoader, AgentHarness(home=), ExtensionAPI.home (pi.home), WorkflowStore(pi_home=) and create_workflow_tool(home=). With the working directory set to the home directory, ~/.pi-python/extensions is no longer imported twice.
  • <git_status> (Phase 6): git's output was decoded with the locale codec, so on non-UTF-8 locales (cp936 on Chinese Windows) a branch such as 功 failed the turn; git now runs with encoding="utf-8", errors="replace" and core.quotePath=false, and any failure omits the section instead. A repository with no commit yet lost the section; it now shows Branch: main (no commits yet). The snapshot ran up to three git processes on the event loop; it is now built in a worker thread, and [git] timeout_seconds is one budget for the whole snapshot.
  • tool_call hooks can no longer overturn a denial: an extension registered after the permission layer could un-deny a call by returning {} or {"block": False} (the last non-None verdict won). Dispatch now stops at the first blocking verdict, like upstream pi's emitToolCall.
  • Extension tools in the system prompt: prompt_snippet / prompt_guidelines of extension-registered tools (workflow, goal_update, web_search, ...) were never rendered by the CLI. pi-goal-x's guidelines were reworded to hold when no goal is active.
  • Sub-agent model routing and credentials (pi-dynamic-workflows): a tier resolved to an Anthropic model whatever the parent ran on, and the one configured API key was handed to every provider (a DeepSeek session sent its key to Anthropic). resolve_tier(tier, tiers=None, *, provider=None) now uses per-provider defaults (DEFAULT_MODEL_TIERS_BY_PROVIDER, anthropic only; DEFAULT_MODEL_TIERS is removed), so under another parent provider a tier inherits the parent model. make_get_api_key(config) returns the key only for config.provider (export the other provider's own variable, e.g. ANTHROPIC_API_KEY, when a workflow routes there), and a sub-agent model keeps the parent's base_url only on the parent's provider.
  • workflow sub-agents ran bash / edit / write without asking (pi-dynamic-workflows): the permission layer is a tool_call hook on the session's harness, which the sub-agents' fresh harnesses did not have, so in ask mode a script could write files and run commands unprompted (and workflow itself was not gated). workflow is now permission-gated and every sub-agent tool call goes through the parent session's tool_call chain (AgentHarness.check_tool_call, exposed to extensions as HarnessBridge.tool_call_gate; fail-closed), with ToolCallEvent.origin telling the prompt where the call comes from.
  • Two extensions defined in one module replaced each other (Phase 7): an extension's name was activate.__module__. A module-level activate is still named after its module; any other callable is now module.qualname, and AgentHarness.load_extension(activate, *, name=None) takes an explicit name. Loading under a taken name still replaces, but warns when the replacement is a different callable.
  • A failing extension vanished without a trace the user could see (Phase 7): import errors, an entry point that resolves to nothing and an activate() that raises are now recorded (ExtensionLoader.failed, AgentHarness.failed_extensions) and reported by the CLI (an ACP agent message after session/new; headless stderr).
  • An invalid tool name broke every later request (Phase 7): providers accept only [a-zA-Z0-9_-]{1,128} and reject the whole request otherwise. register_tool now refuses other names and rolls that extension back.
  • workflow ran against canned answers when sub-agents could not be built (pi-dynamic-workflows): the extension quietly fell back to MockSubagentExecutor, so a script "completed" with fake results. It now registers UnavailableSubagentExecutor(reason), and the tool answers "The workflow tool cannot run in this session: sub-agents are unavailable ()."
  • Workflow run ids and saved-workflow names accepted a trailing newline; a non-dict meta broke the directory scan (pi-dynamic-workflows): both patterns ended in $ and are now matched with fullmatch; meta = 5 in one saved script no longer raises out of the whole scan.
  • resume_from_run_id replayed nothing after a parallel run, and recorded failures as answers (pi-dynamic-workflows): the journal matched calls by position, but parallel() records in completion order, and a failed agent() was written as a successful None. The journal is now a request-keyed cache: a call gets the earliest recorded answer to the same request that this run has not used yet, and a failure is not recorded, so a resume retries it.
  • Cancelling a foreground workflow did not stop it (pi-dynamic-workflows): the tool never looked at the abort signal, so the remaining sub-agents kept spending tokens and editing files. The run is now raced against the signal: on abort it is cancelled (up to 10 s to unwind), its worktrees are removed, and the tool answers "cancelled" with the run_id and how to resume. Background runs are deliberately not tied to the turn that launched them.
  • Sub-agent worktrees lost new files, corrupted non-UTF-8 files and leaked (pi-dynamic-workflows): the patch came from git diff HEAD (no untracked files) and was decoded as text (an edit to a GBK file failed with patch does not apply); a worktree also leaked when its sub-agent failed early, timed out or was cancelled. The patch is now git add -A + git diff --binary --cached HEAD, kept as bytes, and every path removes its worktree.
  • Closing a session left its work running, and a background workflow's result woke the dead session (Phase 7): AgentHarness.close() now aborts the turn in flight, runs every cleanup callback (a failing one no longer stops the others) and stops the turns it started for extensions; afterwards prompt() raises AgentHarnessError("invalid_state"). WorkflowManager.close() cancels background runs and delivers nothing afterwards. ACP session/close and pi/session/delete (which did not call it) both go through close().
  • A background workflow's output entered the conversation as if the user had typed it (Phase 7): the result (text from sub-agents that may have read untrusted files or pages) was injected as a user message and would have run as a slash command had it started with /. It is now delivered with the new HarnessBridge.trigger_message(custom_type, text, *, details=None) as a typed workflow-result message (never slash-dispatched) inside a <workflow-output boundary=...> envelope that declares it untrusted data. That is a convention the model may or may not honour, not isolation.
  • fetch_url fetched anything it was pointed at, without limits (pi-web-access, Phase 7): the model chooses the URL, yet the tool followed redirects to any address (the cloud metadata service, localhost), read whole responses into memory, and crashed on its own truncation notice, so a page over 50 KB came back as Failed to fetch .... Now only http(s) URLs on the public internet are fetched: private, loopback, link-local and reserved addresses, localhost, *.local, *.internal, single-label names and URLs with credentials are refused however they are spelled, and so are redirects to them (at most 5 are followed), with Refusing to fetch ...: ... and no request. Without a proxy the name is resolved once and the checked address used; through a proxy only literal addresses can be checked. The body is cut at 5 MiB and a call takes at most 30 s. Migration: to read a service on this machine or the intranet, use a tool the user authorises for it (bash with curl, say). Details: Phase 7 spec, section 5.3.
  • pi-goal-x: a finished goal came back unfinished, a wrong step index invented a step, and a reminder repeated without end (Phase 7): the goal is now saved whenever it changes, so a resumed session no longer reactivates a finished goal; update_step with an index that names no step raises ValueError naming the steps that exist (it appended an Unnamed step), and the status lists steps as [0], [1] to match the 0-based step_index; the reminder to call goal_complete is sent at most twice. API: create_goal_update_tool / create_goal_complete_tool take an optional on_change callback, GoalState gains reminders_sent, and the turn_end hook no longer saves the goal.
  • Provider matrix and live tests (Phase 6): the deepseek row used deepseek-chat, a non-thinking alias DeepSeek retired on 2026-07-24; it now uses deepseek-v4-flash (MATRIX_DEEPSEEK_MODEL still overrides). real_llm tests were meant to be deselected by default but only skipped when their key was unset, so an exported OPENAI_API_KEY made a plain pytest pay for API calls; pyproject.toml now sets addopts = "-m 'not real_llm'" (run them with pytest -m real_llm ...). The provider-matrix workflow also runs weekly.
  • A prompt sent while a workflow result was being worked on failed with busy (Phase 7): the result of a background workflow starts an LLM turn with no session/prompt behind it, so the client could not know the session was occupied. session/prompt now waits for that turn and then runs (session/cancel or closing the session ends the wait); a second session/prompt from the same client while one is in flight is still busy. ACP's state_update is deliberately not sent: it exists only in the unstable protocol v2 draft, which neither the Python SDK nor the TUI's Rust crate can read. Spec: Phase 7, section 13.
  • zypi told the user nothing when the agent failed to start or died: a missing agent program surfaced as channel closed ... recv_failed, and an agent that exited as soon as it started (a Python without pi_agent_cli, say) left connect waiting forever; an agent that died in the middle of a turn left the requests in flight waiting too. The stdio bridge now notices the exit and says what happened: the program, its exit status and the last lines the agent wrote to agent.stderr.log (failed to spawn ACP agent ... PI_AGENT_COMMAND for a program that is not there). zypi's exit status is unchanged. Found by the new end-to-end suite that runs the pager's ACP client against the real agent (tui/crates/codegen/pi-pager/tests/python_agent_e2e.rs; TUI CI installs the agent for it).
  • zypi -p left the agent and its tools running when only zypi was killed: kill <pid>, kill -9, timeout or an IDE's stop button reached zypi but not the agent, which kept running (and kept running its bash call) on the user's terminal. zypi now passes its pid in PI_AGENT_PARENT_PID; python -m pi_agent_cli -p watches its parent and stops the way it stops on a signal (turn cancelled, tools reaped), and -p now handles SIGTERM and SIGHUP too (exit status 128 + the signal number). POSIX only; the variable is removed from the environment at start-up, so tools do not inherit it, and it is ignored when it names a live process that is not the agent's parent (a wrapper script).
  • zypi --sandbox ... on Linux left the whole process tree running when only the outer bwrap was killed: the sandbox re-launches zypi under bwrap, which by default just waits for its child, so signalling the process the shell started (kill $!, a supervisor) left zypi, the agent and its tools on the terminal. bwrap now runs with --die-with-parent. Trade-off: a SIGTERM or SIGHUP sent to that outer bwrap now reaches zypi as SIGKILL, so the terminal is not restored (alternate screen, raw mode); before, the tree kept running instead.
  • Messages in zypi that pointed at files that do not exist: five messages (four from the MCP config code, one from the sandbox glob code) ended with See ~/.grok/docs/user-guide/<page>.md, a path that zypi never uses; the help of zypi wrap ended with See ~/.pi-python/README.md for more information., and there is no such README; and the footer of the document picker named the folder where zypi used to write the pages. The pointers are gone.
  • Quitting zypi while the agent ran a tool left the tool running (TUI, pi-agent-cli): zypi killed the agent with SIGKILL at once, so the agent could not stop the process group of a running bash call (after a double Ctrl+Q, a sleep 300 kept running). zypi now closes the agent's stdin, waits up to 3 s for the agent to exit, and kills it only after that. The agent treats SIGTERM and SIGHUP like the end of its input: it cancels the turn and stops its tools. A second signal takes the default action, so an agent that hangs while it stops can still be killed. This also covers kill -9 on zypi, where the kernel sends SIGHUP to the foreground process group. In a pseudo-terminal on Linux and on macOS, a double Ctrl+Q, kill -9, kill -TERM, closing the terminal and Ctrl+C left no tool process. Windows has no such test.
  • session/close and session/resume answered "Method not found" (pi-agent-cli): initialize announced both methods, but the ACP SDK serves them only when the agent starts with use_unstable_protocol=True, and it did not. zypi never called them, so only the new stdio contract tests found it. The agent now sets the flag.
  • session/list gave no useful title and a wrong time (pi-agent-cli): the title of each session was its creation time and a short id, and updated_at was the creation time. The title is now the first user message (white space collapsed, 100 characters at most; (no messages) when there is none), and updated_at is the time the session file was last written. So the /resume picker shows readable titles.
  • The project's AGENTS.md went into the prompt twice on a case-insensitive file system (pi-agent-cli): the agent looks for AGENTS.md and AGENTS.MD (and CLAUDE.md and CLAUDE.MD). On macOS both names find one file, and the check for duplicates compared path strings, so it did not see that. The agent now compares the file itself (device and inode), so a hard link counts as the same file. The error was there since Phase 5 (v0.3.0).
  • zypi doctor fix ssh-wrap wrote an alias for a command that does not exist (TUI): the block in the shell's rc file said alias ssh='grok wrap ssh', so after the fix every ssh call failed. It now writes alias ssh='zypi wrap ssh', and the block marker is # >>> zypi doctor >>>. Migration: the new version does not know the old block. If you ran the fix before, delete the old block from the rc file by hand.
  • Messages in zypi named a directory and commands that do not exist (TUI): they said ~/.grok and $GROK_HOME where the real names are ~/.pi-python and $PI_HOME. They told the user to run the slash commands /doctor, /minimal, /fullscreen and /copy, and the commands grok wrap and grok worktree gc|rm, and none of these exists. They now name zypi doctor, zypi wrap ssh <host>, zypi --minimal, zypi --fullscreen and the real directory.
  • zypi export <id> works with the Python agent (TUI): it read the session files of the old Rust agent, so it answered Session '<id>' not found. for every session that the Python agent stored. It now asks the agent, as a resume does: it starts the agent, sends session/load, collects the session/update messages that the agent replays, and writes the Markdown transcript as before (to stdout, to a file, or to the clipboard; plan decision 6, option (a)). The agent is stopped when the command ends, also when the command fails. The command does not stop at the answer to session/load, because the last replayed messages can arrive after it: it waits until no replayed message has come for 500 ms. An agent that says nothing for 60 s is an error (it said nothing for 60 s), and a permission request from the agent is refused. A session that was compacted exports from the compaction on, as a resume shows it. The session file is not changed. Time, on a debug build in WSL2: 2,000 entries (1.4 MB) 2.5 s, 5,000 entries (3.6 MB) 5.7 s, 20,000 entries (14.2 MB) 63 s. The agent alone needs 0.24 s, 0.53 s and 2.5 s for the same sessions, so the rest is zypi turning the messages into text, and that time grows faster than the size. Tests: 18 unit tests, 1 end-to-end test against the real agent, and scripts/tui_pty/resume_matrix.py cases 12 and 13, which now also check that no process is left behind.

Changed

  • agent(..., cwd=) is limited to the project (Phase 7): a workflow script could point a sub-agent at any directory; the permission prompt showed it, nothing stopped it. The directory must now be inside the project (WorkflowRuntime.cwd; relative paths are read against it, symbolic links and junctions resolved first): a path outside is a ValueError the script can catch, a non-string a TypeError. HarnessSubagentExecutor checks again before creating a worktree. Migration: a script that used cwd to leave the project has to be rewritten. Design: docs/specs/2026-10-01-workflow-sandbox-design.md, section 8.1.
  • ask mode asks about every tool call unless the tool declares itself harmless (Phase 7): the permission layer used a fixed set of names (PERMISSION_TOOLS), so every other tool, in particular every tool an extension registers, ran without a question. It now asks by default and lets a call through only when the tool's annotations say readOnlyHint is true, or that it is neither destructive nor open-world (undeclared or malformed hints mean "ask", as in MCP); needs_permission(mode, annotations) replaces needs_permission(mode, tool_name), and auto / always-approve are unchanged. Behaviour change: an extension tool that declares nothing now interrupts the user in ask mode; the tools shipped here declare themselves, so read, grep, find, ls, web_search, fetch_url and the goal_* tools still run unasked while bash, edit, write and workflow ask. Migration: an extension tool that only reads should pass annotations=; agent.toml has no per-tool allow-list, so a tool that declares nothing runs unasked only under permission = "auto". Not covered: the hints are not verified, and a caller who connects MCP servers it does not trust must remove their annotations before from_langchain_tool. Design: Phase 7 spec, section 12.
  • Bridge and lifecycle API (Phase 7): HarnessBridge is a runtime-checkable protocol and gains trigger_message and project_trusted, so a custom bridge (a test double, say) must add both. AgentHarness gains closed (close() is idempotent); WorkflowManager gains close(timeout=5); Journal.truncate_from is removed; WorktreeManager.collect_diff() returns bytes (it returned str).
  • Extension packages declare what they use (Phase 7): pi-web-access-py, pi-goal-x-py and pi-dynamic-workflows-py required pi-agent-core-lc>=0.3.0, which has no pi_agent_core.extensions; the floor is now >=0.5.0, and pi-dynamic-workflows-py also declares pi-agent-harness-lc. test_extension_packaging.py checks that declarations and floors follow the checkout. Release note: these extensions use APIs newer than 0.4.0 and must not be installed against an older core, so the core, pi-agent-harness-lc and pi-agent-cli-lc are 0.5.0 and the three extension packages go from 0.1.0 to 0.2.0 (the publish step skips versions that already exist on PyPI).
  • <git_status> is labelled as a session-start snapshot, and its privacy cost is documented (Phase 6): the block now opens with "Snapshot taken at the start of this session; it is not refreshed as files change. Run git status for the current state." (the 0.4.0 note "on every turn" was inaccurate: the harness caches the system prompt for the session). The block, with the branch name and the paths of changed and untracked files, goes to the model provider with every request; the README, agent.example.toml and the Phase 6 spec say so and how to turn it off ([git] enabled = false, --no-git-context). The default stays on.
  • zypi offers only the permission modes the agent honours (TUI): the agent asks about tool calls or approves them all, and nothing in between, but the TUI still offered Plan, Auto, a settings "Default" and six --permission-mode values, none of which did what it said. Plan restricted nothing (the agent has no session/set_mode handler, so the call failed unseen while the screen said plan); Auto never asked, because the agent treats auto like always-approve while the screen promised a classifier; the settings' Default is a value the agent drops, so after Always-Approve it said Default and the agent still never asked; and of the six --permission-mode values only bypassPermissions did anything, the other five behaved exactly like no flag (acceptEdits accepted no edits, dontAsk asked all the same). Now Shift+Tab toggles Normal and Always-Approve; the plan_mode setting, the plan-mode tip, and the Default and Auto choices of permission_mode are gone from the settings page; and --permission-mode takes default (no flag) and bypassPermissions (--always-approve) only. Behaviour change: --permission-mode plan, auto, acceptEdits and dontAsk now fail at start-up with exit status 2 and a message naming the value and the values that work (they used to start a normal, asking session); a saved permission_mode of auto or default is shown as Ask and the file is left alone; --permission-mode used in a script needs default or bypassPermissions. The code behind the hidden modes stays, behind three constants in app/agent_modes.rs; flip one when the agent honours that mode. Measurements before and after: docs/PLAN/archive/PLAN-RUST-AGENT-RUNTIME-REMOVAL-EXECUTION-LOG.md sections 10.11 and 10.13 (scripts/tui_pty/mode_probe.py).
  • The user guide inside zypi has 7 pages, and zypi no longer writes it to disk at start-up (TUI): the 33 files under pi-pager/docs/ (23 user-guide pages, a README and 9 tutorial pages) were the upstream text for a different program. They named the grok command, grok agent, MCP servers, plugins, the leader process and other features that zypi no longer has. Now user-guide/ holds a README and 7 pages written against the code and agent.example.toml: getting started, slash commands, theming, sessions, terminal support, permissions and safety, status line. The tutorial overlay (views/tutorial.rs, tutorial_docs.rs) is gone: nothing opened it since the entry-point audit. zypi no longer copies the pages to <home>/docs/user-guide/ at each start (extract_user_guide_docs); copies that earlier versions wrote stay where they are. pi-pager tests go from 5,626 to 5,608: the tests of the removed pages and overlay go, and two guard tests are new (no old product name on a page; every file of the directory is in the list built into the binary). Nothing opens the document picker and viewer now, so the 7 pages have no reader until plan item D.6 is decided.
  • tui/NOTICE names the product: it said pi (pi-grok-pager-bin). Now it says zypi, says that tui/ is a hard fork that does not follow upstream, and lists the changes. The stale nfsserve entry in tui/third_party/ is gone.
  • Leftover words in the TUI sources are held by a ratchet (scripts/tui_baseline.py, [gates.residue] in scripts/tui_baseline.toml): each word has a ceiling on the number of lines under tui/crates, and the ceiling can only go down. Now: grok agent 0, leader 245, x.ai 304. The plan asked for zero. That cannot be done for leader and x.ai before phase D: the lines are the name of the removed leader process, xAI service addresses in the auth, voice and update code, and the filter that drops x.ai/* extension notifications. docs/baselines/tui.md section 4 says what each group is and where it goes. A Python test runs the same check, so the Python CI job catches a rise too. All 28 lines with grok agent are gone: 15 were in user-guide pages and 13 in doc comments, a label and two READMEs (pi-shell/README.md was the upstream user manual, 2,682 lines; it is now a 43-line note on what the crate is).
  • What zypi does with config.toml is written down (packages/pi-agent-cli/AGENTS.md, docs/WINDOWS.md, docs/TUI-AND-CODE-AGENT.md): the old text said that Python-only keys break TUI parsing. Measured: zypi is strict about the keys it knows and ignores the keys it does not know. A missing file, an unknown table or key and a Python [model] table start normally. A top-level permission = "ask" (zypi expects a table there), a [[models]] array and invalid TOML stop zypi with exit status 1. The agent reads agent.toml, and falls back to config.toml only when agent.toml does not exist. TUI-AND-CODE-AGENT.md now has the real [model] keys (id, not model_id; no context_window), the permission values (ask, auto, always-approve) and the real slash commands, and says that zypi has no model client, tool runner or MCP client. docs/DESIGN.md section 8.5 states the five conditions for a new pi/ extension, and the Phase 4 spec has a revision note.
  • zypi -p refuses a sandbox it cannot apply, and names the flags it ignores (TUI): -p hands the whole run to the Python agent before zypi applies a sandbox, so v0.4.0 dropped a sandbox from --sandbox, GROK_SANDBOX or [sandbox].profile without a word. Now -p prints an error that names the profile and where it came from, and exits with status 2 without starting the agent. Where the user may change the profile, the error says that --sandbox off runs without one. A flag that -p does not pass to the agent (for example --model, --always-approve, --permission-mode, --allow, --deny or --resume) now gives warning: <flag> has no effect with -p and was ignored on stderr. Behaviour change: a script that runs zypi -p with a sandbox profile set in the environment or in config.toml now fails with status 2 until it passes --sandbox off.
  • zypi is the product name wherever the user sees a name (TUI): the themes are zypi Night and zypi Day (saved as zypinight and zypiday; the old ids and aliases still work, so config.toml needs no change). Desktop notifications, the zypi doctor title, the --minimal welcome page and other messages say zypi where they said Grok. The GROK_* environment variables, the project path .grok/sandbox.toml and the grok_home field of zypi du --json keep their names: a rename of these would break existing setups, so it needs its own decision.
  • zypi --version and the ACP agentInfo.version show the version of the release (TUI, pi-agent-cli): zypi --version printed 1.0.8, the version of the upstream project, and the agent reported 0.1.0 whatever the package was. zypi now prints 0.5.0 (the version in the Cargo.toml of pi-pager-bin and pi-version), and the agent reports the version of the installed pi-agent-cli-lc package. A test fails if those two crates or Cargo.lock differ from the version of pi-agent-cli-lc, so raise them together with the Python packages at each release. The release workflow does not set GROK_VERSION, on purpose: the same variable marks a build as a release build and turns the folder-trust prompt on, and a test fails if a workflow sets it. Behaviour change: the number is lower than before. A [[version_overrides]] patch in a config file whose minimum_version is above 0.5.0 no longer applies; none ships with zypi.
  • The status row is drawn with the Python agent (TUI): [ui.status_line] (type = "builtin" or "command") drew nothing with the Python agent, because the row was built from a session_status message that only the old Rust agent sent. zypi now builds the row from what it knows itself: the working directory, the session id, the model, the session name, its own version, how long it has held the session (cost.total_duration_ms), and when the turn began (turn.started_at_ms). A status that an agent does send is read first, and zypi fills only the fields that the agent left out; the session name is always zypi's own. The row is built again when the session, the model, the name, or the state of the turn changes, so a timer does not stay on the row after its turn. What it does not show: the agent does not tell zypi the size of the context window, the tokens in use, or a cost, so the context and cost items stay empty with the Python agent, and a script gets no context_window.*, cost.total_cost_usd, workspace.branch, workspace.repo_root or other field that only an agent can fill. A script that needs the branch runs git itself. Plan decision 15 first chose that the Python agent sends the status. The review that DESIGN section 8.5 asks for failed on two of its five points: what the agent could truthfully send is known to zypi already or has a standard place in ACP, and the type of the message would live in an old runtime crate. The user then chose this way: no new message on the wire, and no change to the Python packages. The guide page 25-status-line.md and scripts/tui_pty/status_line_probe.py say what the row shows now. Tests: 16 new unit tests (what zypi fills in and what an agent status keeps, the two clocks, when the row is built again, and what a script is given), 2 tests rewritten that said the row waits for the agent, and scripts/tui_pty/status_line_probe.py, which now checks that the row is drawn and that a script gets the facts and no invented number (4 of 4 runs on a real zypi).

Removed

  • The Rust agent runtime in zypi (TUI): zypi carried a second agent written in Rust. The Python agent was already the agent that zypi started by default. The Rust one is gone: the pi-sampler crate (31 files, 14,300 lines), most of pi-shell (the agent, sub-agents, sessions, the leader and relay processes) and the code in pi-pager that used them, with their tests. Since v0.4.0, tui/crates went from 2,500 Rust files and 1,620,612 lines to 1,755 files and 1,021,067 lines, and tui/Cargo.lock from 1,311 to 1,257 packages. The Linux release binary went from 470,461,776 bytes to 420,767,096 bytes. zypi needs the Python agent for everything: it starts python -m pi_agent_cli, or the command in [agent].command or PI_AGENT_COMMAND.
  • Screens, commands and flags that the Python agent cannot serve over standard ACP (TUI): an audit of every entry point removed the agent dashboard; the agents, extensions and persona dialogs; tasks, background and scheduled tasks; the sub-agent, workflow, goal and catalog panes; the shared prompt queue with its interject, send-now and steer actions; the MCP dialog and the import of Claude's MCP settings; hooks, plugins and the marketplace; rewind, fork, jump and external sessions; the recap, feedback, consent and data-sharing prompts; the "What's new" screen; session rename; and "New worktree" (the welcome-page item, and ctrl+w in the session picker). Of the slash commands, only /settings, /new, /model, /resume, /theme, /multiline, /home, /help and /exit are left. The flags --fork-session, --leader, --no-leader and --leader-socket are gone too. A script that uses one of them needs a change.

Known issues

  • --resume, --session-id and --continue work only in part with the Python agent: --resume <title> finds no session (no session id or title matched, exit status 1). --resume <unknown id> fails only after the UI has started. --session-id <id> with an id that is in use is refused by the agent, but the UI shows Session creation failed: Invalid params: ... and stays open. --continue takes the session that was created last, not the one that was used last.
  • Some flags and settings have no effect: in the interactive UI, --system-prompt-override and --rules do nothing, and --allow and --deny do not reach the agent. zypi --help still lists flags from the upstream project that nobody has checked one by one. On the settings page, the items other than the permission mode may have no effect with the Python agent. remember_tool_approvals and default_selected_permission were not tested.
  • [ui.status_line] has no context or cost items with the Python agent: the agent does not tell zypi the size of the context window, the tokens in use or a cost, so these items stay empty, and a script gets no context_window.*, cost.total_cost_usd, workspace.branch or workspace.repo_root. The rest of the row is drawn (see Changed).
  • The user guide has no way to open it: the 7 pages are in the binary, but nothing in the UI opens them.
  • Tested on Linux only for the latest changes: the end-to-end and pseudo-terminal scripts ran on Linux (WSL2). zypi last ran on macOS before the final changes to tui/. The macOS binary of this release is built by CI (a dry run of the release workflow built it) and nobody has started it. There is no Windows binary. The Landlock layer of the sandbox was not tested: the kernel of the test machine (5.10) has none.
  • Open findings in the Python packages: the low-risk findings F7-02 to F7-09 of the Phase 6 and Phase 7 audit have no fix yet (small defects in the extension API, and notes for the specs). See docs/AUDIT/AUDIT-PHASE6-PHASE7-2026-09-30.md, section 8.