Skip to content

zycode v1.2.0

Latest

Choose a tag to compare

@github-actions github-actions released this 27 Nov 13:49
· 2 commits to main since this release

This is a minor release. It adds mid-turn steer and the /btw side chat, adds skills as /skill:<name> slash commands, adds replay_reasoning to send the thinking back to a gateway, builds the agent program with pinned versions, fixes Auto for Git Bash on Windows, fixes three faults of the steer and cancel code, and moves the repository to zy1233/zycode. All eight Python packages and the TUI move to 1.2.0.

Added

  • Mid-turn steer and the /btw side chat (pi-agent-cli, pi-agent-harness, TUI, VS Code extension): two new items on the ACP wire of zycode, pi/session/steer (X9) and pi/session/btw (X10), with their notifications pi/queue_update and pi/btw_update (register: docs/specs/2026-11-05-acp-extension-registry.md; design: docs/specs/2026-11-26-pre-refactor-steer-and-btw-design.md; #157). Only a client that opts in uses them (zypi and the VS Code extension do; the agent announces both in initialize). Steer: while a turn runs, the user can send one more message. The agent keeps it in the steer queue of AgentHarness and shows it to the model at the next turn boundary. A tool that runs is not stopped. A steer that arrives after a cancel is refused (aborting). A steer that the model has not seen when the run ends (an error, max_turns, a stop hook, a cancel) is dropped before prompt() returns, and pi/queue_update (clearedByAbort, clearedSteerIds) tells the client, so that the client can put the text back in the draft and nothing reaches a later prompt. When the run has already ended, the agent answers idle, and the client sends the text as a normal prompt. /btw <question>: a side chat. The agent answers from a read-only copy of the session with no tools, also while a turn runs, and it writes nothing to the chat file. It sends the whole context (the system prompt, the user and assistant text, and the tool results cut to 4000 characters) to the model of [btw].model, which can be another provider with another key. The new [btw] table of agent.toml has model (empty: the model of the session), thinking (off, the default, or inherit) and timeout_seconds (5 to 600, default 120). A client that did not opt in does not see /btw in the command list, and a literal /btw ... prompt gets a short notice and runs no turn. In the VS Code extension, the Send button is Steer while a turn runs, the queued steers show above the message box, and /btw opens a side panel with follow-up questions, Stop, and Esc to close it. An agent without the two items leaves the extension as it was. Tests: packages/pi-agent-cli/tests/test_steer_and_btw.py, vscode/test/steer-and-btw.test.ts, the unit tests of pi-acp-lib, and tui/crates/codegen/pi-pager/tests/python_agent_e2e.rs. Three faults in the steer code are in Fixed. This entry was missing when 1.2.0 was tagged. It was added on 2026-11-27, after the release, and the text of the GitHub Release was made again from this section.
  • Skills as /skill:<name> slash commands (pi-agent-cli, pi-agent-harness): the agent lists every loaded skill in the ACP available_commands_update as skill:<name>, with the description of the skill and an <args> hint. It does so also when no extension registers a command, and also for a skill with disable-model-invocation (only the user can call such a skill). AgentHarness.prompt("/skill:<name> [args]") turns the text into the prompt of the skill (format_skill_invocation), so a client needs no skill menu of its own. An extension command with the same name skill:<name> wins over the skill, in the list and when it runs. The chat list and the replay of a loaded chat show the line that the user typed (/skill:<name> [args]), not the text of the skill; the new skill_invocation_command reads that line back from the stored text, and the model reads the same text as before (#152).
  • replay_reasoning: send the thinking back to a gateway (pi-agent-core, pi-agent-cli, pi-dynamic-workflows): Model.replay_reasoning and the key replay_reasoning in [model] and in each [[models]] entry (never inherited; a value that is not true or false is dropped with a note). When it is true and thinking is on (Model.reasoning and a level other than off), a request to a provider = "openai" gateway (or a provider = "deepseek" gateway) carries the thinking of each earlier assistant message as reasoning_content, in the shape that DeepSeek's own API gets (an empty string for a turn with no thinking, plain-text content). Before, provider = "openai" kept the streamed thinking for the client but sent none of it back. A model that thinks across tool calls then lost its own line of thought and worked out the same conclusions again in every turn (a session of the VS Code extension spent 79 % of 39 minutes in 29 large thinking turns). It is opt-in, because the OpenAI API and some gateways refuse an unknown field of a message. When an endpoint answers 400 or 422 and names reasoning_content, before the first chunk, langchain_stream asks again at once without the thinking; when that works, the agent sends no thinking to that (base_url, model_id) until the process restarts, and logs a warning that names the setting. Any other error is not taken for a refusal. DeepSeek's own API still gets the thinking back by itself and is never asked again without it. Verified with fake servers, and once with a real gateway (the result is at the end of this item). scripts/probe_reasoning_replay.py is the check to run against another gateway (with your own key in REAL_LLM_API_KEY): it runs a small task with replay_reasoning off and on, in which the model keeps two numbers in its thinking across a tool call, and it reports whether the gateway takes the field (with the raw text of the error when it does not), whether the agent recovers, and whether the model uses the thinking it gets back. The same task is a real_llm test, pi_agent_core/tests/test_real_llm_replay.py. Result (2026-11-26): the project owner ran the probe against a local OpenAI-format gateway with a real model (provider = "openai", thinking high; four calls of the script, 28 runs: 14 with replay on and 14 with replay off). The gateway took reasoning_content in all 14 runs with replay on (no 400 or 422; in one run the value was an empty string, for a turn with no thinking). 18 runs gave a clean memory result: with replay on, the model gave its own two numbers back in 10 of 10 runs; with replay off, in 0 of 8 runs (it gave other numbers). In the other 10 runs the test could not run: the first thinking of the model had no number in 7 runs and no thinking at all in 2 runs, and in 1 run only one of the two numbers matched, which can be chance. Still not verified: the error text of a gateway that refuses the field (this gateway took it every time, so the refusal path ran only against fake servers); a gain in a real session (the task of the probe has two to four turns: the last turn had about 130 characters of thinking with replay on and about 250 with replay off, mean over the 14 pairs, and a run took 0 to 1 s less, a hint and not a measurement); other gateways and models (the run does not show which provider answered behind the gateway).

Changed

  • New version numbers (all eight Python packages, TUI): pi-agent-core-lc, pi-agent-harness-lc, pi-agent-cli-lc, pi-web-access-py, pi-goal-x-py, pi-dynamic-workflows-py, pi-codemode-py, pi-mcp-py, and the TUI crates (pi-pager-bin, pi-version, and tui/Cargo.lock) move to 1.2.0. pi-agent-core-lc, pi-agent-harness-lc and pi-agent-cli-lc pin each other with ==1.2.0, and all five extension packages raise their workspace floors to >=1.2.0.

  • The agent program is built with pinned versions, the LangChain packages have an upper bound, and a test reads the private LangChain methods that the adapters use (pi-agent-core, packaging/agent): the build job of agent-binaries.yml now installs with pip install -c packaging/agent/constraints.txt. The file pins the 74 packages that the build pulls in (PyInstaller too), with one resolution for the five platforms (uv pip compile --universal, Python 3.12). Before, each build took the newest version of every dependency on the day of the build, so the same commit made a different program on a different day, and nobody had tested the mix (on 2026-11-27 that was openai 3.60 and langchain-core 1.8, where the development environment had openai 2.54 and langchain-core 1.5). packaging/agent/constraints.in has the list of packages, the command that makes the file again, and a check that every pin has a wheel for each of the five platforms. The first run of that check found that cryptography 49 and later have no macOS x86_64 wheel (PyPI has arm64 wheels only), so the darwin-x86_64 build would have compiled it with Rust; the build now has cryptography<49. langchain-core, langchain-openai, langchain-anthropic and langchain-deepseek now have the upper bound <2: pi_agent_core/adapters/ overrides private methods of ChatOpenAI and ChatDeepSeek (_get_request_payload, _convert_chunk_to_generation_chunk, and it calls _convert_input), and a release that changes one of them could drop the thinking of the model with no error. The new pi_agent_core/tests/test_langchain_private_api.py reads these signatures and fails with the name of the method; scripts/tests/test_agent_constraints.py checks that the pins, the install step, constraints.in and the bounds of the pyproject.toml files agree. ci.yml now installs the deepseek extra, so the tests of ChatDeepSeek (test_deepseek_replay.py and others) run in CI and are not skipped. langchain-mcp-adapters has no upper bound on purpose: pi-mcp calls two public functions of it (create_session, load_mcp_tools) and overrides none of its classes. The other jobs, and a pip install by a user, have no pins. Checked on 2026-11-27: uv pip install --dry-run finds wheels for the pins on the five targets, and the Windows build with the pins passed the smoke test, the ACP contract tests and the frozen sandbox tests. The Linux and macOS builds run only in CI.

  • The GitHub repository is now zy1233/zycode (metadata, docs, vscode, web, release): zy1233/pi-python was renamed on 2026-11-27. The repository id did not change, and the old address redirects (web pages, git, release downloads), so an old link, clone or download still works. This change puts the new address in the places that name it: the Homepage, Repository, Issues and Changelog entries of the eight pyproject.toml files (they reach PyPI with this release), the READMEs that PyPI shows, the two READMEs of the repository, vscode/package.json, the README and the changelog of the extension, vscode/agent-assets.json (the place where the bundled agent is downloaded from), the site (web/), the install commands in the docs, the user agent of scripts/auto_eval.py, and the title of a GitHub Release (zycode <tag>; it was pi-python <tag>). The names that users depend on do not change: the PyPI package names, the module names and the home folder ~/.pi-python. The trusted publishers of Open VSX and of the Marketplace were made again for the new name (record in vscode/RELEASING.md), and Cloudflare keeps the repository of zycode-web by its id (web/README.md). Checked on 2026-11-27: the Cloudflare build of zycode-web for the first commit after the rename succeeded (the live site has the new link and no old one), and a dry run of the VS Code extension workflow built the five VSIX files with the agent downloaded from zy1233/zycode. Not verified: a publish to Open VSX or to the Marketplace after the rename (a dry run does not call a registry), and the pages of the packages on PyPI (they change with this release).

Fixed

  • Auto asked about every path of the project when the Bash tool is Git Bash (pi-agent-cli): Git Bash and MSYS2 on Windows read /c/work/app as C:\work\app, and the model writes the project folder that way (cd /c/work/app && git log). Auto read the same text as \c\work\app, a folder that is not there, so each path of the project looked like a path outside it (path.outside_project). In one session of the VS Code extension on Windows, 84 of 85 decisions of Auto were asks. The session now gives the rules the mount points of the shell of the Bash tool (one for each drive for Git Bash and MSYS2; none for the bash.exe of WSL, for Cygwin, for a shell that is not known and for a host that is not Windows). The rules turn a path word that starts with a mount point into the folder of the mount before they resolve it (any path word, cd, git -C). Every other rule applies to the result as before (the protected set, the secret names, the project trust), a .. above the mount point asks (path.mount_dotdot), and the paths of write and edit are paths of the host and do not change. AutoContext has the new field shell_mounts, and the check of the context says when the folder of a mount is not absolute. scripts/auto_mutation_check.py now runs on Windows too.

  • A steer could be lost, and a cancel from an earlier turn could end the next prompt (pi-agent-harness, pi-agent-cli): three faults in the steer and cancel code of #157, found by an architecture audit. Each fault has a regression test (packages/pi-agent-harness/tests/test_harness_agent.py, packages/pi-agent-cli/tests/test_steer_and_btw.py) that fails on the code before this change: 5 of the 8 new tests fail there, and the other 3 are controls that pass before and after. (1) The agent loop takes the steers out of the queue at the end of a turn. When max_turns or a stream error then ended the run before the loop showed the steers to the model, the harness did not report them: the text of the user was lost, and the client got no pi/queue_update with clearedSteerIds. The harness now keeps an entry for each steer until message_start shows it to the model (or abort() reports it). A run that ends reports every steer that the model never saw, in the order of the calls of steer(). The limit max_turns works as before; only the report is new. (2) The harness found its steers by id(message) and held no reference to the message, so CPython could give the id of a freed steer to a later message. The entry now holds the message, steer_id_for() and is_steered_message() also test that it is the same object, and the agent gives a message to Auto only when its role is user (invariant 9b: Auto gets text of the user, never the text of a tool). The fault needed a stale entry, and fault (1) made one, so it was rare (3 of 300 runs in a test of the audit). (3) begin_abort() raised a counter, and a prompt ended as aborted while the counter was above zero. That also hit a prompt that came after a cancel, when the abort() of the cancel was still sending notifications (a slow client). That abort() also waited for the next run to end, so is_aborting stayed true for all of it, and pi/session/steer got reason: "aborting". A prompt now notes the number of cancels when it begins, and ends as aborted only for a cancel that comes after that. abort() waits only for the run (or the idle) that it saw when it began.