Repository navigation
pi-python v0.5.0
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.mdand project-relative[skills].pathsare 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 asession/request_permission(Don't trust/Trust and remember; noallow_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.jsonwith asha256:fingerprint of the files, so agit pullthat changes them asks again.trusted_projects,trust_project_extensions = true,--trust-project-extensionsandPI_TRUST_PROJECT_EXTENSIONS=1also trust; headless (-p) runs never ask but honour a saved answer that still matches. Extensions read the answer aspi.project_trusted; library users passAgentHarness(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, andAGENTS.md/CLAUDE.mdare 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 awhile Truefroze the host's event loop. EachWorkflowRuntime.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, plusno_new_privsand noforkon Linux; a Job Object and a lowered integrity level on Windows), andWorkflowRuntime(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,budgetin 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, andexecute()raisesWorkflowScriptErrorfor a script that raises and aSandboxErrorfor 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_contentback, whichChatDeepSeekleaves 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 (nobase_url, or one ondeepseek.com), not to gateways serving DeepSeek models. Behaviour change: with the defaultthinking_level="off", requests now sendthinking: disabled; code that relied on the old default to get reasoning blocks must setModel.reasoning=Trueand athinking_level. Not verified against the live API (no key). Spec: Phase 6, section 5.5. [model] reasoninginagent.toml(Phase 6): whether the configured model can reason (Model.reasoning); unset, anythinking_levelother thanoffsays it can. This is what makesthinking_leveltake effect through the CLI, which built every model withreasoning=False(the level was dropped on OpenAI and Anthropic). A model that rejects reasoning parameters needsreasoning = 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,CodingToolandToolDefinitiontakeannotations=,from_langchain_toolreads them fromtool.metadata, andtool_callhooks receive them asToolCallEvent.annotations. Built in,read,grep,find,ls,web_searchandfetch_urldeclare themselves read-only,goal_updateandgoal_completeneither destructive nor open-world, andbash,edit,writeandworkflowdeclare nothing, on purpose. The hints are the tool author's word and are not verified;askmode uses them (see Changed). Design: Phase 7 spec, section 12. - The TUI keeps the agent's stderr:
zypipoints its own stderr at/dev/nulland 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 toagent.stderr.log.1once it is over 1 MiB at the next start).zypi -pis 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 anApplyFailedline insandbox-events.jsonl. It now prints a warning on stderr at start-up and showssandbox:<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/listcomes in pages (pi-agent-cli,pi-agent-harness): the agent answers with at most 50 sessions, newest first, and anextCursorwhile 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 isinvalid_params. The TUI keeps asking until the cursor is gone, so its session picker still lists everything. For library usersJsonlSessionRepo.list_page(...)returns one page andJsonlSessionRepo.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 asession/loadof 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 indocs/PLAN/archive/PLAN-RUST-AGENT-RUNTIME-REMOVAL-EXECUTION-LOG.md§10.11).updated_atis 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,loadandresumeused 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,argsandurlhold tokens).zypino longer forwards what it finds in.mcp.json,~/.claude.jsonand Cursor'smcp.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 insession/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 formuuid.UUIDreads (kept as lower case with hyphens); anything else isinvalid_params, because the id ends up in a file name. An id some session already has is refused withinvalid_params, whatever directory that session belongs to, and two requests for the same id at once make one session.session/new,loadandresumeanswer with_meta["pi/cwd"], the directory the session works in; forloadandresumethe one saved with the session wins over thecwdthe client sent. For library usersJsonlSessionRepo.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 (findreads 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:zypistill 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 showsSession creation failed: Invalid params: {...}instead of exiting 1 with a message (scripts/tui_pty/resume_matrix.py, case 11), and nothing readspi/cwdyet (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 nocargoand no network, and it gives the same answer on Windows, Linux and macOS.cratesshows the dependency closure of the product crates (78 crates in the workspace, 74 in the closure;--without pi-shellshows what onlypi-shellkeeps alive).unitsshows, for one or more crates, the modules that no live code refers to;--banasks what dies if a module goes.keepwritesdocs/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 inpi-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 oftui/, 16 of the 17 modules were deleted, andcargo checkpassed (alsocargo check --workspace --tests, after the test file of the removedpi-hooksmodules went too). The 17th,types::errorinpi-tools, cannot go: it holds theimpl From<…> for ToolErrorthat?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 fromtui/(plan item D.8; execution log section 10.14). - A check that
tui/THIRD-PARTY-NOTICESmatches the dependencies (scripts/tui_notices.py): the file came from the upstream project and did not followCargo.lock.checkfinds the packages that ship inzypi(the normal and build dependencies ofpi-pager-bin, for five target triples, from crates.io, git ortui/third_party/) and exits 1 if an entry is missing or stale.update --writefixes 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 asneeds 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 toCargo.lock. It is not a legal review: nobody has read the copied wording one entry at a time.checkneedscargo. 62 tests. - A network audit of
zypi(scripts/tui_pty/net_audit.py, Linux): it runszypiin a pseudo-terminal, plays one turn, and reads the sockets ofzypiand of every process below it about every 9 ms (/proc/<pid>/fdjoined with/proc/<pid>/net/{tcp,tcp6,udp,udp6}).zypimust 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 startszypion 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 asession_statusnotification that only the old Rust agent sent (4 of 4 runs).status_proxy_agent.pyruns 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. /modelworks through ACP session config options (pi-agent-cli, TUI): the agent answerssession/new,loadandresumewithconfigOptions, one select option with the idmodel.[model]inagent.tomlis the first choice, and each[[models]]table adds one more (agent.example.tomlhas an example). The client changes the model withsession/set_config_option. The choice goes into the session as amodel_changeentry, andloadandresumebring it back.zypireads the choices fromconfigOptions, and usessession/set_modelonly for an agent that publishes none.- A prebuilt
zypifor macOS on Apple silicon (TUI): the release haszypi-macos-arm64next tozypi-linux-x86_64. The release workflow builds it on amacos-14runner. 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 withxattr -d com.apple.quarantine <file>. The install steps are indocs/TUI-AND-CODE-AGENT.md.
Fixed
- A saved workflow whose
metadescription was not text made everysession/promptfail (pi-dynamic-workflows, Phase 7): the value reached the command list unchecked,AvailableCommandrefused it, and the list is re-sent with every prompt until a send succeeds. NowWorkflowStoredrops a non-stringdescription/when_to_use,ExtensionAPI.register_commandraisesTypeErrorfor one (that extension is rolled back like any failed one), andPiAcpAgentleaves 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, andPiAcpAgent(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=)andcreate_workflow_tool(home=). With the working directory set to the home directory,~/.pi-python/extensionsis 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 withencoding="utf-8", errors="replace"andcore.quotePath=false, and any failure omits the section instead. A repository with no commit yet lost the section; it now showsBranch: main (no commits yet). The snapshot ran up to threegitprocesses on the event loop; it is now built in a worker thread, and[git] timeout_secondsis one budget for the whole snapshot.tool_callhooks 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-Noneverdict won). Dispatch now stops at the first blocking verdict, like upstream pi'semitToolCall.- Extension tools in the system prompt:
prompt_snippet/prompt_guidelinesof 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): atierresolved 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,anthropiconly;DEFAULT_MODEL_TIERSis removed), so under another parent provider atierinherits the parent model.make_get_api_key(config)returns the key only forconfig.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'sbase_urlonly on the parent's provider. workflowsub-agents ranbash/edit/writewithout asking (pi-dynamic-workflows): the permission layer is atool_callhook on the session's harness, which the sub-agents' fresh harnesses did not have, so inaskmode a script could write files and run commands unprompted (andworkflowitself was not gated).workflowis now permission-gated and every sub-agent tool call goes through the parent session'stool_callchain (AgentHarness.check_tool_call, exposed to extensions asHarnessBridge.tool_call_gate; fail-closed), withToolCallEvent.origintelling 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-levelactivateis still named after its module; any other callable is nowmodule.qualname, andAgentHarness.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 aftersession/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_toolnow refuses other names and rolls that extension back. workflowran against canned answers when sub-agents could not be built (pi-dynamic-workflows): the extension quietly fell back toMockSubagentExecutor, so a script "completed" with fake results. It now registersUnavailableSubagentExecutor(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
metabroke the directory scan (pi-dynamic-workflows): both patterns ended in$and are now matched withfullmatch;meta = 5in one saved script no longer raises out of the whole scan. resume_from_run_idreplayed nothing after a parallel run, and recorded failures as answers (pi-dynamic-workflows): the journal matched calls by position, butparallel()records in completion order, and a failedagent()was written as a successfulNone. 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
workflowdid 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 therun_idand 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 fromgit diff HEAD(no untracked files) and was decoded as text (an edit to a GBK file failed withpatch does not apply); a worktree also leaked when its sub-agent failed early, timed out or was cancelled. The patch is nowgit 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; afterwardsprompt()raisesAgentHarnessError("invalid_state").WorkflowManager.close()cancels background runs and delivers nothing afterwards. ACPsession/closeandpi/session/delete(which did not call it) both go throughclose(). - 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 newHarnessBridge.trigger_message(custom_type, text, *, details=None)as a typedworkflow-resultmessage (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_urlfetched 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 asFailed to fetch .... Now onlyhttp(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), withRefusing 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 (bashwithcurl, 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_stepwith an index that names no step raisesValueErrornaming the steps that exist (it appended anUnnamed step), and the status lists steps as[0],[1]to match the 0-basedstep_index; the reminder to callgoal_completeis sent at most twice. API:create_goal_update_tool/create_goal_complete_tooltake an optionalon_changecallback,GoalStategainsreminders_sent, and theturn_endhook no longer saves the goal.- Provider matrix and live tests (Phase 6): the
deepseekrow useddeepseek-chat, a non-thinking alias DeepSeek retired on 2026-07-24; it now usesdeepseek-v4-flash(MATRIX_DEEPSEEK_MODELstill overrides).real_llmtests were meant to be deselected by default but only skipped when their key was unset, so an exportedOPENAI_API_KEYmade a plainpytestpay for API calls;pyproject.tomlnow setsaddopts = "-m 'not real_llm'"(run them withpytest -m real_llm ...). Theprovider-matrixworkflow also runs weekly. - A prompt sent while a
workflowresult was being worked on failed withbusy(Phase 7): the result of a backgroundworkflowstarts an LLM turn with nosession/promptbehind it, so the client could not know the session was occupied.session/promptnow waits for that turn and then runs (session/cancelor closing the session ends the wait); a secondsession/promptfrom the same client while one is in flight is stillbusy. ACP'sstate_updateis 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. zypitold the user nothing when the agent failed to start or died: a missing agent program surfaced aschannel closed ... recv_failed, and an agent that exited as soon as it started (a Python withoutpi_agent_cli, say) leftconnectwaiting 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 toagent.stderr.log(failed to spawn ACP agent ... PI_AGENT_COMMANDfor 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 -pleft the agent and its tools running when onlyzypiwas killed:kill <pid>,kill -9,timeoutor an IDE's stop button reachedzypibut not the agent, which kept running (and kept running itsbashcall) on the user's terminal.zypinow passes its pid inPI_AGENT_PARENT_PID;python -m pi_agent_cli -pwatches its parent and stops the way it stops on a signal (turn cancelled, tools reaped), and-pnow 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 outerbwrapwas killed: the sandbox re-launcheszypiunderbwrap, which by default just waits for its child, so signalling the process the shell started (kill $!, a supervisor) leftzypi, the agent and its tools on the terminal.bwrapnow runs with--die-with-parent. Trade-off: a SIGTERM or SIGHUP sent to that outerbwrapnow reacheszypias SIGKILL, so the terminal is not restored (alternate screen, raw mode); before, the tree kept running instead.- Messages in
zypithat pointed at files that do not exist: five messages (four from the MCP config code, one from the sandbox glob code) ended withSee ~/.grok/docs/user-guide/<page>.md, a path thatzypinever uses; the help ofzypi wrapended withSee ~/.pi-python/README.md for more information., and there is no such README; and the footer of the document picker named the folder wherezypiused to write the pages. The pointers are gone. - Quitting
zypiwhile the agent ran a tool left the tool running (TUI,pi-agent-cli):zypikilled the agent with SIGKILL at once, so the agent could not stop the process group of a runningbashcall (after a double Ctrl+Q, asleep 300kept running).zypinow 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 coverskill -9onzypi, 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/closeandsession/resumeanswered "Method not found" (pi-agent-cli):initializeannounced both methods, but the ACP SDK serves them only when the agent starts withuse_unstable_protocol=True, and it did not.zypinever called them, so only the new stdio contract tests found it. The agent now sets the flag.session/listgave no useful title and a wrong time (pi-agent-cli): the title of each session was its creation time and a short id, andupdated_atwas the creation time. The title is now the first user message (white space collapsed, 100 characters at most;(no messages)when there is none), andupdated_atis the time the session file was last written. So the/resumepicker shows readable titles.- The project's
AGENTS.mdwent into the prompt twice on a case-insensitive file system (pi-agent-cli): the agent looks forAGENTS.mdandAGENTS.MD(andCLAUDE.mdandCLAUDE.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-wrapwrote an alias for a command that does not exist (TUI): the block in the shell's rc file saidalias ssh='grok wrap ssh', so after the fix everysshcall failed. It now writesalias 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
zypinamed a directory and commands that do not exist (TUI): they said~/.grokand$GROK_HOMEwhere the real names are~/.pi-pythonand$PI_HOME. They told the user to run the slash commands/doctor,/minimal,/fullscreenand/copy, and the commandsgrok wrapandgrok worktree gc|rm, and none of these exists. They now namezypi doctor,zypi wrap ssh <host>,zypi --minimal,zypi --fullscreenand the real directory. zypi export <id>works with the Python agent (TUI): it read the session files of the old Rust agent, so it answeredSession '<id>' not found.for every session that the Python agent stored. It now asks the agent, as a resume does: it starts the agent, sendssession/load, collects thesession/updatemessages 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 tosession/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 iszypiturning 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, andscripts/tui_pty/resume_matrix.pycases 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 aValueErrorthe script can catch, a non-string aTypeError.HarnessSubagentExecutorchecks again before creating a worktree. Migration: a script that usedcwdto leave the project has to be rewritten. Design:docs/specs/2026-10-01-workflow-sandbox-design.md, section 8.1.askmode 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 sayreadOnlyHintis true, or that it is neither destructive nor open-world (undeclared or malformed hints mean "ask", as in MCP);needs_permission(mode, annotations)replacesneeds_permission(mode, tool_name), andauto/always-approveare unchanged. Behaviour change: an extension tool that declares nothing now interrupts the user inaskmode; the tools shipped here declare themselves, soread,grep,find,ls,web_search,fetch_urland thegoal_*tools still run unasked whilebash,edit,writeandworkflowask. Migration: an extension tool that only reads should passannotations=;agent.tomlhas no per-tool allow-list, so a tool that declares nothing runs unasked only underpermission = "auto". Not covered: the hints are not verified, and a caller who connects MCP servers it does not trust must remove their annotations beforefrom_langchain_tool. Design: Phase 7 spec, section 12.- Bridge and lifecycle API (Phase 7):
HarnessBridgeis a runtime-checkable protocol and gainstrigger_messageandproject_trusted, so a custom bridge (a test double, say) must add both.AgentHarnessgainsclosed(close()is idempotent);WorkflowManagergainsclose(timeout=5);Journal.truncate_fromis removed;WorktreeManager.collect_diff()returnsbytes(it returnedstr). - Extension packages declare what they use (Phase 7):
pi-web-access-py,pi-goal-x-pyandpi-dynamic-workflows-pyrequiredpi-agent-core-lc>=0.3.0, which has nopi_agent_core.extensions; the floor is now>=0.5.0, andpi-dynamic-workflows-pyalso declarespi-agent-harness-lc.test_extension_packaging.pychecks 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-lcandpi-agent-cli-lcare 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. Rungit statusfor 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.tomland the Phase 6 spec say so and how to turn it off ([git] enabled = false,--no-git-context). The default stays on.zypioffers 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-modevalues, none of which did what it said. Plan restricted nothing (the agent has nosession/set_modehandler, so the call failed unseen while the screen saidplan); Auto never asked, because the agent treatsautolikealways-approvewhile 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-modevalues onlybypassPermissionsdid anything, the other five behaved exactly like no flag (acceptEditsaccepted no edits,dontAskasked all the same). Now Shift+Tab toggles Normal and Always-Approve; theplan_modesetting, the plan-mode tip, and the Default and Auto choices ofpermission_modeare gone from the settings page; and--permission-modetakesdefault(no flag) andbypassPermissions(--always-approve) only. Behaviour change:--permission-mode plan,auto,acceptEditsanddontAsknow 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 savedpermission_modeofautoordefaultis shown as Ask and the file is left alone;--permission-modeused in a script needsdefaultorbypassPermissions. The code behind the hidden modes stays, behind three constants inapp/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.mdsections 10.11 and 10.13 (scripts/tui_pty/mode_probe.py).- The user guide inside
zypihas 7 pages, andzypino longer writes it to disk at start-up (TUI): the 33 files underpi-pager/docs/(23 user-guide pages, a README and 9 tutorial pages) were the upstream text for a different program. They named thegrokcommand,grok agent, MCP servers, plugins, the leader process and other features thatzypino longer has. Nowuser-guide/holds a README and 7 pages written against the code andagent.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.zypino 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-pagertests 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/NOTICEnames the product: it saidpi(pi-grok-pager-bin). Now it sayszypi, says thattui/is a hard fork that does not follow upstream, and lists the changes. The stalenfsserveentry intui/third_party/is gone.- Leftover words in the TUI sources are held by a ratchet (
scripts/tui_baseline.py,[gates.residue]inscripts/tui_baseline.toml): each word has a ceiling on the number of lines undertui/crates, and the ceiling can only go down. Now:grok agent0,leader245,x.ai304. The plan asked for zero. That cannot be done forleaderandx.aibefore 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 dropsx.ai/*extension notifications.docs/baselines/tui.mdsection 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 withgrok agentare gone: 15 were in user-guide pages and 13 in doc comments, a label and two READMEs (pi-shell/README.mdwas the upstream user manual, 2,682 lines; it is now a 43-line note on what the crate is). - What
zypidoes withconfig.tomlis 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:zypiis 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-levelpermission = "ask"(zypiexpects a table there), a[[models]]array and invalid TOML stopzypiwith exit status 1. The agent readsagent.toml, and falls back toconfig.tomlonly whenagent.tomldoes not exist.TUI-AND-CODE-AGENT.mdnow has the real[model]keys (id, notmodel_id; nocontext_window), the permission values (ask,auto,always-approve) and the real slash commands, and says thatzypihas no model client, tool runner or MCP client.docs/DESIGN.mdsection 8.5 states the five conditions for a newpi/extension, and the Phase 4 spec has a revision note. zypi -prefuses a sandbox it cannot apply, and names the flags it ignores (TUI):-phands the whole run to the Python agent beforezypiapplies a sandbox, so v0.4.0 dropped a sandbox from--sandbox,GROK_SANDBOXor[sandbox].profilewithout a word. Now-pprints 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 offruns without one. A flag that-pdoes not pass to the agent (for example--model,--always-approve,--permission-mode,--allow,--denyor--resume) now giveswarning: <flag> has no effect with -p and was ignoredon stderr. Behaviour change: a script that runszypi -pwith a sandbox profile set in the environment or inconfig.tomlnow fails with status 2 until it passes--sandbox off.zypiis the product name wherever the user sees a name (TUI): the themes arezypi Nightandzypi Day(saved aszypinightandzypiday; the old ids and aliases still work, soconfig.tomlneeds no change). Desktop notifications, thezypi doctortitle, the--minimalwelcome page and other messages sayzypiwhere they saidGrok. TheGROK_*environment variables, the project path.grok/sandbox.tomland thegrok_homefield ofzypi du --jsonkeep their names: a rename of these would break existing setups, so it needs its own decision.zypi --versionand the ACPagentInfo.versionshow the version of the release (TUI,pi-agent-cli):zypi --versionprinted1.0.8, the version of the upstream project, and the agent reported0.1.0whatever the package was.zypinow prints0.5.0(the version in theCargo.tomlofpi-pager-binandpi-version), and the agent reports the version of the installedpi-agent-cli-lcpackage. A test fails if those two crates orCargo.lockdiffer from the version ofpi-agent-cli-lc, so raise them together with the Python packages at each release. The release workflow does not setGROK_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 whoseminimum_versionis above0.5.0no longer applies; none ships withzypi.- 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 asession_statusmessage that only the old Rust agent sent.zypinow 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, andzypifills only the fields that the agent left out; the session name is alwayszypi'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 tellzypithe size of the context window, the tokens in use, or a cost, so thecontextandcostitems stay empty with the Python agent, and a script gets nocontext_window.*,cost.total_cost_usd,workspace.branch,workspace.repo_rootor other field that only an agent can fill. A script that needs the branch runsgititself. 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 tozypialready 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 page25-status-line.mdandscripts/tui_pty/status_line_probe.pysay what the row shows now. Tests: 16 new unit tests (whatzypifills 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, andscripts/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 realzypi).
Removed
- The Rust agent runtime in
zypi(TUI):zypicarried a second agent written in Rust. The Python agent was already the agent thatzypistarted by default. The Rust one is gone: thepi-samplercrate (31 files, 14,300 lines), most ofpi-shell(the agent, sub-agents, sessions, the leader and relay processes) and the code inpi-pagerthat used them, with their tests. Since v0.4.0,tui/crateswent from 2,500 Rust files and 1,620,612 lines to 1,755 files and 1,021,067 lines, andtui/Cargo.lockfrom 1,311 to 1,257 packages. The Linux release binary went from 470,461,776 bytes to 420,767,096 bytes.zypineeds the Python agent for everything: it startspython -m pi_agent_cli, or the command in[agent].commandorPI_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+win the session picker). Of the slash commands, only/settings,/new,/model,/resume,/theme,/multiline,/home,/helpand/exitare left. The flags--fork-session,--leader,--no-leaderand--leader-socketare gone too. A script that uses one of them needs a change.
Known issues
--resume,--session-idand--continuework 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 showsSession creation failed: Invalid params: ...and stays open.--continuetakes 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-overrideand--rulesdo nothing, and--allowand--denydo not reach the agent.zypi --helpstill 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_approvalsanddefault_selected_permissionwere not tested. [ui.status_line]has nocontextorcostitems with the Python agent: the agent does not tellzypithe size of the context window, the tokens in use or a cost, so these items stay empty, and a script gets nocontext_window.*,cost.total_cost_usd,workspace.branchorworkspace.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).
zypilast ran on macOS before the final changes totui/. 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.