Skip to content

pi-python v1.0.0

Choose a tag to compare

@github-actions github-actions released this 16 Nov 10:58
· 37 commits to main since this release
037b162

This is 1.0.0, the first stable release of zycode. All seven Python packages and the TUI go to 1.0.0.

One change can break a set-up that works today: zypi no longer starts python -m pi_agent_cli when you set nothing. It starts zycode-agent. Changed has the details and the one-line fix. Added has the standalone bundle (zypi and zycode-agent in one archive), zypi --setup, a zypi binary for Linux aarch64, and four changes in the agent: usage_update, the max thinking level, auto_compact and the stop reason max_turn_requests. Known issues says what nobody tried yet.

Added

  • The agent tells an ACP client how full the context window is: usage_update (pi-agent-cli): a model in agent.toml ([model] or an entry of [[models]]) can have context_window, a whole number of tokens. A window belongs to one model, so it is never inherited. A value that cannot be used is dropped, and a note says so at the start of the session. When the model has a window, the agent sends usage_update (used and size) after a turn, after a compaction, after session/load and session/resume (only when the count is still true), and after a change of model. It never sends cost, because the agent has no price table. used is the count that the provider gave, plus an estimate for the tool results. After a compaction it is an estimate for the messages that remain. A model with no context_window gets no update: the 128,000 tokens of the core are a placeholder, not a window. Compaction now uses the declared window, with limits that fit small windows (before, it used the placeholder). The VS Code extension already reads the update and shows a Context row. zypi ignores it (see Known issues). Tests: packages/pi-agent-cli/tests/test_context_usage.py. Design: docs/specs/2026-11-13-agent-context-usage.md (#131).
  • The max thinking level (pi-agent-core, pi-agent-cli): thinking_level = "max" is a seventh level, above xhigh. DeepSeek V4, OpenAI GPT-5.6 and later, Anthropic adaptive models, Kimi K3 and GLM 5.x have it as their highest effort. The OpenAI format (gateways too) sends reasoning_effort = "max", and xhigh still sends "high". DeepSeek's own API gets reasoning_effort = "max", as it does for xhigh. Anthropic gets the budget of xhigh (budget_tokens = 40000), because a budget has no step above it. max is open for every model. A model that does not take it answers with an error, and the agent lowers nothing. A test checks that each of the three tables names every level, because a level that a table lacks sends no parameter, and the model then silently does not think. Record: docs/specs/2026-11-16-thinking-max-and-turn-limit.md (#131).
  • auto_compact and the stop reason max_turn_requests (pi-agent-core, pi-agent-cli): auto_compact = true | false is a new optional key at the top of agent.toml. The key wins. When it is not set, compaction is on for a model that has a declared context_window and for max_turns of 30 or more, and off in the other cases (before, only max_turns of 30 or more turned it on). After a change of model, the rule decides again. auto_compact = true for a model with no window assumes 128,000 tokens. When the loop reaches max_turns, the stop reason is now max_turn_requests (before: end_turn). Any other error is still end_turn. The text of the error has one source: MAX_TURNS_MESSAGE in pi_agent_core/types.py. The VS Code extension shows "The turn ended: max_turn_requests." and zypi says "done" (#131).
  • The VS Code extension can offer max (vscode/): the Thinking menu lists max, but only for an agent of version 1.0.0 or later (MAX_LEVEL_SINCE in src/core/thinking.ts), because an older agent reads max as off and says nothing. The extension reads the version from the initialize answer of the agent. This release is not an extension release. The extension bundles the agent that vscode/agent-assets.json pins (0.9.1 today), so the menu changes only when an extension release moves the pin (#131).
  • Terminal setup command zypi --setup: Added --setup flag to zypi to directly launch the agent's interactive setup dialog in the terminal to configure the provider, model, and API key before running interactive sessions.
  • Combined standalone bundles (zycode-<target>-<version>.tar.gz): packaging/agent/build.py has a new option --bundle-from-archive, and the Agent binaries workflow uses it after the Release workflow. It packs zypi (the zypi-* file of the Release) and zycode-agent (the agent archive of the same platform) at the root of one archive (mode 0755). A bundle exists for linux-x86_64, linux-aarch64 and darwin-aarch64, and the step fails when it cannot make one of the three. The user needs no Python.
  • Linux aarch64 TUI binary in release workflow: Added build-tui-linux-arm job to .github/workflows/release.yml on ubuntu-24.04-arm to build and publish zypi-linux-aarch64.
  • A design record for the Omarchy Linux Agent menu (docs): docs/specs/2026-11-15-omarchy-agent-pr.md has the patch that adds zycode (zypi) to the Agent menu of Omarchy Linux, with the mise declaration and the test notes. The patch is a draft: see Known issues.

Changed

  • Behaviour change: zypi starts zycode-agent, and no longer falls back to python -m pi_agent_cli (TUI): zypi looks for zycode-agent (zycode-agent.exe on Windows) next to its own executable (a symlink is followed), and then on PATH. The order is: PI_AGENT_COMMAND, then [agent].command (in agent.toml or config.toml), then PI_PYTHON (only when it is set and not empty; it runs python -m pi_agent_cli), then zycode-agent. Before, zypi ran python -m pi_agent_cli when you set nothing. If you installed the agent with pip install pi-agent-cli-lc and you run a standalone zypi, set PI_PYTHON to the Python that has pi-agent-cli-lc, or set PI_AGENT_COMMAND, or use the bundle (see Added), which has both programs.
  • Version 1.0.0 for every package: all seven Python packages (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-mcp-py) and the TUI crates (pi-pager-bin, pi-version) go to 1.0.0. The first three change their classifier from Development Status :: 4 - Beta to Development Status :: 5 - Production/Stable. The four extension packages never had a Development Status classifier, and they still have none. The README, the docs and the site name 1.0.0 as the current release.
  • A thinking_level that is not a level is still off, and a note says so (pi-agent-cli): it was off with no word, so a typo looked like off. The note comes at the start of the session (#131).
  • agent.example.toml has new example values (pi-agent-cli): max_turns = 200 (it was 50) and context_window = 1000000 (it was 128000). The default of max_turns in the code is still None (no limit) (#131).
  • Refusal message for zypi --oauth updated to direct users to zypi --setup.
  • Updated spawn error messages to guide placing zycode-agent next to zypi or setting PI_AGENT_COMMAND / PI_PYTHON.

Known issues

The known issues of 0.9.0 still hold, except where an item below says otherwise.

  • zypi ignores usage_update (TUI): the agent sends it now, but zypi has no code that reads it. The context item of [ui.status_line] (a known issue of 0.9.0) stays empty, and so does cost. zypi does not fail on the update only because tui/Cargo.toml turns on the feature unstable of agent-client-protocol, and the pager has a catch-all arm for the updates that it does not use. Do not remove that feature without a new check (#131).
  • The count in usage_update is partly an estimate (pi-agent-cli): the tool results of a turn, and the whole count after a compaction, are estimates (4 characters for 1 token, which is too low for CJK text). The next model call gives an exact number. A window that is too small can show more than 100 %. A change to a model with no window leaves the old numbers on the client, because ACP cannot clear them (#131).
  • max was not sent to a real provider (pi-agent-core): the tests use scripted models and a fake OpenAI-format server. Nobody sent reasoning_effort = "max" to a real gateway or to api.openai.com, and nobody tried the Anthropic path (langchain_anthropic is not in the dev environment). The documentation of Anthropic says that Claude 4.7 and later refuse the budget form that the agent sends. This is not verified. Adaptive thinking with effort is not built (#131).
  • A client may show max_turn_requests as a failure: the VS Code extension shows a line of notice, and zypi says "done". Nobody checked another client (#131).
  • The max item of the VS Code menu was not tried in a real VS Code window with a real agent of 1.0.0 (vscode/): the tests use a fake agent that reports a version. A released extension has six levels. For a user who writes max in agent.toml, its menu shows off, and a note says that the agent does not know max. For the 1.0.0 agent that note is wrong. Nothing breaks (#131).
  • Nobody ran zypi for Linux aarch64 or macOS arm64 by hand: CI builds them. The macOS binary is not signed and not notarized. The Linux zypi needs glibc 2.39 or newer.
  • The Omarchy patch is a draft with two defects that are not fixed: docs/specs/2026-11-15-omarchy-agent-pr.md has a patch for the Agent menu of Omarchy Linux, and a draft PR in the Omarchy fork has the same patch. A review found two defects. The mise declaration resolves latest to the oldest release, and the agent id zycode is not the name of a command (the command is zypi). Do not send the patch to Omarchy before both are fixed.