diff --git a/AGENTS.md b/AGENTS.md index d542a07c..622c0d21 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -37,7 +37,7 @@ AgentMessage[] → transform_context() → convert_to_llm() → LangChain BaseMe | `packages/pi-mcp/` | Optional extension `pi-mcp-py` (entry point `pi-mcp`): connects the MCP servers (stdio, http, sse) that an ACP client passes in `session/new`, one runner task per server, tools named `mcp____`, `/mcp` command. Core, harness and CLI have no MCP client; they hand the servers over as data (`ClientMcpServer`, `ExtensionAPI.client_mcp_servers`). Design: `docs/specs/2026-10-23-mcp-extension-design.md`. Its tests are left out of a run that did not install the package (the header says so) | — | | `packaging/agent/` | Builds the agent as a one-file executable (PyInstaller; `build.py`, `zycode-agent.spec`, `entry.py`) and the smoke test over ACP with a fake model server (`smoke.py`). `.github/workflows/agent-binaries.yml` runs both on five platforms and attaches the archives to the GitHub Release after the `Release` workflow. A frozen build has no interpreter: `host.py` starts a frozen `child.py`, and only the OpenAI-format provider is in it. Design and the registry entry draft: `docs/specs/2026-10-31-agent-binaries.md` | — | | `packages/pi-agent-cli/` | Standard-ACP CLI (`python -m pi_agent_cli`); config `agent.example.toml`, home `~/.pi-python`; TUI binary `zypi` under `tui/`. See [`packages/pi-agent-cli/AGENTS.md`](packages/pi-agent-cli/AGENTS.md) for spawn, config, first run (`--setup` and the terminal login that `initialize` offers to a client that can run one; `zypi` still gets `authMethods: []`), prompt pipeline, and the three permission modes `ask`, `auto` and `always-approve` (Auto: rules, and a model step for a `bash` call that no rule decides: `auto_rules.py`, `auto_classifier.py`, `auto_mode.py`, `permission_modes.py`; design `docs/specs/2026-11-02-auto-mode-design.md`; the pager offers all three, and a clean start is `ask`). The items on the ACP wire beyond standard ACP (`pi/session/delete`, `_meta.sessionId`, and others) are in the register `docs/specs/2026-11-05-acp-extension-registry.md` | — | -| `vscode/` | The VS Code extension `zycode.zycode` (TypeScript, `src/core/` has no `vscode` import). It is an ACP client and a chat view for zycode in VS Code: it starts the agent as a child process, shows permission questions and a diff for `write`/`edit`, runs the first-run setup in a terminal (a walkthrough, a banner and hints guide the first start; the agent's own `--setup` and `auth_required` carry it, no wire item and no agent change), lists past chats of the folder in a view (`session/list`, `session/load`, `pi/session/delete`), and offers the three permission modes `ask`, `auto` and `always-approve` in the chat menu (`always-approve` only after a modal warning, never restored for a new chat, a past chat or a restart, and not in an untrusted workspace; the `zycode.permissionMode` setting stays `ask`/`auto`; it moves the agent with the agent's own `pi/yolo_mode_changed`). The extension never writes `always-approve` through `set_config_option`. A Thinking menu shows `thinking_level` of `agent.toml`; agent 0.9.1 cannot change it live, so a change edits that one line (checked by parsing, after a modal), restarts the agent and reopens the chat (design section 7c). The menu has `max` only for an agent of `MAX_LEVEL_SINCE` (`src/core/thinking.ts`, 1.0.0) or later, because an older agent reads `max` as `off` and says nothing; check that number when the pin moves (`vscode/PACKAGING.md`). One VSIX per platform, each with the bundled `zycode-agent` binary of one Release (pin and sha256 in `agent-assets.json`). Not a Python package: pytest does not read it, and ruff reads only its three Python helpers (`scripts/python_licenses.py`, `test/support/fake_model.py`, `test/support/pty_answers.py`). `.github/workflows/vscode-extension.yml` runs `npm run check` and a `linux-x64` VSIX smoke test for a PR that changes it. `ci.yml` (Ruff, pytest) skips a PR that touches only `vscode/`, `docs/` and that workflow, with no `.py` file (a `paths` filter with `!` patterns; no check is required on `main`, so a skipped run blocks no merge). The same workflow publishes (Trusted Publishing, by hand on `main`, environment `vscode-publish`). 1.0.0 was the first stable release (the pre-release 0.1.0 was uploaded by hand; the 1.0.0 run, run `43181052994` on 2026-11-12, was the first real OIDC publish and worked on the first try on Open VSX and the Marketplace, five targets, no token; the record is in `vscode/RELEASING.md`; the owner tested the install of 1.0.0 and the update from 0.1.0 on Windows (2026-11-12), and the rest of the Windows flow, macOS and Linux in a real VS Code are not verified; stable = even minor, pre-release = odd minor). Do not rename that file or the environment: the registries name them. Local check: `cd vscode; npm run check`. Design: `docs/specs/2026-11-04-vscode-extension-design.md`; make and test a VSIX: `vscode/PACKAGING.md`; releases: `vscode/RELEASING.md` | — | +| `vscode/` | The VS Code extension `zycode.zycode` (TypeScript, `src/core/` has no `vscode` import). It is an ACP client and a chat view for zycode in VS Code: it starts the agent as a child process, shows permission questions and a diff for `write`/`edit`, runs the first-run setup in a terminal (a walkthrough, a banner and hints guide the first start; the agent's own `--setup` and `auth_required` carry it, no wire item and no agent change), lists past chats of the folder in a view (`session/list`, `session/load`, `pi/session/delete`), and offers the three permission modes `ask`, `auto` and `always-approve` in the chat menu (`always-approve` only after a modal warning, never restored for a new chat, a past chat or a restart, and not in an untrusted workspace; the `zycode.permissionMode` setting stays `ask`/`auto`; it moves the agent with the agent's own `pi/yolo_mode_changed`). The extension never writes `always-approve` through `set_config_option`. A Thinking menu shows `thinking_level` of `agent.toml`; agents 0.9.1 and 1.0.0 cannot change it live, so a change edits that one line (checked by parsing, after a modal), restarts the agent and reopens the chat (design section 7c). The menu has `max` only for an agent of `MAX_LEVEL_SINCE` (`src/core/thinking.ts`, 1.0.0) or later, because an older agent reads `max` as `off` and says nothing; check that number when the pin moves (`vscode/PACKAGING.md`). One VSIX per platform, each with the bundled `zycode-agent` binary of one Release (pin and sha256 in `agent-assets.json`; 1.4.0 is the first extension that bundles agent 1.0.0, so its menu has `max` and its Context row shows for a model that has `context_window`). Not a Python package: pytest does not read it, and ruff reads only its three Python helpers (`scripts/python_licenses.py`, `test/support/fake_model.py`, `test/support/pty_answers.py`). `.github/workflows/vscode-extension.yml` runs `npm run check` and a `linux-x64` VSIX smoke test for a PR that changes it. `ci.yml` (Ruff, pytest) skips a PR that touches only `vscode/`, `docs/` and that workflow, with no `.py` file (a `paths` filter with `!` patterns; no check is required on `main`, so a skipped run blocks no merge). The same workflow publishes (Trusted Publishing, by hand on `main`, environment `vscode-publish`). 1.0.0 was the first stable release (the pre-release 0.1.0 was uploaded by hand; the 1.0.0 run, run `43181052994` on 2026-11-12, was the first real OIDC publish and worked on the first try on Open VSX and the Marketplace, five targets, no token; the record is in `vscode/RELEASING.md`; the owner tested the install of 1.0.0 and the update from 0.1.0 on Windows (2026-11-12), and the rest of the Windows flow, macOS and Linux in a real VS Code are not verified; stable = even minor, pre-release = odd minor). Do not rename that file or the environment: the registries name them. Local check: `cd vscode; npm run check`. Design: `docs/specs/2026-11-04-vscode-extension-design.md`; make and test a VSIX: `vscode/PACKAGING.md`; releases: `vscode/RELEASING.md` | — | | `web/` | Product site for zycode, live at `https://zycode.dev` (static Astro, Node ≥ 22.23.4; English at `/`, Chinese at `/zh/`; Cloudflare Workers static assets, no server of ours). Not a Python package: ruff and pytest do not read it; `.github/workflows/web-ci.yml` runs `npm run check` and `npm run build` for a PR that changes `web/`. A merge to `main` that changes `web/` deploys to `zycode.dev` by itself (Cloudflare Workers Builds, not GitHub Actions). Its claims must stay equal to the README table "Status" and to the benchmark report, and `en.ts` / `zh.ts` keep the same keys. See [`web/README.md`](web/README.md) for commands, deploy, the domain, and the Cloudflare settings that are not in the repository | — | ### Invariants diff --git a/docs/specs/2026-11-04-vscode-extension-design.md b/docs/specs/2026-11-04-vscode-extension-design.md index 6525ddce..8630ed4c 100644 --- a/docs/specs/2026-11-04-vscode-extension-design.md +++ b/docs/specs/2026-11-04-vscode-extension-design.md @@ -17,7 +17,8 @@ - **Two kinds of trust.** VS Code Workspace Trust decides if the extension starts at all. The agent's own project trust decides if the project may load its extensions. The text of the two prompts says so. - **Publishing.** Open VSX first, then the Marketplace. The first upload to each (0.1.0, a pre-release) was a hand upload of a VSIX that the packaging script made. The publish workflow (`.github/workflows/vscode-extension.yml`, section 11) runs from `main` by `workflow_dispatch`, with Trusted Publishing and the environment `vscode-publish`; it publishes the stable releases, 1.0.0 first. - **Added in 1.0.0.** A first-run guide, `always-approve` in the mode menu (with a warning, never restored), a Past chats view (list, open, delete), and a Thinking menu. All four use what the bundled agent already has (0.1.0 bundled 0.9.0; 1.0.0 bundles **0.9.1**): no wire item and no agent change. The Thinking menu edits one line of `agent.toml` and restarts the agent, because 0.9.0 has no live setting (section 7c). -- **Added after 1.0.0.** Markdown in the chat (section 2, rule 5, and D34), and a richer status row (section 7d): the context window and the cost when the agent sends the standard `usage_update`, the time of the turn, and the folder. Agent 0.9.1 sends no `usage_update`, so the Context row does not show with the bundled agent. The agent change that sends it was built on 2026-11-16 (`docs/specs/2026-11-13-agent-context-usage.md`); it is not released, so the row shows after the next agent release and a new pin. +- **Added after 1.0.0.** Markdown in the chat (section 2, rule 5, and D34), and a richer status row (section 7d): the context window and the cost when the agent sends the standard `usage_update`, the time of the turn, and the folder. Agent 0.9.1 sent no `usage_update`, so the Context row did not show with the agent that 1.0.0 and 1.2.0 bundle. The agent change that sends it was built on 2026-11-16 (`docs/specs/2026-11-13-agent-context-usage.md`) and released in agent 1.0.0. Extension 1.4.0 bundles that agent, so the row shows for a model that has `context_window`. +- **Added in 1.4.0.** The pin moves from agent 0.9.1 to agent 1.0.0. The Thinking menu offers the level `max` to an agent of 1.0.0 or later (section 7c), and the Context row shows with the bundled agent (section 7d). The agent still has no live thinking setting: `set_config_option` of 1.0.0 takes only `model` and `mode` (read in `pi_agent_cli/agent.py`), so the menu still edits `agent.toml` and restarts the agent. - **Not yet.** Model choice, images, `@file`, MCP servers, fallback package, and everything of report section 3.3 from Phase 2 on (section 12). ## 1. Facts the design rests on @@ -352,7 +353,7 @@ Nothing else is needed, so there is **no wire item to add and no agent change**. | Time of the turn | the clock of the host, from `send` to the end of the turn | in the header after the state: `Working · 1 min 12 s`, then `Ready · last turn 8.4 s` until the next turn; a line of the tooltip | While a turn runs, and after it. | | Folder | `cwd` of the session | in the line of the agent and the model: `folder pi-python` (the full path is its tooltip); a line of the tooltip of the status bar item | When the chat has a folder. | -**Agent 0.9.1 sends no `usage_update`, so the Context row does not show with the bundled agent.** What was found is in `docs/specs/2026-11-13-agent-context-usage.md`. The agent change that sends `usage_update` (for a model that has `context_window` in `agent.toml`) was built later, on 2026-11-16. It is not released, and no pin was moved. +**Agent 0.9.1 sent no `usage_update`, so the Context row did not show with the agent that extensions 1.0.0 and 1.2.0 bundle.** What was found is in `docs/specs/2026-11-13-agent-context-usage.md`. The agent change that sends `usage_update` (for a model that has `context_window` in `agent.toml`) was built later, on 2026-11-16, and released in agent 1.0.0. Extension 1.4.0 moves the pin to that agent, so the row shows for a model that has `context_window`. The agent sends no cost, so the Cost line does not show. The extension was not run against agent 1.0.0 in a real VS Code window with a real model. **Design notes.** @@ -536,7 +537,7 @@ From the report, section 3.3 (Phase 2 and later), and from the limits above: ## 14. Decisions -**Status of D15 to D33:** the user adopted all of them as recommended (2026-11-12, 14:49 Asia/Shanghai: "都按你的建议", one answer for every decision). Each row marked (adopted) is built as the row says. The bundled agent of 1.0.0 is **0.9.1** (`agent-assets.json`, pinned with size and sha256). +**Status of D15 to D33:** the user adopted all of them as recommended (2026-11-12, 14:49 Asia/Shanghai: "都按你的建议", one answer for every decision). Each row marked (adopted) is built as the row says. The bundled agent of extension 1.0.0 is **0.9.1** (`agent-assets.json`, pinned with size and sha256). Extension 1.4.0 bundles agent 1.0.0. **Status of D34 and D35:** both are newer (2026-11-12, after 1.0.0). D34 is the answer of the user to a question with three options: the user chose option A. D35 is a part of the work for D34. The user was not asked about D35. diff --git a/docs/specs/2026-11-13-agent-context-usage.md b/docs/specs/2026-11-13-agent-context-usage.md index 466f34f4..b2e20301 100644 --- a/docs/specs/2026-11-13-agent-context-usage.md +++ b/docs/specs/2026-11-13-agent-context-usage.md @@ -1,7 +1,7 @@ # Context use and cost from the agent: investigation record > Date: 2026-11-13 (investigation); 2026-11-16 (built). -> Status: **built (Plan A), not released.** Sections 1 to 3 are the investigation of 2026-11-13. They describe agent 0.9.1, and they are not changed. Section 4 says what the agent does now. +> Status: **built (Plan A) and released in agent 1.0.0 (2026-11-16); the extension bundles that agent from 1.4.0.** Sections 1 to 3 are the investigation of 2026-11-13. They describe agent 0.9.1, and they are not changed. Section 4 says what the agent does now. > Reason: the user asked for the context use in the status row of the VS Code extension. On 2026-11-13 the user said: if the agent must change, write down the result of the investigation, and do not make the change. On 2026-11-16 the user asked for the change, with Plan A (option A of section 4, item 1, in the first version of this record). > Related: `docs/specs/2026-11-04-vscode-extension-design.md` section 7d (the extension side, which is built); `docs/specs/2026-11-05-acp-extension-registry.md` section 5; the entry of 2026-10-13 in `docs/PLAN/archive/PLAN-RUST-AGENT-RUNTIME-REMOVAL-EXECUTION-LOG.md` (the pager had the same question). @@ -65,11 +65,11 @@ The change follows the proposal of the first version of this record. The differe An agent change is not enough. The extension bundles one fixed agent binary. After the change: release the agent, then change `zycodeAgentVersion` and the size and the sha256 in `vscode/agent-assets.json`, then release the extension. A user who sets `zycode.agentPath` gets the change as soon as that program is new. -At the extension release, change the sentences that say that the bundled agent sends no `usage_update`: `vscode/README.md` (the Context row), `vscode/CHANGELOG.md` and design section 7d. They are true for agent 0.9.1 only. +At the extension release, change the sentences that say that the bundled agent sends no `usage_update`: `vscode/README.md` (the Context row), `vscode/CHANGELOG.md` and design section 7d. They are true for agent 0.9.1 only. **Done** in extension 1.4.0 (2026-11-16): the pin moved to agent 1.0.0 and these three places say that the Context row shows for a model that has `context_window`. ## 7. Decisions -1. Change the agent? **Yes** (the user, 2026-11-16). It is built, and it is not released. +1. Change the agent? **Yes** (the user, 2026-11-16). It is built, and it is released in agent 1.0.0. 2. The source of the window size: **A** (section 4, item 1). 3. Compaction by the real window, in the same change? **Yes.** It follows from setting `Model.context_window`. It has its own test, and a guard for small windows (section 4, item 5). 4. Teach the pager to read `usage_update`? **Open.** Not decided, not built. @@ -82,4 +82,4 @@ It does what needs no agent change (design section 7d): - It measures the time of the turn with its own clock. - It shows the folder of the chat. -With agent 0.9.1, which the extension bundles now, the Context row does not show. With an agent that has the change in section 4, it shows for a model that has a `context_window`. The extension reads the message in tests with a fake agent. Its chat controller ran once against the changed agent (section 4, item 7). The extension has not been run against the changed agent in a real VS Code. +With agent 0.9.1, which extensions 1.0.0 and 1.2.0 bundle, the Context row does not show. With an agent that has the change in section 4 (agent 1.0.0, which extension 1.4.0 bundles), it shows for a model that has a `context_window`. The extension reads the message in tests with a fake agent. Its chat controller ran once against the changed agent (section 4, item 7). The extension has not been run against the changed agent in a real VS Code. diff --git a/docs/specs/2026-11-16-thinking-max-and-turn-limit.md b/docs/specs/2026-11-16-thinking-max-and-turn-limit.md index f0d917e4..e2fd6910 100644 --- a/docs/specs/2026-11-16-thinking-max-and-turn-limit.md +++ b/docs/specs/2026-11-16-thinking-max-and-turn-limit.md @@ -1,6 +1,6 @@ # The `max` thinking level and the turn limit: investigation record -Date: 2026-11-16. Status: built in the branch of PR #131, as separate commits (the agent, then the extension). Not released. +Date: 2026-11-16. Status: built in the branch of PR #131, as separate commits (the agent, then the extension). The agent is released in 1.0.0 (2026-11-16). The extension release 1.4.0 moves the pin to that agent. ## 1. Question @@ -54,9 +54,9 @@ Tests: `test_thinking.py`, `test_deepseek_thinking.py`, `test_deepseek_replay.py ## 5. Risks and side effects -- **A declared window turns compaction on.** A user who has `context_window` and no `max_turns` did not compact before. This is on purpose: the agent knows when the context is full. `auto_compact = false` turns it off. `context_window` is not released yet (PR #131), so nobody depends on the old behaviour. +- **A declared window turns compaction on.** A user who has `context_window` and no `max_turns` did not compact before. This is on purpose: the agent knows when the context is full. `auto_compact = false` turns it off. `context_window` was not in any release before agent 1.0.0 (PR #131), so nobody depended on the old behaviour. - **`max` is open for every model.** A model that does not take it answers with an error, and nothing is lowered. Plan B would lower it. -- **Old agents.** An agent that does not know `max` takes `thinking_level = "max"` as `off`, and it gives no note. The extension of this PR does not offer `max` to such an agent (section 4). But `MAX_LEVEL_SINCE` is a statement about a release that is not made yet (1.0.0): it must be the first release that has `max`, or a later one. A number that is too low shows `max` to an agent that reads it as `off`. A number that is too high only hides `max`. If PR #130 releases 1.0.0 without this PR, change the number before the extension release that bundles that agent. +- **Old agents.** An agent that does not know `max` takes `thinking_level = "max"` as `off`, and it gives no note. The extension of this PR does not offer `max` to such an agent (section 4). But `MAX_LEVEL_SINCE` is a statement about a release that is not made yet (1.0.0): it must be the first release that has `max`, or a later one. A number that is too low shows `max` to an agent that reads it as `off`. A number that is too high only hides `max`. If PR #130 releases 1.0.0 without this PR, change the number before the extension release that bundles that agent. **Checked on 2026-11-16:** PR #131 was in `main` before PR #130 was merged, and 1.0.0 was released from that commit, so 1.0.0 is the first release that has `max`. The number is right. - **The extension 1.0.0 and `max` in the file.** The extension reads `thinking_level` itself (`vscode/src/core/thinking.ts`) and has six levels. For a user who writes `max` by hand, its menu shows `off`, and a note says that the agent does not know `max` (`chat-controller.ts`). For the new agent that note is wrong: the agent uses `max`. Nothing breaks. The note goes away when the extension knows `max`. - **A client sees `max_turn_requests`, not `end_turn`.** The extension shows a line of notice. `zypi` takes it as "done". Another client may show it as a failure: not checked. @@ -70,7 +70,7 @@ Tests: `test_thinking.py`, `test_deepseek_thinking.py`, `test_deepseek_replay.py ## 7. Open -1. The extension release: move the pin (`vscode/PACKAGING.md`), check `MAX_LEVEL_SINCE`, and change the sentences that say the menu has six levels (`vscode/README.md`, `vscode/CHANGELOG.md`). They stay as they are until then, because they are true for the agent 0.9.1 that the extension bundles today. +1. The extension release: move the pin (`vscode/PACKAGING.md`), check `MAX_LEVEL_SINCE`, and change the sentences that say the menu has six levels (`vscode/README.md`, `vscode/CHANGELOG.md`). They stayed as they were until then, because they were true for the agent 0.9.1 that the extension bundled. **Done** in extension 1.4.0 (2026-11-16): the pin is agent 1.0.0, `MAX_LEVEL_SINCE` is 1.0.0 (the first release that has `max`), and the README and the CHANGELOG say that the menu has `max` for an agent of 1.0.0 or later. 2. Anthropic: adaptive thinking with `effort` for new models, and a higher floor for `langchain-anthropic`. A separate change. 3. Plan B: a table of levels per model, as in `pi`, so that a level that a model does not take is lowered, and a menu can hide it. 4. A compaction threshold of its own. With a window of 1M, compaction starts above 983,616 tokens, which can be late (cost, quality). Not investigated. diff --git a/vscode/CHANGELOG.md b/vscode/CHANGELOG.md index e9045853..72a662c8 100644 --- a/vscode/CHANGELOG.md +++ b/vscode/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 1.4.0 (2026-11-16) + +Stable release. It follows 1.2.0 and bundles agent 1.0.0 (1.2.0 had 0.9.1). A user of 1.2.0 gets it as an update. + +### New + +- The **Thinking** menu has a new level, `max`, above `xhigh`. The menu offers `max` only for an agent of version 1.0.0 or later, because an older agent reads `max` as `off` and says nothing. The bundled agent is 1.0.0, so its menu has `max`. An older agent that you choose with `zycode.agentPath` keeps the six levels. The extension does not know which model takes `max`. A model that does not take it answers with an error. Then choose a lower level. +- The **Context** row now shows with the bundled agent. Agent 1.0.0 sends the standard ACP message `usage_update` when the model has `context_window` in `agent.toml` (a whole number of tokens). The row has a bar, the percent and the tokens, and the VS Code status bar shows `· context 42%`. A model with no `context_window` gets no row. The agent sends no cost, so there is no **Cost** line (the agent has no price table). Part of the count is an estimate: the tool results of a turn, and the whole count after a compaction. The next model call gives an exact number. + +### Changed + +- Bundles `zycode-agent` 1.0.0 for `linux-x64`, `linux-arm64`, `darwin-arm64`, `darwin-x64` and `win32-x64`. Version 1.2.0 had 0.9.1. Two more changes of the agent reach you with it. When the model has a `context_window`, the agent compacts a long chat by itself (`auto_compact = false` at the top of `agent.toml` turns this off). When an answer ends because the agent reached `max_turns`, the stop reason is `max_turn_requests` (it was `end_turn`), and the chat shows "The turn ended: max_turn_requests." The list of all changes of agent 1.0.0 is in the [CHANGELOG of the repository](https://github.com/zy1233/pi-python/blob/main/CHANGELOG.md). + ## 1.2.0 (2026-11-13) Stable release. It follows 1.0.0 and has the same bundled agent (0.9.1). A user of 1.0.0 gets it as an update. diff --git a/vscode/README.md b/vscode/README.md index bb0bbeb2..3b862e95 100644 --- a/vscode/README.md +++ b/vscode/README.md @@ -7,14 +7,14 @@ zycode is a coding agent. This extension puts it in a chat view in VS Code. The ## What you get - A chat view in the activity bar, with the status of the agent, its version, the model, and the permission mode. -- A status row at the top of the chat: the state of the agent with the time of the turn (a clock while it works, and how long the last turn took), the version, the model and the folder. When the agent reports how full the context window is, a **Context** row adds a bar, the percent, the tokens and the cost. The VS Code status bar shows `zycode: `, and `· context 42%` when the agent reports it. +- A status row at the top of the chat: the state of the agent with the time of the turn (a clock while it works, and how long the last turn took), the version, the model and the folder. When the agent reports how full the context window is, a **Context** row adds a bar, the percent and the tokens (and the cost, for an agent that sends it). The bundled agent reports it for a model that has `context_window` in `agent.toml`. The VS Code status bar shows `zycode: `, and `· context 42%` when the agent reports it. - Markdown in the answers: headings, bold, italic, strikethrough, lists, quotes, tables, code blocks and links. A link opens through VS Code, and only `http`, `https` and `mailto` links open. - A question card for every tool call that is not read-only. You choose *Allow once* or *Reject*. - A **Show diff** button for `write` and `edit` calls, before the call (what it would change) and after it (what it changed). The diff is for reading. The extension never writes your files. - A getting-started guide for the first start (a VS Code walkthrough), and help in the chat when the agent has no model, no key, or a key that is refused. The setup runs in a VS Code terminal, and you type the key there. - A **Past chats** view under the chat: the chats of the open folder. Open one to continue it, or delete it. - A mode menu in the chat: **Ask**, **Auto** and **Always approve**. -- A **Thinking** menu next to it: the thinking level of the model (`off` to `xhigh`). A change edits one line of `agent.toml` and restarts the agent (see Thinking level). +- A **Thinking** menu next to it: the thinking level of the model (`off` to `max`; `max` only for an agent of version 1.0.0 or later). A change edits one line of `agent.toml` and restarts the agent (see Thinking level). - Commands (Command Palette, category *zycode*): Open chat, New chat, Stop, Restart agent, Set up model and API key, Open the getting-started guide, Open agent.toml, Show log, Refresh past chats. ## The first start @@ -64,9 +64,9 @@ The **Past chats** view is under the chat. It lists the chats that the agent sav ## Thinking level -The **Thinking** menu in the chat header shows the thinking level that the running agent uses, and it lists the six levels that the agent knows: `xhigh`, `high`, `medium`, `low`, `minimal` and `off` (the order of the `zypi` menu). +The **Thinking** menu in the chat header shows the thinking level that the running agent uses, and it lists the levels that the agent knows: `max`, `xhigh`, `high`, `medium`, `low`, `minimal` and `off` (the order of the `zypi` menu). An agent older than 1.0.0 does not know `max`: it reads `max` as `off` and says nothing. So the menu lists `max` only for an agent of version 1.0.0 or later (the bundled agent), and six levels for an older agent (one that you choose with `zycode.agentPath`). The extension does not know which model takes `max`. A model that does not take it answers with an error. Then choose a lower level. -- **The agent cannot change the level while it runs** (agent 0.9.1). It reads `thinking_level` from `agent.toml` when it starts, and it has no setting, option or command for it over ACP. So the menu changes the file, not the agent: when you pick a level, a modal question names the file and the line, and after **Set and restart** the extension writes `thinking_level = ""` in `agent.toml`, restarts the agent, and opens the same chat again with its history. Nothing else in the file changes: the extension edits one line (or adds it above the first table), keeps your comments and line ends, checks the result by reading both texts as TOML, and writes through a temporary file. If the line is written in a form that it does not edit, it changes nothing and tells you to edit it by hand. +- **The agent cannot change the level while it runs** (agents 0.9.1 and 1.0.0). It reads `thinking_level` from `agent.toml` when it starts, and it has no setting, option or command for it over ACP. So the menu changes the file, not the agent: when you pick a level, a modal question names the file and the line, and after **Set and restart** the extension writes `thinking_level = ""` in `agent.toml`, restarts the agent, and opens the same chat again with its history. Nothing else in the file changes: the extension edits one line (or adds it above the first table), keeps your comments and line ends, checks the result by reading both texts as TOML, and writes through a temporary file. If the line is written in a form that it does not edit, it changes nothing and tells you to edit it by hand. - **The level is one setting for all chats.** It is in `agent.toml`, so a new chat, a past chat that you open, a restart of the agent and a restart of VS Code all start at the level that the file has, and `zypi` in a terminal uses the same level. A chat does not keep a level of its own: the agent does not save it in the chat. There is no `zycode` setting for it, because it could differ from the file. - **A model that does not think.** If `agent.toml` says `reasoning = false` for the model, the agent asks no provider to think, whatever the level is. The menu is then off, and its tooltip says why. The agent does not tell a client which model can think: the file is the only place that says it. If `reasoning` is not set, the menu is on, and a level other than `off` makes the agent treat the model as one that thinks. A model or provider that does not know thinking can answer with an error. Then set the level to `off`. - The menu is off while an answer runs, when `agent.toml` does not exist yet (run the setup first) and when it is not valid TOML. @@ -93,7 +93,7 @@ The extension has no telemetry and sends nothing to its authors. The agent sends - The bundled agent has only the OpenAI-format provider (and services that speak that format). For the Anthropic or DeepSeek provider, install the Python agent and set `zycode.agentPath`. - On Linux the bundled agent needs glibc 2.35 or newer. There is no package for Alpine (musl), 32-bit ARM, or Windows on ARM. - The thinking level is a line of `agent.toml`, and a change restarts the agent (the chat is opened again; a running answer must end first; Always approve is off again after the restart). A live setting needs a change in the agent. -- The **Context** row shows only when the agent sends the standard ACP message `usage_update`. Agent 0.9.1, which is bundled, does not send it, so the row does not show yet. The extension does not count tokens and does not guess the size of the window. What an agent change needs is in [the investigation record](https://github.com/zy1233/pi-python/blob/main/docs/specs/2026-11-13-agent-context-usage.md). +- The **Context** row shows only when the agent sends the standard ACP message `usage_update`. The bundled agent sends it for a model that has `context_window` in `agent.toml` (a whole number of tokens, in `[model]` or in an entry of `[[models]]`). For a model with no `context_window`, the row does not show. The agent sends no cost, so the **Cost** line does not show with it. Part of the count is an estimate (the tool results of a turn, and the whole count after a compaction), and the next model call gives an exact number. A `context_window` that is too small can show more than 100 %. The extension does not count tokens and does not guess the size of the window. How this was found is in [the investigation record](https://github.com/zy1233/pi-python/blob/main/docs/specs/2026-11-13-agent-context-usage.md). - One chat at a time (open a past chat to switch). No model choice, no images, no `@file` mentions yet. - Markdown in an answer: raw HTML shows as text, and an image is not loaded (it shows as a link). There is no math, no footnote and no task-list box: their marks show as text (but the line of a footnote definition, `[^1]: …`, does not show, because Markdown reads it as the definition of a link). A link with an address that the extension does not open (for example `javascript:`) shows its text and its address as plain text. Bold, italic, strikethrough and links nest at most 32 levels deep (all kinds count together), and a deeper one shows only its text. diff --git a/vscode/RELEASING.md b/vscode/RELEASING.md index fd051ff7..87d263b1 100644 --- a/vscode/RELEASING.md +++ b/vscode/RELEASING.md @@ -33,7 +33,7 @@ This file is the checklist for a release. How the files are made is in `PACKAGIN - A release and a pre-release are two lines of the same extension. The version decides which one a user gets. The Marketplace rule: use **even minor numbers for releases** (`1.0.0`, `1.2.0`) and **odd minor numbers for pre-releases** (`1.1.0`, `1.1.1`). A user on the pre-release channel gets the highest version of both lines. A user on the release channel gets the highest release. - `1.0.0` is above `0.1.0`, so the pre-release `0.1.0` updates to `1.0.0`. `1.0.0` has no pre-release flag: the VSIX is made without `--pre-release`, the workflow calls `vsce publish` without it, and `scripts/check-vsix.mjs` fails a VSIX that has the flag. -- The next pre-release line is `1.1.x`, and the next stable release is `1.2.0`. A pre-release needs a new input in the workflow and the flag in `scripts/package.mjs` first. Do that in its own pull request. +- The versions in use: `1.0.0`, `1.2.0` and `1.4.0` (releases), and `0.1.0` (pre-release). After `1.4.0`, the next pre-release line is `1.5.x`, and the next stable release is `1.6.0` (or `1.4.1` for a fix). A pre-release needs a new input in the workflow and the flag in `scripts/package.mjs` first. Do that in its own pull request. - A version cannot be published twice or changed. If a published version is wrong, publish a higher one. ## Before the run diff --git a/vscode/agent-assets.json b/vscode/agent-assets.json index 5c8a58ac..9ec84bf8 100644 --- a/vscode/agent-assets.json +++ b/vscode/agent-assets.json @@ -1,43 +1,43 @@ { - "version": "0.9.1", - "tag": "v0.9.1", + "version": "1.0.0", + "tag": "v1.0.0", "repository": "zy1233/pi-python", "pythonPackages": [ - "pi-agent-cli-lc==0.9.1", - "pi-web-access-py==0.6.1", - "pi-goal-x-py==0.6.1", - "pi-dynamic-workflows-py==0.6.1", - "pi-mcp-py==0.4.1" + "pi-agent-cli-lc==1.0.0", + "pi-web-access-py==1.0.0", + "pi-goal-x-py==1.0.0", + "pi-dynamic-workflows-py==1.0.0", + "pi-mcp-py==1.0.0" ], "targets": { "linux-x64": { - "asset": "zycode-agent-linux-x86_64-0.9.1.tar.gz", - "size": 76460419, - "sha256": "c241e4aea5e251ddc3198e1628883188228918502dcd4e941cdee6cebc1dd7db", + "asset": "zycode-agent-linux-x86_64-1.0.0.tar.gz", + "size": 76495166, + "sha256": "889ac685c7d209282fe04d83ad3fdd8ba29d8337733a6ab51020c2d8c48cc2bd", "program": "zycode-agent" }, "linux-arm64": { - "asset": "zycode-agent-linux-aarch64-0.9.1.tar.gz", - "size": 73714178, - "sha256": "2d0ce101619111abff347c1add8ae19969adc98723286b45c266a2ceeea813ac", + "asset": "zycode-agent-linux-aarch64-1.0.0.tar.gz", + "size": 73746530, + "sha256": "b729a5491b4f66a6f7292832af6b0aea2a4e305f07d9be878a081ea548d9b0e0", "program": "zycode-agent" }, "darwin-arm64": { - "asset": "zycode-agent-darwin-aarch64-0.9.1.tar.gz", - "size": 40856991, - "sha256": "400221f9275e71eedcfd69b461dfeeeada8ddee26cfe261f052d72465ab2326c", + "asset": "zycode-agent-darwin-aarch64-1.0.0.tar.gz", + "size": 40893558, + "sha256": "f38c47e0eda248d6d0ced2f67dc3cfe9de5d41cc0dbfe2310b1ec1b453295ff3", "program": "zycode-agent" }, "darwin-x64": { - "asset": "zycode-agent-darwin-x86_64-0.9.1.tar.gz", - "size": 40756947, - "sha256": "57afdec27a3c84c01de4a80d6374e2d0d43ad9909f20c5d190f37320a3f3c40b", + "asset": "zycode-agent-darwin-x86_64-1.0.0.tar.gz", + "size": 40790929, + "sha256": "eed770ef65811d52e71524d9253ab1c21a6eab7804547518b4f34e0785233c13", "program": "zycode-agent" }, "win32-x64": { - "asset": "zycode-agent-windows-x86_64-0.9.1.zip", - "size": 42346505, - "sha256": "9eb0e7175499ef78397b15a28780d667837d2a81a95d0bc622a792fe5595a620", + "asset": "zycode-agent-windows-x86_64-1.0.0.zip", + "size": 42382434, + "sha256": "8d0347339f27d1ca475208fe73c8feeedb2dbd58982f94c16afc24118c636c4e", "program": "zycode-agent.exe" } } diff --git a/vscode/package-lock.json b/vscode/package-lock.json index 2172f897..a76236a4 100644 --- a/vscode/package-lock.json +++ b/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "zycode", - "version": "1.2.0", + "version": "1.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "zycode", - "version": "1.2.0", + "version": "1.4.0", "license": "MIT", "devDependencies": { "@agentclientprotocol/sdk": "2.4.0", diff --git a/vscode/package.json b/vscode/package.json index 5de231e7..f3e3c09b 100644 --- a/vscode/package.json +++ b/vscode/package.json @@ -2,7 +2,7 @@ "name": "zycode", "displayName": "zycode", "description": "Chat with the zycode coding agent in VS Code. Unofficial; not affiliated with pi or Microsoft.", - "version": "1.2.0", + "version": "1.4.0", "publisher": "zycode", "icon": "media/icon.png", "galleryBanner": { @@ -19,7 +19,7 @@ "bugs": { "url": "https://github.com/zy1233/pi-python/issues" }, - "zycodeAgentVersion": "0.9.1", + "zycodeAgentVersion": "1.0.0", "engines": { "vscode": "^1.90.0" },