Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 57 additions & 2 deletions .github/workflows/agent-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,19 +192,74 @@ jobs:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
TAG: ${{ needs.plan.outputs.tag }}
VERSION: ${{ needs.plan.outputs.version }}
steps:
- uses: actions/checkout@v7
with:
ref: ${{ needs.plan.outputs.ref }}
- uses: actions/download-artifact@v7
with:
pattern: agent-*
path: archives
merge-multiple: true
- name: Create the release if it is not there, then upload
- name: Create the release if it is not there, attach the agent archives, build and attach the bundles
run: |
ls -l archives
if ! gh release view "$TAG" >/dev/null 2>&1; then
# Another run may create it between the check and here; then the upload is enough.
gh release create "$TAG" --title "$TAG" --notes "Agent binaries for $TAG." --verify-tag \
|| gh release view "$TAG" >/dev/null
fi
gh release upload "$TAG" archives/* --clobber

# The agent archives go first: the VS Code extension and the ACP registry entry use them,
# and a bundle that fails below must not hold them back.
gh release upload "$TAG" archives/zycode-agent-* --clobber

# A bundle is the zypi file of the release and the agent archive of the same platform.
# The build.py of a tag from before the bundles has no --bundle-from-archive. That tag
# gets no bundle, because this step is also the way to repair the release of an old tag.
help_text="$(python3 packaging/agent/build.py --help)"
case "$help_text" in
*--bundle-from-archive*) bundles=yes ;;
*)
bundles=no
echo "::notice::build.py of $TAG has no --bundle-from-archive, so this tag gets no bundles."
;;
esac

if [ "$bundles" = yes ]; then
mkdir -p tui-downloads
made=()
# Each of the three must work. A missing input or a failed download stops the step.
# Without a bundle, the download links in the README and on the web site give a 404,
# and the run would still be green.
for pair in "zypi-linux-x86_64:linux-x86_64" "zypi-linux-aarch64:linux-aarch64" "zypi-macos-arm64:darwin-aarch64"; do
asset="${pair%%:*}"
target="${pair##*:}"
tui_bin="tui-downloads/$asset"
agent_archive="archives/zycode-agent-$target-$VERSION.tar.gz"
bundle="archives/zycode-$target-$VERSION.tar.gz"
gh release download "$TAG" -p "$asset" -D tui-downloads
[ -f "$tui_bin" ] || { echo "::error::The release $TAG has no file $asset."; exit 1; }
[ -f "$agent_archive" ] || { echo "::error::There is no agent archive $agent_archive."; exit 1; }
chmod +x "$tui_bin"
python3 packaging/agent/build.py \
--bundle-from-archive "$agent_archive" \
--tui-binary "$tui_bin" \
--target "$target" \
--version "$VERSION" \
--out archives
[ -f "$bundle" ] || { echo "::error::build.py did not make $bundle."; exit 1; }
made+=("$bundle")
done
gh release upload "$TAG" "${made[@]}" --clobber

# The release must now hold all three bundles.
assets="$(gh release view "$TAG" --json assets --jq '.assets[].name')"
for target in linux-x86_64 linux-aarch64 darwin-aarch64; do
printf '%s\n' "$assets" | grep -Fxq "zycode-$target-$VERSION.tar.gz" \
|| { echo "::error::The release $TAG has no bundle for $target."; exit 1; }
done
fi

gh release view "$TAG" --json assets --jq '.assets[] | "\(.name) \(.size) \(.digest)"'
47 changes: 46 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,46 @@ jobs:
name: tui-binary
path: zypi-linux-x86_64

build-tui-linux-arm:
name: Build TUI binary (Linux aarch64)
needs: test
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v7

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache Cargo registry and build
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
tui/target
key: tui-release-${{ runner.os }}-arm64-${{ hashFiles('tui/Cargo.lock') }}
restore-keys: tui-release-${{ runner.os }}-arm64-

- name: Install protoc
uses: arduino/setup-protoc@v3
with:
version: "28.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build zypi (release-dist)
working-directory: tui
run: cargo build --profile release-dist -p pi-pager-bin

- name: Prepare binary artifact
run: |
cp tui/target/release-dist/zypi zypi-linux-aarch64
chmod +x zypi-linux-aarch64

- uses: actions/upload-artifact@v6
with:
name: tui-binary-linux-aarch64
path: zypi-linux-aarch64

build-tui-macos-arm:
name: Build TUI binary (macOS arm64)
needs: test
Expand Down Expand Up @@ -173,7 +213,7 @@ jobs:

github-release:
name: GitHub Release
needs: [build, build-tui, build-tui-macos-arm]
needs: [build, build-tui, build-tui-linux-arm, build-tui-macos-arm]
# Same rule as publish-pypi.
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
Expand All @@ -192,6 +232,11 @@ jobs:
name: tui-binary
path: tui-bin/

- uses: actions/download-artifact@v7
with:
name: tui-binary-linux-aarch64
path: tui-bin/

- uses: actions/download-artifact@v7
with:
name: tui-binary-macos-arm64
Expand Down
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,44 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.0.0] - 2026-11-16

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.

## [0.9.1] - 2026-11-12

This is a patch release. It has one fix: `provider = "openai"` now shows the thinking that a gateway streams as `reasoning_content`. **Fixed** has the details. The VS Code extension needs a new agent binary to get the fix, so it needs a new Release and a new VSIX. **Changed** has the new version numbers. **Known issues** says that the 0.9.0 list still holds.
Expand Down
Loading
Loading