mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-23 09:42:53 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3c82d5fe6 |
@@ -93,6 +93,3 @@ app.json
|
||||
|
||||
# Heap snapshots dumped by --heapsnapshot-near-heap-limit; keep them for debugging.
|
||||
*.heapsnapshot
|
||||
|
||||
# Project-local Serena configuration and memories.
|
||||
.serena/
|
||||
|
||||
+8
-77
@@ -1,57 +1,12 @@
|
||||
# Changelog
|
||||
|
||||
## 0.11.4 - 2026-10-15
|
||||
|
||||
[Hoplite](https://hoplite.sh) joins Paseo as our first sponsor through the company sponsorship program. Hoplite builds cloud coding agents that turn tasks from GitHub, Linear, Slack and more into pull requests. Thank you to the Hoplite team for supporting Paseo.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed Hoplite showing an error in Settings → Providers instead of discovering models in workspaces linked to a Hoplite project
|
||||
|
||||
## 0.11.3 - 2026-10-15
|
||||
|
||||
### Added
|
||||
|
||||
- Added Hoplite as an opt-in provider in the ACP provider catalog ([#6953](https://github.com/getpaseo/paseo/pull/6953) by [@odinglyn0](https://github.com/odinglyn0))
|
||||
- Added search to the Add provider catalog ([#6953](https://github.com/getpaseo/paseo/pull/6953), [#7030](https://github.com/getpaseo/paseo/pull/7030))
|
||||
|
||||
### Changed
|
||||
|
||||
- Changed Add provider failures to show as a toast ([#7030](https://github.com/getpaseo/paseo/pull/7030))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed Remove being offered for plugin providers such as Antigravity and Muse Code ([#6568](https://github.com/getpaseo/paseo/pull/6568) by [@Ctrl-Creeper](https://github.com/Ctrl-Creeper))
|
||||
|
||||
## 0.11.2 - 2026-10-09
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed intermittent text clipping in iOS chats and Markdown previews ([#6445](https://github.com/getpaseo/paseo/pull/6445))
|
||||
|
||||
## 0.11.1 - 2026-10-07
|
||||
|
||||
### Added
|
||||
|
||||
- Added Claude Haiku 5.5 for Claude Code 2.1.293 and newer ([#6332](https://github.com/getpaseo/paseo/pull/6332))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed Claude tool calls that run longer than 30 seconds, such as WebFetch or MCP tools, showing up as subagents ([#6308](https://github.com/getpaseo/paseo/pull/6308))
|
||||
- Fixed subagents that finish while the app is disconnected staying "working" until one is opened ([#6316](https://github.com/getpaseo/paseo/pull/6316))
|
||||
- Fixed a Claude agent's history showing "No activity to display" after a daemon restart when its transcript is in another project folder, such as after moving the daemon or running Windows Claude Code from WSL ([#6301](https://github.com/getpaseo/paseo/pull/6301))
|
||||
|
||||
## 0.11.0 - 2026-10-07
|
||||
|
||||
Paseo 0.11 adds support for the [plugin registry](https://paseo.sh/plugins). Browse community plugins there, install one with `paseo plugin add owner/slug`, or [submit your own](https://paseo.sh/docs/plugins/publishing#plugin-registry).
|
||||
|
||||
**Before upgrading:** `paseo plugin add owner/repo` now installs from the registry, so use `github:owner/repo` to install straight from GitHub and `./path` for a local directory.
|
||||
## 0.11.0-beta.5 - 2026-10-06
|
||||
|
||||
### Added
|
||||
|
||||
- Added Muse Code as a provider, with model, approval mode, and reasoning effort controls ([#5719](https://github.com/getpaseo/paseo/pull/5719), [#5775](https://github.com/getpaseo/paseo/pull/5775) by [@millerben95](https://github.com/millerben95))
|
||||
- Added Antigravity as a provider that drives the installed `agy` CLI, always in Full access ([#5714](https://github.com/getpaseo/paseo/pull/5714), [#5795](https://github.com/getpaseo/paseo/pull/5795))
|
||||
- Added Usage, opened from the sidebar footer as a dialog on desktop and a sheet on mobile, showing each subscription account's quota windows with Refresh ([#5465](https://github.com/getpaseo/paseo/pull/5465), [#5685](https://github.com/getpaseo/paseo/pull/5685), [#5786](https://github.com/getpaseo/paseo/pull/5786), [#5805](https://github.com/getpaseo/paseo/pull/5805), [#5921](https://github.com/getpaseo/paseo/pull/5921), [#6216](https://github.com/getpaseo/paseo/pull/6216))
|
||||
- Added a Usage screen, opened from the sidebar footer, showing each subscription account's quota windows with Refresh ([#5465](https://github.com/getpaseo/paseo/pull/5465), [#5685](https://github.com/getpaseo/paseo/pull/5685), [#5786](https://github.com/getpaseo/paseo/pull/5786), [#5805](https://github.com/getpaseo/paseo/pull/5805), [#5921](https://github.com/getpaseo/paseo/pull/5921))
|
||||
- Added an opt-in Usage summary to the sidebar footer that shows the windows you pin ([#5903](https://github.com/getpaseo/paseo/pull/5903), [#5975](https://github.com/getpaseo/paseo/pull/5975), [#6089](https://github.com/getpaseo/paseo/pull/6089))
|
||||
- Added Usage discovery of ChatGPT logins from Codex CLI, OpenCode, Pi, and OMP ([#5844](https://github.com/getpaseo/paseo/pull/5844))
|
||||
- Added Usage discovery of Claude logins from the Claude Code credential file, the macOS keychain, Pi, and OMP ([#5844](https://github.com/getpaseo/paseo/pull/5844))
|
||||
@@ -61,26 +16,21 @@ Paseo 0.11 adds support for the [plugin registry](https://paseo.sh/plugins). Bro
|
||||
- Added Fast mode and an Auto thinking level to OMP ([#5550](https://github.com/getpaseo/paseo/pull/5550) by [@n24q02m](https://github.com/n24q02m), [@abhi-wan-kenobi](https://github.com/abhi-wan-kenobi))
|
||||
- Added MCP servers to OMP schedules and Hub runs ([#5550](https://github.com/getpaseo/paseo/pull/5550) by [@omercnet](https://github.com/omercnet))
|
||||
- Added a Content width setting for the maximum width of chat and Markdown files on wide screens ([#5680](https://github.com/getpaseo/paseo/pull/5680))
|
||||
- Added syntax highlighting for Vue files ([#6205](https://github.com/getpaseo/paseo/pull/6205) by [@Davnn1](https://github.com/Davnn1))
|
||||
- Added `agents.providers.<id>.options` in `config.json` as default options for every provider, with per-agent overrides ([#5780](https://github.com/getpaseo/paseo/pull/5780))
|
||||
- Added the terminal key bar and Paste to terminal panes on iPad and Android tablets ([#5712](https://github.com/getpaseo/paseo/pull/5712) by [@lardissone](https://github.com/lardissone))
|
||||
|
||||
### Plugins
|
||||
|
||||
- Changed `paseo plugin add owner/slug` to install the reviewed plugin from the plugin registry, so local directories need a path such as `./slug` and direct GitHub installs need `github:owner/repo` ([#6224](https://github.com/getpaseo/paseo/pull/6224))
|
||||
- Added [screens and sidebar header and footer items](https://paseo.sh/docs/plugins/reference#screens-and-sidebar-items) to the plugin SDK ([#5685](https://github.com/getpaseo/paseo/pull/5685))
|
||||
- Added screens and sidebar header and footer items to the plugin SDK ([#5685](https://github.com/getpaseo/paseo/pull/5685))
|
||||
- Added usage sources to the plugin SDK ([#5465](https://github.com/getpaseo/paseo/pull/5465), [#5876](https://github.com/getpaseo/paseo/pull/5876))
|
||||
- Added `spawnProcess()`, `execCommand()`, and `terminateProcess()` to the plugin SDK for launching CLIs, including Windows `.cmd` and `.bat` scripts ([#6151](https://github.com/getpaseo/paseo/pull/6151))
|
||||
- Added `client.playAudio()` to the plugin SDK for playing audio on every client ([#5976](https://github.com/getpaseo/paseo/pull/5976))
|
||||
- Added an `agent.closed` plugin lifecycle event ([#5971](https://github.com/getpaseo/paseo/pull/5971) by [@ilteoood](https://github.com/ilteoood))
|
||||
- Added command and environment overrides and availability diagnostics for plugin providers ([#5707](https://github.com/getpaseo/paseo/pull/5707))
|
||||
- Added a display name, icon, screenshots, and videos to the plugin manifest ([#6263](https://github.com/getpaseo/paseo/pull/6263))
|
||||
- Added an `OVERVIEW.md` template to `paseo plugin init` for plugin registry listings ([#6226](https://github.com/getpaseo/paseo/pull/6226))
|
||||
|
||||
### Changed
|
||||
|
||||
- Enabled the plugin registry by default: `paseo plugin add owner/slug` installs a reviewed artifact even when a local directory matches; use explicit local paths (including `.`, `..`, and Windows drive or UNC paths), and use `github:owner/repository` for direct GitHub installs. Registry connection, missing-ID, and `--ref` errors include recovery steps.
|
||||
|
||||
- Changed the context window details to show usage for the account the agent runs under, including custom `CLAUDE_CONFIG_DIR` and `CODEX_HOME` homes ([#5465](https://github.com/getpaseo/paseo/pull/5465))
|
||||
- Changed the context window details on desktop to a hover card with Refresh ([#5975](https://github.com/getpaseo/paseo/pull/5975), [#6185](https://github.com/getpaseo/paseo/pull/6185))
|
||||
- Changed the context window details on desktop to a hover card with Refresh ([#5975](https://github.com/getpaseo/paseo/pull/5975))
|
||||
- Changed the context window meter to show before an agent's first turn ([#6089](https://github.com/getpaseo/paseo/pull/6089))
|
||||
- Changed Codex Fast to a Speed menu listing the Normal, Fast, and Ultrafast speeds each model offers, shown as a lightning bolt on desktop that turns yellow while Fast or Ultrafast is selected ([#5708](https://github.com/getpaseo/paseo/pull/5708), [#6152](https://github.com/getpaseo/paseo/pull/6152) by [@Nurshot](https://github.com/Nurshot))
|
||||
- Changed Explorer tabs to work like workspace tabs, with a + menu, drag and drop, and Close for Files and Changes ([#5942](https://github.com/getpaseo/paseo/pull/5942))
|
||||
@@ -96,18 +46,12 @@ Paseo 0.11 adds support for the [plugin registry](https://paseo.sh/plugins). Bro
|
||||
### Fixed
|
||||
|
||||
- Fixed Claude agents never showing Thought rows on Claude Opus 4.7 and later ([#4355](https://github.com/getpaseo/paseo/pull/4355) by [@ThePharmer](https://github.com/ThePharmer))
|
||||
- Fixed a Claude agent showing as running while only its background helpers worked, and a send or Stop killing those helpers ([#6295](https://github.com/getpaseo/paseo/pull/6295) by [@IsakPersson](https://github.com/IsakPersson))
|
||||
- Fixed a Claude agent in Auto mode failing to switch modes when Claude Code uses Bedrock or Vertex ([#6272](https://github.com/getpaseo/paseo/pull/6272))
|
||||
- Fixed a Claude subagent's auto-mode report showing as a raw SubagentHandback tool card instead of markdown ([#6248](https://github.com/getpaseo/paseo/pull/6248))
|
||||
- Fixed background Claude subagent cards showing as a bare "Task" that stayed running, as "Agent" after a daemon restart, or unlabeled when two launch together ([#6067](https://github.com/getpaseo/paseo/pull/6067), [#6100](https://github.com/getpaseo/paseo/pull/6100), [#6268](https://github.com/getpaseo/paseo/pull/6268))
|
||||
- Fixed a background Claude subagent's card showing as a bare "Task" that stayed running, or as "Agent" after a daemon restart ([#6067](https://github.com/getpaseo/paseo/pull/6067), [#6100](https://github.com/getpaseo/paseo/pull/6100))
|
||||
- Fixed Claude Code terminals not showing as needing input when Claude is idle ([#6022](https://github.com/getpaseo/paseo/pull/6022))
|
||||
- Fixed Claude usage calling a rate-limited login again before its retry time ([#6089](https://github.com/getpaseo/paseo/pull/6089))
|
||||
- Fixed a Claude agent that entered plan mode on its own still showing and storing its previous mode ([#6074](https://github.com/getpaseo/paseo/pull/6074))
|
||||
- Fixed a resumed agent returning to its creation-time mode after its mode was changed in the session ([#5140](https://github.com/getpaseo/paseo/pull/5140) by [@ThePlenkov](https://github.com/ThePlenkov))
|
||||
- Fixed ACP plugin providers failing to launch a `.cmd` or `.bat` CLI on Windows ([#6151](https://github.com/getpaseo/paseo/pull/6151))
|
||||
- Fixed ACP agents running on their default model when the configured model is one the agent does not advertise ([#6273](https://github.com/getpaseo/paseo/pull/6273))
|
||||
- Fixed archiving an ACP agent leaving its provider running when the provider never answers close ([#6213](https://github.com/getpaseo/paseo/pull/6213) by [@apple-ouyang](https://github.com/apple-ouyang))
|
||||
- Fixed an archived ACP agent showing an empty chat after its worktree was removed ([#6228](https://github.com/getpaseo/paseo/pull/6228))
|
||||
- Fixed ACP agents rejecting every following message after a turn failed with a permission request open ([#6045](https://github.com/getpaseo/paseo/pull/6045))
|
||||
- Fixed the context window meter never appearing for ACP agents that report context usage ([#4848](https://github.com/getpaseo/paseo/pull/4848) by [@apple-ouyang](https://github.com/apple-ouyang))
|
||||
- Fixed schedule runs and workspace metadata recording `[object Object]` when an ACP agent rejects a session setting ([#5765](https://github.com/getpaseo/paseo/pull/5765))
|
||||
@@ -122,14 +66,12 @@ Paseo 0.11 adds support for the [plugin registry](https://paseo.sh/plugins). Bro
|
||||
- Fixed opening an archived OMP agent starting an `omp` process that stayed running ([#5550](https://github.com/getpaseo/paseo/pull/5550) by [@thomasvan](https://github.com/thomasvan))
|
||||
- Fixed an OMP turn staying running forever when the run contains a message Paseo does not show, such as an OMP rule reminder ([#6112](https://github.com/getpaseo/paseo/pull/6112))
|
||||
- Fixed a prompt OMP rejects, such as for a missing API key, ending as a completed turn with no error ([#6110](https://github.com/getpaseo/paseo/pull/6110), [#6115](https://github.com/getpaseo/paseo/pull/6115))
|
||||
- Fixed reopened OMP chats showing "Custom message" rows for compactions and other entries OMP writes on its own ([#6198](https://github.com/getpaseo/paseo/pull/6198), [#6215](https://github.com/getpaseo/paseo/pull/6215))
|
||||
- Fixed Pi and OMP sessions whose model was removed failing to import or reopen ([#6061](https://github.com/getpaseo/paseo/pull/6061))
|
||||
- Fixed Pi agents on Pi 0.99 starting without Paseo's MCP servers when `pi-mcp-adapter` is not installed ([#5762](https://github.com/getpaseo/paseo/pull/5762) by [@ArietidsZ](https://github.com/ArietidsZ))
|
||||
- Fixed a running Pi subagent showing an empty transcript until it finished ([#5755](https://github.com/getpaseo/paseo/pull/5755))
|
||||
- Fixed a grouped Tintinweb pi-subagents completion marking only its first agent completed and leaving the rest on working ([#5826](https://github.com/getpaseo/paseo/pull/5826))
|
||||
- Fixed OpenCode `ask` rules for `paseo_*` tools running the tool without a prompt ([#5801](https://github.com/getpaseo/paseo/pull/5801) by [@ymarcus93](https://github.com/ymarcus93))
|
||||
- Fixed the first OpenCode prompt waiting for the event stream timeout when the OpenCode server was slow to become ready ([#5873](https://github.com/getpaseo/paseo/pull/5873) by [@axsuul](https://github.com/axsuul))
|
||||
- Fixed OpenCode v2 agents staying running after a question is dismissed or a tool permission is denied ([#6177](https://github.com/getpaseo/paseo/pull/6177), [#6188](https://github.com/getpaseo/paseo/pull/6188))
|
||||
- Fixed the Nix packages failing to start the daemon and to open terminals ([#5523](https://github.com/getpaseo/paseo/pull/5523) by [@wongcallum](https://github.com/wongcallum))
|
||||
- Fixed OpenCode v2 agents failing to start on the Nix packages ([#5988](https://github.com/getpaseo/paseo/pull/5988))
|
||||
- Fixed each Paseo skill appearing twice in Codex's skill list ([#5827](https://github.com/getpaseo/paseo/pull/5827) by [@3ae3ae](https://github.com/3ae3ae))
|
||||
@@ -143,18 +85,12 @@ Paseo 0.11 adds support for the [plugin registry](https://paseo.sh/plugins). Bro
|
||||
- Fixed Codex terminal rows reading only "Terminal" without the command on current Codex ([#5774](https://github.com/getpaseo/paseo/pull/5774))
|
||||
- Fixed the composer showing the catalog default thinking level instead of the one the agent runs on ([#5804](https://github.com/getpaseo/paseo/pull/5804))
|
||||
- Fixed the composer showing another model's label when the agent's model is missing from the loaded catalog ([#5796](https://github.com/getpaseo/paseo/pull/5796))
|
||||
- Fixed the chat jumping back by several screens when scrolling up through older history on web and desktop ([#5945](https://github.com/getpaseo/paseo/pull/5945), [#5970](https://github.com/getpaseo/paseo/pull/5970), [#6172](https://github.com/getpaseo/paseo/pull/6172))
|
||||
- Fixed the chat jumping back by several screens when scrolling up through older history on web and desktop ([#5945](https://github.com/getpaseo/paseo/pull/5945), [#5970](https://github.com/getpaseo/paseo/pull/5970))
|
||||
- Fixed images in chat shifting the text below them when they finish loading ([#5970](https://github.com/getpaseo/paseo/pull/5970))
|
||||
- Fixed copying all the code in a chat code block sometimes including its ``` fence lines ([#6138](https://github.com/getpaseo/paseo/pull/6138))
|
||||
- Fixed copying across a code block nested in a numbered list item renumbering the next item ([#6158](https://github.com/getpaseo/paseo/pull/6158))
|
||||
- Fixed copying a chat selection across an image losing its alt text and source, or including the image when the selection started below it ([#6181](https://github.com/getpaseo/paseo/pull/6181), [#6195](https://github.com/getpaseo/paseo/pull/6195))
|
||||
- Fixed relative `path:line` file links in chat opening at the first line referenced for that file ([#5653](https://github.com/getpaseo/paseo/pull/5653) by [@3ae3ae](https://github.com/3ae3ae))
|
||||
- Fixed PR comments with linked pictures showing raw HTML tags and losing the image link ([#5968](https://github.com/getpaseo/paseo/pull/5968))
|
||||
- Fixed text typed by the browser tool appearing in your message box instead of the browser tab ([#6207](https://github.com/getpaseo/paseo/pull/6207))
|
||||
- Fixed Astro expressions losing their colors after a nested template string ([#6219](https://github.com/getpaseo/paseo/pull/6219))
|
||||
- Fixed downloading files whose names contain non-ASCII characters ([#6278](https://github.com/getpaseo/paseo/pull/6278), [#6281](https://github.com/getpaseo/paseo/pull/6281) by [@dillonzq](https://github.com/dillonzq), [@jasonhnd](https://github.com/jasonhnd))
|
||||
- Fixed the PR panel, sidebar workspace status, and "Worked for" line showing English in other app languages ([#6196](https://github.com/getpaseo/paseo/pull/6196), [#6208](https://github.com/getpaseo/paseo/pull/6208), [#6225](https://github.com/getpaseo/paseo/pull/6225) by [@dillonzq](https://github.com/dillonzq))
|
||||
- Fixed French translations that read as word-for-word machine translation ([#6004](https://github.com/getpaseo/paseo/pull/6004) by [@fxlelouarn](https://github.com/fxlelouarn))
|
||||
- Fixed the desktop window not dragging from the workspace header after scrolling a long chat ([#5233](https://github.com/getpaseo/paseo/pull/5233) by [@Zhou-Ruichen](https://github.com/Zhou-Ruichen))
|
||||
- Fixed opening an agent on a touch screen in the desktop layout raising the on-screen keyboard ([#5477](https://github.com/getpaseo/paseo/pull/5477) by [@dinhphieu](https://github.com/dinhphieu))
|
||||
- Fixed Option+arrow, Cmd+arrow, and Cmd+Backspace line editing in the macOS terminal ([#3339](https://github.com/getpaseo/paseo/pull/3339) by [@gpambrozio](https://github.com/gpambrozio))
|
||||
@@ -162,16 +98,12 @@ Paseo 0.11 adds support for the [plugin registry](https://paseo.sh/plugins). Bro
|
||||
- Fixed a new worktree workspace being archived when its `paseo.json` cannot be parsed ([#6036](https://github.com/getpaseo/paseo/pull/6036) by [@3ae3ae](https://github.com/3ae3ae))
|
||||
- Fixed workspace script status not updating in other connected clients ([#6007](https://github.com/getpaseo/paseo/pull/6007) by [@swbiggart](https://github.com/swbiggart))
|
||||
- Fixed agents and terminals inheriting the voice library path, which truncated Git Bash's PATH on Windows ([#5987](https://github.com/getpaseo/paseo/pull/5987) by [@hanh9898](https://github.com/hanh9898))
|
||||
- Fixed dictation failing until the model was deleted by hand when the daemon stopped while extracting a local speech model ([#6210](https://github.com/getpaseo/paseo/pull/6210) by [@3ae3ae](https://github.com/3ae3ae))
|
||||
- Fixed macOS hosts showing as `UNKNOWN` when the network supplies no hostname ([#5922](https://github.com/getpaseo/paseo/pull/5922))
|
||||
- Fixed `paseo daemon status` reporting a daemon in a Linux VM as stopped after the host wakes from sleep ([#6279](https://github.com/getpaseo/paseo/pull/6279))
|
||||
- Fixed relay reconnects being ignored after a relay connection stalled before its handshake ([#5648](https://github.com/getpaseo/paseo/pull/5648) by [@3ae3ae](https://github.com/3ae3ae))
|
||||
- Fixed `paseo daemon run` exiting with "Daemon failed to start" when the program that launched it stops reading its output ([#6117](https://github.com/getpaseo/paseo/pull/6117))
|
||||
- Fixed CLI commands crashing with `EPIPE`, and the Windows desktop app showing an error dialog, when their output stops being read ([#6097](https://github.com/getpaseo/paseo/pull/6097))
|
||||
- Fixed daemon self-update on a linked global install giving the wrong reason for refusing ([#6095](https://github.com/getpaseo/paseo/pull/6095))
|
||||
- Fixed daemon self-update failing for an npm install under a prefix other than npm's global prefix ([#5649](https://github.com/getpaseo/paseo/pull/5649) by [@3ae3ae](https://github.com/3ae3ae))
|
||||
- Fixed opening an archived agent whose worktree was removed showing "Workspace unavailable" when the workspace had no recorded branch ([#5694](https://github.com/getpaseo/paseo/pull/5694))
|
||||
- Fixed a failed send to an archived agent whose directory was removed taking it out of History ([#6255](https://github.com/getpaseo/paseo/pull/6255))
|
||||
- Fixed a host's version staying stale on the host page after its daemon restarts ([#5351](https://github.com/getpaseo/paseo/pull/5351) by [@bashrusakh](https://github.com/bashrusakh))
|
||||
- Fixed Remote SSH hosts failing to connect to a password-protected daemon, with a new Daemon password field ([#6081](https://github.com/getpaseo/paseo/pull/6081) by [@royenheart](https://github.com/royenheart))
|
||||
- Fixed removing a host during its first connection attempt not stopping the connection ([#5722](https://github.com/getpaseo/paseo/pull/5722))
|
||||
@@ -191,7 +123,6 @@ Paseo 0.11 adds support for the [plugin registry](https://paseo.sh/plugins). Bro
|
||||
- Fixed `paseo schedule update --no-max-runs` and `--no-expires-in` failing before reaching the daemon ([#5973](https://github.com/getpaseo/paseo/pull/5973) by [@Mar-garet](https://github.com/Mar-garet))
|
||||
- Fixed `daemon.log` saying nothing when a resumed Claude agent's transcript is missing or cannot be read ([#5818](https://github.com/getpaseo/paseo/pull/5818) by [@gabrielgiordan](https://github.com/gabrielgiordan))
|
||||
- Fixed reloading a plugin adding `[System Error] Provider connection closed` to finished chats on its provider ([#5579](https://github.com/getpaseo/paseo/pull/5579))
|
||||
- Fixed `paseo plugin add .` looking for the plugin in the daemon's directory instead of the CLI's ([#6239](https://github.com/getpaseo/paseo/pull/6239))
|
||||
- Fixed plugin settings screens on desktop having no way back to the Plugins page ([#5620](https://github.com/getpaseo/paseo/pull/5620))
|
||||
- Fixed plugin client code failing to import npm packages that declare only `main` or `module` ([#5838](https://github.com/getpaseo/paseo/pull/5838))
|
||||
- Fixed the SDK's `send()` and `run()` rejecting `activeTurnBehavior` in TypeScript ([#5605](https://github.com/getpaseo/paseo/pull/5605) by [@wjxdy](https://github.com/wjxdy))
|
||||
|
||||
@@ -484,7 +484,7 @@ The [Agent Client Protocol (ACP)](https://agentclientprotocol.com) is an open st
|
||||
|
||||
ACP agents communicate over JSON-RPC 2.0 on stdio. Paseo spawns the agent process and talks to it through stdin/stdout.
|
||||
|
||||
Paseo also ships an in-app ACP provider catalog for common agents, including CodeWhale, Cursor, DeepAgents, DimCode, Gemini CLI, Hermes, Qwen Code, and Kimi Code. Most catalog entries create the same `extends: "acp"` provider config shown below. Hoplite activates its [bundled provider](plugins.md#built-in-plugins) instead.
|
||||
Paseo also ships an in-app ACP provider catalog for common agents, including CodeWhale, Cursor, DeepAgents, DimCode, Gemini CLI, Hermes, Qwen Code, and Kimi Code. Catalog entries create the same `extends: "acp"` provider config shown below.
|
||||
|
||||
### Adding a generic ACP provider
|
||||
|
||||
|
||||
@@ -107,12 +107,6 @@ absent from the installed plugin list and source configuration; their client bun
|
||||
appear in the plugin catalog. Editing one in development requires a daemon restart.
|
||||
Directory, Git, and npm installs cannot use a built-in ID.
|
||||
|
||||
A provider registration with `requiresConfiguration: true` participates only while its ID exists
|
||||
under `agents.providers`. Hoplite uses this for catalog opt-in. Add writes `{ "enabled": true }`
|
||||
without `extends`, so it selects the bundled adapter. Remove deletes the config entry; setting
|
||||
`enabled: false` keeps the entry. The bundled JavaScript still loads at startup, but an absent
|
||||
provider does not enter executable resolution or catalog discovery.
|
||||
|
||||
Provider plugins use separate installation and provider IDs. `muse-provider` registers the
|
||||
selectable `muse` provider (Muse Code) and a usage source. Its `status({ launch })` reports
|
||||
availability and a diagnostic after the daemon resolves the executable. Configure command,
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
Added
|
||||
- Added Muse Code as a provider, with model, approval mode, and reasoning effort controls
|
||||
- Added Antigravity as a provider that drives the installed agy CLI, always in Full access
|
||||
- Added Usage, opened from the sidebar footer as a dialog on desktop and a sheet on mobile, showing each subscription account's quota windows with Refresh
|
||||
- Added an opt-in Usage summary to the sidebar footer that shows the windows you pin
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -1,7 +0,0 @@
|
||||
Added
|
||||
- Added Muse Code as a provider, with model, approval mode, and reasoning effort controls
|
||||
- Added Antigravity as a provider that drives the installed agy CLI, always in Full access
|
||||
- Added Usage, opened from the sidebar footer as a dialog on desktop and a sheet on mobile, showing each subscription account's quota windows with Refresh
|
||||
- Added an opt-in Usage summary to the sidebar footer that shows the windows you pin
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -1,7 +0,0 @@
|
||||
Added
|
||||
- Added Muse Code as a provider, with model, approval mode, and reasoning effort controls
|
||||
- Added Antigravity as a provider that drives the installed agy CLI, always in Full access
|
||||
- Added Usage, opened from the sidebar footer as a dialog on desktop and a sheet on mobile, showing each subscription account's quota windows with Refresh
|
||||
- Added an opt-in Usage summary to the sidebar footer that shows the windows you pin
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -1,7 +0,0 @@
|
||||
Added
|
||||
- Added Muse Code as a provider, with model, approval mode, and reasoning effort controls
|
||||
- Added Antigravity as a provider that drives the installed agy CLI, always in Full access
|
||||
- Added Usage, opened from the sidebar footer as a dialog on desktop and a sheet on mobile, showing each subscription account's quota windows with Refresh
|
||||
- Added an opt-in Usage summary to the sidebar footer that shows the windows you pin
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -1,8 +0,0 @@
|
||||
Added
|
||||
- Added Claude Haiku 5.5 for Claude Code 2.1.293 and newer
|
||||
|
||||
Fixed
|
||||
- Fixed Claude tool calls that run longer than 30 seconds, such as WebFetch or MCP tools, showing up as subagents
|
||||
- Fixed subagents that finish while the app is disconnected staying "working" until one is opened
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -1,8 +0,0 @@
|
||||
Added
|
||||
- Added Claude Haiku 5.5 for Claude Code 2.1.293 and newer
|
||||
|
||||
Fixed
|
||||
- Fixed Claude tool calls that run longer than 30 seconds, such as WebFetch or MCP tools, showing up as subagents
|
||||
- Fixed subagents that finish while the app is disconnected staying "working" until one is opened
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -1,8 +0,0 @@
|
||||
Added
|
||||
- Added Claude Haiku 5.5 for Claude Code 2.1.293 and newer
|
||||
|
||||
Fixed
|
||||
- Fixed Claude tool calls that run longer than 30 seconds, such as WebFetch or MCP tools, showing up as subagents
|
||||
- Fixed subagents that finish while the app is disconnected staying "working" until one is opened
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -1,8 +0,0 @@
|
||||
Added
|
||||
- Added Claude Haiku 5.5 for Claude Code 2.1.293 and newer
|
||||
|
||||
Fixed
|
||||
- Fixed Claude tool calls that run longer than 30 seconds, such as WebFetch or MCP tools, showing up as subagents
|
||||
- Fixed subagents that finish while the app is disconnected staying "working" until one is opened
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -1,4 +0,0 @@
|
||||
Fixed
|
||||
- Fixed intermittent text clipping in iOS chats and Markdown previews
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -1,4 +0,0 @@
|
||||
Fixed
|
||||
- Fixed intermittent text clipping in iOS chats and Markdown previews
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -1,4 +0,0 @@
|
||||
Fixed
|
||||
- Fixed intermittent text clipping in iOS chats and Markdown previews
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -1,4 +0,0 @@
|
||||
Fixed
|
||||
- Fixed intermittent text clipping in iOS chats and Markdown previews
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -1,11 +0,0 @@
|
||||
Added
|
||||
- Added Hoplite as an opt-in provider in the ACP provider catalog
|
||||
- Added search to the Add provider catalog
|
||||
|
||||
Changed
|
||||
- Changed Add provider failures to show as a toast
|
||||
|
||||
Fixed
|
||||
- Fixed Remove being offered for plugin providers such as Antigravity and Muse Code
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -1,11 +0,0 @@
|
||||
Added
|
||||
- Added Hoplite as an opt-in provider in the ACP provider catalog
|
||||
- Added search to the Add provider catalog
|
||||
|
||||
Changed
|
||||
- Changed Add provider failures to show as a toast
|
||||
|
||||
Fixed
|
||||
- Fixed Remove being offered for plugin providers such as Antigravity and Muse Code
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -1,11 +0,0 @@
|
||||
Added
|
||||
- Added Hoplite as an opt-in provider in the ACP provider catalog
|
||||
- Added search to the Add provider catalog
|
||||
|
||||
Changed
|
||||
- Changed Add provider failures to show as a toast
|
||||
|
||||
Fixed
|
||||
- Fixed Remove being offered for plugin providers such as Antigravity and Muse Code
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -1,11 +0,0 @@
|
||||
Added
|
||||
- Added Hoplite as an opt-in provider in the ACP provider catalog
|
||||
- Added search to the Add provider catalog
|
||||
|
||||
Changed
|
||||
- Changed Add provider failures to show as a toast
|
||||
|
||||
Fixed
|
||||
- Fixed Remove being offered for plugin providers such as Antigravity and Muse Code
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -1,6 +0,0 @@
|
||||
Hoplite joins Paseo as our first sponsor through the company sponsorship program. Hoplite builds cloud coding agents that turn tasks from GitHub, Linear, Slack and more into pull requests. Thank you to the Hoplite team for supporting Paseo.
|
||||
|
||||
Fixed
|
||||
- Fixed Hoplite showing an error in Settings → Providers instead of discovering models in workspaces linked to a Hoplite project
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -1,6 +0,0 @@
|
||||
Hoplite joins Paseo as our first sponsor through the company sponsorship program. Hoplite builds cloud coding agents that turn tasks from GitHub, Linear, Slack and more into pull requests. Thank you to the Hoplite team for supporting Paseo.
|
||||
|
||||
Fixed
|
||||
- Fixed Hoplite showing an error in Settings → Providers instead of discovering models in workspaces linked to a Hoplite project
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -1,6 +0,0 @@
|
||||
Hoplite joins Paseo as our first sponsor through the company sponsorship program. Hoplite builds cloud coding agents that turn tasks from GitHub, Linear, Slack and more into pull requests. Thank you to the Hoplite team for supporting Paseo.
|
||||
|
||||
Fixed
|
||||
- Fixed Hoplite showing an error in Settings → Providers instead of discovering models in workspaces linked to a Hoplite project
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -1,6 +0,0 @@
|
||||
Hoplite joins Paseo as our first sponsor through the company sponsorship program. Hoplite builds cloud coding agents that turn tasks from GitHub, Linear, Slack and more into pull requests. Thank you to the Hoplite team for supporting Paseo.
|
||||
|
||||
Fixed
|
||||
- Fixed Hoplite showing an error in Settings → Providers instead of discovering models in workspaces linked to a Hoplite project
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
+1
-1
@@ -1 +1 @@
|
||||
sha256-AKY6OMZgHeyn/To/2zsmtfb5C4fKniUp8gvpEYaR7/o=
|
||||
sha256-zL3+gbScK8eMkjQUtKDX4UJTXt4BMeqMSyeWB017MA4=
|
||||
|
||||
Generated
+28
-28
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "paseo",
|
||||
"version": "0.11.4",
|
||||
"version": "0.11.0-beta.5",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "paseo",
|
||||
"version": "0.11.4",
|
||||
"version": "0.11.0-beta.5",
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
"workspaces": [
|
||||
@@ -36413,7 +36413,7 @@
|
||||
},
|
||||
"packages/app": {
|
||||
"name": "@getpaseo/app",
|
||||
"version": "0.11.4",
|
||||
"version": "0.11.0-beta.5",
|
||||
"dependencies": {
|
||||
"@codemirror/commands": "6.10.4",
|
||||
"@codemirror/language": "6.12.4",
|
||||
@@ -37496,12 +37496,12 @@
|
||||
},
|
||||
"packages/cli": {
|
||||
"name": "@getpaseo/cli",
|
||||
"version": "0.11.4",
|
||||
"version": "0.11.0-beta.5",
|
||||
"dependencies": {
|
||||
"@clack/prompts": "^1.0.0",
|
||||
"@getpaseo/client": "0.11.4",
|
||||
"@getpaseo/protocol": "0.11.4",
|
||||
"@getpaseo/server": "0.11.4",
|
||||
"@getpaseo/client": "0.11.0-beta.5",
|
||||
"@getpaseo/protocol": "0.11.0-beta.5",
|
||||
"@getpaseo/server": "0.11.0-beta.5",
|
||||
"chalk": "^5.3.0",
|
||||
"commander": "^12.0.0",
|
||||
"mime-types": "^2.1.35",
|
||||
@@ -37748,10 +37748,10 @@
|
||||
},
|
||||
"packages/client": {
|
||||
"name": "@getpaseo/client",
|
||||
"version": "0.11.4",
|
||||
"version": "0.11.0-beta.5",
|
||||
"dependencies": {
|
||||
"@getpaseo/protocol": "0.11.4",
|
||||
"@getpaseo/relay": "0.11.4",
|
||||
"@getpaseo/protocol": "0.11.0-beta.5",
|
||||
"@getpaseo/relay": "0.11.0-beta.5",
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -37762,7 +37762,7 @@
|
||||
},
|
||||
"packages/desktop": {
|
||||
"name": "@getpaseo/desktop",
|
||||
"version": "0.11.4",
|
||||
"version": "0.11.0-beta.5",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@getpaseo/cli": "*",
|
||||
@@ -38006,7 +38006,7 @@
|
||||
},
|
||||
"packages/expo-two-way-audio": {
|
||||
"name": "@getpaseo/expo-two-way-audio",
|
||||
"version": "0.11.4",
|
||||
"version": "0.11.0-beta.5",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.14",
|
||||
@@ -38902,7 +38902,7 @@
|
||||
},
|
||||
"packages/highlight": {
|
||||
"name": "@getpaseo/highlight",
|
||||
"version": "0.11.4",
|
||||
"version": "0.11.0-beta.5",
|
||||
"dependencies": {
|
||||
"@codemirror/language": "6.12.4",
|
||||
"@codemirror/legacy-modes": "^6.5.3",
|
||||
@@ -38931,14 +38931,14 @@
|
||||
},
|
||||
"packages/plugin": {
|
||||
"name": "@getpaseo/plugin",
|
||||
"version": "0.11.4",
|
||||
"version": "0.11.0-beta.5",
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "^1.4.0",
|
||||
"use-sync-external-store": "^1.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@getpaseo/client": "0.11.4",
|
||||
"@getpaseo/protocol": "0.11.4",
|
||||
"@getpaseo/client": "0.11.0-beta.5",
|
||||
"@getpaseo/protocol": "0.11.0-beta.5",
|
||||
"@types/node": "^20.9.0",
|
||||
"@types/react": "~19.2.0",
|
||||
"react": "19.1.0",
|
||||
@@ -38948,8 +38948,8 @@
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@getpaseo/client": "0.11.4",
|
||||
"@getpaseo/protocol": "0.11.4",
|
||||
"@getpaseo/client": "0.11.0-beta.5",
|
||||
"@getpaseo/protocol": "0.11.0-beta.5",
|
||||
"react": "~19.1.0",
|
||||
"react-native": ">=0.81.5",
|
||||
"zod": "^4.4.3"
|
||||
@@ -38971,7 +38971,7 @@
|
||||
},
|
||||
"packages/protocol": {
|
||||
"name": "@getpaseo/protocol",
|
||||
"version": "0.11.4",
|
||||
"version": "0.11.0-beta.5",
|
||||
"dependencies": {
|
||||
"semver": "^7.8.5",
|
||||
"zod": "^4.4.3"
|
||||
@@ -38998,7 +38998,7 @@
|
||||
},
|
||||
"packages/relay": {
|
||||
"name": "@getpaseo/relay",
|
||||
"version": "0.11.4",
|
||||
"version": "0.11.0-beta.5",
|
||||
"dependencies": {
|
||||
"base64-js": "^1.5.1",
|
||||
"tweetnacl": "^1.0.3",
|
||||
@@ -39216,16 +39216,16 @@
|
||||
},
|
||||
"packages/server": {
|
||||
"name": "@getpaseo/server",
|
||||
"version": "0.11.4",
|
||||
"version": "0.11.0-beta.5",
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "^0.17.1",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.246",
|
||||
"@anthropic-ai/sdk": "^0.104.2",
|
||||
"@getpaseo/client": "0.11.4",
|
||||
"@getpaseo/highlight": "0.11.4",
|
||||
"@getpaseo/plugin": "0.11.4",
|
||||
"@getpaseo/protocol": "0.11.4",
|
||||
"@getpaseo/relay": "0.11.4",
|
||||
"@getpaseo/client": "0.11.0-beta.5",
|
||||
"@getpaseo/highlight": "0.11.0-beta.5",
|
||||
"@getpaseo/plugin": "0.11.0-beta.5",
|
||||
"@getpaseo/protocol": "0.11.0-beta.5",
|
||||
"@getpaseo/relay": "0.11.0-beta.5",
|
||||
"@isaacs/ttlcache": "^2.1.4",
|
||||
"@modelcontextprotocol/sdk": "1.29.0",
|
||||
"@opencode-ai/sdk": "1.14.46",
|
||||
@@ -40146,7 +40146,7 @@
|
||||
},
|
||||
"packages/website": {
|
||||
"name": "@getpaseo/website",
|
||||
"version": "0.11.4",
|
||||
"version": "0.11.0-beta.5",
|
||||
"dependencies": {
|
||||
"@cloudflare/vite-plugin": "^1.29.1",
|
||||
"@cloudflare/workers-types": "^4.20260317.1",
|
||||
@@ -41754,7 +41754,7 @@
|
||||
},
|
||||
"plugins": {
|
||||
"name": "@getpaseo/builtin-plugins",
|
||||
"version": "0.11.4",
|
||||
"version": "0.11.0-beta.5",
|
||||
"dependencies": {
|
||||
"@getpaseo/plugin": "*",
|
||||
"zod": "^4.4.3"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "paseo",
|
||||
"version": "0.11.4",
|
||||
"version": "0.11.0-beta.5",
|
||||
"private": true,
|
||||
"description": "Paseo: voice-controlled development environment for local AI coding agents",
|
||||
"keywords": [
|
||||
|
||||
@@ -1,24 +1,13 @@
|
||||
import {
|
||||
closeModelPicker,
|
||||
openModelPicker,
|
||||
seedAgentProfiles,
|
||||
} from "../support/helpers/agent-profiles";
|
||||
import { expectComposerVisible } from "../support/helpers/composer";
|
||||
import { clickNewChat, gotoWorkspace } from "../support/helpers/launcher";
|
||||
import { seedWorkspace } from "../support/helpers/seed-client";
|
||||
import { writeFile } from "node:fs/promises";
|
||||
import { expect, test } from "../support/fixtures";
|
||||
import { test } from "../support/fixtures";
|
||||
import { gotoAppShell, openSettings } from "../support/helpers/app";
|
||||
import { connectDaemonClient } from "../support/helpers/daemon-client-loader";
|
||||
import { getServerId } from "../support/helpers/server-id";
|
||||
import {
|
||||
expectProviderInstalledInSettings,
|
||||
findAcpCatalogProvider,
|
||||
installAcpCatalogProvider,
|
||||
openAddProviderArea,
|
||||
openSettingsHost,
|
||||
openSettingsHostSection,
|
||||
seedSavedSettingsHosts,
|
||||
} from "../support/helpers/settings";
|
||||
|
||||
const ACP_PROVIDER = {
|
||||
@@ -27,13 +16,8 @@ const ACP_PROVIDER = {
|
||||
};
|
||||
|
||||
interface ProviderCatalogDaemonClient {
|
||||
getLastServerInfoMessage(): {
|
||||
features?: { hopliteProvider?: boolean; plugins?: boolean };
|
||||
} | null;
|
||||
connect(): Promise<void>;
|
||||
close(): Promise<void>;
|
||||
getDaemonConfig(): Promise<{ config: { providers?: Record<string, unknown> } }>;
|
||||
getProvidersSnapshot(): Promise<{ entries: Array<{ provider: string }> }>;
|
||||
patchDaemonConfig(config: { removeProviders?: string[] }): Promise<unknown>;
|
||||
}
|
||||
|
||||
@@ -57,124 +41,3 @@ test.describe("ACP provider catalog", () => {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
for (const theme of ["light", "dark"] as const) {
|
||||
test(`adds Hoplite from the catalog in ${theme} theme`, async ({ page }, testInfo) => {
|
||||
const client = await connectDaemonClient<ProviderCatalogDaemonClient>({
|
||||
clientIdPrefix: "hoplite-catalog-e2e",
|
||||
});
|
||||
try {
|
||||
expect(client.getLastServerInfoMessage()?.features?.hopliteProvider).toBe(true);
|
||||
await client.patchDaemonConfig({ removeProviders: ["hoplite"] });
|
||||
expect(
|
||||
(await client.getProvidersSnapshot()).entries.some((entry) => entry.provider === "hoplite"),
|
||||
).toBe(false);
|
||||
await page.addInitScript((value) => {
|
||||
localStorage.setItem("@paseo:app-settings", JSON.stringify({ theme: value }));
|
||||
}, theme);
|
||||
await gotoAppShell(page);
|
||||
await openSettings(page);
|
||||
await openSettingsHost(page, getServerId());
|
||||
await openSettingsHostSection(page, getServerId(), "providers");
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Hoplite provider details", exact: true }),
|
||||
).toHaveCount(0);
|
||||
await openAddProviderArea(page);
|
||||
await findAcpCatalogProvider(page, "Hoplite");
|
||||
await page.screenshot({ path: testInfo.outputPath(`hoplite-catalog-${theme}.png`) });
|
||||
await installAcpCatalogProvider(page, "Hoplite");
|
||||
await expectProviderInstalledInSettings(page, "Hoplite");
|
||||
await page.screenshot({ path: testInfo.outputPath(`hoplite-installed-${theme}.png`) });
|
||||
expect((await client.getDaemonConfig()).config.providers?.hoplite).toEqual({ enabled: true });
|
||||
await writeFile(
|
||||
testInfo.outputPath(`hoplite-added-${theme}.json`),
|
||||
JSON.stringify(await client.getProvidersSnapshot(), null, 2),
|
||||
);
|
||||
await removeHoplite(page);
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Hoplite provider details", exact: true }),
|
||||
).toHaveCount(0);
|
||||
expect((await client.getDaemonConfig()).config.providers?.hoplite).toBeUndefined();
|
||||
expect(
|
||||
(await client.getProvidersSnapshot()).entries.some((entry) => entry.provider === "hoplite"),
|
||||
).toBe(false);
|
||||
await writeFile(
|
||||
testInfo.outputPath(`hoplite-removed-${theme}.json`),
|
||||
JSON.stringify(await client.getProvidersSnapshot(), null, 2),
|
||||
);
|
||||
await openAddProviderArea(page);
|
||||
await findAcpCatalogProvider(page, "Hoplite");
|
||||
await page.screenshot({ path: testInfo.outputPath(`hoplite-removed-${theme}.png`) });
|
||||
await installAcpCatalogProvider(page, "Hoplite");
|
||||
await expectProviderInstalledInSettings(page, "Hoplite");
|
||||
} finally {
|
||||
await client.patchDaemonConfig({ removeProviders: ["hoplite"] }).catch(() => undefined);
|
||||
await client.close().catch(() => undefined);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function removeHoplite(page: import("@playwright/test").Page): Promise<void> {
|
||||
await page.getByTestId("provider-actions-hoplite").click();
|
||||
page.once("dialog", (dialog) => {
|
||||
void dialog.accept();
|
||||
});
|
||||
await page.getByTestId("provider-remove-hoplite").click();
|
||||
}
|
||||
|
||||
test("unsupported host asks for an update without writing Hoplite config", async ({
|
||||
page,
|
||||
outdatedDaemon,
|
||||
}, testInfo) => {
|
||||
const client = await connectDaemonClient<ProviderCatalogDaemonClient>({
|
||||
clientIdPrefix: "hoplite-unsupported",
|
||||
port: Number(new URL(`http://${outdatedDaemon.endpoint}`).port),
|
||||
});
|
||||
try {
|
||||
expect(client.getLastServerInfoMessage()?.features?.plugins).toBe(true);
|
||||
expect(client.getLastServerInfoMessage()?.features?.hopliteProvider).toBe(false);
|
||||
const before = await client.getDaemonConfig();
|
||||
await seedSavedSettingsHosts(page, [outdatedDaemon]);
|
||||
await page.reload();
|
||||
await openSettings(page);
|
||||
await openSettingsHost(page, outdatedDaemon.serverId);
|
||||
await openSettingsHostSection(page, outdatedDaemon.serverId, "providers");
|
||||
await openAddProviderArea(page);
|
||||
await page.getByRole("button", { name: "Add Hoplite", exact: true }).click();
|
||||
const errorToast = page.getByTestId("app-toast-message");
|
||||
await expect(errorToast).toHaveText("Update the host to add Hoplite.");
|
||||
await expect(errorToast).toBeInViewport();
|
||||
expect((await client.getDaemonConfig()).config).toEqual(before.config);
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Hoplite provider details", exact: true }),
|
||||
).toHaveCount(0);
|
||||
await page.screenshot({ path: testInfo.outputPath("hoplite-update-host.png") });
|
||||
} finally {
|
||||
await client.close();
|
||||
}
|
||||
});
|
||||
|
||||
test("model selector excludes Hoplite before opt-in", async ({ page }, testInfo) => {
|
||||
const client = await connectDaemonClient<ProviderCatalogDaemonClient>({
|
||||
clientIdPrefix: "hoplite-picker",
|
||||
});
|
||||
const profiles = await seedAgentProfiles([
|
||||
{ id: "hoplite-picker-anchor", name: "Picker anchor", provider: "mock" },
|
||||
]);
|
||||
const workspace = await seedWorkspace({ repoPrefix: "hoplite-picker-" });
|
||||
try {
|
||||
await client.patchDaemonConfig({ removeProviders: ["hoplite"] });
|
||||
await gotoWorkspace(page, workspace.workspaceId);
|
||||
await clickNewChat(page);
|
||||
await expectComposerVisible(page);
|
||||
await openModelPicker(page);
|
||||
await expect(page.getByTestId("model-provider-mock")).toBeVisible();
|
||||
await expect(page.getByTestId("model-provider-hoplite")).toHaveCount(0);
|
||||
await page.screenshot({ path: testInfo.outputPath("hoplite-model-selector-absent.png") });
|
||||
await closeModelPicker(page);
|
||||
} finally {
|
||||
await workspace.cleanup();
|
||||
await profiles.restore();
|
||||
await client.close();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -133,58 +133,6 @@ test("scroll detector accounts for delayed wheel input and growth below the new
|
||||
).toHaveLength(1);
|
||||
});
|
||||
|
||||
test("scroll detector follows the entered image through resize and virtual offset correction", () => {
|
||||
for (const height of [225, 1632]) {
|
||||
const before: ScrollFrame = {
|
||||
at: 1000,
|
||||
scrollTop: 2208,
|
||||
scrollHeight: 5000,
|
||||
viewportHeight: 516,
|
||||
virtualized: true,
|
||||
loading: false,
|
||||
rows: [
|
||||
{ id: "image", top: -704, height: 560 },
|
||||
{ id: "caption", top: -144, height: 100 },
|
||||
{ id: "old-reader", top: -44, height: 127 },
|
||||
],
|
||||
anchor: "old-reader",
|
||||
wheelTotal: 0,
|
||||
lastWheelAt: 0,
|
||||
inputFinishedAt: null,
|
||||
imageLoads: 0,
|
||||
mounted: 3,
|
||||
unmounted: 0,
|
||||
};
|
||||
const resize = height - 560;
|
||||
const after: ScrollFrame = {
|
||||
...before,
|
||||
at: 1060,
|
||||
// The virtualizer corrects 110px of estimates while the wheel moves 160px.
|
||||
scrollTop: 1938,
|
||||
scrollHeight: 5000 + resize - 110,
|
||||
wheelTotal: 160,
|
||||
lastWheelAt: 1020,
|
||||
imageLoads: 1,
|
||||
rows: [
|
||||
{ id: "image", top: -544, height },
|
||||
{ id: "caption", top: 16 + resize, height: 100 },
|
||||
{ id: "old-reader", top: 116 + resize, height: 127 },
|
||||
],
|
||||
};
|
||||
expect(findScrollJumps([before, after])).toEqual([]);
|
||||
// Resizing must not excuse additional viewport movement.
|
||||
expect(
|
||||
findScrollJumps([
|
||||
before,
|
||||
{
|
||||
...after,
|
||||
rows: after.rows.map((row) => ({ id: row.id, height: row.height, top: row.top + 100 })),
|
||||
},
|
||||
]),
|
||||
).toHaveLength(1);
|
||||
}
|
||||
});
|
||||
|
||||
for (const cadence of scrollCadences) {
|
||||
test(`varied timeline preserves reading position during ${cadence.name} upward scrolling`, async ({
|
||||
page,
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
import path from "node:path";
|
||||
import type { DaemonClient } from "@getpaseo/client/internal/daemon-client";
|
||||
import { expect, test, type Page } from "../support/fixtures";
|
||||
import { gotoAppShell, openSettings } from "../support/helpers/app";
|
||||
import {
|
||||
closeModelPicker,
|
||||
drillIntoProvider,
|
||||
openModelPicker,
|
||||
} from "../support/helpers/agent-profiles";
|
||||
import { expectComposerVisible, expectComposerFocused } from "../support/helpers/composer";
|
||||
import { connectDaemonClient } from "../support/helpers/daemon-client-loader";
|
||||
import { clickNewChat, gotoWorkspace } from "../support/helpers/launcher";
|
||||
import { getServerId } from "../support/helpers/server-id";
|
||||
import { openSettingsHost, openSettingsHostSection } from "../support/helpers/settings";
|
||||
|
||||
// Use an existing repository linked to the signed-in user's Hoplite project.
|
||||
const cwd = process.env.E2E_HOPLITE_CWD ?? path.resolve(__dirname, "../../../..");
|
||||
|
||||
test.use({
|
||||
viewport: { width: 1440, height: 1000 },
|
||||
e2eDaemonConfig: { version: 1, agents: { providers: { hoplite: { enabled: true } } } },
|
||||
});
|
||||
|
||||
async function openHopliteSettings(page: Page): Promise<void> {
|
||||
await gotoAppShell(page);
|
||||
await openSettings(page);
|
||||
await openSettingsHost(page, getServerId());
|
||||
await openSettingsHostSection(page, getServerId(), "providers");
|
||||
await page.getByRole("button", { name: "Hoplite provider details", exact: true }).click();
|
||||
}
|
||||
|
||||
async function expectEmptyGlobalCatalog(page: Page, client: DaemonClient): Promise<void> {
|
||||
const models = await client.listProviderModels("hoplite");
|
||||
expect(models.error).toBeNull();
|
||||
expect(models.models).toEqual([]);
|
||||
const snapshot = await client.getProvidersSnapshot();
|
||||
expect(snapshot.entries.find((entry) => entry.provider === "hoplite")).toMatchObject({
|
||||
status: "ready",
|
||||
models: [],
|
||||
});
|
||||
await expect(page.getByText("No models detected", { exact: true })).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "Retry", exact: true })).toHaveCount(0);
|
||||
}
|
||||
|
||||
async function refreshGlobalCatalog(page: Page): Promise<void> {
|
||||
await page.getByRole("button", { name: "Refresh", exact: true }).click();
|
||||
await expect(page.getByRole("button", { name: "Refresh", exact: true })).toBeEnabled({
|
||||
timeout: 120_000,
|
||||
});
|
||||
}
|
||||
|
||||
async function openWorkspaceModels(page: Page, workspaceId: string): Promise<void> {
|
||||
await gotoWorkspace(page, workspaceId);
|
||||
await clickNewChat(page);
|
||||
await expectComposerVisible(page);
|
||||
await expectComposerFocused(page);
|
||||
await openModelPicker(page);
|
||||
await page.getByTestId("sheet-header-back").click();
|
||||
await drillIntoProvider(page, "hoplite");
|
||||
}
|
||||
|
||||
test("real Hoplite has an empty global catalog and discovers models in its linked workspace", async ({
|
||||
page,
|
||||
e2eWorkerClient,
|
||||
}, testInfo) => {
|
||||
test.setTimeout(180_000);
|
||||
const client = await connectDaemonClient<DaemonClient>({ clientIdPrefix: "hoplite-discovery" });
|
||||
const created = await e2eWorkerClient.createWorkspace({
|
||||
source: { kind: "directory", path: cwd },
|
||||
title: "Hoplite discovery QA",
|
||||
});
|
||||
expect(created.error).toBeNull();
|
||||
const workspace = created.workspace!;
|
||||
try {
|
||||
await test.step("global settings succeed with no models, including refresh", async () => {
|
||||
await openHopliteSettings(page);
|
||||
await expectEmptyGlobalCatalog(page, client);
|
||||
await refreshGlobalCatalog(page);
|
||||
await expectEmptyGlobalCatalog(page, client);
|
||||
await page.screenshot({ path: testInfo.outputPath("hoplite-global-empty.png") });
|
||||
});
|
||||
|
||||
await test.step("the linked workspace discovers real models", async () => {
|
||||
const models = await client.listProviderModels("hoplite", { cwd });
|
||||
expect(models.error).toBeNull();
|
||||
expect(models.models!.length).toBeGreaterThan(0);
|
||||
await testInfo.attach("workspace-models", {
|
||||
body: JSON.stringify(models, null, 2),
|
||||
contentType: "application/json",
|
||||
});
|
||||
await openWorkspaceModels(page, workspace.id);
|
||||
await expect(page.getByText(models.models![0]!.label, { exact: true }).last()).toBeVisible();
|
||||
await page.screenshot({ path: testInfo.outputPath("hoplite-workspace-models.png") });
|
||||
await closeModelPicker(page);
|
||||
});
|
||||
|
||||
await test.step("workspace discovery does not populate the global catalog", async () => {
|
||||
await openHopliteSettings(page);
|
||||
await expectEmptyGlobalCatalog(page, client);
|
||||
await refreshGlobalCatalog(page);
|
||||
await expectEmptyGlobalCatalog(page, client);
|
||||
const models = await client.listProviderModels("hoplite", { cwd });
|
||||
expect(models.error).toBeNull();
|
||||
expect(models.models!.length).toBeGreaterThan(0);
|
||||
});
|
||||
} finally {
|
||||
await client.close();
|
||||
await e2eWorkerClient.removeProject(workspace.projectId);
|
||||
}
|
||||
});
|
||||
@@ -10,29 +10,16 @@ import {
|
||||
openSettingsHost,
|
||||
openSettingsHostSection,
|
||||
} from "../support/helpers/settings";
|
||||
import { copyPluginExample } from "../support/helpers/plugin-fixture";
|
||||
|
||||
const CUSTOM_PROVIDER = {
|
||||
id: "junie",
|
||||
name: "Junie",
|
||||
} as const;
|
||||
|
||||
const PLUGIN_PROVIDER = {
|
||||
id: "direct-example",
|
||||
name: "Direct provider example",
|
||||
pluginId: "provider-direct-example",
|
||||
} as const;
|
||||
|
||||
interface ProviderRemovalDaemonClient {
|
||||
connect(): Promise<void>;
|
||||
close(): Promise<void>;
|
||||
getDaemonConfig(): Promise<{ config: { pluginsEnabled?: boolean } }>;
|
||||
patchDaemonConfig(config: {
|
||||
removeProviders?: string[];
|
||||
pluginsEnabled?: boolean;
|
||||
}): Promise<unknown>;
|
||||
installDirectoryPlugin(path: string): Promise<unknown>;
|
||||
removePlugin(pluginId: string): Promise<void>;
|
||||
patchDaemonConfig(config: { removeProviders?: string[] }): Promise<unknown>;
|
||||
getProvidersSnapshot(): Promise<{
|
||||
entries: Array<{ provider: string; source?: "builtin" | "custom" }>;
|
||||
}>;
|
||||
@@ -106,45 +93,4 @@ test.describe("provider removal", () => {
|
||||
await client.close().catch(() => undefined);
|
||||
}
|
||||
});
|
||||
|
||||
test("does not offer Remove for a plugin-registered provider", async ({ page }) => {
|
||||
test.setTimeout(120_000);
|
||||
const client = await connectDaemonClient<ProviderRemovalDaemonClient>({
|
||||
clientIdPrefix: "provider-removal-e2e",
|
||||
});
|
||||
|
||||
const plugin = await copyPluginExample("provider-direct");
|
||||
try {
|
||||
const previous = await client.getDaemonConfig();
|
||||
try {
|
||||
await client.patchDaemonConfig({ pluginsEnabled: true });
|
||||
await client.installDirectoryPlugin(plugin.directory);
|
||||
|
||||
await gotoAppShell(page);
|
||||
await openSettings(page);
|
||||
await openSettingsHost(page, getServerId());
|
||||
await openSettingsHostSection(page, getServerId(), "providers");
|
||||
|
||||
const pluginProviderRow = page.getByRole("button", {
|
||||
name: `${PLUGIN_PROVIDER.name} provider details`,
|
||||
exact: true,
|
||||
});
|
||||
await expect(pluginProviderRow).toBeVisible();
|
||||
await expect(page.getByTestId(`provider-actions-${PLUGIN_PROVIDER.id}`)).toHaveCount(0);
|
||||
|
||||
// The provider survives a removeProviders patch pointed at it: the
|
||||
// plugin, not config.json, owns the definition.
|
||||
await client.patchDaemonConfig({ removeProviders: [PLUGIN_PROVIDER.id] });
|
||||
await expect(pluginProviderRow).toBeVisible();
|
||||
} finally {
|
||||
await client.removePlugin(PLUGIN_PROVIDER.pluginId).catch(() => undefined);
|
||||
await client
|
||||
.patchDaemonConfig({ pluginsEnabled: previous.config.pluginsEnabled })
|
||||
.catch(() => undefined);
|
||||
}
|
||||
} finally {
|
||||
await client.close().catch(() => undefined);
|
||||
await plugin.cleanup();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
# Native iOS text geometry regression
|
||||
|
||||
Run on the Namespace Mac with a fresh simulator development build. Use the PID
|
||||
returned by `xcrun simctl launch <your-task-simulator-UDID> sh.paseo.debug`.
|
||||
Attach only to your task's app, while no device replay is running:
|
||||
|
||||
```sh
|
||||
PASEO_NATIVE_TEXT_REFLOW_PID=12345 \
|
||||
PASEO_NATIVE_TEXT_REFLOW_LOG=/Volumes/devbox/workspace/native-text-reflow.log \
|
||||
bash packages/app/e2e/mobile/native-text-reflow/ios.sh
|
||||
```
|
||||
|
||||
The probe constructs the installed `RNUITextView`, fills its real UIKit text view,
|
||||
and resizes its content container from 500 to 240 and back to 500 points. It
|
||||
asserts the inner frame follows both widths and the same selection survives.
|
||||
It uses public UIView/UITextView operations, without mocking React Native.
|
||||
LLDB detaches after the probe. An assertion failure or evaluation error fails the
|
||||
shell command; the log distinguishes them.
|
||||
|
||||
This covers native container resizing and selection retention. It does not cover
|
||||
Fabric event delivery, chat row height, reader anchoring, or the on-screen copy
|
||||
menu. Those require the real chat journey: read an older multiline response,
|
||||
open/close Explorer, resize/rotate, inspect complete paragraphs and bullets,
|
||||
retain expanded/collapsed details, and check a stationary reader's position.
|
||||
Accessibility exposes full text even when glyphs are clipped, so a text wait
|
||||
alone does not verify that journey.
|
||||
@@ -0,0 +1,55 @@
|
||||
import lldb
|
||||
|
||||
|
||||
def __lldb_init_module(debugger, _internal_dict):
|
||||
debugger.HandleCommand("expression -l objc++ -- @import UIKit")
|
||||
frame = debugger.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame()
|
||||
options = lldb.SBExpressionOptions()
|
||||
options.SetLanguage(lldb.eLanguageTypeObjC_plus_plus)
|
||||
result = frame.EvaluateExpression(
|
||||
r'''({
|
||||
UIView *host = (UIView *)[[NSClassFromString(@"RNUITextView") alloc] init];
|
||||
auto hostFrame = host.frame;
|
||||
hostFrame.size.width = 500;
|
||||
hostFrame.size.height = 200;
|
||||
host.frame = hostFrame;
|
||||
UIView *container = (UIView *)[host performSelector:@selector(contentView)];
|
||||
container.frame = host.bounds;
|
||||
UITextView *text = nil;
|
||||
for (UIView *child in host.subviews) {
|
||||
if ([child isKindOfClass:UITextView.class]) text = (UITextView *)child;
|
||||
for (UIView *nested in child.subviews) {
|
||||
if ([nested isKindOfClass:UITextView.class]) text = (UITextView *)nested;
|
||||
}
|
||||
}
|
||||
text.frame = container.bounds;
|
||||
text.font = [UIFont systemFontOfSize:16];
|
||||
text.text = @"A realistic multiline paragraph must reflow when Explorer narrows the available chat width, then fill the restored width without replacing the text view or discarding a selection.";
|
||||
auto range = text.selectedRange;
|
||||
range.location = 12;
|
||||
range.length = 9;
|
||||
text.selectedRange = range;
|
||||
auto frame = container.frame;
|
||||
frame.size.width = 240;
|
||||
container.frame = frame;
|
||||
[container layoutIfNeeded];
|
||||
CGFloat narrow = text.frame.size.width;
|
||||
auto selection = text.selectedRange;
|
||||
frame.size.width = 500;
|
||||
container.frame = frame;
|
||||
[container layoutIfNeeded];
|
||||
CGFloat wide = text.frame.size.width;
|
||||
BOOL ok = text != nil && narrow == 240 && wide == 500 &&
|
||||
selection.location == text.selectedRange.location &&
|
||||
selection.length == text.selectedRange.length &&
|
||||
selection.location == 12 && selection.length == 9;
|
||||
[NSString stringWithFormat:@"NATIVE_REFLOW_%@ narrow=%.0f wide=%.0f selection=%lu:%lu",
|
||||
ok ? @"PASS" : @"FAIL", narrow, wide,
|
||||
(unsigned long)text.selectedRange.location,
|
||||
(unsigned long)text.selectedRange.length];
|
||||
})''',
|
||||
options,
|
||||
)
|
||||
if result.GetError().Fail():
|
||||
raise RuntimeError(result.GetError().GetCString())
|
||||
print(result.GetObjectDescription())
|
||||
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
: "${PASEO_NATIVE_TEXT_REFLOW_PID:?Set the PID of your task-owned Paseo iOS simulator app}"
|
||||
: "${PASEO_NATIVE_TEXT_REFLOW_LOG:?Set the test output log path}"
|
||||
|
||||
if [[ "$(ps -p "$PASEO_NATIVE_TEXT_REFLOW_PID" -o comm=)" != *PaseoDebug.app/PaseoDebug ]]; then
|
||||
echo "Expected a running PaseoDebug simulator app" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
probe_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
xcrun lldb --batch -p "$PASEO_NATIVE_TEXT_REFLOW_PID" \
|
||||
-o "command script import $probe_dir/ios.py" \
|
||||
-o "process detach" -o quit > "$PASEO_NATIVE_TEXT_REFLOW_LOG" 2>&1
|
||||
|
||||
grep '^NATIVE_REFLOW_' "$PASEO_NATIVE_TEXT_REFLOW_LOG"
|
||||
grep -q '^NATIVE_REFLOW_PASS narrow=240 wide=500 selection=12:9$' "$PASEO_NATIVE_TEXT_REFLOW_LOG"
|
||||
@@ -370,7 +370,7 @@ export async function findAcpCatalogProvider(page: Page, providerName: string):
|
||||
|
||||
export async function installAcpCatalogProvider(page: Page, providerName: string): Promise<void> {
|
||||
await findAcpCatalogProvider(page, providerName);
|
||||
await page.getByRole("button", { name: `Add ${providerName}`, exact: true }).click();
|
||||
await page.getByRole("button", { name: "Add", exact: true }).click();
|
||||
}
|
||||
|
||||
export async function expectProviderInstalledInSettings(
|
||||
|
||||
@@ -297,7 +297,11 @@ export function findScrollJumps(frames: ScrollFrame[]) {
|
||||
// Follow that intended row, not text now below the image.
|
||||
const recent = frames.findLast((frame) => frame.at <= previous.at - 100);
|
||||
const wheelBudget = current.wheelTotal - (recent?.wheelTotal ?? 0);
|
||||
const frameScroll = Math.max(0, previous.scrollTop - current.scrollTop);
|
||||
const availableScroll = Math.min(frameScroll, wheelBudget, previous.scrollTop);
|
||||
const readingLine = 8 - availableScroll;
|
||||
const currentRows = new Map(current.rows.map((row) => [row.id, row]));
|
||||
const intendedRow = previous.rows.find((row) => row.top + row.height > readingLine);
|
||||
const anchor = previous.anchor;
|
||||
const before = currentRows.has(anchor)
|
||||
? previous.rows.find((row) => row.id === anchor)!
|
||||
@@ -312,33 +316,25 @@ export function findScrollJumps(frames: ScrollFrame[]) {
|
||||
// A busy main thread can deliver wheel movement hundreds of milliseconds
|
||||
// after its event. Only assert idle stability after the driver stops input.
|
||||
const idle = current.inputFinishedAt !== null && previous.at - current.inputFinishedAt > 250;
|
||||
// scrollTop also includes virtualizer estimate corrections. Locate the row
|
||||
// entered by wheel input from its viewport movement instead. Its old height
|
||||
// identifies the reader before a simultaneous image resize takes effect.
|
||||
const intendedRow = previous.rows.find((row) => {
|
||||
const next = currentRows.get(row.id);
|
||||
if (!next || idle || wheelBudget <= 0) return false;
|
||||
const travel = next.top - row.top;
|
||||
return (
|
||||
travel >= -8 &&
|
||||
travel <= Math.min(wheelBudget, previous.scrollTop) + 32 &&
|
||||
(next.top <= 8 || current.scrollTop === 0) &&
|
||||
next.top + row.height > 8
|
||||
);
|
||||
});
|
||||
const enteredRowResize = intendedRow
|
||||
// Wheel events can precede their scroll update, or include input already
|
||||
// applied in earlier frames. Locate the reader with this frame's scroll,
|
||||
// bounded by recent input. Growth below it can move the old anchor without
|
||||
// moving the reading line.
|
||||
const readerFollowsInput =
|
||||
intendedRow &&
|
||||
currentRows.has(intendedRow.id) &&
|
||||
Math.abs(currentRows.get(intendedRow.id)!.top - intendedRow.top - availableScroll) <= 32;
|
||||
const enteredRowGrowth = readerFollowsInput
|
||||
? previous.rows.reduce((growth, row) => {
|
||||
if (row.top < intendedRow.top || row.top >= before.top) return growth;
|
||||
const height = currentRows.get(row.id)?.height ?? row.height;
|
||||
return growth + height - row.height;
|
||||
return growth + Math.max(0, height - row.height);
|
||||
}, 0)
|
||||
: 0;
|
||||
const readingMovement = movement - enteredRowResize;
|
||||
const excessForward = readingMovement > wheelBudget + 32;
|
||||
const excessForward = movement > wheelBudget + enteredRowGrowth + 32;
|
||||
// Upward wheel input moves the same text DOWN the viewport. A negative move
|
||||
// is a reversal, independent of legitimate scrollTop compensation on prepend.
|
||||
if (readingMovement >= -8 && (!idle || Math.abs(readingMovement) <= 8) && !excessForward)
|
||||
return [];
|
||||
if (movement >= -8 && (!idle || Math.abs(movement) <= 8) && !excessForward) return [];
|
||||
return [
|
||||
{
|
||||
frame: index,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/app",
|
||||
"version": "0.11.4",
|
||||
"version": "0.11.0-beta.5",
|
||||
"private": true,
|
||||
"main": "index.ts",
|
||||
"scripts": {
|
||||
|
||||
@@ -48,8 +48,6 @@ export const ACP_PROVIDER_ICON_SVGS = {
|
||||
goose:
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24">\n <path fill="currentColor" d="M20.9093 19.3861L19.5185 18.2413C18.7624 17.619 18.1189 16.8713 17.6157 16.0313C16.9205 14.8706 15.9599 13.8912 14.8133 13.1735L14.2533 12.8475C14.0614 12.7141 13.9276 12.5062 13.9086 12.2716C13.8963 12.1204 13.9326 11.9852 14.0171 11.8662C14.3087 11.4553 15.896 9.74698 16.1722 9.51845C16.528 9.22442 16.9243 8.97987 17.2921 8.69986C17.3443 8.66 17.3968 8.62035 17.4485 8.57989C17.4503 8.57808 17.4529 8.57668 17.4545 8.57508C17.5725 8.48195 17.6838 8.383 17.7724 8.26563C18.2036 7.76631 18.195 7.3443 18.195 7.3443C18.195 7.3443 18.1954 7.3439 18.1956 7.3437C18.1497 7.23133 17.9847 6.88163 17.6492 6.71759C17.9458 6.71178 18.2805 6.82294 18.4323 6.97156C18.6148 6.68534 18.7328 6.49967 18.9162 6.18762C18.9599 6.11352 18.9831 5.97652 18.8996 5.89981C18.8996 5.89981 18.8992 5.89981 18.8988 5.89981C18.8988 5.89981 18.8988 5.8994 18.8988 5.899C18.8972 5.8974 18.8952 5.8962 18.8936 5.8946C18.892 5.893 18.891 5.89119 18.8892 5.88939C18.8892 5.88939 18.8888 5.88939 18.8884 5.88939C18.8884 5.88939 18.8884 5.88899 18.8884 5.88859C18.885 5.88518 18.8812 5.88258 18.8776 5.87938C18.8754 5.87717 18.8736 5.87457 18.8716 5.87217C18.8692 5.87016 18.8665 5.86836 18.8643 5.86616C18.8609 5.86275 18.8587 5.85855 18.8551 5.85534C18.8551 5.85534 18.8545 5.85514 18.8543 5.85534C18.8543 5.85534 18.8543 5.85494 18.8543 5.85454C18.8527 5.85294 18.8507 5.85174 18.8491 5.85013C18.8475 5.84853 18.8463 5.84653 18.8447 5.84493C18.8447 5.84493 18.8441 5.84473 18.8439 5.84493C18.8439 5.84493 18.8439 5.84453 18.8439 5.84413C18.7672 5.7606 18.6302 5.78384 18.5561 5.8275C18.1503 6.06625 17.7555 6.32322 17.3996 6.54855C17.3996 6.54855 16.9778 6.53973 16.4783 6.97116C16.3607 7.05989 16.2618 7.17125 16.1688 7.28902C16.167 7.29082 16.1654 7.29322 16.164 7.29503C16.1234 7.3465 16.0837 7.39898 16.0441 7.45145C15.7639 7.81939 15.5195 8.21556 15.2255 8.57128C14.9971 8.84768 13.2887 10.4348 12.8777 10.7264C12.7587 10.8109 12.6237 10.8474 12.4723 10.835C12.2379 10.8161 12.0298 10.6821 11.8965 10.4903L11.5704 9.93024C10.8527 8.78318 9.87332 7.82299 8.71264 7.12778C7.87262 6.62466 7.12514 5.98092 6.50264 5.22503L5.35778 3.83421C5.3013 3.76571 5.19314 3.77693 5.15268 3.85585C5.02249 4.10941 4.77393 4.64479 4.58346 5.36483C4.57885 5.38186 4.58286 5.39988 4.59407 5.4135C4.83082 5.69952 5.37901 6.32983 6.03196 6.863C6.07742 6.90005 6.04017 6.97336 5.98369 6.95774C5.42047 6.80432 4.87288 6.55796 4.46308 6.34805C4.42964 6.33103 4.38918 6.35226 4.38437 6.38951C4.32068 6.89985 4.30425 7.46027 4.37155 8.05112C4.37355 8.07035 4.38577 8.08697 4.4036 8.09479C4.87088 8.29808 5.61816 8.59311 6.40269 8.78078C6.45958 8.7944 6.45777 8.87632 6.40029 8.88733C5.78941 9.0023 5.14968 9.02794 4.62973 9.02113C4.59327 9.02073 4.56643 9.05518 4.57625 9.09023C4.6806 9.45896 4.822 9.8339 5.00847 10.2115C5.08559 10.3811 5.16951 10.5475 5.25944 10.7104C5.27486 10.7382 5.3047 10.7548 5.33655 10.7534C5.76577 10.7324 6.28452 10.6871 6.80608 10.595C6.89501 10.5794 6.94268 10.6964 6.86757 10.7466C6.51345 10.9834 6.13571 11.1873 5.7844 11.3551C5.73733 11.3777 5.72211 11.4378 5.75315 11.4797C5.96186 11.7625 6.19139 12.0301 6.44075 12.2794C6.44075 12.2794 7.66853 13.5441 7.70198 13.6432C8.41841 12.9096 9.59612 12.0964 10.8966 11.3864C9.15488 12.8036 8.18387 13.8499 7.69517 14.4444L7.35447 14.9225C7.17742 15.1708 7.02379 15.4346 6.89541 15.7112C6.46579 16.6356 5.75756 18.5051 5.75756 18.5051C5.70328 18.6515 5.74754 18.7959 5.84168 18.89C5.84388 18.8922 5.84609 18.8944 5.84849 18.8964C5.85069 18.8986 5.8527 18.901 5.8549 18.9032C5.94924 18.9976 6.09345 19.0416 6.23986 18.9874C6.23986 18.9874 8.10897 18.2791 9.03371 17.8495C9.31031 17.7211 9.57429 17.5673 9.82245 17.3905L10.349 17.0153C10.6278 16.8166 11.0096 16.8483 11.2517 17.0904L12.4655 18.3042C12.7148 18.5535 12.9824 18.7831 13.2652 18.9918C13.3073 19.0226 13.3672 19.0076 13.3898 18.9605C13.5579 18.6094 13.7618 18.2313 13.9983 17.8774C14.0486 17.8022 14.1657 17.8501 14.1499 17.9388C14.0576 18.4606 14.0127 18.9794 13.9915 19.4084C13.9899 19.44 14.0067 19.4701 14.0345 19.4855C14.1972 19.5756 14.3636 19.6595 14.5335 19.7364C14.911 19.9229 15.2862 20.0645 15.6547 20.1687C15.6897 20.1785 15.7242 20.1516 15.7238 20.1152C15.7168 19.595 15.7424 18.9553 15.8576 18.3446C15.8684 18.2869 15.9503 18.2851 15.9641 18.3422C16.1516 19.127 16.4466 19.8742 16.6501 20.3413C16.6579 20.3591 16.6744 20.3712 16.6938 20.3734C17.2847 20.4407 17.8451 20.4242 18.3554 20.3606C18.3929 20.3559 18.4141 20.3155 18.3969 20.2818C18.187 19.872 17.9406 19.3241 17.7872 18.7612C17.7718 18.7046 17.8449 18.6675 17.8819 18.713C18.4151 19.3659 19.0454 19.9141 19.3314 20.1508C19.345 20.1621 19.3633 20.1659 19.3801 20.1615C20.1003 19.9712 20.6357 19.7226 20.8891 19.5922C20.968 19.5518 20.9792 19.4436 20.9107 19.3871L20.9093 19.3861Z"/>\n</svg>\n',
|
||||
grok: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 1024 1024" fill="none">\n <path fill="currentColor" d="M395.479 633.828L735.91 381.105C752.599 368.715 776.454 373.548 784.406 392.792C826.26 494.285 807.561 616.253 724.288 699.996C641.016 783.739 525.151 802.104 419.247 760.277L303.556 814.143C469.49 928.202 670.987 899.995 796.901 773.282C896.776 672.843 927.708 535.937 898.785 412.476L899.047 412.739C857.105 231.37 909.358 158.874 1016.4 10.6326C1018.93 7.11771 1021.47 3.60279 1024 0L883.144 141.651V141.212L395.392 633.916"/>\n <path fill="currentColor" d="M325.226 695.251C206.128 580.84 226.662 403.776 328.285 301.668C403.431 226.097 526.549 195.254 634.026 240.596L749.454 186.994C728.657 171.88 702.007 155.623 671.424 144.2C533.19 86.9942 367.693 115.465 255.323 228.382C147.234 337.081 113.244 504.215 171.613 646.833C215.216 753.423 143.739 828.818 71.7385 904.916C46.2237 931.893 20.6216 958.87 0 987.429L325.139 695.339"/>\n</svg>\n',
|
||||
hoplite:
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="1.394 1.679 8.494 7.828" fill="currentColor"><path d="M8.237 7.813C8.276 7.789 8.327 7.796 8.358 7.83L9.741 9.346C9.797 9.407 9.754 9.506 9.671 9.507H8.977C8.924 9.507 8.881 9.463 8.881 9.41V9.125C8.881 9.089 8.861 9.057 8.83 9.04L7.589 8.379C7.524 8.344 7.521 8.251 7.584 8.212L8.237 7.813ZM3.944 1.679C4.502 1.679 5.052 1.82 5.54 2.09L5.962 2.323C6.024 2.358 6.029 2.446 5.97 2.486L5.091 3.09C5.065 3.108 5.05 3.137 5.05 3.169V3.495C5.05 3.529 5.032 3.561 5.003 3.578L4.68 3.769C4.594 3.82 4.498 3.722 4.549 3.637L4.592 3.566C4.63 3.502 4.584 3.421 4.51 3.421H4.028C3.925 3.421 3.894 3.562 3.989 3.604L4.377 3.775C4.448 3.806 4.455 3.904 4.389 3.944L3.77 4.323C3.755 4.332 3.737 4.337 3.72 4.337H3.361C3.309 4.337 3.268 4.379 3.268 4.431C3.268 4.484 3.309 4.526 3.361 4.526H3.779C3.797 4.526 3.814 4.521 3.829 4.513L7.599 2.272C8.135 1.954 8.815 2.008 9.294 2.407C9.307 2.418 9.314 2.434 9.314 2.451V2.729C9.315 2.812 9.413 2.856 9.475 2.8L9.728 2.57C9.789 2.514 9.888 2.558 9.888 2.641V5.812C9.888 5.865 9.845 5.908 9.792 5.908H9.359C9.331 5.908 9.303 5.895 9.285 5.873L8.374 4.773C8.337 4.728 8.268 4.728 8.229 4.771L7.468 5.625C7.429 5.669 7.438 5.737 7.487 5.769L9.038 6.776C9.098 6.815 9.096 6.903 9.035 6.939L6.618 8.363C6.556 8.4 6.478 8.358 6.474 8.286L6.439 7.633C6.437 7.578 6.48 7.532 6.535 7.532H6.925C6.948 7.532 6.971 7.523 6.988 7.508L7.211 7.31C7.276 7.252 7.236 7.144 7.148 7.142L5.991 7.118H1.49C1.437 7.118 1.394 7.075 1.394 7.022V3.308C1.394 3.255 1.437 3.212 1.49 3.212H2.544C2.597 3.212 2.64 3.169 2.64 3.116V2.969C2.64 2.916 2.597 2.873 2.544 2.873H1.461C1.366 2.873 1.329 2.75 1.408 2.697L2.134 2.221C2.672 1.867 3.301 1.679 3.944 1.679Z"/></svg>\n',
|
||||
junie:
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 40 40" fill="none">\n <path d="M25 15H35V16.75C35 29 30.5001 35 16.5001 35H15V25H16.5001C22.6251 25 25 22.875 25 16.75V15Z" fill="currentColor"/>\n <rect x="5" y="15" width="10" height="10" fill="currentColor"/>\n <rect x="15" y="5" width="10" height="10" fill="currentColor"/>\n</svg>\n',
|
||||
kilo: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 40 40">\n <path fill="currentColor" d="M27.9998324,34.6666921h6.6666279v5.3333023h-8.3809037l-3.6190266-3.6190266v-8.3809037h5.3333023v6.6666279ZM39.9997627,26.2857884l-3.6190266-3.6190266h-8.3809037v5.3333023h6.6666279v6.6666279h5.3333023v-8.3809037ZM17.3332326,22.6667578h-5.3333023v5.3333023h5.3333023v-5.3333023ZM0,36.3809638l3.6190266,3.6190266h13.714206v-5.3333023H5.3333023v-11.9999302H0v13.714206ZM33.9600959,11.9999247V3.619021L30.3410693-.0000056h-7.6745392v5.3333023h5.9602634v6.6666279h-5.9602634v5.3333023h17.3332326v-5.3333023h-6.0396668ZM5.3333023,0H0v17.3332326h5.3333023v-5.9999651h6.6666279v5.9999651h5.3333023v-5.9999651l-5.3333023-5.3333023h-6.6666279V0ZM17.3332326,0h-5.3333023v5.9999651h5.3333023V0Z"/>\n</svg>\n',
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="1.394 1.679 8.494 7.828" fill="currentColor"><path d="M8.237 7.813C8.276 7.789 8.327 7.796 8.358 7.83L9.741 9.346C9.797 9.407 9.754 9.506 9.671 9.507H8.977C8.924 9.507 8.881 9.463 8.881 9.41V9.125C8.881 9.089 8.861 9.057 8.83 9.04L7.589 8.379C7.524 8.344 7.521 8.251 7.584 8.212L8.237 7.813ZM3.944 1.679C4.502 1.679 5.052 1.82 5.54 2.09L5.962 2.323C6.024 2.358 6.029 2.446 5.97 2.486L5.091 3.09C5.065 3.108 5.05 3.137 5.05 3.169V3.495C5.05 3.529 5.032 3.561 5.003 3.578L4.68 3.769C4.594 3.82 4.498 3.722 4.549 3.637L4.592 3.566C4.63 3.502 4.584 3.421 4.51 3.421H4.028C3.925 3.421 3.894 3.562 3.989 3.604L4.377 3.775C4.448 3.806 4.455 3.904 4.389 3.944L3.77 4.323C3.755 4.332 3.737 4.337 3.72 4.337H3.361C3.309 4.337 3.268 4.379 3.268 4.431C3.268 4.484 3.309 4.526 3.361 4.526H3.779C3.797 4.526 3.814 4.521 3.829 4.513L7.599 2.272C8.135 1.954 8.815 2.008 9.294 2.407C9.307 2.418 9.314 2.434 9.314 2.451V2.729C9.315 2.812 9.413 2.856 9.475 2.8L9.728 2.57C9.789 2.514 9.888 2.558 9.888 2.641V5.812C9.888 5.865 9.845 5.908 9.792 5.908H9.359C9.331 5.908 9.303 5.895 9.285 5.873L8.374 4.773C8.337 4.728 8.268 4.728 8.229 4.771L7.468 5.625C7.429 5.669 7.438 5.737 7.487 5.769L9.038 6.776C9.098 6.815 9.096 6.903 9.035 6.939L6.618 8.363C6.556 8.4 6.478 8.358 6.474 8.286L6.439 7.633C6.437 7.578 6.48 7.532 6.535 7.532H6.925C6.948 7.532 6.971 7.523 6.988 7.508L7.211 7.31C7.276 7.252 7.236 7.144 7.148 7.142L5.991 7.118H1.49C1.437 7.118 1.394 7.075 1.394 7.022V3.308C1.394 3.255 1.437 3.212 1.49 3.212H2.544C2.597 3.212 2.64 3.169 2.64 3.116V2.969C2.64 2.916 2.597 2.873 2.544 2.873H1.461C1.366 2.873 1.329 2.75 1.408 2.697L2.134 2.221C2.672 1.867 3.301 1.679 3.944 1.679Z"/></svg>
|
||||
|
Before Width: | Height: | Size: 1.7 KiB |
@@ -1,21 +1,19 @@
|
||||
import { useCallback, useMemo, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Text, View, type LayoutChangeEvent } from "react-native";
|
||||
import { Pressable, Text, View } from "react-native";
|
||||
import { SvgXml } from "react-native-svg";
|
||||
import { StyleSheet, withUnistyles } from "react-native-unistyles";
|
||||
import { PackagePlus } from "lucide-react-native";
|
||||
import { ExternalLink, PackagePlus, Search } from "lucide-react-native";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { ExternalLink } from "@/components/ui/external-link";
|
||||
import { SearchField } from "@/components/ui/search-field";
|
||||
import { StatusBadge } from "@/components/ui/status-badge";
|
||||
import { rankProviderCatalog } from "@/components/provider-catalog-search";
|
||||
import { isWeb } from "@/constants/platform";
|
||||
import {
|
||||
useAcpProviderCatalog,
|
||||
type AcpProviderCatalogItem,
|
||||
} from "@/hooks/use-acp-provider-catalog";
|
||||
import { useProvidersSnapshot } from "@/hooks/use-providers-snapshot";
|
||||
import { SPACING, type Theme } from "@/styles/theme";
|
||||
import { settingsStyles } from "@/styles/settings";
|
||||
import type { Theme } from "@/styles/theme";
|
||||
import { openExternalUrl } from "@/utils/open-external-url";
|
||||
import { EditingTextInput as TextInput } from "@/components/ui/text-input";
|
||||
|
||||
interface ProviderCatalogListProps {
|
||||
serverId: string;
|
||||
@@ -23,43 +21,52 @@ interface ProviderCatalogListProps {
|
||||
onInstall: (entry: AcpProviderCatalogItem) => Promise<void> | void;
|
||||
}
|
||||
|
||||
const SEARCH_ICON_SIZE = 16;
|
||||
const PROVIDER_FALLBACK_ICON_SIZE = 20;
|
||||
const PROVIDER_REMOTE_ICON_SIZE = 24;
|
||||
const TILE_GAP = SPACING[3];
|
||||
/** Narrowest tile that keeps the icon, type badge, install link, and Add on one row. */
|
||||
const MIN_TILE_WIDTH = 300;
|
||||
const MAX_COLUMNS = 4;
|
||||
|
||||
const ThemedPackagePlus = withUnistyles(PackagePlus);
|
||||
const ThemedSvgXml = withUnistyles(SvgXml);
|
||||
const ThemedSearch = withUnistyles(Search);
|
||||
const ThemedExternalLink = withUnistyles(ExternalLink);
|
||||
const ThemedTextInput = withUnistyles(TextInput, (theme) => ({
|
||||
placeholderTextColor: theme.colors.foregroundMuted,
|
||||
}));
|
||||
|
||||
const foregroundColorMapping = (theme: Theme) => ({ color: theme.colors.foreground });
|
||||
const foregroundMutedColorMapping = (theme: Theme) => ({
|
||||
color: theme.colors.foregroundMuted,
|
||||
});
|
||||
|
||||
function columnCountForWidth(width: number): number {
|
||||
const fits = Math.floor((width + TILE_GAP) / (MIN_TILE_WIDTH + TILE_GAP));
|
||||
return Math.min(MAX_COLUMNS, Math.max(1, fits));
|
||||
function matchesSearch(entry: AcpProviderCatalogItem, query: string): boolean {
|
||||
const normalized = query.trim().toLowerCase();
|
||||
if (!normalized) return true;
|
||||
return [entry.title, entry.id, entry.description].some((value) =>
|
||||
value.toLowerCase().includes(normalized),
|
||||
);
|
||||
}
|
||||
|
||||
interface CatalogTileProps {
|
||||
interface CatalogRowProps {
|
||||
entry: AcpProviderCatalogItem;
|
||||
/** `undefined` until the grid is measured, or in a single column; the tile fills the row. */
|
||||
width: number | undefined;
|
||||
installing: boolean;
|
||||
onInstall: (entry: AcpProviderCatalogItem) => void;
|
||||
}
|
||||
|
||||
function CatalogTile({ entry, width, installing, onInstall }: CatalogTileProps) {
|
||||
function CatalogRow({ entry, installing, onInstall }: CatalogRowProps) {
|
||||
const { t } = useTranslation();
|
||||
const actionLabel = installing
|
||||
? t("providerCatalog.actions.adding")
|
||||
: t("providerCatalog.actions.add");
|
||||
const handleInstall = useCallback(() => {
|
||||
onInstall(entry);
|
||||
}, [entry, onInstall]);
|
||||
const tileStyle = useMemo(
|
||||
() => [settingsStyles.card, styles.tile, width === undefined ? styles.tileFull : { width }],
|
||||
[width],
|
||||
);
|
||||
|
||||
const handleOpenInstallLink = useCallback(() => {
|
||||
void openExternalUrl(entry.installLink);
|
||||
}, [entry.installLink]);
|
||||
|
||||
return (
|
||||
<View style={tileStyle} testID={`provider-catalog-tile-${entry.id}`}>
|
||||
<View style={styles.row}>
|
||||
<View style={styles.iconFrame}>
|
||||
{entry.iconSvg ? (
|
||||
<ThemedSvgXml
|
||||
@@ -72,33 +79,42 @@ function CatalogTile({ entry, width, installing, onInstall }: CatalogTileProps)
|
||||
<ThemedPackagePlus size={PROVIDER_FALLBACK_ICON_SIZE} uniProps={foregroundColorMapping} />
|
||||
)}
|
||||
</View>
|
||||
<View style={styles.details}>
|
||||
<Text style={styles.name} numberOfLines={1}>
|
||||
{entry.title}
|
||||
</Text>
|
||||
<View style={styles.metaRow}>
|
||||
{/* The catalog is the ACP registry, so every entry it offers is an ACP provider. */}
|
||||
<StatusBadge label={t("providerCatalog.types.acp")} size="xs" />
|
||||
<ExternalLink
|
||||
href={entry.installLink}
|
||||
label={t("providerCatalog.actions.installInstructions")}
|
||||
accessibilityLabel={t("providerCatalog.actions.installInstructionsFor", {
|
||||
provider: entry.title,
|
||||
})}
|
||||
/>
|
||||
<View style={styles.textColumn}>
|
||||
<View style={styles.titleRow}>
|
||||
<Text style={styles.name} numberOfLines={1}>
|
||||
{entry.title}
|
||||
</Text>
|
||||
<Text style={styles.version} numberOfLines={1}>
|
||||
{entry.version}
|
||||
</Text>
|
||||
</View>
|
||||
<Text style={styles.description} numberOfLines={1}>
|
||||
{entry.description || entry.id}
|
||||
</Text>
|
||||
<Pressable
|
||||
accessibilityRole="link"
|
||||
accessibilityLabel={t("providerCatalog.actions.installInstructionsFor", {
|
||||
provider: entry.title,
|
||||
})}
|
||||
onPress={handleOpenInstallLink}
|
||||
style={styles.installLink}
|
||||
>
|
||||
<Text style={styles.installLinkText} numberOfLines={1}>
|
||||
{t("providerCatalog.actions.installInstructions")}
|
||||
</Text>
|
||||
<ThemedExternalLink size={12} uniProps={foregroundMutedColorMapping} />
|
||||
</Pressable>
|
||||
</View>
|
||||
<Button
|
||||
size="xs"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
variant="default"
|
||||
disabled={installing}
|
||||
loading={installing}
|
||||
onPress={handleInstall}
|
||||
accessibilityLabel={t("providerCatalog.actions.addProvider", { provider: entry.title })}
|
||||
style={styles.addButton}
|
||||
style={styles.actionButton}
|
||||
testID={`install-provider-${entry.id}`}
|
||||
>
|
||||
{installing ? t("providerCatalog.actions.adding") : t("providerCatalog.actions.add")}
|
||||
{actionLabel}
|
||||
</Button>
|
||||
</View>
|
||||
);
|
||||
@@ -113,7 +129,6 @@ export function ProviderCatalogList({
|
||||
const { entries: catalogEntries } = useAcpProviderCatalog();
|
||||
const { entries: providerEntries } = useProvidersSnapshot(serverId);
|
||||
const [search, setSearch] = useState("");
|
||||
const [gridWidth, setGridWidth] = useState<number | null>(null);
|
||||
|
||||
const installedIds = useMemo(
|
||||
() => new Set(providerEntries?.map((entry) => entry.provider) ?? []),
|
||||
@@ -122,48 +137,41 @@ export function ProviderCatalogList({
|
||||
|
||||
const availableEntries = useMemo(
|
||||
() =>
|
||||
rankProviderCatalog(
|
||||
catalogEntries.filter((entry) => !installedIds.has(entry.id)),
|
||||
search,
|
||||
),
|
||||
catalogEntries
|
||||
.filter((entry) => !installedIds.has(entry.id))
|
||||
.filter((entry) => matchesSearch(entry, search)),
|
||||
[catalogEntries, installedIds, search],
|
||||
);
|
||||
|
||||
const handleGridLayout = useCallback((event: LayoutChangeEvent) => {
|
||||
setGridWidth(event.nativeEvent.layout.width);
|
||||
}, []);
|
||||
|
||||
const tileWidth = useMemo(() => {
|
||||
if (gridWidth === null) return undefined;
|
||||
const columns = columnCountForWidth(gridWidth);
|
||||
if (columns === 1) return undefined;
|
||||
return Math.floor((gridWidth - TILE_GAP * (columns - 1)) / columns);
|
||||
}, [gridWidth]);
|
||||
|
||||
return (
|
||||
<View>
|
||||
<View style={styles.searchRail}>
|
||||
<SearchField
|
||||
value={search}
|
||||
onChangeText={setSearch}
|
||||
placeholder={t("providerCatalog.search")}
|
||||
clearAccessibilityLabel={t("providerCatalog.clearSearch")}
|
||||
<View style={styles.searchField}>
|
||||
<View style={styles.searchIcon}>
|
||||
<ThemedSearch size={SEARCH_ICON_SIZE} uniProps={foregroundMutedColorMapping} />
|
||||
</View>
|
||||
<ThemedTextInput
|
||||
testID="provider-catalog-search"
|
||||
clearTestID="provider-catalog-search-clear"
|
||||
initialValue={search}
|
||||
onChangeText={setSearch}
|
||||
accessibilityLabel={t("providerCatalog.search")}
|
||||
placeholder={t("providerCatalog.search")}
|
||||
// @ts-expect-error - outlineStyle is web-only
|
||||
style={[styles.searchInput, isWeb && { outlineStyle: "none" }]}
|
||||
autoCapitalize="none"
|
||||
autoCorrect={false}
|
||||
/>
|
||||
</View>
|
||||
|
||||
{availableEntries.length === 0 ? (
|
||||
<View style={[settingsStyles.card, styles.stateBox]}>
|
||||
<View style={styles.stateBox}>
|
||||
<Text style={styles.stateText}>{t("providerCatalog.noProviders")}</Text>
|
||||
</View>
|
||||
) : (
|
||||
<View style={styles.grid} onLayout={handleGridLayout}>
|
||||
<View style={styles.list}>
|
||||
{availableEntries.map((entry) => (
|
||||
<CatalogTile
|
||||
<CatalogRow
|
||||
key={entry.id}
|
||||
entry={entry}
|
||||
width={tileWidth}
|
||||
installing={installingProviderId === entry.id}
|
||||
onInstall={onInstall}
|
||||
/>
|
||||
@@ -175,56 +183,101 @@ export function ProviderCatalogList({
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create((theme) => ({
|
||||
searchRail: {
|
||||
searchField: {
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
gap: theme.spacing[2],
|
||||
backgroundColor: theme.colors.surface2,
|
||||
borderRadius: theme.borderRadius.lg,
|
||||
borderWidth: 1,
|
||||
borderColor: theme.colors.border,
|
||||
paddingHorizontal: theme.spacing[3],
|
||||
marginBottom: theme.spacing[3],
|
||||
},
|
||||
grid: {
|
||||
flexDirection: "row",
|
||||
flexWrap: "wrap",
|
||||
gap: TILE_GAP,
|
||||
searchIcon: {
|
||||
width: 18,
|
||||
alignItems: "center",
|
||||
},
|
||||
tile: {
|
||||
searchInput: {
|
||||
flex: 1,
|
||||
minWidth: 0,
|
||||
paddingVertical: theme.spacing[3],
|
||||
color: theme.colors.foreground,
|
||||
fontSize: theme.fontSize.base,
|
||||
},
|
||||
list: {
|
||||
borderRadius: theme.borderRadius.lg,
|
||||
borderWidth: 1,
|
||||
borderColor: theme.colors.border,
|
||||
overflow: "hidden",
|
||||
},
|
||||
row: {
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
gap: theme.spacing[3],
|
||||
padding: theme.spacing[3],
|
||||
},
|
||||
tileFull: {
|
||||
width: "100%",
|
||||
},
|
||||
details: {
|
||||
flex: 1,
|
||||
minWidth: 0,
|
||||
gap: theme.spacing[1],
|
||||
borderBottomWidth: 1,
|
||||
borderBottomColor: theme.colors.border,
|
||||
},
|
||||
iconFrame: {
|
||||
flexShrink: 0,
|
||||
width: 36,
|
||||
height: 36,
|
||||
borderRadius: theme.borderRadius.md,
|
||||
backgroundColor: theme.colors.surface2,
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
},
|
||||
addButton: {
|
||||
flexShrink: 0,
|
||||
},
|
||||
textColumn: {
|
||||
flex: 1,
|
||||
minWidth: 0,
|
||||
gap: theme.spacing[1],
|
||||
},
|
||||
titleRow: {
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
gap: theme.spacing[2],
|
||||
minWidth: 0,
|
||||
},
|
||||
name: {
|
||||
color: theme.colors.foreground,
|
||||
fontSize: theme.fontSize.base,
|
||||
fontWeight: theme.fontWeight.normal,
|
||||
fontWeight: theme.fontWeight.medium,
|
||||
flexShrink: 1,
|
||||
},
|
||||
metaRow: {
|
||||
version: {
|
||||
color: theme.colors.foregroundMuted,
|
||||
fontSize: theme.fontSize.sm,
|
||||
flexShrink: 0,
|
||||
},
|
||||
description: {
|
||||
color: theme.colors.foregroundMuted,
|
||||
fontSize: theme.fontSize.sm,
|
||||
},
|
||||
installLink: {
|
||||
alignSelf: "flex-start",
|
||||
flexDirection: "row",
|
||||
flexWrap: "wrap",
|
||||
alignItems: "center",
|
||||
gap: theme.spacing[2],
|
||||
gap: theme.spacing[1],
|
||||
maxWidth: "100%",
|
||||
},
|
||||
installLinkText: {
|
||||
color: theme.colors.foregroundMuted,
|
||||
fontSize: theme.fontSize.sm,
|
||||
},
|
||||
actionButton: {
|
||||
width: 92,
|
||||
flexShrink: 0,
|
||||
},
|
||||
stateBox: {
|
||||
minHeight: 96,
|
||||
borderRadius: theme.borderRadius.lg,
|
||||
borderWidth: 1,
|
||||
borderColor: theme.colors.border,
|
||||
backgroundColor: theme.colors.surface1,
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
gap: theme.spacing[3],
|
||||
padding: theme.spacing[4],
|
||||
},
|
||||
stateText: {
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { rankProviderCatalog } from "./provider-catalog-search";
|
||||
|
||||
const entries = [
|
||||
{ id: "kiro-cli", title: "Kiro CLI" },
|
||||
{ id: "goose", title: "goose" },
|
||||
{ id: "kimi", title: "Kimi Code CLI" },
|
||||
{ id: "gemini", title: "Gemini CLI" },
|
||||
{ id: "qwen-code", title: "Qwen Code" },
|
||||
{ id: "codex-acp", title: "Codex" },
|
||||
];
|
||||
|
||||
function titles(list: { title: string }[]): string[] {
|
||||
return list.map((entry) => entry.title);
|
||||
}
|
||||
|
||||
describe("rankProviderCatalog", () => {
|
||||
it("lists every provider alphabetically by name without a query", () => {
|
||||
expect(titles(rankProviderCatalog(entries, " "))).toEqual([
|
||||
"Codex",
|
||||
"Gemini CLI",
|
||||
"goose",
|
||||
"Kimi Code CLI",
|
||||
"Kiro CLI",
|
||||
"Qwen Code",
|
||||
]);
|
||||
});
|
||||
|
||||
it("ranks the strongest match first and drops providers that do not match", () => {
|
||||
expect(titles(rankProviderCatalog(entries, "cod"))).toEqual([
|
||||
"Codex",
|
||||
"Kimi Code CLI",
|
||||
"Qwen Code",
|
||||
]);
|
||||
});
|
||||
|
||||
it("matches in-word subsequences and multiple tokens like the other pickers", () => {
|
||||
expect(titles(rankProviderCatalog(entries, "gmni"))).toEqual(["Gemini CLI"]);
|
||||
expect(titles(rankProviderCatalog(entries, "qw cod"))).toEqual(["Qwen Code"]);
|
||||
});
|
||||
|
||||
it("matches the provider id", () => {
|
||||
expect(titles(rankProviderCatalog(entries, "kiro-cli"))).toEqual(["Kiro CLI"]);
|
||||
});
|
||||
});
|
||||
@@ -1,34 +0,0 @@
|
||||
import {
|
||||
compareMatchScores,
|
||||
scoreTextFields,
|
||||
type MatchScore,
|
||||
} from "@getpaseo/protocol/search/text-match";
|
||||
|
||||
export interface SearchableCatalogEntry {
|
||||
id: string;
|
||||
title: string;
|
||||
}
|
||||
|
||||
function compareTitles(a: SearchableCatalogEntry, b: SearchableCatalogEntry): number {
|
||||
return a.title.localeCompare(b.title, undefined, { sensitivity: "base" });
|
||||
}
|
||||
|
||||
/**
|
||||
* Orders the Add provider catalog. Without a query the list is alphabetical by
|
||||
* name. With a query it uses the pickers' ranked matcher over the fields the
|
||||
* tile shows (name and id), best match first, ties alphabetical.
|
||||
*/
|
||||
export function rankProviderCatalog<T extends SearchableCatalogEntry>(
|
||||
entries: readonly T[],
|
||||
query: string,
|
||||
): T[] {
|
||||
if (!query.trim()) return [...entries].sort(compareTitles);
|
||||
|
||||
const scored: { entry: T; score: MatchScore }[] = [];
|
||||
for (const entry of entries) {
|
||||
const score = scoreTextFields(query, [entry.title, entry.id]);
|
||||
if (score) scored.push({ entry, score });
|
||||
}
|
||||
scored.sort((a, b) => compareMatchScores(a.score, b.score) || compareTitles(a.entry, b.entry));
|
||||
return scored.map(({ entry }) => entry);
|
||||
}
|
||||
@@ -50,7 +50,7 @@ import { useToast } from "@/contexts/toast-context";
|
||||
import { toErrorMessage } from "@/utils/error-messages";
|
||||
import { showProviderNoticeToast } from "@/utils/provider-notice-toast";
|
||||
import { applyCheckoutStatusUpdateFromEvent } from "@/git/checkout-status-cache";
|
||||
import { resyncProviderSubagents, useProviderSubagentStore } from "@/subagents/provider-store";
|
||||
import { useProviderSubagentStore } from "@/subagents/provider-store";
|
||||
|
||||
// Re-export types from session-store and draft-store for backward compatibility
|
||||
export type { DraftInput } from "@/stores/draft-store";
|
||||
@@ -532,14 +532,9 @@ function SessionProviderInternal({ children, serverId, client }: SessionProvider
|
||||
}
|
||||
});
|
||||
|
||||
const unsubProviderSubagentUpdate = feeds.subscribe({
|
||||
snapshot: () => {
|
||||
void resyncProviderSubagents(client, serverId);
|
||||
},
|
||||
update: (message) => {
|
||||
if (message.type !== "agent.provider_subagents.update") return;
|
||||
useProviderSubagentStore.getState().applyUpdate(serverId, message.payload);
|
||||
},
|
||||
const unsubProviderSubagentUpdate = onFeed("agent.provider_subagents.update", (message) => {
|
||||
if (message.type !== "agent.provider_subagents.update") return;
|
||||
useProviderSubagentStore.getState().applyUpdate(serverId, message.payload);
|
||||
});
|
||||
|
||||
const unsubCheckoutStatusUpdate = onFeed("checkout_status_update", (message) => {
|
||||
|
||||
@@ -8,7 +8,6 @@ export interface AcpProviderCatalogEntry {
|
||||
iconSvg: string | null;
|
||||
installLink: string;
|
||||
command: readonly [string, ...string[]];
|
||||
bundledProvider?: boolean;
|
||||
env?: Readonly<Record<string, string>>;
|
||||
params?: Readonly<Record<string, unknown>>;
|
||||
}
|
||||
@@ -239,16 +238,6 @@ const CATALOG_DATA = [
|
||||
installLink: "https://hermes-agent.nousresearch.com/docs/user-guide/features/acp",
|
||||
command: ["hermes", "acp"],
|
||||
},
|
||||
{
|
||||
id: "hoplite",
|
||||
bundledProvider: true,
|
||||
title: "Hoplite",
|
||||
description: "Cloud coding agent through the local hoplite acp bridge",
|
||||
version: "manual",
|
||||
iconId: "hoplite",
|
||||
installLink: "https://hoplite.sh/docs/cli#install",
|
||||
command: ["hoplite", "acp"],
|
||||
},
|
||||
{
|
||||
id: "junie",
|
||||
title: "Junie",
|
||||
@@ -400,7 +389,6 @@ export const ACP_PROVIDER_CATALOG: AcpProviderCatalogEntry[] = CATALOG_DATA.map(
|
||||
version: entry.version,
|
||||
installLink: entry.installLink,
|
||||
command: entry.command,
|
||||
bundledProvider: "bundledProvider" in entry ? entry.bundledProvider : undefined,
|
||||
env: "env" in entry ? entry.env : undefined,
|
||||
params: "params" in entry ? entry.params : undefined,
|
||||
iconSvg: entry.iconId ? (ACP_PROVIDER_ICON_SVGS[entry.iconId] ?? null) : null,
|
||||
|
||||
@@ -44,7 +44,6 @@ describe("ACP provider catalog", () => {
|
||||
expect(findProvider("codewhale").command).toEqual(["codewhale", "serve", "--acp"]);
|
||||
expect(findProvider("devin").command).toEqual(["devin", "acp"]);
|
||||
expect(findProvider("goose").command).toEqual(["goose", "acp"]);
|
||||
expect(findProvider("hoplite").command).toEqual(["hoplite", "acp"]);
|
||||
expect(findProvider("junie").command).toEqual(["junie", "--acp", "true"]);
|
||||
expect(findProvider("kiro").command).toEqual(["kiro-cli", "acp"]);
|
||||
expect(findProvider("poolside").command).toEqual(["pool", "acp"]);
|
||||
@@ -60,32 +59,6 @@ describe("ACP provider catalog", () => {
|
||||
expect(findProvider("minimax-code").iconSvg).toContain("<svg");
|
||||
});
|
||||
|
||||
it("offers Hoplite through its local ACP bridge with the Hoplite mark", () => {
|
||||
expect(findProvider("hoplite")).toMatchObject({
|
||||
title: "Hoplite",
|
||||
command: ["hoplite", "acp"],
|
||||
installLink: "https://hoplite.sh/docs/cli#install",
|
||||
});
|
||||
expect(buildAcpProviderConfigPatch(findProvider("hoplite"), true)).toEqual({
|
||||
providers: {
|
||||
hoplite: { enabled: true },
|
||||
},
|
||||
});
|
||||
const ids = getAcpProviderCatalog().map((entry) => entry.id);
|
||||
expect(ids.indexOf("hermes")).toBeLessThan(ids.indexOf("hoplite"));
|
||||
expect(ids.indexOf("hoplite")).toBeLessThan(ids.indexOf("junie"));
|
||||
expect(findProvider("hoplite").iconSvg).toContain('fill="currentColor"');
|
||||
});
|
||||
|
||||
it.each([undefined, false])(
|
||||
"rejects unsupported bundled Hoplite before producing a patch (%s)",
|
||||
(supported) => {
|
||||
expect(() => buildAcpProviderConfigPatch(findProvider("hoplite"), supported)).toThrow(
|
||||
"Update the host to add Hoplite.",
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
it("maps a catalog entry to the daemon provider config patch", () => {
|
||||
expect(buildAcpProviderConfigPatch(findProvider("amp-acp"))).toEqual({
|
||||
providers: {
|
||||
|
||||
@@ -10,13 +10,7 @@ export function getAcpProviderCatalog(): AcpProviderCatalogItem[] {
|
||||
|
||||
export function buildAcpProviderConfigPatch(
|
||||
entry: AcpProviderCatalogItem,
|
||||
supportsHopliteProvider = false,
|
||||
): MutableDaemonConfigPatch {
|
||||
if (entry.bundledProvider) {
|
||||
// COMPAT(hopliteProvider): added after v0.11.2, remove after 2027-04-15 once host floor includes the bundled adapter.
|
||||
if (!supportsHopliteProvider) throw new Error("Update the host to add Hoplite.");
|
||||
return { providers: { [entry.id]: { enabled: true } } };
|
||||
}
|
||||
return {
|
||||
providers: {
|
||||
[entry.id]: {
|
||||
|
||||
@@ -1650,19 +1650,14 @@ export const ar: TranslationResources = {
|
||||
title: "إضافة مزود",
|
||||
search: "مقدمي البحث",
|
||||
noProviders: "لم يتم العثور على مقدمي الخدمات",
|
||||
clearSearch: "مسح البحث",
|
||||
actions: {
|
||||
add: "يضيف",
|
||||
addProvider: "إضافة {{provider}}",
|
||||
adding: "إضافة",
|
||||
installed: "تم التثبيت",
|
||||
cancel: "يلغي",
|
||||
installInstructions: "تعليمات التثبيت",
|
||||
installInstructionsFor: "تعليمات تثبيت{{provider}}",
|
||||
},
|
||||
types: {
|
||||
acp: "ACP",
|
||||
},
|
||||
errors: {
|
||||
unableToInstall: "غير قادر على تثبيت الموفر",
|
||||
},
|
||||
|
||||
@@ -1675,19 +1675,14 @@ export const en = {
|
||||
title: "Add provider",
|
||||
search: "Search providers",
|
||||
noProviders: "No providers found",
|
||||
clearSearch: "Clear search",
|
||||
actions: {
|
||||
add: "Add",
|
||||
addProvider: "Add {{provider}}",
|
||||
adding: "Adding",
|
||||
installed: "Installed",
|
||||
cancel: "Cancel",
|
||||
installInstructions: "Install instructions",
|
||||
installInstructionsFor: "{{provider}} install instructions",
|
||||
},
|
||||
types: {
|
||||
acp: "ACP",
|
||||
},
|
||||
errors: {
|
||||
unableToInstall: "Unable to install provider",
|
||||
},
|
||||
|
||||
@@ -1696,19 +1696,14 @@ export const es: TranslationResources = {
|
||||
title: "Agregar proveedor",
|
||||
search: "Proveedores de búsqueda",
|
||||
noProviders: "No se encontraron proveedores",
|
||||
clearSearch: "Borrar búsqueda",
|
||||
actions: {
|
||||
add: "Agregar",
|
||||
addProvider: "Añadir {{provider}}",
|
||||
adding: "Añadiendo",
|
||||
installed: "Instalado",
|
||||
cancel: "Cancelar",
|
||||
installInstructions: "Instrucciones de instalación",
|
||||
installInstructionsFor: "Instrucciones de instalación de{{provider}}",
|
||||
},
|
||||
types: {
|
||||
acp: "ACP",
|
||||
},
|
||||
errors: {
|
||||
unableToInstall: "No se puede instalar el proveedor",
|
||||
},
|
||||
|
||||
@@ -1692,19 +1692,14 @@ export const fr: TranslationResources = {
|
||||
title: "Ajouter un fournisseur",
|
||||
search: "Rechercher des fournisseurs",
|
||||
noProviders: "Aucun fournisseur trouvé",
|
||||
clearSearch: "Effacer la recherche",
|
||||
actions: {
|
||||
add: "Ajouter",
|
||||
addProvider: "Ajouter {{provider}}",
|
||||
adding: "Ajout…",
|
||||
installed: "Installé",
|
||||
cancel: "Annuler",
|
||||
installInstructions: "Instructions d’installation",
|
||||
installInstructionsFor: "Instructions d’installation de {{provider}}",
|
||||
},
|
||||
types: {
|
||||
acp: "ACP",
|
||||
},
|
||||
errors: {
|
||||
unableToInstall: "Impossible d’installer le fournisseur",
|
||||
},
|
||||
|
||||
@@ -1667,19 +1667,14 @@ export const ja: TranslationResources = {
|
||||
title: "プロバイダーを追加",
|
||||
search: "プロバイダーを検索",
|
||||
noProviders: "プロバイダーが見つかりません",
|
||||
clearSearch: "検索をクリア",
|
||||
actions: {
|
||||
add: "追加",
|
||||
addProvider: "{{provider}} を追加",
|
||||
adding: "追加中",
|
||||
installed: "インストール済み",
|
||||
cancel: "キャンセル",
|
||||
installInstructions: "インストール手順",
|
||||
installInstructionsFor: "{{provider}}のインストール手順",
|
||||
},
|
||||
types: {
|
||||
acp: "ACP",
|
||||
},
|
||||
errors: {
|
||||
unableToInstall: "プロバイダーをインストールできません",
|
||||
},
|
||||
|
||||
@@ -1660,19 +1660,14 @@ export const ko: TranslationResources = {
|
||||
title: "프로바이더 추가",
|
||||
search: "프로바이더 검색",
|
||||
noProviders: "프로바이더를 찾을 수 없습니다",
|
||||
clearSearch: "검색 지우기",
|
||||
actions: {
|
||||
add: "추가",
|
||||
addProvider: "{{provider}} 추가",
|
||||
adding: "추가 중",
|
||||
installed: "설치됨",
|
||||
cancel: "취소",
|
||||
installInstructions: "설치 안내",
|
||||
installInstructionsFor: "{{provider}} 설치 안내",
|
||||
},
|
||||
types: {
|
||||
acp: "ACP",
|
||||
},
|
||||
errors: {
|
||||
unableToInstall: "프로바이더를 설치할 수 없습니다",
|
||||
},
|
||||
|
||||
@@ -1681,19 +1681,14 @@ export const ptBR: TranslationResources = {
|
||||
title: "Adicionar provedor",
|
||||
search: "Buscar provedores",
|
||||
noProviders: "Nenhum provedor encontrado",
|
||||
clearSearch: "Limpar pesquisa",
|
||||
actions: {
|
||||
add: "Adicionar",
|
||||
addProvider: "Adicionar {{provider}}",
|
||||
adding: "Adicionando",
|
||||
installed: "Instalado",
|
||||
cancel: "Cancelar",
|
||||
installInstructions: "Instruções de instalação",
|
||||
installInstructionsFor: "Instruções de instalação de {{provider}}",
|
||||
},
|
||||
types: {
|
||||
acp: "ACP",
|
||||
},
|
||||
errors: {
|
||||
unableToInstall: "Não foi possível instalar provedor",
|
||||
},
|
||||
|
||||
@@ -1679,19 +1679,14 @@ export const ru: TranslationResources = {
|
||||
title: "Добавить провайдера",
|
||||
search: "Поиск провайдеров",
|
||||
noProviders: "Провайдеры не найдены",
|
||||
clearSearch: "Очистить поиск",
|
||||
actions: {
|
||||
add: "Добавить",
|
||||
addProvider: "Добавить {{provider}}",
|
||||
adding: "Добавление",
|
||||
installed: "Установлено",
|
||||
cancel: "Отмена",
|
||||
installInstructions: "Инструкции по установке",
|
||||
installInstructionsFor: "Инструкции по установке {{provider}}",
|
||||
},
|
||||
types: {
|
||||
acp: "ACP",
|
||||
},
|
||||
errors: {
|
||||
unableToInstall: "Не удалось установить провайдера",
|
||||
},
|
||||
|
||||
@@ -1633,19 +1633,14 @@ export const zhCN: TranslationResources = {
|
||||
title: "添加 provider",
|
||||
search: "搜索 providers",
|
||||
noProviders: "未找到 providers",
|
||||
clearSearch: "清除搜索",
|
||||
actions: {
|
||||
add: "添加",
|
||||
addProvider: "添加 {{provider}}",
|
||||
adding: "正在添加",
|
||||
installed: "已安装",
|
||||
cancel: "取消",
|
||||
installInstructions: "安装说明",
|
||||
installInstructionsFor: "{{provider}} 安装说明",
|
||||
},
|
||||
types: {
|
||||
acp: "ACP",
|
||||
},
|
||||
errors: {
|
||||
unableToInstall: "无法安装 provider",
|
||||
},
|
||||
|
||||
@@ -6,7 +6,6 @@ import { createRoot, type Root } from "react-dom/client";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { ProviderSnapshotEntry } from "@getpaseo/protocol/agent-types";
|
||||
import type { MutableDaemonConfig } from "@getpaseo/protocol/messages";
|
||||
import { ToastApiProvider } from "@/contexts/toast-api-context";
|
||||
|
||||
const { theme, snapshotState, configState, patchConfigMock, openProviderSettingsMock } = vi.hoisted(
|
||||
() => ({
|
||||
@@ -282,12 +281,6 @@ vi.mock("@/utils/confirm-dialog", () => ({
|
||||
|
||||
import { ProvidersSection } from "./providers-section";
|
||||
|
||||
function unexpectedToast(): never {
|
||||
throw new Error("Provider row interactions should not display a toast");
|
||||
}
|
||||
|
||||
const toastApi = { show: unexpectedToast, copied: unexpectedToast, error: unexpectedToast };
|
||||
|
||||
const claudeEntry: ProviderSnapshotEntry = {
|
||||
provider: "claude",
|
||||
status: "ready",
|
||||
@@ -373,11 +366,7 @@ describe("ProvidersSection", () => {
|
||||
|
||||
function render(): void {
|
||||
act(() => {
|
||||
root?.render(
|
||||
<ToastApiProvider api={toastApi}>
|
||||
<ProvidersSection serverId="server-1" />
|
||||
</ToastApiProvider>,
|
||||
);
|
||||
root?.render(<ProvidersSection serverId="server-1" />);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
} from "react-native";
|
||||
import { StyleSheet, useUnistyles } from "react-native-unistyles";
|
||||
import { useIsCompactFormFactor } from "@/constants/layout";
|
||||
import { useToast } from "@/contexts/toast-api-context";
|
||||
import { settingsStyles } from "@/styles/settings";
|
||||
import { useHostRuntimeIsConnected } from "@/runtime/host-runtime";
|
||||
import { useHostFeature } from "@/runtime/host-features";
|
||||
@@ -20,7 +19,6 @@ import { useDaemonConfig } from "@/hooks/use-daemon-config";
|
||||
import { buildProviderDefinitions } from "@/utils/provider-definitions";
|
||||
import {
|
||||
buildAcpProviderConfigPatch,
|
||||
getAcpProviderCatalog,
|
||||
type AcpProviderCatalogItem,
|
||||
} from "@/hooks/use-acp-provider-catalog";
|
||||
import { ProviderCatalogList } from "@/components/provider-catalog-list";
|
||||
@@ -327,12 +325,10 @@ export interface ProvidersSectionProps {
|
||||
|
||||
export function ProvidersSection({ serverId }: ProvidersSectionProps) {
|
||||
const { t } = useTranslation();
|
||||
const toast = useToast();
|
||||
const isConnected = useHostRuntimeIsConnected(serverId);
|
||||
const supportsHopliteProvider = useHostFeature(serverId, "hopliteProvider");
|
||||
const supportsProviderRemoval = useHostFeature(serverId, "providerRemoval");
|
||||
const { entries, isLoading, refresh } = useProvidersSnapshot(serverId);
|
||||
const { config, patchConfig } = useDaemonConfig(serverId);
|
||||
const { patchConfig } = useDaemonConfig(serverId);
|
||||
const openProviderSettings = useProviderSettingsStore((state) => state.open);
|
||||
const [pendingProviderId, setPendingProviderId] = useState<string | null>(null);
|
||||
const [removingProviderId, setRemovingProviderId] = useState<string | null>(null);
|
||||
@@ -342,19 +338,6 @@ export function ProvidersSection({ serverId }: ProvidersSectionProps) {
|
||||
const providerDefinitions = useMemo(() => buildProviderDefinitions(entries), [entries]);
|
||||
const hasServer = serverId.length > 0;
|
||||
|
||||
/** Config owns derived providers and opt-in bundled catalog providers. */
|
||||
const isConfigOwnedProvider = useCallback(
|
||||
(providerId: string) =>
|
||||
Boolean(
|
||||
config?.providers?.[providerId] &&
|
||||
(config.providers[providerId].extends ||
|
||||
getAcpProviderCatalog().some(
|
||||
(entry) => entry.id === providerId && entry.bundledProvider,
|
||||
)),
|
||||
),
|
||||
[config],
|
||||
);
|
||||
|
||||
const handleOpenProviderSettings = useCallback(
|
||||
(providerId: string) => {
|
||||
openProviderSettings({ serverId, provider: providerId });
|
||||
@@ -416,15 +399,18 @@ export function ProvidersSection({ serverId }: ProvidersSectionProps) {
|
||||
if (installingProviderId) return;
|
||||
setInstallingProviderId(entry.id);
|
||||
try {
|
||||
await patchConfig(buildAcpProviderConfigPatch(entry, supportsHopliteProvider));
|
||||
await patchConfig(buildAcpProviderConfigPatch(entry));
|
||||
await refresh([entry.id]);
|
||||
} catch (error) {
|
||||
toast.error(error instanceof Error ? error.message : String(error));
|
||||
Alert.alert(
|
||||
t("settings.providers.addErrorTitle"),
|
||||
error instanceof Error ? error.message : String(error),
|
||||
);
|
||||
} finally {
|
||||
setInstallingProviderId((current) => (current === entry.id ? null : current));
|
||||
}
|
||||
},
|
||||
[installingProviderId, patchConfig, refresh, supportsHopliteProvider, toast],
|
||||
[installingProviderId, patchConfig, refresh, t],
|
||||
);
|
||||
|
||||
return (
|
||||
@@ -458,11 +444,7 @@ export function ProvidersSection({ serverId }: ProvidersSectionProps) {
|
||||
enabled={entry.enabled ?? true}
|
||||
isToggling={pendingProviderId === def.id}
|
||||
isRemoving={removingProviderId === def.id}
|
||||
canRemove={
|
||||
supportsProviderRemoval &&
|
||||
entry.source === "custom" &&
|
||||
isConfigOwnedProvider(def.id)
|
||||
}
|
||||
canRemove={supportsProviderRemoval && entry.source === "custom"}
|
||||
isFirst={index === 0}
|
||||
onPress={handleOpenProviderSettings}
|
||||
onToggleEnabled={handleToggleEnabled}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
import { DaemonConnectionError } from "@getpaseo/client/internal/daemon-client";
|
||||
import { afterEach, describe, expect, test } from "vitest";
|
||||
import type { ProviderSubagentDescriptorPayload } from "@getpaseo/protocol/messages";
|
||||
import {
|
||||
observeProviderSubagentTimeline,
|
||||
providerSubagentKey,
|
||||
refreshProviderSubagents,
|
||||
resyncProviderSubagents,
|
||||
useProviderSubagentStore,
|
||||
} from "./provider-store";
|
||||
|
||||
@@ -18,7 +15,6 @@ afterEach(() => {
|
||||
descriptors: new Map(),
|
||||
timelines: new Map(),
|
||||
hiddenFromTrack: new Set(),
|
||||
trackedParents: new Set(),
|
||||
});
|
||||
});
|
||||
|
||||
@@ -731,96 +727,3 @@ describe("projected child history", () => {
|
||||
expect(current().lastSeq).toBe(2000);
|
||||
});
|
||||
});
|
||||
|
||||
describe("resyncing after the update feed resubscribes", () => {
|
||||
function child(
|
||||
id: string,
|
||||
parentAgentId: string,
|
||||
status: ProviderSubagentDescriptorPayload["status"],
|
||||
): ProviderSubagentDescriptorPayload {
|
||||
return {
|
||||
id,
|
||||
parentAgentId,
|
||||
provider: "claude",
|
||||
title: "Explore",
|
||||
description: null,
|
||||
status,
|
||||
createdAt: "2026-10-07T10:00:00.000Z",
|
||||
updatedAt: "2026-10-07T10:00:00.000Z",
|
||||
toolCallId: id,
|
||||
};
|
||||
}
|
||||
|
||||
function fakeDaemon(lists: Record<string, ProviderSubagentDescriptorPayload[]>) {
|
||||
const requested: string[] = [];
|
||||
return {
|
||||
requested,
|
||||
lists,
|
||||
client: {
|
||||
listProviderSubagents: async (parentAgentId: string) => {
|
||||
requested.push(parentAgentId);
|
||||
return {
|
||||
requestId: "list",
|
||||
parentAgentId,
|
||||
subagents: lists[parentAgentId] ?? [],
|
||||
error: null,
|
||||
};
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
const status = (parentAgentId: string, subagentId: string) =>
|
||||
useProviderSubagentStore
|
||||
.getState()
|
||||
.descriptors.get(providerSubagentKey(SERVER_ID, parentAgentId, subagentId))?.status;
|
||||
|
||||
test("catches up on children that finished or started while updates were not delivered", async () => {
|
||||
const daemon = fakeDaemon({ [PARENT_ID]: [child("child-1", PARENT_ID, "running")] });
|
||||
await refreshProviderSubagents(daemon.client, SERVER_ID, PARENT_ID);
|
||||
expect(status(PARENT_ID, "child-1")).toBe("running");
|
||||
|
||||
// The connection dropped: the daemon finished child-1 and ran child-2 without telling us.
|
||||
daemon.lists[PARENT_ID] = [
|
||||
child("child-1", PARENT_ID, "completed"),
|
||||
child("child-2", PARENT_ID, "completed"),
|
||||
];
|
||||
await resyncProviderSubagents(daemon.client, SERVER_ID);
|
||||
|
||||
expect(status(PARENT_ID, "child-1")).toBe("completed");
|
||||
expect(status(PARENT_ID, "child-2")).toBe("completed");
|
||||
});
|
||||
|
||||
test("catches up on a parent whose first list failed while disconnected", async () => {
|
||||
const daemon = fakeDaemon({});
|
||||
const disconnected = {
|
||||
listProviderSubagents: async () => {
|
||||
throw new DaemonConnectionError("Transport not connected");
|
||||
},
|
||||
};
|
||||
await expect(
|
||||
refreshProviderSubagents(disconnected, SERVER_ID, PARENT_ID),
|
||||
).rejects.toBeInstanceOf(DaemonConnectionError);
|
||||
useProviderSubagentStore.getState().applyUpdate(SERVER_ID, {
|
||||
kind: "upsert",
|
||||
subagent: child("child-1", PARENT_ID, "running"),
|
||||
});
|
||||
|
||||
// The connection dropped again: the daemon finished child-1 without telling us.
|
||||
daemon.lists[PARENT_ID] = [child("child-1", PARENT_ID, "completed")];
|
||||
await resyncProviderSubagents(daemon.client, SERVER_ID);
|
||||
|
||||
expect(status(PARENT_ID, "child-1")).toBe("completed");
|
||||
});
|
||||
|
||||
test("lists again only the parents this server was showing", async () => {
|
||||
const daemon = fakeDaemon({});
|
||||
await refreshProviderSubagents(daemon.client, SERVER_ID, PARENT_ID);
|
||||
await refreshProviderSubagents(daemon.client, "server-2", "other-parent");
|
||||
daemon.requested.length = 0;
|
||||
|
||||
await resyncProviderSubagents(daemon.client, SERVER_ID);
|
||||
|
||||
expect(daemon.requested).toEqual([PARENT_ID]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -28,9 +28,6 @@ interface ProviderSubagentState {
|
||||
descriptors: Map<string, ProviderSubagentDescriptorPayload>;
|
||||
timelines: Map<string, ProviderSubagentTimelineState>;
|
||||
hiddenFromTrack: Set<string>;
|
||||
/** Parents whose list this client asked for, so a resubscribed update feed can catch them up. */
|
||||
trackedParents: Set<string>;
|
||||
trackParent(serverId: string, parentAgentId: string): void;
|
||||
hideFromTrack(serverId: string, parentAgentId: string, subagentIds: readonly string[]): void;
|
||||
replaceList(
|
||||
serverId: string,
|
||||
@@ -87,7 +84,6 @@ export function refreshProviderSubagents(
|
||||
const pending = clientRequests.get(requestKey);
|
||||
if (pending) return pending;
|
||||
|
||||
useProviderSubagentStore.getState().trackParent(serverId, parentAgentId);
|
||||
const request = client
|
||||
.listProviderSubagents(parentAgentId)
|
||||
.then((payload) => {
|
||||
@@ -105,27 +101,6 @@ function parentPrefix(serverId: string, parentAgentId: string): string {
|
||||
return `${serverId}\0${parentAgentId}\0`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates are not replayed across a reconnect, so a child that finished or started while the
|
||||
* update feed was down stays stale until its parent is listed again. Call this once the feed has
|
||||
* resubscribed, so every update after the list is delivered.
|
||||
*/
|
||||
export async function resyncProviderSubagents(
|
||||
client: ProviderSubagentListClient,
|
||||
serverId: string,
|
||||
): Promise<void> {
|
||||
const serverPrefix = `${serverId}\0`;
|
||||
const parentAgentIds = [...useProviderSubagentStore.getState().trackedParents]
|
||||
.filter((key) => key.startsWith(serverPrefix))
|
||||
.map((key) => key.slice(serverPrefix.length, -1));
|
||||
await Promise.all(
|
||||
parentAgentIds.map((parentAgentId) =>
|
||||
// A parent that was archived meanwhile has nothing left to catch up.
|
||||
refreshProviderSubagents(client, serverId, parentAgentId).catch(() => undefined),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
const EMPTY_TIMELINE: ProviderSubagentTimelineState = {
|
||||
tail: [],
|
||||
head: [],
|
||||
@@ -172,14 +147,6 @@ export const useProviderSubagentStore = create<ProviderSubagentState>((set) => (
|
||||
descriptors: new Map(),
|
||||
timelines: new Map(),
|
||||
hiddenFromTrack: new Set(),
|
||||
trackedParents: new Set(),
|
||||
trackParent(serverId, parentAgentId) {
|
||||
set((state) => {
|
||||
const prefix = parentPrefix(serverId, parentAgentId);
|
||||
if (state.trackedParents.has(prefix)) return state;
|
||||
return { trackedParents: new Set(state.trackedParents).add(prefix) };
|
||||
});
|
||||
},
|
||||
hideFromTrack(serverId, parentAgentId, subagentIds) {
|
||||
set((state) => {
|
||||
const hiddenFromTrack = new Set(state.hiddenFromTrack);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/cli",
|
||||
"version": "0.11.4",
|
||||
"version": "0.11.0-beta.5",
|
||||
"description": "Paseo CLI - control your AI coding agents from the command line",
|
||||
"bin": {
|
||||
"paseo": "bin/paseo"
|
||||
@@ -28,9 +28,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@clack/prompts": "^1.0.0",
|
||||
"@getpaseo/client": "0.11.4",
|
||||
"@getpaseo/protocol": "0.11.4",
|
||||
"@getpaseo/server": "0.11.4",
|
||||
"@getpaseo/client": "0.11.0-beta.5",
|
||||
"@getpaseo/protocol": "0.11.0-beta.5",
|
||||
"@getpaseo/server": "0.11.0-beta.5",
|
||||
"chalk": "^5.3.0",
|
||||
"commander": "^12.0.0",
|
||||
"mime-types": "^2.1.35",
|
||||
|
||||
@@ -122,15 +122,10 @@ const EXPECTED_CLAUDE_MODELS = [
|
||||
model: "Opus 4.6",
|
||||
descriptionFragment: "Most capable",
|
||||
},
|
||||
{
|
||||
id: "claude-haiku-5-5",
|
||||
model: "Haiku 5.5",
|
||||
descriptionFragment: "Fastest",
|
||||
},
|
||||
{
|
||||
id: "claude-haiku-4-5",
|
||||
model: "Haiku 4.5",
|
||||
descriptionFragment: "Previous release",
|
||||
descriptionFragment: "Fastest",
|
||||
},
|
||||
] as const;
|
||||
|
||||
@@ -440,8 +435,8 @@ try {
|
||||
"--quiet should print the same ordered model IDs returned by --json",
|
||||
);
|
||||
assert(
|
||||
claudeModelsFromJson.some((m) => m.id === "claude-haiku-5-5"),
|
||||
"captured --json output should include the current Claude quick-answer model id",
|
||||
claudeModelsFromJson.some((m) => m.id === "claude-sonnet-5-5"),
|
||||
"captured --json output should include the current Claude everyday model id",
|
||||
);
|
||||
console.log("✓ provider models --quiet outputs model IDs only\n");
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/client",
|
||||
"version": "0.11.4",
|
||||
"version": "0.11.0-beta.5",
|
||||
"description": "Paseo client SDK package",
|
||||
"files": [
|
||||
"dist",
|
||||
@@ -39,8 +39,8 @@
|
||||
"test": "vitest run"
|
||||
},
|
||||
"dependencies": {
|
||||
"@getpaseo/protocol": "0.11.4",
|
||||
"@getpaseo/relay": "0.11.4",
|
||||
"@getpaseo/protocol": "0.11.0-beta.5",
|
||||
"@getpaseo/relay": "0.11.0-beta.5",
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/desktop",
|
||||
"version": "0.11.4",
|
||||
"version": "0.11.0-beta.5",
|
||||
"private": true,
|
||||
"description": "Paseo desktop app (Electron wrapper)",
|
||||
"homepage": "https://paseo.sh",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/expo-two-way-audio",
|
||||
"version": "0.11.4",
|
||||
"version": "0.11.0-beta.5",
|
||||
"description": "Native module for two way audio streaming",
|
||||
"keywords": [
|
||||
"ExpoTwoWayAudio",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/highlight",
|
||||
"version": "0.11.4",
|
||||
"version": "0.11.0-beta.5",
|
||||
"files": [
|
||||
"dist",
|
||||
"!dist/**/*.map",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/plugin",
|
||||
"version": "0.11.4",
|
||||
"version": "0.11.0-beta.5",
|
||||
"description": "Paseo plugin SDK package",
|
||||
"files": [
|
||||
"dist",
|
||||
@@ -70,8 +70,8 @@
|
||||
"use-sync-external-store": "^1.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@getpaseo/client": "0.11.4",
|
||||
"@getpaseo/protocol": "0.11.4",
|
||||
"@getpaseo/client": "0.11.0-beta.5",
|
||||
"@getpaseo/protocol": "0.11.0-beta.5",
|
||||
"@types/node": "^20.9.0",
|
||||
"@types/react": "~19.2.0",
|
||||
"react": "19.1.0",
|
||||
@@ -81,8 +81,8 @@
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@getpaseo/client": "0.11.4",
|
||||
"@getpaseo/protocol": "0.11.4",
|
||||
"@getpaseo/client": "0.11.0-beta.5",
|
||||
"@getpaseo/protocol": "0.11.0-beta.5",
|
||||
"react": "~19.1.0",
|
||||
"react-native": ">=0.81.5",
|
||||
"zod": "^4.4.3"
|
||||
|
||||
@@ -359,8 +359,6 @@ class AcpRuntime {
|
||||
private emit: (event: ProviderEvent) => void;
|
||||
private readonly messages = new Map<string, string>();
|
||||
private readonly toolCalls = new Map<string, AcpToolCallSnapshot>();
|
||||
// Running tool rows published by transformers; the turn's terminal closes any left open.
|
||||
private readonly vendorToolCalls = new Map<string, ToolCallTimelineItem>();
|
||||
private readonly pendingCompactions = new Set<string>();
|
||||
private readonly permissions = new Map<
|
||||
string,
|
||||
@@ -547,13 +545,8 @@ class AcpRuntime {
|
||||
return sessionCapabilities;
|
||||
}
|
||||
|
||||
async discover(cwd?: string): Promise<ProviderCatalog> {
|
||||
if (cwd === undefined && this.options.options.acpOptions?.workspaceOnlyCatalog) {
|
||||
return { models: [], modes: [] };
|
||||
}
|
||||
const response = await this.call(
|
||||
this.connection.newSession({ cwd: cwd ?? process.cwd(), mcpServers: [] }),
|
||||
);
|
||||
async discover(cwd = process.cwd()): Promise<ProviderCatalog> {
|
||||
const response = await this.call(this.connection.newSession({ cwd, mcpServers: [] }));
|
||||
this.nativeSessionId = response.sessionId;
|
||||
this.modes = response.modes;
|
||||
this.configOptions = response.configOptions ?? [];
|
||||
@@ -602,13 +595,10 @@ class AcpRuntime {
|
||||
turnId,
|
||||
state: "started",
|
||||
});
|
||||
// The SDK dispatches notifications without awaiting them, so the prompt response can resolve
|
||||
// while earlier session updates are still queued. Apply them before the turn ends.
|
||||
const settled = this.call(
|
||||
this.connection.prompt({ sessionId: this.nativeSessionId, prompt }),
|
||||
).then(
|
||||
async (response): Promise<void> => {
|
||||
await this.drainNotifications();
|
||||
(response): void => {
|
||||
const state = response.stopReason === "cancelled" ? "canceled" : "completed";
|
||||
this.fallbackChunkIds.clear();
|
||||
this.terminalizeTransientItems(state);
|
||||
@@ -620,8 +610,7 @@ class AcpRuntime {
|
||||
});
|
||||
return undefined;
|
||||
},
|
||||
async (error): Promise<void> => {
|
||||
await this.drainNotifications();
|
||||
(error): void => {
|
||||
this.fallbackChunkIds.clear();
|
||||
this.terminalizeTransientItems("failed");
|
||||
this.emit({
|
||||
@@ -1038,17 +1027,9 @@ class AcpRuntime {
|
||||
this.emit({
|
||||
type: "timeline.item",
|
||||
sessionId: this.options.boundarySessionId,
|
||||
item: terminalToolItem(toolTimelineItem(snapshot), state),
|
||||
item: toolTimelineItem(completed),
|
||||
});
|
||||
}
|
||||
for (const item of this.vendorToolCalls.values()) {
|
||||
this.emit({
|
||||
type: "timeline.item",
|
||||
sessionId: this.options.boundarySessionId,
|
||||
item: terminalToolItem(item, state),
|
||||
});
|
||||
}
|
||||
this.vendorToolCalls.clear();
|
||||
for (const id of this.pendingCompactions) {
|
||||
this.emit({
|
||||
type: "timeline.item",
|
||||
@@ -1095,10 +1076,6 @@ class AcpRuntime {
|
||||
if (this.configTransaction) this.stagedTransformerConfig = update.config;
|
||||
else this.emitConfigSnapshot(update.config);
|
||||
} else if (update.type === "timeline") {
|
||||
if (update.item.type === "tool_call") {
|
||||
if (update.item.status === "running") this.vendorToolCalls.set(update.item.id, update.item);
|
||||
else this.vendorToolCalls.delete(update.item.id);
|
||||
}
|
||||
this.emit({
|
||||
type: "timeline.item",
|
||||
sessionId: this.options.boundarySessionId,
|
||||
@@ -1406,9 +1383,7 @@ function configValues(
|
||||
return Object.fromEntries(options.map((option) => [option.id, option.currentValue]));
|
||||
}
|
||||
|
||||
type ToolCallTimelineItem = Extract<ProviderTimelineItem, { type: "tool_call" }>;
|
||||
|
||||
function toolTimelineItem(snapshot: AcpToolCallSnapshot): ToolCallTimelineItem {
|
||||
function toolTimelineItem(snapshot: AcpToolCallSnapshot): ProviderTimelineItem {
|
||||
const input = jsonRecord(snapshot.input);
|
||||
const isEdit = snapshot.kind === "edit" || snapshot.name?.toLowerCase().includes("edit") === true;
|
||||
const detail = isEdit
|
||||
@@ -1436,18 +1411,6 @@ function toolTimelineItem(snapshot: AcpToolCallSnapshot): ToolCallTimelineItem {
|
||||
return { ...base, status, error: null };
|
||||
}
|
||||
|
||||
// A row the turn left open ends with the turn. The wire contract requires a non-null error on a
|
||||
// failed tool call, so a canceled turn cancels its rows instead of failing them.
|
||||
function terminalToolItem(
|
||||
item: ToolCallTimelineItem,
|
||||
state: "completed" | "failed" | "canceled",
|
||||
): ToolCallTimelineItem {
|
||||
if (state === "failed") {
|
||||
return { ...item, status: "failed", error: item.error ?? { message: "Turn failed" } };
|
||||
}
|
||||
return { ...item, status: state, error: null };
|
||||
}
|
||||
|
||||
function jsonValue(value: unknown) {
|
||||
return z.json().parse(value);
|
||||
}
|
||||
|
||||
@@ -272,39 +272,6 @@ lines.on("line", (line) => {
|
||||
}
|
||||
});
|
||||
|
||||
it("still reports initialization failures for workspace-only global discovery", async () => {
|
||||
let unavailable = false;
|
||||
const { connector } = connectorHarness({
|
||||
handleRequest(instance, request) {
|
||||
if (unavailable && request.method === "initialize") {
|
||||
instance.reject(request, "Bridge unavailable");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
});
|
||||
const registration = runAcpProvider({
|
||||
id: "workspace-acp",
|
||||
label: "Workspace ACP",
|
||||
connector,
|
||||
acpOptions: { workspaceOnlyCatalog: true },
|
||||
});
|
||||
const connection = await registration.connect({ versions: [1], capabilities: [] });
|
||||
const events: ProviderEvent[] = [];
|
||||
connection.onEvent((event) => events.push(event));
|
||||
try {
|
||||
unavailable = true;
|
||||
await connection.send({ type: "catalog", requestId: "global" });
|
||||
expect(await waitForEvent(events, (event) => event.type === "request.failed")).toMatchObject({
|
||||
requestId: "global",
|
||||
error: { message: expect.stringContaining("Bridge unavailable") },
|
||||
});
|
||||
expect(events.some((event) => event.type === "catalog")).toBe(false);
|
||||
} finally {
|
||||
await connection.close();
|
||||
}
|
||||
});
|
||||
|
||||
it("rejects connection cleanly when the ACP executable does not exist", async () => {
|
||||
const registration = runAcpProvider({
|
||||
id: "missing-acp",
|
||||
@@ -652,146 +619,6 @@ lines.on("line", (line) => {
|
||||
await connection.close();
|
||||
});
|
||||
|
||||
it.each([
|
||||
["end_turn", "completed", "completed"],
|
||||
["cancelled", "canceled", "canceled"],
|
||||
] as const)(
|
||||
"closes a transformer's running tool row when the turn ends with %s",
|
||||
async (stopReason, turnState, rowStatus) => {
|
||||
const harness = connectorHarness({
|
||||
handleMessage(instance, message) {
|
||||
if (!("method" in message) || !("id" in message)) return false;
|
||||
if (message.method !== "session/prompt") return false;
|
||||
instance.notify("vendor/phase", { id: "phase-1", label: "Preparing" });
|
||||
instance.respond(message as AcpRequestMessage, { stopReason });
|
||||
return true;
|
||||
},
|
||||
});
|
||||
const registration = runAcpProvider({
|
||||
id: "vendor-row-acp",
|
||||
label: "Vendor row ACP",
|
||||
connector: harness.connector,
|
||||
transformers: [
|
||||
{
|
||||
notification(notification) {
|
||||
if (notification.method !== "vendor/phase") return null;
|
||||
return {
|
||||
type: "timeline",
|
||||
item: {
|
||||
type: "tool_call",
|
||||
id: "phase-1",
|
||||
callId: "phase-1",
|
||||
name: "Vendor phase",
|
||||
detail: { type: "plain_text", label: "Preparing" },
|
||||
status: "running",
|
||||
error: null,
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
const connection = await registration.connect({
|
||||
versions: [1],
|
||||
capabilities: ["prompt.message"],
|
||||
});
|
||||
const events: ProviderEvent[] = [];
|
||||
connection.onEvent((event) => events.push(event));
|
||||
await connection.send(openInput());
|
||||
await waitForEvent(events, (event) => event.type === "session.ready");
|
||||
|
||||
await connection.send({
|
||||
type: "session.prompt",
|
||||
sessionId: "session-1",
|
||||
prompt: {
|
||||
clientMessageId: "first",
|
||||
delivery: "auto",
|
||||
input: { type: "message", content: [{ type: "text", text: "first" }] },
|
||||
},
|
||||
});
|
||||
await waitForEvent(
|
||||
events,
|
||||
(event) => event.type === "session.turn" && event.state === turnState,
|
||||
);
|
||||
|
||||
const rows = events.flatMap((event) =>
|
||||
event.type === "timeline.item" && event.item.id === "phase-1" ? [event.item] : [],
|
||||
);
|
||||
expect(rows.map((row) => row.type === "tool_call" && row.status)).toEqual([
|
||||
"running",
|
||||
rowStatus,
|
||||
]);
|
||||
const closed = events.findIndex(
|
||||
(event) =>
|
||||
event.type === "timeline.item" &&
|
||||
event.item.id === "phase-1" &&
|
||||
event.item.type === "tool_call" &&
|
||||
event.item.status === rowStatus,
|
||||
);
|
||||
const terminal = events.findIndex(
|
||||
(event) => event.type === "session.turn" && event.state === turnState,
|
||||
);
|
||||
expect(closed).toBeLessThan(terminal);
|
||||
// The wire contract only accepts a failed tool call with a non-null error.
|
||||
expect(rows.at(-1)).toMatchObject({ error: null });
|
||||
await connection.close();
|
||||
},
|
||||
);
|
||||
|
||||
it("cancels an in-progress ACP tool call with the canceled turn instead of failing it without an error", async () => {
|
||||
const harness = connectorHarness({
|
||||
handleMessage(instance, message) {
|
||||
if (!("method" in message) || !("id" in message)) return false;
|
||||
if (message.method !== "session/prompt") return false;
|
||||
instance.notify("session/update", {
|
||||
sessionId: "connector-session",
|
||||
update: {
|
||||
sessionUpdate: "tool_call",
|
||||
toolCallId: "tool-1",
|
||||
title: "Run tests",
|
||||
kind: "execute",
|
||||
status: "in_progress",
|
||||
},
|
||||
});
|
||||
instance.respond(message as AcpRequestMessage, { stopReason: "cancelled" });
|
||||
return true;
|
||||
},
|
||||
});
|
||||
const registration = runAcpProvider({
|
||||
id: "cancel-tool-acp",
|
||||
label: "Cancel tool ACP",
|
||||
connector: harness.connector,
|
||||
});
|
||||
const connection = await registration.connect({
|
||||
versions: [1],
|
||||
capabilities: ["prompt.message"],
|
||||
});
|
||||
const events: ProviderEvent[] = [];
|
||||
connection.onEvent((event) => events.push(event));
|
||||
await connection.send(openInput());
|
||||
await waitForEvent(events, (event) => event.type === "session.ready");
|
||||
|
||||
await connection.send({
|
||||
type: "session.prompt",
|
||||
sessionId: "session-1",
|
||||
prompt: {
|
||||
clientMessageId: "first",
|
||||
delivery: "auto",
|
||||
input: { type: "message", content: [{ type: "text", text: "first" }] },
|
||||
},
|
||||
});
|
||||
await waitForEvent(
|
||||
events,
|
||||
(event) => event.type === "session.turn" && event.state === "canceled",
|
||||
);
|
||||
|
||||
const rows = events.flatMap((event) =>
|
||||
event.type === "timeline.item" && event.item.id === "tool-1" ? [event.item] : [],
|
||||
);
|
||||
expect(rows.at(-1)).toMatchObject({ type: "tool_call", status: "canceled", error: null });
|
||||
await connection.close();
|
||||
});
|
||||
|
||||
it("serializes configuration mutations", async () => {
|
||||
let releaseMutation: (() => void) | null = null;
|
||||
const configOptions = [
|
||||
|
||||
@@ -44,8 +44,6 @@ export type AcpConnector = () => AcpStream | Promise<AcpStream>;
|
||||
export interface AcpOptions {
|
||||
protocol?: "auto" | "v1";
|
||||
startupTimeoutMs?: number;
|
||||
/** Global discovery initializes ACP but returns an empty catalog without opening a session. */
|
||||
workspaceOnlyCatalog?: boolean;
|
||||
waitForInitialCommands?: boolean;
|
||||
initialCommandsTimeoutMs?: number;
|
||||
}
|
||||
|
||||
@@ -26,8 +26,6 @@ export const PROVIDER_CAPABILITIES = [
|
||||
export type ProviderCapability = (typeof PROVIDER_CAPABILITIES)[number];
|
||||
|
||||
export interface ProviderRegistration {
|
||||
/** Activate only while agents.providers contains this provider ID, independently of enabled. */
|
||||
requiresConfiguration?: boolean;
|
||||
/** Equal keys share discovery within this provider. Include effective configuration and execution environment. */
|
||||
getCatalogCacheKey?(options: ProviderCatalogOptions): Promise<string | undefined>;
|
||||
/** Default executable and arguments; the daemon resolves overrides before status/connect. */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/protocol",
|
||||
"version": "0.11.4",
|
||||
"version": "0.11.0-beta.5",
|
||||
"description": "Paseo shared protocol schemas and wire types",
|
||||
"files": [
|
||||
"dist",
|
||||
|
||||
@@ -812,14 +812,3 @@ describe("checkout PR schemas", () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test.each([undefined, false, true])(
|
||||
"accepts optional Hoplite capability (%s)",
|
||||
(hopliteProvider) => {
|
||||
const features = hopliteProvider === undefined ? {} : { hopliteProvider };
|
||||
expect(
|
||||
ServerInfoStatusPayloadSchema.parse({ status: "server_info", serverId: "test", features })
|
||||
.features,
|
||||
).toEqual(features);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -3680,8 +3680,6 @@ export const ServerInfoStatusPayloadSchema = z
|
||||
commitBaseClassification: z.boolean().optional(),
|
||||
// COMPAT(providerRemoval): added in v0.1.105, drop the gate when floor >= v0.1.105.
|
||||
providerRemoval: z.boolean().optional(),
|
||||
// COMPAT(hopliteProvider): added after v0.11.2, remove after 2027-04-15 once host floor includes the bundled adapter.
|
||||
hopliteProvider: z.boolean().optional(),
|
||||
// COMPAT(importSessionWorkspaceTarget): added in v0.1.110, remove gate after 2027-01-16.
|
||||
importSessionWorkspaceTarget: z.boolean().optional(),
|
||||
// COMPAT(importSessionSearch): added in v0.8.0, remove gate after 2027-03-02.
|
||||
|
||||
@@ -31,7 +31,6 @@ export const ACP_PROVIDER_ICON_NAMES = [
|
||||
"glm-acp-agent",
|
||||
"goose",
|
||||
"grok",
|
||||
"hoplite",
|
||||
"junie",
|
||||
"kilo",
|
||||
"kimi",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/relay",
|
||||
"version": "0.11.4",
|
||||
"version": "0.11.0-beta.5",
|
||||
"description": "Paseo relay for bridging daemon and client connections",
|
||||
"files": [
|
||||
"dist",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/server",
|
||||
"version": "0.11.4",
|
||||
"version": "0.11.0-beta.5",
|
||||
"description": "Paseo backend server",
|
||||
"files": [
|
||||
"dist/server",
|
||||
@@ -107,11 +107,11 @@
|
||||
"@agentclientprotocol/sdk": "^0.17.1",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.246",
|
||||
"@anthropic-ai/sdk": "^0.104.2",
|
||||
"@getpaseo/client": "0.11.4",
|
||||
"@getpaseo/highlight": "0.11.4",
|
||||
"@getpaseo/plugin": "0.11.4",
|
||||
"@getpaseo/protocol": "0.11.4",
|
||||
"@getpaseo/relay": "0.11.4",
|
||||
"@getpaseo/client": "0.11.0-beta.5",
|
||||
"@getpaseo/highlight": "0.11.0-beta.5",
|
||||
"@getpaseo/plugin": "0.11.0-beta.5",
|
||||
"@getpaseo/protocol": "0.11.0-beta.5",
|
||||
"@getpaseo/relay": "0.11.0-beta.5",
|
||||
"@isaacs/ttlcache": "^2.1.4",
|
||||
"@modelcontextprotocol/sdk": "1.29.0",
|
||||
"@opencode-ai/sdk": "1.14.46",
|
||||
|
||||
@@ -1121,50 +1121,3 @@ describe("plugin provider launch and status", () => {
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
test("config-required plugin membership is independent of enablement and other providers", async () => {
|
||||
const logger = createTestLogger();
|
||||
const plugins = new PluginAgentClientRegistry(logger);
|
||||
const harness = createProviderHarness();
|
||||
let connections = 0;
|
||||
let probes = 0;
|
||||
plugins.replace([
|
||||
{
|
||||
...harness.registration,
|
||||
requiresConfiguration: true,
|
||||
async status() {
|
||||
probes++;
|
||||
return { available: true };
|
||||
},
|
||||
async connect(request) {
|
||||
connections++;
|
||||
return harness.registration.connect(request);
|
||||
},
|
||||
},
|
||||
]);
|
||||
const build = (providerOverrides = {}) =>
|
||||
buildProviderRegistry(logger, {
|
||||
pluginProviders: plugins.definitions(),
|
||||
providerOverrides,
|
||||
});
|
||||
try {
|
||||
const before = build();
|
||||
expect(before["plugin-direct"]).toBeUndefined();
|
||||
expect({ probes, connections }).toEqual({ probes: 0, connections: 0 });
|
||||
const added = build({ "plugin-direct": {} });
|
||||
expect(added["plugin-direct"].enabled).toBe(true);
|
||||
const client = added["plugin-direct"].createClient(logger);
|
||||
expect(await client.isAvailable()).toBe(true);
|
||||
const catalog = await client.fetchCatalog({ scope: "global" });
|
||||
expect(catalog.models.map((model) => model.id)).toEqual(["plugin-model"]);
|
||||
expect({ probes, connections }).toEqual({ probes: 1, connections: 1 });
|
||||
const disabled = build({ "plugin-direct": { enabled: false } });
|
||||
expect(disabled["plugin-direct"].enabled).toBe(false);
|
||||
expect(Object.keys(build())).toEqual(Object.keys(before));
|
||||
for (const id of Object.keys(before)) {
|
||||
expect(added[id].enabled).toBe(before[id].enabled);
|
||||
}
|
||||
} finally {
|
||||
await plugins.shutdown();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -885,7 +885,6 @@ function createPluginProviderDefinition(
|
||||
label: registration.label,
|
||||
description: registration.description ?? `Plugin provider ${registration.label}`,
|
||||
iconSvg: registration.icon,
|
||||
requiresConfiguration: registration.requiresConfiguration,
|
||||
defaultModeId: null,
|
||||
modes: [],
|
||||
supportsExactMcpPreapproval: true,
|
||||
|
||||
@@ -97,7 +97,6 @@ export interface ProviderDefinition extends AgentProviderDefinition {
|
||||
|
||||
/** Provider metadata and an unconfigured factory; the registry owns override application. */
|
||||
export interface RegisteredProviderDefinition extends AgentProviderDefinition {
|
||||
requiresConfiguration?: boolean;
|
||||
iconSvg?: string;
|
||||
supportsExactMcpPreapproval: boolean;
|
||||
createClient: (logger: Logger, runtimeSettings?: ProviderRuntimeSettings) => AgentClient;
|
||||
@@ -926,8 +925,6 @@ export function buildProviderRegistry(
|
||||
throw new Error(`Plugin provider '${provider}' conflicts with a built-in provider`);
|
||||
}
|
||||
const override = providerOverrides[provider];
|
||||
if (definition.requiresConfiguration && !override) continue;
|
||||
|
||||
if (override?.extends) {
|
||||
logger.warn({ provider }, "Plugin provider shadowed by configured provider");
|
||||
continue;
|
||||
|
||||
@@ -348,10 +348,6 @@ export class ProviderSnapshotManager {
|
||||
return Object.prototype.hasOwnProperty.call(this.generation.definitions, provider);
|
||||
}
|
||||
|
||||
supportsConfigRequiredProvider(provider: AgentProvider): boolean {
|
||||
return this.pluginProviders.definitions()[provider]?.requiresConfiguration === true;
|
||||
}
|
||||
|
||||
getProviderLabel(provider: AgentProvider): string {
|
||||
return this.generation.definitions[provider]?.label ?? provider;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { chmodSync, mkdirSync, mkdtempSync, rmSync } from "node:fs";
|
||||
import { mkdirSync, mkdtempSync, rmSync } from "node:fs";
|
||||
import * as os from "node:os";
|
||||
import * as path from "node:path";
|
||||
import pino from "pino";
|
||||
@@ -90,29 +90,4 @@ describe("ClaudeAgentSession persisted history load", () => {
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
// chmod does not remove read access on Windows, or for root.
|
||||
test.skipIf(process.platform === "win32" || process.getuid?.() === 0)(
|
||||
"logs a warning with the error when Claude's project folders cannot be listed",
|
||||
async () => {
|
||||
// The transcript is not under cwd's folder, so the lookup lists the other project folders.
|
||||
mkdirSync(path.join(configDir, "projects"), { recursive: true });
|
||||
chmodSync(path.join(configDir, "projects"), 0o000);
|
||||
|
||||
try {
|
||||
await resume();
|
||||
} finally {
|
||||
chmodSync(path.join(configDir, "projects"), 0o755);
|
||||
}
|
||||
|
||||
expect(records).toContainEqual(
|
||||
expect.objectContaining({
|
||||
level: pino.levels.values.warn,
|
||||
msg: "Failed to load Claude history from transcript",
|
||||
sessionId: SESSION_ID,
|
||||
err: expect.objectContaining({ message: expect.stringContaining("EACCES") }),
|
||||
}),
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
+454
@@ -1,3 +1,10 @@
|
||||
import type {
|
||||
NonNullableUsage,
|
||||
Options,
|
||||
Query,
|
||||
SDKMessage,
|
||||
SDKUserMessage,
|
||||
} from "@anthropic-ai/claude-agent-sdk";
|
||||
import { afterEach, expect, test, vi } from "vitest";
|
||||
|
||||
import { createTestLogger } from "../../../../test-utils/test-logger.js";
|
||||
@@ -276,6 +283,453 @@ afterEach(() => {
|
||||
queryFactory.mockReset();
|
||||
});
|
||||
|
||||
function deferred() {
|
||||
let resolve!: () => void;
|
||||
const promise = new Promise<void>((done) => {
|
||||
resolve = done;
|
||||
});
|
||||
return { promise, resolve };
|
||||
}
|
||||
|
||||
function unsupportedQueryOperation(): never {
|
||||
throw new Error("Unexpected query operation in runtime lifecycle test");
|
||||
}
|
||||
|
||||
interface RuntimeQueryHooks {
|
||||
initialize?: (flags: Parameters<Query["applyFlagSettings"]>[0]) => Promise<void>;
|
||||
retire?: () => Promise<void>;
|
||||
beforeReply?: () => Promise<void>;
|
||||
}
|
||||
|
||||
function createRuntimeQuery(prompt: AsyncIterable<SDKUserMessage>, hooks: RuntimeQueryHooks = {}) {
|
||||
const usage: NonNullableUsage = {
|
||||
input_tokens: 1,
|
||||
output_tokens: 1,
|
||||
cache_creation_input_tokens: 0,
|
||||
cache_read_input_tokens: 0,
|
||||
cache_creation: { ephemeral_1h_input_tokens: 0, ephemeral_5m_input_tokens: 0 },
|
||||
server_tool_use: { web_fetch_requests: 0, web_search_requests: 0 },
|
||||
service_tier: "standard",
|
||||
inference_geo: "",
|
||||
speed: "standard",
|
||||
iterations: [],
|
||||
output_tokens_details: { thinking_tokens: 0 },
|
||||
};
|
||||
const output = createAsyncQueue<SDKMessage>();
|
||||
const received: string[] = [];
|
||||
let closed = false;
|
||||
const stream = (async function* () {
|
||||
for (;;) {
|
||||
const next = await output.next();
|
||||
if (next.done) return;
|
||||
yield next.value;
|
||||
}
|
||||
})();
|
||||
const returnStream = stream.return.bind(stream);
|
||||
const query: Query = Object.assign(stream, {
|
||||
interrupt: async () => undefined,
|
||||
setPermissionMode: async () => undefined,
|
||||
setModel: async () => undefined,
|
||||
applyFlagSettings: async (flags: Parameters<Query["applyFlagSettings"]>[0]) => {
|
||||
await hooks.initialize?.(flags);
|
||||
},
|
||||
return: async () => {
|
||||
output.end();
|
||||
await hooks.retire?.();
|
||||
return returnStream();
|
||||
},
|
||||
supportedCommands: async () => [],
|
||||
supportedModels: async () => [],
|
||||
close: () => {
|
||||
closed = true;
|
||||
output.end();
|
||||
},
|
||||
setMcpPermissionModeOverride: unsupportedQueryOperation,
|
||||
setMaxThinkingTokens: unsupportedQueryOperation,
|
||||
initializationResult: unsupportedQueryOperation,
|
||||
reinitialize: unsupportedQueryOperation,
|
||||
supportedAgents: unsupportedQueryOperation,
|
||||
mcpServerStatus: unsupportedQueryOperation,
|
||||
getContextUsage: unsupportedQueryOperation,
|
||||
usage_EXPERIMENTAL_MAY_CHANGE_DO_NOT_RELY_ON_THIS_API_YET: unsupportedQueryOperation,
|
||||
readFile: unsupportedQueryOperation,
|
||||
reloadPlugins: unsupportedQueryOperation,
|
||||
reloadSkills: unsupportedQueryOperation,
|
||||
accountInfo: unsupportedQueryOperation,
|
||||
rewindFiles: unsupportedQueryOperation,
|
||||
seedReadState: unsupportedQueryOperation,
|
||||
reconnectMcpServer: unsupportedQueryOperation,
|
||||
toggleMcpServer: unsupportedQueryOperation,
|
||||
setMcpServers: unsupportedQueryOperation,
|
||||
streamInput: unsupportedQueryOperation,
|
||||
stopTask: unsupportedQueryOperation,
|
||||
backgroundTasks: unsupportedQueryOperation,
|
||||
});
|
||||
void (async () => {
|
||||
for await (const message of prompt) {
|
||||
const text = extractPromptText(message);
|
||||
received.push(text);
|
||||
await hooks.beforeReply?.();
|
||||
output.push({
|
||||
type: "assistant",
|
||||
uuid: crypto.randomUUID(),
|
||||
session_id: "runtime-lifecycle",
|
||||
parent_tool_use_id: null,
|
||||
message: {
|
||||
id: crypto.randomUUID(),
|
||||
type: "message",
|
||||
role: "assistant",
|
||||
model: "opus",
|
||||
content: [{ type: "text", text: `reply to ${text}`, citations: null }],
|
||||
stop_reason: "end_turn",
|
||||
stop_sequence: null,
|
||||
usage,
|
||||
container: null,
|
||||
context_management: null,
|
||||
diagnostics: null,
|
||||
stop_details: null,
|
||||
},
|
||||
});
|
||||
output.push({
|
||||
type: "result",
|
||||
subtype: "success",
|
||||
uuid: crypto.randomUUID(),
|
||||
session_id: "runtime-lifecycle",
|
||||
duration_ms: 1,
|
||||
duration_api_ms: 1,
|
||||
is_error: false,
|
||||
num_turns: 1,
|
||||
result: `reply to ${text}`,
|
||||
stop_reason: "end_turn",
|
||||
total_cost_usd: 0,
|
||||
usage,
|
||||
modelUsage: {},
|
||||
permission_denials: [],
|
||||
});
|
||||
}
|
||||
})();
|
||||
return { query, received, isClosed: () => closed };
|
||||
}
|
||||
|
||||
test("command discovery overlapping startup preserves replies to subsequent prompts", async () => {
|
||||
const lookup = deferred();
|
||||
let lookups = 0;
|
||||
const queries: ReturnType<typeof createRuntimeQuery>[] = [];
|
||||
const session = await new ClaudeAgentClient({
|
||||
logger: createTestLogger(),
|
||||
resolveBinary: async () => {
|
||||
if (++lookups === 1) await lookup.promise;
|
||||
return "/test/claude/bin";
|
||||
},
|
||||
queryFactory: ({ prompt }) => {
|
||||
if (typeof prompt === "string") throw new Error("Expected streaming input");
|
||||
const runtime = createRuntimeQuery(prompt);
|
||||
queries.push(runtime);
|
||||
return runtime.query;
|
||||
},
|
||||
}).createSession({ provider: "claude", cwd: process.cwd() });
|
||||
const events: AgentStreamEvent[] = [];
|
||||
session.subscribe((event) => events.push(event));
|
||||
try {
|
||||
const commands = session.listCommands!();
|
||||
const first = session.startTurn("first");
|
||||
// Finish all work not blocked by executable discovery before releasing it.
|
||||
await new Promise<void>((resolve) => setImmediate(resolve));
|
||||
lookup.resolve();
|
||||
await Promise.all([commands, first]);
|
||||
await new Promise<void>((resolve) => setImmediate(resolve));
|
||||
await session.startTurn("hello");
|
||||
await new Promise<void>((resolve) => setImmediate(resolve));
|
||||
expect(collectAssistantText(events)).toBe("reply to firstreply to hello");
|
||||
expect(events.filter((event) => event.type === "turn_completed")).toHaveLength(2);
|
||||
expect(queries).toHaveLength(1);
|
||||
expect(queries[0].received).toEqual(["first", "hello"]);
|
||||
} finally {
|
||||
lookup.resolve();
|
||||
for (const runtime of queries) runtime.query.close();
|
||||
await session.close();
|
||||
}
|
||||
});
|
||||
|
||||
test("closing during query initialization disposes the process before initialization settles", async () => {
|
||||
const initializing = deferred();
|
||||
const release = deferred();
|
||||
const queries: ReturnType<typeof createRuntimeQuery>[] = [];
|
||||
const session = await new ClaudeAgentClient({
|
||||
logger: createTestLogger(),
|
||||
resolveBinary: async () => "/test/claude/bin",
|
||||
queryFactory: ({ prompt }) => {
|
||||
if (typeof prompt === "string") throw new Error("Expected streaming input");
|
||||
const runtime = createRuntimeQuery(prompt, {
|
||||
initialize: async () => {
|
||||
initializing.resolve();
|
||||
await release.promise;
|
||||
},
|
||||
});
|
||||
queries.push(runtime);
|
||||
return runtime.query;
|
||||
},
|
||||
}).createSession({ provider: "claude", model: "claude-opus-5-5", cwd: process.cwd() });
|
||||
const discovery = session.listCommands!();
|
||||
const rejected = expect(discovery).rejects.toThrow("Claude session is closed");
|
||||
try {
|
||||
await initializing.promise;
|
||||
await session.close();
|
||||
expect(queries[0].isClosed()).toBe(true);
|
||||
} finally {
|
||||
release.resolve();
|
||||
await rejected;
|
||||
await session.close();
|
||||
}
|
||||
});
|
||||
|
||||
async function createRuntimeHarness(
|
||||
options: {
|
||||
resolveBinary?: () => Promise<string>;
|
||||
hooks?: RuntimeQueryHooks;
|
||||
} = {},
|
||||
) {
|
||||
const launches: Options[] = [];
|
||||
const queries: ReturnType<typeof createRuntimeQuery>[] = [];
|
||||
const session = await new ClaudeAgentClient({
|
||||
logger: createTestLogger(),
|
||||
resolveBinary: options.resolveBinary ?? (async () => "/test/claude/bin"),
|
||||
queryFactory: ({ prompt, options: launch }) => {
|
||||
if (typeof prompt === "string") throw new Error("Expected streaming input");
|
||||
launches.push(launch);
|
||||
const runtime = createRuntimeQuery(prompt, options.hooks);
|
||||
queries.push(runtime);
|
||||
return runtime.query;
|
||||
},
|
||||
}).createSession({
|
||||
provider: "claude",
|
||||
model: "claude-opus-5-5",
|
||||
thinkingOptionId: "low",
|
||||
cwd: process.cwd(),
|
||||
});
|
||||
return { session, queries, launches };
|
||||
}
|
||||
|
||||
test.each([true, false])(
|
||||
"Fast mode changed to %s during startup reaches the launched query",
|
||||
async (enabled) => {
|
||||
const lookup = deferred();
|
||||
const entered = deferred();
|
||||
const applied: unknown[] = [];
|
||||
const { session, queries } = await createRuntimeHarness({
|
||||
resolveBinary: async () => {
|
||||
entered.resolve();
|
||||
await lookup.promise;
|
||||
return "/test/claude/bin";
|
||||
},
|
||||
hooks: {
|
||||
initialize: async (flags) => {
|
||||
applied.push(flags.fastMode);
|
||||
},
|
||||
},
|
||||
});
|
||||
await session.setFeature!("fast_mode", !enabled);
|
||||
const discovery = session.listCommands!();
|
||||
try {
|
||||
await entered.promise;
|
||||
await session.setFeature!("fast_mode", enabled);
|
||||
lookup.resolve();
|
||||
await discovery;
|
||||
await session.listCommands!();
|
||||
expect(applied).toEqual([enabled]);
|
||||
expect(queries).toHaveLength(1);
|
||||
} finally {
|
||||
lookup.resolve();
|
||||
await discovery;
|
||||
await session.close();
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
test("command discovery leaves a thinking change pending until the active turn finishes", async () => {
|
||||
const reply = deferred();
|
||||
const { session, queries, launches } = await createRuntimeHarness({
|
||||
hooks: { beforeReply: () => reply.promise },
|
||||
});
|
||||
try {
|
||||
const turn = collectUntilTerminal(streamSession(session, "first"));
|
||||
await new Promise<void>((resolve) => setImmediate(resolve));
|
||||
await session.setThinkingOption!("high");
|
||||
await session.listCommands!();
|
||||
expect(queries).toHaveLength(1);
|
||||
reply.resolve();
|
||||
expect(collectAssistantText(await turn)).toBe("reply to first");
|
||||
const next = await collectUntilTerminal(streamSession(session, "hello"));
|
||||
expect(collectAssistantText(next)).toBe("reply to hello");
|
||||
expect(launches.map((launch) => launch.effort)).toEqual(["low", "high"]);
|
||||
} finally {
|
||||
reply.resolve();
|
||||
await session.close();
|
||||
}
|
||||
});
|
||||
|
||||
test("command discovery and a prompt share replacement until the old runtime retires", async () => {
|
||||
const retiring = deferred();
|
||||
const release = deferred();
|
||||
const { session, queries } = await createRuntimeHarness({
|
||||
hooks: {
|
||||
retire: async () => {
|
||||
retiring.resolve();
|
||||
await release.promise;
|
||||
},
|
||||
},
|
||||
});
|
||||
try {
|
||||
await collectUntilTerminal(streamSession(session, "first"));
|
||||
await session.setThinkingOption!("high");
|
||||
const commands = session.listCommands!();
|
||||
await retiring.promise;
|
||||
const next = collectUntilTerminal(streamSession(session, "second"));
|
||||
await new Promise<void>((resolve) => setImmediate(resolve));
|
||||
expect(queries).toHaveLength(1);
|
||||
release.resolve();
|
||||
await commands;
|
||||
expect(collectAssistantText(await next)).toBe("reply to second");
|
||||
expect(collectAssistantText(await collectUntilTerminal(streamSession(session, "third")))).toBe(
|
||||
"reply to third",
|
||||
);
|
||||
expect(queries).toHaveLength(2);
|
||||
expect(queries[0].isClosed()).toBe(true);
|
||||
expect(queries[1].received).toEqual(["second", "third"]);
|
||||
} finally {
|
||||
release.resolve();
|
||||
await session.close();
|
||||
}
|
||||
});
|
||||
|
||||
test("a thinking change during startup remains pending for the following turn", async () => {
|
||||
const lookup = deferred();
|
||||
const entered = deferred();
|
||||
const { session, launches } = await createRuntimeHarness({
|
||||
resolveBinary: async () => {
|
||||
entered.resolve();
|
||||
await lookup.promise;
|
||||
return "/test/claude/bin";
|
||||
},
|
||||
});
|
||||
try {
|
||||
await session.setThinkingOption!("medium");
|
||||
const first = collectUntilTerminal(streamSession(session, "first"));
|
||||
await entered.promise;
|
||||
await session.setThinkingOption!("high");
|
||||
lookup.resolve();
|
||||
expect(collectAssistantText(await first)).toBe("reply to first");
|
||||
expect(collectAssistantText(await collectUntilTerminal(streamSession(session, "second")))).toBe(
|
||||
"reply to second",
|
||||
);
|
||||
expect(launches.map((launch) => launch.effort)).toEqual(["medium", "high"]);
|
||||
} finally {
|
||||
lookup.resolve();
|
||||
await session.close();
|
||||
}
|
||||
});
|
||||
|
||||
test("closing during executable discovery never launches a late query", async () => {
|
||||
const lookup = deferred();
|
||||
const entered = deferred();
|
||||
const { session, queries } = await createRuntimeHarness({
|
||||
resolveBinary: async () => {
|
||||
entered.resolve();
|
||||
await lookup.promise;
|
||||
return "/test/claude/bin";
|
||||
},
|
||||
});
|
||||
const discovery = session.listCommands!();
|
||||
const rejected = expect(discovery).rejects.toThrow("Claude session is closed");
|
||||
await entered.promise;
|
||||
await session.close();
|
||||
lookup.resolve();
|
||||
await rejected;
|
||||
expect(queries).toHaveLength(0);
|
||||
await expect(session.listCommands!()).rejects.toThrow("Claude session is closed");
|
||||
});
|
||||
|
||||
test("a failed shared initialization releases the runtime for a subsequent prompt", async () => {
|
||||
let attempts = 0;
|
||||
const { session, queries } = await createRuntimeHarness({
|
||||
hooks: {
|
||||
initialize: async () => {
|
||||
if (++attempts === 1) throw new Error("initialization rejected");
|
||||
},
|
||||
},
|
||||
});
|
||||
try {
|
||||
const discovery = session.listCommands!();
|
||||
const rejected = expect(discovery).rejects.toThrow("initialization rejected");
|
||||
const failed = await collectUntilTerminal(streamSession(session, "first"));
|
||||
await rejected;
|
||||
expect(failed.at(-1)).toMatchObject({ type: "turn_failed", error: "initialization rejected" });
|
||||
expect(queries[0].isClosed()).toBe(true);
|
||||
expect(queries[0].received).toEqual([]);
|
||||
const recovered = await collectUntilTerminal(streamSession(session, "retry"));
|
||||
expect(collectAssistantText(recovered)).toBe("reply to retry");
|
||||
expect(queries).toHaveLength(2);
|
||||
} finally {
|
||||
await session.close();
|
||||
}
|
||||
});
|
||||
|
||||
test("a new turn waits for a naturally ended runtime to finish cleanup", async () => {
|
||||
const retiring = deferred();
|
||||
const release = deferred();
|
||||
const { session, queries } = await createRuntimeHarness({
|
||||
hooks: {
|
||||
retire: async () => {
|
||||
retiring.resolve();
|
||||
await release.promise;
|
||||
},
|
||||
},
|
||||
});
|
||||
try {
|
||||
await collectUntilTerminal(streamSession(session, "first"));
|
||||
queries[0].query.close();
|
||||
await retiring.promise;
|
||||
const next = collectUntilTerminal(streamSession(session, "second"));
|
||||
await new Promise<void>((resolve) => setImmediate(resolve));
|
||||
expect(queries).toHaveLength(1);
|
||||
release.resolve();
|
||||
expect(collectAssistantText(await next)).toBe("reply to second");
|
||||
expect(queries).toHaveLength(2);
|
||||
} finally {
|
||||
release.resolve();
|
||||
await session.close();
|
||||
}
|
||||
});
|
||||
|
||||
test("an interrupted startup failure does not finish its replacement turn twice", async () => {
|
||||
const entered = deferred();
|
||||
const release = deferred();
|
||||
const { session } = await createRuntimeHarness({
|
||||
hooks: {
|
||||
initialize: async () => {
|
||||
entered.resolve();
|
||||
await release.promise;
|
||||
throw new Error("initialization rejected");
|
||||
},
|
||||
},
|
||||
});
|
||||
const events: AgentStreamEvent[] = [];
|
||||
session.subscribe((event) => events.push(event));
|
||||
try {
|
||||
const first = session.startTurn("first");
|
||||
await entered.promise;
|
||||
await session.interrupt();
|
||||
const replacement = session.startTurn("second");
|
||||
release.resolve();
|
||||
await Promise.all([first, replacement]);
|
||||
expect(events.filter((event) => event.type === "turn_canceled")).toHaveLength(1);
|
||||
expect(events.filter((event) => event.type === "turn_failed")).toHaveLength(1);
|
||||
} finally {
|
||||
release.resolve();
|
||||
await session.close();
|
||||
}
|
||||
});
|
||||
|
||||
test("interrupt only calls query.interrupt and leaves the query open", async () => {
|
||||
const logger = createTestLogger();
|
||||
const queries: ScriptedQuery[] = [];
|
||||
|
||||
@@ -143,10 +143,6 @@ function getLatestCompletedBashCall(events: AgentStreamEvent[]): ToolCallTimelin
|
||||
.find((item) => item.status === "completed" && item.name.toLowerCase() === "bash");
|
||||
}
|
||||
|
||||
function getInternalQuery(session: AgentSession): unknown {
|
||||
return (session as AgentSession & { query?: unknown }).query ?? null;
|
||||
}
|
||||
|
||||
async function createSession(params?: {
|
||||
cwdPrefix?: string;
|
||||
modeId?: string;
|
||||
@@ -316,7 +312,7 @@ describe("ClaudeAgentSession integration", () => {
|
||||
}
|
||||
}, 60_000);
|
||||
|
||||
test("interrupts a running Bash turn and continues on the same query", async () => {
|
||||
test("interrupts a running Bash turn and continues the same conversation", async () => {
|
||||
const handle = await createSession({
|
||||
cwdPrefix: "claude-agent-interrupt-continue-",
|
||||
});
|
||||
@@ -340,9 +336,9 @@ describe("ClaudeAgentSession integration", () => {
|
||||
event.item.name.toLowerCase() === "bash",
|
||||
45_000,
|
||||
);
|
||||
const firstQuery = getInternalQuery(handle.session);
|
||||
const firstSessionId = (await handle.session.getRuntimeInfo()).sessionId;
|
||||
|
||||
expect(firstQuery).toBeTruthy();
|
||||
expect(firstSessionId).toEqual(expect.any(String));
|
||||
|
||||
await handle.session.interrupt();
|
||||
|
||||
@@ -360,9 +356,9 @@ describe("ClaudeAgentSession integration", () => {
|
||||
const followUpEvents = await collectUntilTerminal(
|
||||
streamSession(handle.session, "Respond with exactly: AFTER_INTERRUPT_OK"),
|
||||
);
|
||||
const secondQuery = getInternalQuery(handle.session);
|
||||
const secondSessionId = (await handle.session.getRuntimeInfo()).sessionId;
|
||||
|
||||
expect(secondQuery).toBe(firstQuery);
|
||||
expect(secondSessionId).toBe(firstSessionId);
|
||||
expect(compactText(getAssistantText(followUpEvents))).toContain("after_interrupt_ok");
|
||||
expect(followUpEvents.at(-1)).toMatchObject({
|
||||
type: "turn_completed",
|
||||
|
||||
@@ -478,31 +478,23 @@ test("logs redacted query summary and never leaks sentinel secrets", async () =>
|
||||
test("interruptActiveTurn only interrupts the active query without info logs", async () => {
|
||||
const spy = createSpyLogger();
|
||||
const session = await createSessionWithLogger(spy.logger);
|
||||
const internal: {
|
||||
query: {
|
||||
interrupt: () => Promise<void>;
|
||||
return?: () => Promise<void>;
|
||||
close?: () => void;
|
||||
} | null;
|
||||
input: { end: () => void } | null;
|
||||
queryRestartNeeded: boolean;
|
||||
mainTurnInFlight: boolean;
|
||||
interruptActiveTurn: () => Promise<void>;
|
||||
} = asInternals(session);
|
||||
const interrupt = vi.fn(async () => undefined);
|
||||
const queryReturn = vi.fn(async () => undefined);
|
||||
const end = vi.fn(() => undefined);
|
||||
internal.query = {
|
||||
interrupt,
|
||||
return: queryReturn,
|
||||
close: vi.fn(() => undefined),
|
||||
};
|
||||
internal.input = { end };
|
||||
internal.queryRestartNeeded = false;
|
||||
internal.mainTurnInFlight = true;
|
||||
let acknowledgeInit!: () => void;
|
||||
const initialized = new Promise<void>((resolve) => {
|
||||
acknowledgeInit = resolve;
|
||||
});
|
||||
const activeQuery = createBaseQueryMock(
|
||||
vi.fn(() => {
|
||||
acknowledgeInit();
|
||||
return new Promise<never>(() => {});
|
||||
}),
|
||||
);
|
||||
activeQuery.next.mockResolvedValueOnce({ done: false, value: claudeTurnInit() });
|
||||
sdkQueryFactory.mockImplementation(() => activeQuery);
|
||||
await session.startTurn("hello");
|
||||
await initialized;
|
||||
|
||||
try {
|
||||
await internal.interruptActiveTurn();
|
||||
await session.interrupt();
|
||||
|
||||
const interruptInfoMessages = extractStringLogArgs(spy.info.mock.calls).filter((message) =>
|
||||
message.includes("interruptActiveTurn"),
|
||||
@@ -513,12 +505,11 @@ test("interruptActiveTurn only interrupts the active query without info logs", a
|
||||
|
||||
expect(interruptInfoMessages).toEqual([]);
|
||||
expect(interruptDebugMessages).toEqual([]);
|
||||
expect(interrupt).toHaveBeenCalledTimes(1);
|
||||
expect(queryReturn).not.toHaveBeenCalled();
|
||||
expect(end).not.toHaveBeenCalled();
|
||||
expect(internal.query).not.toBeNull();
|
||||
expect(internal.input).not.toBeNull();
|
||||
expect(internal.queryRestartNeeded).toBe(false);
|
||||
expect(activeQuery.interrupt).toHaveBeenCalledTimes(1);
|
||||
expect(activeQuery.return).not.toHaveBeenCalled();
|
||||
expect(activeQuery.close).not.toHaveBeenCalled();
|
||||
await session.listCommands!();
|
||||
expect(sdkQueryFactory).toHaveBeenCalledTimes(1);
|
||||
} finally {
|
||||
await session.close();
|
||||
}
|
||||
|
||||
@@ -587,75 +587,4 @@ describe("ClaudeAgentSession sub-agent sidechain updates", () => {
|
||||
expect(latest.detail.log).toContain("[Read] file-6.md");
|
||||
expect(latest.detail.log).toContain("[Read] file-205.md");
|
||||
});
|
||||
|
||||
test("keeps a long main-thread tool call out of the subagents track", async () => {
|
||||
// Claude Code sends a heartbeat every 30 s while a tool runs, with the tool's own id as
|
||||
// parent_tool_use_id. Frames captured from Claude Code 2.1.291 for a 40 s MCP call.
|
||||
queryFactory.mockImplementation(() =>
|
||||
buildQueryMock([
|
||||
{
|
||||
type: "system",
|
||||
subtype: "init",
|
||||
session_id: "heartbeat-session",
|
||||
permissionMode: "bypassPermissions",
|
||||
model: "opus",
|
||||
},
|
||||
{
|
||||
type: "assistant",
|
||||
parent_tool_use_id: null,
|
||||
message: {
|
||||
id: "msg-heartbeat-1",
|
||||
role: "assistant",
|
||||
content: [
|
||||
{ type: "tool_use", id: "toolu_slow", name: "mcp__slow__slow_check", input: {} },
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "tool_progress",
|
||||
tool_use_id: "toolu_slow-heartbeat-0",
|
||||
tool_name: "mcp__slow__slow_check",
|
||||
parent_tool_use_id: "toolu_slow",
|
||||
elapsed_time_seconds: 30,
|
||||
heartbeat: true,
|
||||
},
|
||||
{
|
||||
type: "user",
|
||||
parent_tool_use_id: null,
|
||||
message: {
|
||||
role: "user",
|
||||
content: [
|
||||
{
|
||||
type: "tool_result",
|
||||
tool_use_id: "toolu_slow",
|
||||
content: [{ type: "text", text: "SLOW_CHECK_OK" }],
|
||||
is_error: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "result",
|
||||
subtype: "success",
|
||||
usage: { input_tokens: 1, cache_read_input_tokens: 0, output_tokens: 1 },
|
||||
total_cost_usd: 0,
|
||||
},
|
||||
]),
|
||||
);
|
||||
const session = await new ClaudeAgentClient({
|
||||
logger,
|
||||
queryFactory,
|
||||
resolveBinary: async () => "/test/claude/bin",
|
||||
}).createSession({ provider: "claude", cwd: process.cwd() });
|
||||
|
||||
const events = await collectUntilTerminal(streamSession(session, "run the slow check"));
|
||||
await session.close();
|
||||
|
||||
expect(events.filter((event) => event.type === "provider_subagent")).toEqual([]);
|
||||
const toolCallNames = events.flatMap((event) =>
|
||||
event.type === "timeline" && event.item.type === "tool_call" ? [event.item.name] : [],
|
||||
);
|
||||
expect(toolCallNames).toContain("mcp__slow__slow_check");
|
||||
expect(toolCallNames).not.toContain("Task");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -496,7 +496,7 @@ describe("ClaudeAgentClient.fetchCatalog", () => {
|
||||
const client = new ClaudeAgentClient({
|
||||
logger,
|
||||
resolveBinary: async () => "/test/claude/bin",
|
||||
resolveVersion: async () => "2.1.293",
|
||||
resolveVersion: async () => "2.1.284",
|
||||
runtimeSettings: { env: { CLAUDE_CONFIG_DIR: emptyConfigDir } },
|
||||
});
|
||||
const { models } = await client.fetchCatalog({
|
||||
@@ -515,15 +515,6 @@ describe("ClaudeAgentClient.fetchCatalog", () => {
|
||||
expect(getThinkingIds("claude-opus-4-8")).toContain("ultracode");
|
||||
expect(getThinkingIds("claude-sonnet-5")).toContain("xhigh");
|
||||
expect(getThinkingIds("claude-sonnet-5")).toContain("ultracode");
|
||||
expect(getThinkingIds("claude-haiku-5-5")).toEqual([
|
||||
"off",
|
||||
"low",
|
||||
"medium",
|
||||
"high",
|
||||
"xhigh",
|
||||
"max",
|
||||
"ultracode",
|
||||
]);
|
||||
expect(getThinkingIds("claude-sonnet-5-5")).toContain("xhigh");
|
||||
expect(getThinkingIds("claude-sonnet-5-5")).not.toContain("off");
|
||||
expect(getThinkingIds("claude-opus-4-7[1m]")).toContain("ultracode");
|
||||
@@ -1232,7 +1223,6 @@ describe("ClaudeAgentSession features", () => {
|
||||
|
||||
test.each([
|
||||
["supported model", "claude-opus-4-8", { type: "disabled" }, undefined],
|
||||
["Haiku 5.5", "claude-haiku-5-5", { type: "disabled" }, undefined],
|
||||
["unsupported model", "claude-fable-5", { type: "adaptive", display: "summarized" }, "high"],
|
||||
["custom model", "openrouter/anthropic/claude-opus-4-8", undefined, undefined],
|
||||
["provider default", null, undefined, undefined],
|
||||
|
||||
@@ -84,7 +84,7 @@ import {
|
||||
type ClaudeRewindSdk,
|
||||
} from "./rewind.js";
|
||||
import { normalizeProviderReplayTimestamp } from "../../provider-history-timestamps.js";
|
||||
import { claudeConfigDir, claudeProjectDirSync, claudeTranscriptPathSync } from "./project-dir.js";
|
||||
import { claudeConfigDir, claudeProjectDirSync } from "./project-dir.js";
|
||||
import { THINKING_APPLIES_NEXT_TURN_NOTICE } from "../../provider-notices.js";
|
||||
import {
|
||||
isProviderImageMarkdown,
|
||||
@@ -1916,11 +1916,6 @@ function readClaudeParentToolUseId(message: SDKMessage): string | null {
|
||||
if (!("parent_tool_use_id" in message)) {
|
||||
return null;
|
||||
}
|
||||
// Claude Code's liveness tick for a tool still running after 30 s names that tool as its
|
||||
// parent, so a long main-thread call would otherwise read as a subagent.
|
||||
if (message.type === "tool_progress" && message.heartbeat === true) {
|
||||
return null;
|
||||
}
|
||||
const parentToolUseId = (message as { parent_tool_use_id?: unknown }).parent_tool_use_id;
|
||||
return typeof parentToolUseId === "string" && parentToolUseId.length > 0 ? parentToolUseId : null;
|
||||
}
|
||||
@@ -2062,6 +2057,14 @@ class ClaudeContextUsageState {
|
||||
}
|
||||
}
|
||||
|
||||
interface ClaudeRuntime {
|
||||
query: Query;
|
||||
input: AsyncMessageInput<SDKUserMessage>;
|
||||
process: { child: ChildProcess | null };
|
||||
pump: Promise<void> | null;
|
||||
closing: Promise<void> | null;
|
||||
}
|
||||
|
||||
class ClaudeAgentSession implements AgentSession {
|
||||
readonly provider = "claude" as const;
|
||||
readonly capabilities = CLAUDE_CAPABILITIES;
|
||||
@@ -2075,14 +2078,12 @@ class ClaudeAgentSession implements AgentSession {
|
||||
private readonly logger: Logger;
|
||||
private readonly queryFactory?: ClaudeQueryFactory;
|
||||
private readonly resolveBinary: () => Promise<string>;
|
||||
private query: Query | null = null;
|
||||
private runtime: ClaudeRuntime | null = null;
|
||||
private runtimeStarting: Promise<ClaudeRuntime> | null = null;
|
||||
private readonly harnessEnvironment: Record<string, string>;
|
||||
private readonly usageSessionKey = randomUUID();
|
||||
private childProcess: ChildProcess | null = null;
|
||||
private input: AsyncMessageInput<SDKUserMessage> | null = null;
|
||||
/** The exact SDK query/input pair that owns the current foreground turn. */
|
||||
private activeForegroundQuery: Query | null = null;
|
||||
private activeForegroundInput: AsyncMessageInput<SDKUserMessage> | null = null;
|
||||
/** The runtime that owns the foreground or autonomous turn. */
|
||||
private activeTurnRuntime: ClaudeRuntime | null = null;
|
||||
/**
|
||||
* Messages pushed into the live SDK input (steers, and a foreground turn's own prompt) whose
|
||||
* command_lifecycle has not reached "started". Interrupting has to withdraw them, or the SDK
|
||||
@@ -2138,7 +2139,6 @@ class ClaudeAgentSession implements AgentSession {
|
||||
private lastRuntimeModel: string | null = null;
|
||||
private compacting = false;
|
||||
private compactionMarkerOpen = false;
|
||||
private queryPumpPromise: Promise<void> | null = null;
|
||||
private queryRestartNeeded = false;
|
||||
private pendingInterruptAbort = false;
|
||||
/**
|
||||
@@ -2324,19 +2324,15 @@ class ClaudeAgentSession implements AgentSession {
|
||||
this.notifySubscribers({ type: "turn_started", provider: "claude" });
|
||||
|
||||
try {
|
||||
await this.ensureQuery();
|
||||
if (cancelIssued) {
|
||||
// Stopped while Claude was still starting up: withdrawn by never sending it.
|
||||
const runtime = await this.ensureRuntime();
|
||||
if (this.closed || cancelIssued || this.activeForegroundTurnId !== turnId) {
|
||||
// Stopped during startup: withdraw this turn's message by never sending it.
|
||||
if (sdkUserMessageId) this.unstartedMessageUuids.delete(sdkUserMessageId);
|
||||
return { turnId };
|
||||
}
|
||||
if (!this.input) {
|
||||
throw new Error("Claude session input stream not initialized");
|
||||
}
|
||||
this.activeForegroundQuery = this.query;
|
||||
this.activeForegroundInput = this.input;
|
||||
this.startQueryPump();
|
||||
this.input.push(sdkMessage);
|
||||
this.activeTurnRuntime = runtime;
|
||||
runtime.input.push(sdkMessage);
|
||||
this.startQueryPump(runtime);
|
||||
setTimeout(() => {
|
||||
if (this.activeForegroundTurnId === turnId) {
|
||||
this.emitSubmittedUserMessage(sdkMessage, turnId, options?.clientMessageId);
|
||||
@@ -2344,9 +2340,13 @@ class ClaudeAgentSession implements AgentSession {
|
||||
}, 0);
|
||||
} catch (error) {
|
||||
if (sdkUserMessageId) this.unstartedMessageUuids.delete(sdkUserMessageId);
|
||||
this.finishForegroundTurn(
|
||||
this.buildTurnFailedEvent(error instanceof Error ? error.message : "Claude stream failed"),
|
||||
);
|
||||
if (this.activeForegroundTurnId === turnId) {
|
||||
this.finishForegroundTurn(
|
||||
this.buildTurnFailedEvent(
|
||||
error instanceof Error ? error.message : "Claude stream failed",
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return { turnId };
|
||||
@@ -2366,23 +2366,20 @@ class ClaudeAgentSession implements AgentSession {
|
||||
|
||||
// Capture both ends of the live SDK stream before creating or delivering the message. There
|
||||
// is deliberately no await below: a finished A cannot make this input point at a later B.
|
||||
const query = this.activeForegroundQuery;
|
||||
const input = this.activeForegroundInput;
|
||||
if (!query || !input || this.query !== query || this.input !== input) {
|
||||
const runtime = this.activeTurnRuntime;
|
||||
if (!runtime || this.runtime !== runtime) {
|
||||
return { status: "unavailable" };
|
||||
}
|
||||
const message = this.toSdkUserMessage(prompt);
|
||||
message.priority = "next";
|
||||
if (
|
||||
(this.activeForegroundTurnId ?? this.autonomousTurn?.id) !== options.expectedTurnId ||
|
||||
this.activeForegroundQuery !== query ||
|
||||
this.activeForegroundInput !== input ||
|
||||
this.query !== query ||
|
||||
this.input !== input
|
||||
this.activeTurnRuntime !== runtime ||
|
||||
this.runtime !== runtime
|
||||
) {
|
||||
return { status: "unavailable" };
|
||||
}
|
||||
this.enqueueSteer(input, message, options.clearPendingPermissions === true);
|
||||
this.enqueueSteer(runtime.input, message, options.clearPendingPermissions === true);
|
||||
return { status: "accepted" };
|
||||
}
|
||||
|
||||
@@ -2474,7 +2471,7 @@ class ClaudeAgentSession implements AgentSession {
|
||||
const normalized = isPermissionMode(modeId) ? modeId : "default";
|
||||
assertClaudeModeCanRun(normalized, this.harnessEnvironment);
|
||||
const previousMode = this.currentMode;
|
||||
const launchesQuery = !this.query || this.queryRestartNeeded;
|
||||
const launchesQuery = !this.runtime || this.queryRestartNeeded;
|
||||
const activeQuery = await this.ensureQuery(normalized);
|
||||
try {
|
||||
await activeQuery.setPermissionMode(normalized);
|
||||
@@ -2573,7 +2570,7 @@ class ClaudeAgentSession implements AgentSession {
|
||||
...this.config.featureValues,
|
||||
fast_mode: enabled,
|
||||
};
|
||||
const activeQuery = query ?? this.query;
|
||||
const activeQuery = query ?? this.runtime?.query;
|
||||
if (activeQuery) {
|
||||
await activeQuery.applyFlagSettings({ fastMode: enabled });
|
||||
}
|
||||
@@ -2736,8 +2733,8 @@ class ClaudeAgentSession implements AgentSession {
|
||||
sessionId: this.claudeSessionId,
|
||||
turnId: this.activeForegroundTurnId ?? this.autonomousTurn?.id ?? undefined,
|
||||
turnState: this.turnState,
|
||||
hasQuery: Boolean(this.query),
|
||||
hasInput: Boolean(this.input),
|
||||
hasQuery: Boolean(this.runtime),
|
||||
hasInput: Boolean(this.runtime),
|
||||
hasActiveForegroundTurnId: Boolean(this.activeForegroundTurnId),
|
||||
},
|
||||
"provider.claude.session_close.start",
|
||||
@@ -2747,35 +2744,17 @@ class ClaudeAgentSession implements AgentSession {
|
||||
this.cancelCurrentTurn?.();
|
||||
this.subscribers.clear();
|
||||
this.activeForegroundTurnId = null;
|
||||
this.activeForegroundQuery = null;
|
||||
this.activeForegroundInput = null;
|
||||
this.activeTurnRuntime = null;
|
||||
this.autonomousTurn = null;
|
||||
this.cancelCurrentTurn = null;
|
||||
this.turnState = "idle";
|
||||
this.sidechainTracker.clear();
|
||||
this.taskProtocolSource.reset();
|
||||
this.input?.end();
|
||||
this.query?.close?.();
|
||||
await this.awaitWithTimeout(this.query?.interrupt?.(), "close query interrupt");
|
||||
await this.awaitWithTimeout(this.query?.return?.(), "close query return");
|
||||
this.query = null;
|
||||
this.input = null;
|
||||
// Terminate the entire process tree (claude + MCP children) to prevent
|
||||
// orphan accumulation. The SDK's internal cleanup may only kill the
|
||||
// direct child process.
|
||||
if (this.childProcess) {
|
||||
const result = await terminateWithTreeKill(this.childProcess, {
|
||||
gracefulTimeoutMs: 2_000,
|
||||
forceTimeoutMs: 2_000,
|
||||
});
|
||||
if (result === "kill-timeout") {
|
||||
this.logger.warn(
|
||||
{ pid: this.childProcess.pid, agentId: this.agentId },
|
||||
"Claude process tree did not report exit after SIGKILL",
|
||||
);
|
||||
}
|
||||
this.childProcess = null;
|
||||
}
|
||||
const runtime = this.runtime;
|
||||
this.runtime = null;
|
||||
if (runtime) await this.disposeRuntime(runtime);
|
||||
// A pending launch checks closed before spawning and after initialization. Do not
|
||||
// wait on executable discovery here: closing must work even when discovery stalls.
|
||||
if (this.persistSession === false && this.claudeSessionId) {
|
||||
// Claude Code currently ignores --no-session-persistence outside --print mode
|
||||
// (see `claude --help`), so the SDK's persistSession=false is silently dropped
|
||||
@@ -2989,7 +2968,7 @@ class ClaudeAgentSession implements AgentSession {
|
||||
}
|
||||
|
||||
private async ensureFreshQuery(): Promise<Query> {
|
||||
if (this.query) {
|
||||
if (this.runtime) {
|
||||
this.queryRestartNeeded = true;
|
||||
}
|
||||
return this.ensureQuery();
|
||||
@@ -3169,75 +3148,99 @@ class ClaudeAgentSession implements AgentSession {
|
||||
}
|
||||
|
||||
private async ensureQuery(launchMode: PermissionMode = this.currentMode): Promise<Query> {
|
||||
if (this.query && !this.queryRestartNeeded) {
|
||||
return this.query;
|
||||
return (await this.ensureRuntime(launchMode)).query;
|
||||
}
|
||||
|
||||
private ensureRuntime(launchMode: PermissionMode = this.currentMode): Promise<ClaudeRuntime> {
|
||||
if (this.closed) return Promise.reject(new Error("Claude session is closed"));
|
||||
if (this.runtimeStarting) return this.runtimeStarting;
|
||||
if (
|
||||
this.runtime &&
|
||||
!this.runtime.closing &&
|
||||
(!this.queryRestartNeeded || this.activeTurnRuntime === this.runtime)
|
||||
) {
|
||||
return Promise.resolve(this.runtime);
|
||||
}
|
||||
|
||||
if (this.queryRestartNeeded && this.query) {
|
||||
const oldQuery = this.query;
|
||||
const oldInput = this.input;
|
||||
// Null out query/input BEFORE awaiting the old iterator's return so the
|
||||
// old pump sees this.query !== activeQuery and skips failActiveTurns.
|
||||
this.query = null;
|
||||
this.input = null;
|
||||
this.queryPumpPromise = null;
|
||||
this.queryRestartNeeded = false;
|
||||
// Ending the input retires the process on purpose. Detach first so its
|
||||
// exit is not reported as a crash.
|
||||
const retiredChild = this.childProcess;
|
||||
this.childProcess = null;
|
||||
if (retiredChild) this.failRunningRuntimeTasks();
|
||||
oldInput?.end();
|
||||
oldQuery.close?.();
|
||||
try {
|
||||
await oldQuery.return?.();
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
// Tree-kill the old process tree now that the SDK has cleaned up.
|
||||
// If we skip this, MCP children of the previous claude process can
|
||||
// survive as orphans when the session spawns a replacement query.
|
||||
if (retiredChild) {
|
||||
await terminateWithTreeKill(retiredChild, {
|
||||
gracefulTimeoutMs: 2_000,
|
||||
forceTimeoutMs: 2_000,
|
||||
}).catch(() => {
|
||||
/* process may already be dead */
|
||||
});
|
||||
}
|
||||
}
|
||||
const starting = this.createRuntime(launchMode).finally(() => {
|
||||
if (this.runtimeStarting === starting) this.runtimeStarting = null;
|
||||
});
|
||||
this.runtimeStarting = starting;
|
||||
return starting;
|
||||
}
|
||||
|
||||
// Preserve claudeSessionId across query recreation so buildOptions() passes
|
||||
// resume: sessionId and the new query continues the existing conversation.
|
||||
private async createRuntime(launchMode: PermissionMode): Promise<ClaudeRuntime> {
|
||||
const retired = this.runtime;
|
||||
this.runtime = null;
|
||||
if (retired) {
|
||||
this.failRunningRuntimeTasks();
|
||||
await this.disposeRuntime(retired);
|
||||
}
|
||||
if (this.closed) throw new Error("Claude session is closed");
|
||||
|
||||
// Consume only the settings captured by this launch. A change during an await
|
||||
// remains pending for the next turn, and the pump never initiates a restart.
|
||||
this.queryRestartNeeded = false;
|
||||
this.persistence = null;
|
||||
|
||||
const input = createAsyncMessageInput<SDKUserMessage>();
|
||||
const options = await this.buildOptions(launchMode);
|
||||
if (this.closed) throw new Error("Claude session is closed");
|
||||
this.logger.debug({ options: summarizeClaudeOptionsForLog(options) }, "claude query");
|
||||
this.input = input;
|
||||
// A fresh Claude process has no turn of its own in flight.
|
||||
this.mainTurnInFlight = false;
|
||||
this.query = claudeQuery(
|
||||
const input = createAsyncMessageInput<SDKUserMessage>();
|
||||
const process: ClaudeRuntime["process"] = { child: null };
|
||||
const query = claudeQuery(
|
||||
{ prompt: input.iterable, options },
|
||||
{
|
||||
runtimeSettings: this.runtimeSettings,
|
||||
launchEnv: this.launchEnv,
|
||||
queryFactory: this.queryFactory,
|
||||
onChildProcess: (child) => {
|
||||
this.childProcess = child;
|
||||
process.child = child;
|
||||
child.once("exit", (code, signal) => this.handleRuntimeExit(child, code, signal));
|
||||
},
|
||||
},
|
||||
);
|
||||
const fastMode = this.resolveFastModeSetting();
|
||||
if (fastMode !== null) {
|
||||
await this.query.applyFlagSettings({ fastMode });
|
||||
const runtime: ClaudeRuntime = { query, input, process, pump: null, closing: null };
|
||||
this.runtime = runtime;
|
||||
try {
|
||||
const fastMode = this.resolveFastModeSetting();
|
||||
if (fastMode !== null) await query.applyFlagSettings({ fastMode });
|
||||
if (this.closed) throw new Error("Claude session is closed");
|
||||
if (this.runtime !== runtime) throw new Error("Claude runtime exited during initialization");
|
||||
return runtime;
|
||||
} catch (error) {
|
||||
if (this.runtime === runtime) this.runtime = null;
|
||||
await this.disposeRuntime(runtime);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
private disposeRuntime(runtime: ClaudeRuntime): Promise<void> {
|
||||
runtime.closing ??= this.closeRuntime(runtime);
|
||||
return runtime.closing;
|
||||
}
|
||||
|
||||
private async closeRuntime(runtime: ClaudeRuntime): Promise<void> {
|
||||
const child = runtime.process.child;
|
||||
runtime.process.child = null;
|
||||
runtime.input.end();
|
||||
runtime.query.close?.();
|
||||
await this.awaitWithTimeout(runtime.query.interrupt?.(), "close query interrupt");
|
||||
await this.awaitWithTimeout(runtime.query.return?.(), "close query return");
|
||||
// Claude's SDK cleanup does not own MCP children; retire the entire tree.
|
||||
if (child) {
|
||||
const result = await terminateWithTreeKill(child, {
|
||||
gracefulTimeoutMs: 2_000,
|
||||
forceTimeoutMs: 2_000,
|
||||
});
|
||||
if (result === "kill-timeout") {
|
||||
this.logger.warn(
|
||||
{ pid: child.pid, agentId: this.agentId },
|
||||
"Claude process tree did not report exit after SIGKILL",
|
||||
);
|
||||
}
|
||||
}
|
||||
// Do not kick off background control-plane queries here. Methods like
|
||||
// supportedCommands()/setPermissionMode() may execute immediately after
|
||||
// ensureQuery() (for listCommands()/setMode()), and sharing the same query
|
||||
// control plane can cause those calls to wait behind supportedModels().
|
||||
return this.query;
|
||||
}
|
||||
|
||||
private async awaitWithTimeout(
|
||||
@@ -3356,17 +3359,6 @@ class ClaudeAgentSession implements AgentSession {
|
||||
const sdkEnv = this.harnessEnvironment;
|
||||
assertClaudeModeCanRun(permissionMode, sdkEnv);
|
||||
|
||||
const claudeBinary = await this.resolveBinary();
|
||||
this.logger.debug(
|
||||
{
|
||||
claudeBinary,
|
||||
pathEnvKey: resolvePathEnvKey(),
|
||||
pathIncludesClaudeLocalBin: (process.env["Path"] ?? process.env["PATH"] ?? "")
|
||||
.toLowerCase()
|
||||
.includes("\\.local\\bin"),
|
||||
},
|
||||
"Resolved Claude executable",
|
||||
);
|
||||
const sessionBinding: Pick<ClaudeOptions, "resume" | "sessionId"> = {};
|
||||
if (this.pendingFreshSessionId) {
|
||||
sessionBinding.sessionId = this.pendingFreshSessionId;
|
||||
@@ -3384,7 +3376,6 @@ class ClaudeAgentSession implements AgentSession {
|
||||
allowDangerouslySkipPermissions: true,
|
||||
agents: this.defaults?.agents,
|
||||
canUseTool: this.handlePermissionRequest,
|
||||
pathToClaudeCodeExecutable: claudeBinary,
|
||||
// Use Claude Code preset system prompt and load CLAUDE.md files
|
||||
// Append provider-agnostic system prompts for agents.
|
||||
systemPrompt: {
|
||||
@@ -3434,7 +3425,18 @@ class ClaudeAgentSession implements AgentSession {
|
||||
...this.runtimeSettings.disallowedTools,
|
||||
];
|
||||
}
|
||||
return base;
|
||||
const claudeBinary = await this.resolveBinary();
|
||||
this.logger.debug(
|
||||
{
|
||||
claudeBinary,
|
||||
pathEnvKey: resolvePathEnvKey(),
|
||||
pathIncludesClaudeLocalBin: (process.env["Path"] ?? process.env["PATH"] ?? "")
|
||||
.toLowerCase()
|
||||
.includes("\\.local\\bin"),
|
||||
},
|
||||
"Resolved Claude executable",
|
||||
);
|
||||
return { pathToClaudeCodeExecutable: claudeBinary, ...base };
|
||||
}
|
||||
|
||||
private buildSettingsOptions(
|
||||
@@ -3690,8 +3692,7 @@ class ClaudeAgentSession implements AgentSession {
|
||||
}
|
||||
this.notifySubscribers(event);
|
||||
this.activeForegroundTurnId = null;
|
||||
this.activeForegroundQuery = null;
|
||||
this.activeForegroundInput = null;
|
||||
this.activeTurnRuntime = null;
|
||||
this.cancelCurrentTurn = null;
|
||||
this.activeTurnHasAssistantText = false;
|
||||
this.compactionMarkerOpen = false;
|
||||
@@ -3709,15 +3710,13 @@ class ClaudeAgentSession implements AgentSession {
|
||||
this.compactionMarkerOpen = false;
|
||||
if (this.activeForegroundTurnId) {
|
||||
this.activeForegroundTurnId = null;
|
||||
this.activeForegroundQuery = null;
|
||||
this.activeForegroundInput = null;
|
||||
this.activeTurnRuntime = null;
|
||||
this.cancelCurrentTurn = null;
|
||||
this.activeTurnHasAssistantText = false;
|
||||
this.syncTurnState("foreground turn terminal");
|
||||
} else if (this.autonomousTurn) {
|
||||
this.autonomousTurn = null;
|
||||
this.activeForegroundQuery = null;
|
||||
this.activeForegroundInput = null;
|
||||
this.activeTurnRuntime = null;
|
||||
this.activeTurnHasAssistantText = false;
|
||||
this.syncTurnState("autonomous turn terminal");
|
||||
}
|
||||
@@ -3731,8 +3730,7 @@ class ClaudeAgentSession implements AgentSession {
|
||||
this.autonomousTurn = {
|
||||
id: this.createTurnId("autonomous"),
|
||||
};
|
||||
this.activeForegroundQuery = this.query;
|
||||
this.activeForegroundInput = this.input;
|
||||
this.activeTurnRuntime = this.runtime;
|
||||
this.activeTurnHasAssistantText = false;
|
||||
this.contextUsage.beginTurn();
|
||||
this.notifySubscribers({ type: "turn_started", provider: "claude" });
|
||||
@@ -3745,8 +3743,7 @@ class ClaudeAgentSession implements AgentSession {
|
||||
}
|
||||
this.notifySubscribers({ type: "turn_completed", provider: "claude" });
|
||||
this.autonomousTurn = null;
|
||||
this.activeForegroundQuery = null;
|
||||
this.activeForegroundInput = null;
|
||||
this.activeTurnRuntime = null;
|
||||
this.activeTurnHasAssistantText = false;
|
||||
this.compactionMarkerOpen = false;
|
||||
this.syncTurnState("autonomous turn completed");
|
||||
@@ -3774,10 +3771,11 @@ class ClaudeAgentSession implements AgentSession {
|
||||
code: number | null,
|
||||
signal: NodeJS.Signals | null,
|
||||
): void {
|
||||
if (this.closed || this.childProcess !== child) {
|
||||
const runtime = this.runtime;
|
||||
if (this.closed || !runtime || runtime.process.child !== child) {
|
||||
return;
|
||||
}
|
||||
this.childProcess = null;
|
||||
runtime.process.child = null;
|
||||
this.logger.warn(
|
||||
{ agentId: this.agentId, pid: child.pid, code, signal },
|
||||
"Claude runtime exited unexpectedly",
|
||||
@@ -3786,13 +3784,19 @@ class ClaudeAgentSession implements AgentSession {
|
||||
if (this.activeForegroundTurnId || this.autonomousTurn) {
|
||||
// The pump is about to throw. It waits for stderr to flush and reports the
|
||||
// real cause; reporting here first would replace that with a bare exit code
|
||||
// and detach this.query, which is how the pump recognizes its own stream.
|
||||
// and detach the runtime, which is how the pump recognizes its own stream.
|
||||
return;
|
||||
}
|
||||
// Drop the dead handles so the next write spawns a fresh process instead of
|
||||
// failing against a dead transport forever.
|
||||
this.query = null;
|
||||
this.input = null;
|
||||
void this.disposeRuntime(runtime)
|
||||
.then(() => {
|
||||
if (this.runtime === runtime) this.runtime = null;
|
||||
return undefined;
|
||||
})
|
||||
.catch((error) => {
|
||||
this.logger.warn({ err: error }, "Failed to retire exited Claude runtime");
|
||||
});
|
||||
this.dispatchEvents([
|
||||
this.buildTurnFailedEvent(
|
||||
`Claude stopped unexpectedly (${signal ? `signal ${signal}` : `exit code ${code ?? "unknown"}`}). Any background shells, monitors or other work it had running were terminated with it.`,
|
||||
@@ -3808,12 +3812,12 @@ class ClaudeAgentSession implements AgentSession {
|
||||
);
|
||||
}
|
||||
|
||||
private startQueryPump(): void {
|
||||
if (this.closed || this.queryPumpPromise) {
|
||||
private startQueryPump(runtime: ClaudeRuntime): void {
|
||||
if (this.closed || runtime.pump) {
|
||||
return;
|
||||
}
|
||||
|
||||
const pump = this.runQueryPump().catch((error) => {
|
||||
const pump = this.runQueryPump(runtime).catch((error) => {
|
||||
this.logger.trace(
|
||||
{
|
||||
agentId: this.agentId,
|
||||
@@ -3826,33 +3830,16 @@ class ClaudeAgentSession implements AgentSession {
|
||||
);
|
||||
});
|
||||
|
||||
this.queryPumpPromise = pump;
|
||||
runtime.pump = pump;
|
||||
void pump.finally(() => {
|
||||
if (this.queryPumpPromise === pump) {
|
||||
this.queryPumpPromise = null;
|
||||
if (runtime.pump === pump) {
|
||||
runtime.pump = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private async runQueryPump(): Promise<void> {
|
||||
let activeQuery: Query;
|
||||
try {
|
||||
activeQuery = await this.ensureQuery();
|
||||
} catch (error) {
|
||||
this.logger.trace(
|
||||
{
|
||||
agentId: this.agentId,
|
||||
provider: "claude",
|
||||
sessionId: this.claudeSessionId,
|
||||
turnId: this.activeForegroundTurnId ?? this.autonomousTurn?.id ?? undefined,
|
||||
err: error,
|
||||
},
|
||||
"provider.claude.query_pump.init_failed",
|
||||
);
|
||||
this.failActiveTurns(error instanceof Error ? error.message : "Claude stream failed");
|
||||
return;
|
||||
}
|
||||
|
||||
private async runQueryPump(runtime: ClaudeRuntime): Promise<void> {
|
||||
const activeQuery = runtime.query;
|
||||
let consecutiveInterruptAbortRecoveries = 0;
|
||||
const logRawMessage = (message: SDKMessage): void => {
|
||||
this.logger.trace(
|
||||
@@ -3870,9 +3857,10 @@ class ClaudeAgentSession implements AgentSession {
|
||||
);
|
||||
};
|
||||
const handlePumpedMessage = async (message: SDKMessage): Promise<boolean> => {
|
||||
if (this.runtime !== runtime) return true;
|
||||
logRawMessage(message);
|
||||
consecutiveInterruptAbortRecoveries = 0;
|
||||
if (await this.handleMissingResumedConversation(message, activeQuery)) {
|
||||
if (await this.handleMissingResumedConversation(message, runtime)) {
|
||||
return true;
|
||||
}
|
||||
await this.routeSdkMessageFromPump(message);
|
||||
@@ -3887,19 +3875,19 @@ class ClaudeAgentSession implements AgentSession {
|
||||
return false;
|
||||
};
|
||||
try {
|
||||
while (!this.closed && this.query === activeQuery) {
|
||||
while (!this.closed && this.runtime === runtime) {
|
||||
try {
|
||||
if (await drainActiveQuery()) {
|
||||
return;
|
||||
}
|
||||
if (!this.closed && this.query === activeQuery) {
|
||||
if (!this.closed && this.runtime === runtime) {
|
||||
this.failActiveTurns("Claude stream ended before terminal result");
|
||||
}
|
||||
return;
|
||||
} catch (error) {
|
||||
if (
|
||||
!this.closed &&
|
||||
this.query === activeQuery &&
|
||||
this.runtime === runtime &&
|
||||
this.shouldRecoverInterruptedQueryAbort(error, consecutiveInterruptAbortRecoveries)
|
||||
) {
|
||||
consecutiveInterruptAbortRecoveries += 1;
|
||||
@@ -3909,7 +3897,7 @@ class ClaudeAgentSession implements AgentSession {
|
||||
);
|
||||
continue;
|
||||
}
|
||||
if (!this.closed && this.query === activeQuery) {
|
||||
if (!this.closed && this.runtime === runtime) {
|
||||
await this.awaitRecentStderrAfterProcessExit(error);
|
||||
this.failActiveTurns(error instanceof Error ? error.message : "Claude stream failed");
|
||||
}
|
||||
@@ -3917,10 +3905,8 @@ class ClaudeAgentSession implements AgentSession {
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
if (this.query === activeQuery) {
|
||||
this.query = null;
|
||||
this.input = null;
|
||||
}
|
||||
await this.disposeRuntime(runtime);
|
||||
if (this.runtime === runtime) this.runtime = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4092,7 +4078,7 @@ class ClaudeAgentSession implements AgentSession {
|
||||
|
||||
private async handleMissingResumedConversation(
|
||||
message: SDKMessage,
|
||||
activeQuery: Query,
|
||||
runtime: ClaudeRuntime,
|
||||
): Promise<boolean> {
|
||||
const staleResumeError = this.readMissingResumedConversationError(message);
|
||||
if (!staleResumeError) {
|
||||
@@ -4107,29 +4093,8 @@ class ClaudeAgentSession implements AgentSession {
|
||||
);
|
||||
|
||||
this.failActiveTurns(staleResumeError);
|
||||
// Ending the input retires the process on purpose. Detach first so its exit
|
||||
// is not reported as a crash.
|
||||
const retiredChild = this.childProcess;
|
||||
this.childProcess = null;
|
||||
this.input?.end();
|
||||
await this.awaitWithTimeout(
|
||||
activeQuery.return?.(),
|
||||
"query pump return on missing resumed conversation",
|
||||
);
|
||||
// Tree-kill for the same reason the restart path does: MCP children of the
|
||||
// retired claude process outlive it otherwise.
|
||||
if (retiredChild) {
|
||||
await terminateWithTreeKill(retiredChild, {
|
||||
gracefulTimeoutMs: 2_000,
|
||||
forceTimeoutMs: 2_000,
|
||||
}).catch(() => {
|
||||
/* process may already be dead */
|
||||
});
|
||||
}
|
||||
if (this.query === activeQuery) {
|
||||
this.query = null;
|
||||
this.input = null;
|
||||
}
|
||||
// Clear the conversation before yielding to teardown, so a later request
|
||||
// cannot resume a session that has already been rejected.
|
||||
this.persistence = null;
|
||||
this.persistedHistory = [];
|
||||
this.persistedProviderSubagentEvents = [];
|
||||
@@ -4138,9 +4103,10 @@ class ClaudeAgentSession implements AgentSession {
|
||||
this.queryRestartNeeded = false;
|
||||
this.autonomousTurn = null;
|
||||
this.activeForegroundTurnId = null;
|
||||
this.activeForegroundQuery = null;
|
||||
this.activeForegroundInput = null;
|
||||
this.activeTurnRuntime = null;
|
||||
this.syncTurnState("missing resumed conversation");
|
||||
await this.disposeRuntime(runtime);
|
||||
if (this.runtime === runtime) this.runtime = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -4151,7 +4117,7 @@ class ClaudeAgentSession implements AgentSession {
|
||||
* perTaskStopAffordance), and no result would follow to consume pendingInterruptAbort.
|
||||
*/
|
||||
private async interruptActiveTurn(claudeStartedTurn = this.mainTurnInFlight): Promise<void> {
|
||||
const queryToInterrupt = this.query;
|
||||
const queryToInterrupt = this.runtime?.query;
|
||||
if (!queryToInterrupt || typeof queryToInterrupt.interrupt !== "function") {
|
||||
this.logger.trace(
|
||||
{
|
||||
@@ -5221,11 +5187,26 @@ class ClaudeAgentSession implements AgentSession {
|
||||
private resolveHistoryPath(sessionId: string): string | null {
|
||||
const cwd = this.config.cwd;
|
||||
if (!cwd) return null;
|
||||
return claudeTranscriptPathSync({
|
||||
cwd,
|
||||
sessionId,
|
||||
configDir: claudeConfigDir(this.harnessEnvironment),
|
||||
});
|
||||
const configDir = claudeConfigDir(this.harnessEnvironment);
|
||||
const candidates = [cwd];
|
||||
try {
|
||||
const realCwd = fs.realpathSync(cwd);
|
||||
if (realCwd !== cwd) {
|
||||
candidates.push(realCwd);
|
||||
}
|
||||
} catch {
|
||||
// Fall back to the configured cwd when the path has already disappeared.
|
||||
}
|
||||
for (const candidate of candidates) {
|
||||
const historyPath = path.join(
|
||||
claudeProjectDirSync(candidate, { configDir }),
|
||||
`${sessionId}.jsonl`,
|
||||
);
|
||||
if (fs.existsSync(historyPath)) {
|
||||
return historyPath;
|
||||
}
|
||||
}
|
||||
return path.join(claudeProjectDirSync(cwd, { configDir }), `${sessionId}.jsonl`);
|
||||
}
|
||||
|
||||
private convertHistoryEntry(entry: ClaudeHistoryEntry): AgentTimelineItem[] {
|
||||
|
||||
@@ -170,20 +170,10 @@ export const CLAUDE_MODEL_MANIFEST = [
|
||||
effortLevels: CLAUDE_EFFORT_LEVELS.standard,
|
||||
supportsThinkingDisabled: true,
|
||||
},
|
||||
{
|
||||
id: "claude-haiku-5-5",
|
||||
label: "Haiku 5.5",
|
||||
description: "Haiku 5.5 · Fastest for quick answers",
|
||||
minimumClaudeCodeVersion: "2.1.293",
|
||||
defaultThinkingOptionId: "medium",
|
||||
contextWindowMaxTokens: 1_000_000,
|
||||
effortLevels: CLAUDE_EFFORT_LEVELS.xhigh,
|
||||
supportsThinkingDisabled: true,
|
||||
},
|
||||
{
|
||||
id: "claude-haiku-4-5",
|
||||
label: "Haiku 4.5",
|
||||
description: "Haiku 4.5 · Previous release",
|
||||
description: "Haiku 4.5 · Fastest for quick answers",
|
||||
contextWindowMaxTokens: 200_000,
|
||||
},
|
||||
] as const satisfies readonly ClaudeModelManifestEntry[];
|
||||
|
||||
@@ -39,7 +39,7 @@ async function createClaudeConfigDirWithRawSettings(settings: string): Promise<s
|
||||
return configDir;
|
||||
}
|
||||
|
||||
function createCatalogClient(claudeCodeVersion = "2.1.293"): ClaudeAgentClient {
|
||||
function createCatalogClient(claudeCodeVersion = "2.1.284"): ClaudeAgentClient {
|
||||
return new ClaudeAgentClient({
|
||||
logger: createTestLogger(),
|
||||
resolveVersion: async () => claudeCodeVersion,
|
||||
@@ -66,7 +66,6 @@ describe("getClaudeModels", () => {
|
||||
"claude-opus-4-6",
|
||||
"claude-sonnet-4-6[1m]",
|
||||
"claude-sonnet-4-6",
|
||||
"claude-haiku-5-5",
|
||||
"claude-haiku-4-5",
|
||||
]);
|
||||
});
|
||||
@@ -101,7 +100,6 @@ describe("getClaudeModels", () => {
|
||||
["claude-opus-4-6", 200_000],
|
||||
["claude-sonnet-4-6[1m]", 1_000_000],
|
||||
["claude-sonnet-4-6", 200_000],
|
||||
["claude-haiku-5-5", 1_000_000],
|
||||
["claude-haiku-4-5", 200_000],
|
||||
]),
|
||||
);
|
||||
@@ -125,12 +123,6 @@ describe("getClaudeModels", () => {
|
||||
expect(getClaudeModels("2.1.284").map((model) => model.id)).toContain("claude-sonnet-5-5");
|
||||
});
|
||||
|
||||
it("gates Haiku 5.5 on Claude Code 2.1.293 without changing the default", () => {
|
||||
expect(getClaudeModels("2.1.292").map((model) => model.id)).not.toContain("claude-haiku-5-5");
|
||||
expect(getClaudeModels("2.1.293").map((model) => model.id)).toContain("claude-haiku-5-5");
|
||||
expect(getClaudeModels("2.1.293").find((model) => model.isDefault)?.id).toBe("claude-opus-5-5");
|
||||
});
|
||||
|
||||
it("derives thinking options from model effort capabilities", () => {
|
||||
const models = new Map(getClaudeModels().map((model) => [model.id, model]));
|
||||
|
||||
@@ -200,8 +192,6 @@ describe("getClaudeModels", () => {
|
||||
["claude-sonnet-5-20260101", true, "high"],
|
||||
["claude-fable-5", false, "high"],
|
||||
["claude-fable-5-1", false, "high"],
|
||||
["claude-haiku-5-5", true, "medium"],
|
||||
["claude-haiku-5-5-20261007", true, "medium"],
|
||||
["claude-haiku-4-5", false, undefined],
|
||||
["openrouter/anthropic/claude-opus-4-8", false, undefined],
|
||||
[null, false, undefined],
|
||||
@@ -663,51 +653,6 @@ describe("Claude Sonnet 5.5 catalog", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("Claude Haiku 5.5 catalog", () => {
|
||||
it("offers one Haiku 5.5 entry with a 1M context window", () => {
|
||||
const haiku55Models = getClaudeModels()
|
||||
.filter((model) => model.id.startsWith("claude-haiku-5-5"))
|
||||
.map(({ id, label, contextWindowMaxTokens }) => ({ id, label, contextWindowMaxTokens }));
|
||||
|
||||
expect(haiku55Models).toEqual([
|
||||
{ id: "claude-haiku-5-5", label: "Haiku 5.5", contextWindowMaxTokens: 1_000_000 },
|
||||
]);
|
||||
});
|
||||
|
||||
it("offers Off and every effort level with medium as the default", () => {
|
||||
const haiku55 = getClaudeModels().find((model) => model.id === "claude-haiku-5-5");
|
||||
|
||||
expect(haiku55?.thinkingOptions?.map((option) => option.id)).toEqual([
|
||||
CLAUDE_DISABLED_THINKING_OPTION_ID,
|
||||
"low",
|
||||
"medium",
|
||||
"high",
|
||||
"xhigh",
|
||||
"max",
|
||||
CLAUDE_ULTRACODE_THINKING_OPTION_ID,
|
||||
]);
|
||||
expect(haiku55?.defaultThinkingOptionId).toBe("medium");
|
||||
expect(
|
||||
haiku55?.thinkingOptions?.filter((option) => option.isDefault).map((option) => option.id),
|
||||
).toEqual(["medium"]);
|
||||
});
|
||||
|
||||
it("normalizes provider-prefixed runtime IDs", () => {
|
||||
expect(normalizeClaudeRuntimeModelId("anthropic/claude-haiku-5-5")).toBe("claude-haiku-5-5");
|
||||
expect(normalizeClaudeRuntimeModelId("us.anthropic.claude-haiku-5-5-v1:0")).toBe(
|
||||
"claude-haiku-5-5",
|
||||
);
|
||||
expect(claudeManifestModelSupportsFastMode("claude-haiku-5-5")).toBe(false);
|
||||
});
|
||||
|
||||
it("resolves suffixed and dated Haiku 5.5 IDs to the single catalog entry", () => {
|
||||
expect(findClaudeModel("claude-haiku-5-5[1m]")?.id).toBe("claude-haiku-5-5");
|
||||
expect(findClaudeModel("claude-haiku-5-5-20261007")?.id).toBe("claude-haiku-5-5");
|
||||
expect(findClaudeModel("claude-haiku-5-5-20261007[1m]")?.id).toBe("claude-haiku-5-5");
|
||||
expect(findClaudeModel("claude-haiku-5-5[1m]")?.contextWindowMaxTokens).toBe(1_000_000);
|
||||
});
|
||||
});
|
||||
|
||||
describe("claudeManifestModelSupportsFastMode", () => {
|
||||
it("keeps fast mode strict to first-party manifest model IDs", () => {
|
||||
expect(normalizeClaudeManifestModelId("openrouter/anthropic/claude-opus-4-8")).toBeNull();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { existsSync, readdirSync, realpathSync } from "node:fs";
|
||||
import { realpathSync } from "node:fs";
|
||||
import { realpath } from "node:fs/promises";
|
||||
import { homedir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
@@ -30,46 +30,6 @@ export function claudeProjectDirSync(cwd: string, options?: ClaudeProjectDirOpti
|
||||
return join(projectsRoot, encode(canonical));
|
||||
}
|
||||
|
||||
// Claude Code resumes a session by id from any working directory and keeps appending to the
|
||||
// transcript in the project folder where the session started. That folder differs from the
|
||||
// one `cwd` encodes to when the project moved, the daemon migrated, or Claude Code sees the
|
||||
// cwd under another name (a Windows binary under WSL). Returns the expected path when no
|
||||
// transcript exists anywhere.
|
||||
export function claudeTranscriptPathSync(input: {
|
||||
cwd: string;
|
||||
sessionId: string;
|
||||
configDir?: string;
|
||||
}): string {
|
||||
const options = { configDir: input.configDir };
|
||||
const fileName = `${input.sessionId}.jsonl`;
|
||||
const expected = join(claudeProjectDirSync(input.cwd, options), fileName);
|
||||
if (existsSync(expected)) {
|
||||
return expected;
|
||||
}
|
||||
const projectsRoot = join(resolveConfigDir(options), "projects");
|
||||
let projectDirs: string[];
|
||||
try {
|
||||
projectDirs = readdirSync(projectsRoot);
|
||||
} catch (error) {
|
||||
if (isMissingDirectoryError(error)) {
|
||||
return expected;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
for (const projectDir of projectDirs) {
|
||||
const candidate = join(projectsRoot, projectDir, fileName);
|
||||
if (existsSync(candidate)) {
|
||||
return candidate;
|
||||
}
|
||||
}
|
||||
return expected;
|
||||
}
|
||||
|
||||
function isMissingDirectoryError(error: unknown): boolean {
|
||||
const code = (error as NodeJS.ErrnoException | null)?.code;
|
||||
return code === "ENOENT" || code === "ENOTDIR";
|
||||
}
|
||||
|
||||
async function canonicalize(input: string): Promise<string> {
|
||||
try {
|
||||
return normalizeProjectPath(await realpath(input));
|
||||
|
||||
@@ -1,130 +0,0 @@
|
||||
import { afterEach, beforeEach, describe, expect, test } from "vitest";
|
||||
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import path from "node:path";
|
||||
|
||||
import { claudeProjectDirSync } from "../agent/providers/claude/project-dir.js";
|
||||
import { DaemonClient } from "../test-utils/daemon-client.js";
|
||||
import { createTestPaseoDaemon, type TestPaseoDaemon } from "../test-utils/paseo-daemon.js";
|
||||
|
||||
// Claude Code resumes a session by id from any working directory and keeps writing to the
|
||||
// transcript under the project folder it started in. The agent's cwd can name a different
|
||||
// folder: a project that moved, a daemon migrated between machines or containers, or Claude
|
||||
// Code running under WSL interop and seeing the cwd as a Windows path.
|
||||
// The test daemon fakes the built-in providers; a provider that extends `claude` runs the real one.
|
||||
const PROVIDER_ID = "claude-real";
|
||||
const SESSION_ID = "6f0c5d8e-4c3a-4f7b-9a51-2d8e1b7c9f10";
|
||||
|
||||
function timelineText(entries: ReadonlyArray<{ item: { type: string; text?: string } }>): string {
|
||||
return entries
|
||||
.filter(
|
||||
(
|
||||
entry,
|
||||
): entry is {
|
||||
item: { type: "user_message" | "assistant_message"; text: string };
|
||||
} => entry.item.type === "user_message" || entry.item.type === "assistant_message",
|
||||
)
|
||||
.map((entry) => entry.item.text)
|
||||
.join("\n");
|
||||
}
|
||||
|
||||
describe("daemon E2E - Claude history stored under another project folder", () => {
|
||||
let tempRoot: string;
|
||||
let paseoHomeRoot: string;
|
||||
let configDir: string;
|
||||
let transcriptCwd: string;
|
||||
let agentCwd: string;
|
||||
let daemon: TestPaseoDaemon | undefined;
|
||||
let client: DaemonClient | undefined;
|
||||
|
||||
beforeEach(() => {
|
||||
tempRoot = mkdtempSync(path.join(tmpdir(), "claude-history-other-project-"));
|
||||
paseoHomeRoot = path.join(tempRoot, "paseo-home");
|
||||
configDir = path.join(tempRoot, "claude-config");
|
||||
transcriptCwd = path.join(tempRoot, "where-claude-started");
|
||||
agentCwd = path.join(tempRoot, "agent-cwd");
|
||||
mkdirSync(paseoHomeRoot, { recursive: true });
|
||||
mkdirSync(agentCwd, { recursive: true });
|
||||
|
||||
const projectDir = claudeProjectDirSync(transcriptCwd, { configDir });
|
||||
mkdirSync(projectDir, { recursive: true });
|
||||
writeFileSync(
|
||||
path.join(projectDir, `${SESSION_ID}.jsonl`),
|
||||
[
|
||||
{
|
||||
type: "user",
|
||||
uuid: "user-uuid-1",
|
||||
sessionId: SESSION_ID,
|
||||
cwd: transcriptCwd,
|
||||
message: { role: "user", content: "hello from the original folder" },
|
||||
},
|
||||
{
|
||||
type: "assistant",
|
||||
sessionId: SESSION_ID,
|
||||
cwd: transcriptCwd,
|
||||
message: {
|
||||
role: "assistant",
|
||||
content: "reply from the original folder",
|
||||
},
|
||||
},
|
||||
]
|
||||
.map((entry) => `${JSON.stringify(entry)}\n`)
|
||||
.join(""),
|
||||
"utf8",
|
||||
);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await client?.close().catch(() => undefined);
|
||||
await daemon?.close().catch(() => undefined);
|
||||
client = undefined;
|
||||
daemon = undefined;
|
||||
rmSync(tempRoot, { recursive: true, force: true });
|
||||
}, 60_000);
|
||||
|
||||
async function startDaemon(): Promise<DaemonClient> {
|
||||
daemon = await createTestPaseoDaemon({
|
||||
paseoHomeRoot,
|
||||
cleanup: false,
|
||||
providerOverrides: {
|
||||
[PROVIDER_ID]: {
|
||||
extends: "claude",
|
||||
label: "Claude",
|
||||
env: { CLAUDE_CONFIG_DIR: configDir },
|
||||
},
|
||||
},
|
||||
});
|
||||
client = new DaemonClient({ url: `ws://127.0.0.1:${daemon.port}/ws` });
|
||||
await client.connect();
|
||||
await client.fetchAgents({ subscribe: {} });
|
||||
return client;
|
||||
}
|
||||
|
||||
async function stopDaemon(): Promise<void> {
|
||||
await client?.close();
|
||||
await daemon?.close();
|
||||
client = undefined;
|
||||
daemon = undefined;
|
||||
}
|
||||
|
||||
test("an agent's timeline survives a daemon restart", async () => {
|
||||
const firstClient = await startDaemon();
|
||||
const agent = await firstClient.importAgent({
|
||||
provider: PROVIDER_ID,
|
||||
sessionId: SESSION_ID,
|
||||
cwd: agentCwd,
|
||||
});
|
||||
await stopDaemon();
|
||||
|
||||
const restartedClient = await startDaemon();
|
||||
const timeline = await restartedClient.fetchAgentTimeline(agent.id, {
|
||||
direction: "tail",
|
||||
limit: 0,
|
||||
projection: "canonical",
|
||||
});
|
||||
|
||||
const text = timelineText(timeline.entries);
|
||||
expect(text).toContain("hello from the original folder");
|
||||
expect(text).toContain("reply from the original folder");
|
||||
}, 60_000);
|
||||
});
|
||||
@@ -60,7 +60,7 @@ describe("daemon E2E (real claude) - thinking effort memory", () => {
|
||||
}
|
||||
});
|
||||
|
||||
test("changing thinking effort preserves the previous conversation", async () => {
|
||||
test("concurrent command discovery and thinking changes preserve replies and conversation", async () => {
|
||||
const logger = pino({ level: "silent" });
|
||||
const cwd = tmpCwd();
|
||||
const daemon = await createTestPaseoDaemon({
|
||||
@@ -88,10 +88,13 @@ describe("daemon E2E (real claude) - thinking effort memory", () => {
|
||||
model: model.id,
|
||||
});
|
||||
|
||||
await client.sendMessage(
|
||||
agent.id,
|
||||
"Remember the code phrase PASEO_MEMORY_56. Reply exactly: ACK_56",
|
||||
);
|
||||
await Promise.all([
|
||||
client.listCommands(agent.id),
|
||||
client.sendMessage(
|
||||
agent.id,
|
||||
"Remember the code phrase PASEO_MEMORY_56. Reply exactly: ACK_56",
|
||||
),
|
||||
]);
|
||||
const firstFinish = await client.waitForFinish(agent.id, 180_000);
|
||||
expect(firstFinish.status).toBe("idle");
|
||||
expect(firstFinish.final?.lastError).toBeUndefined();
|
||||
@@ -99,16 +102,25 @@ describe("daemon E2E (real claude) - thinking effort memory", () => {
|
||||
|
||||
await client.setAgentThinkingOption(agent.id, "low");
|
||||
|
||||
await client.sendMessage(
|
||||
agent.id,
|
||||
"What code phrase did I ask you to remember? Reply exactly with that code phrase and nothing else.",
|
||||
);
|
||||
await Promise.all([
|
||||
client.listCommands(agent.id),
|
||||
client.sendMessage(
|
||||
agent.id,
|
||||
"What code phrase did I ask you to remember? Reply exactly with that code phrase and nothing else.",
|
||||
),
|
||||
]);
|
||||
const secondFinish = await client.waitForFinish(agent.id, 180_000);
|
||||
expect(secondFinish.status).toBe("idle");
|
||||
expect(secondFinish.final?.lastError).toBeUndefined();
|
||||
|
||||
const assistantText = await getAssistantText(client, agent.id);
|
||||
expect(compactText(assistantText)).toContain("paseo_memory_56");
|
||||
|
||||
await client.sendMessage(agent.id, "Reply exactly: FOLLOWUP_56");
|
||||
const followup = await client.waitForFinish(agent.id, 180_000);
|
||||
expect(followup.status).toBe("idle");
|
||||
expect(followup.final?.lastError).toBeUndefined();
|
||||
expect(compactText(await getAssistantText(client, agent.id))).toContain("followup_56");
|
||||
} finally {
|
||||
await client.close().catch(() => undefined);
|
||||
await daemon.close().catch(() => undefined);
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
// Local ACP peer for the bundled Hoplite adapter; no Hoplite service or credentials.
|
||||
const fs = require("node:fs");
|
||||
const readline = require("node:readline");
|
||||
fs.appendFileSync(process.env.HOPLITE_TEST_RECORD, "launch\n");
|
||||
const configOptions = [
|
||||
{
|
||||
id: "model",
|
||||
category: "model",
|
||||
type: "select",
|
||||
name: "Model",
|
||||
currentValue: "fixture-model",
|
||||
options: [{ value: "fixture-model", name: "Fixture model" }],
|
||||
},
|
||||
];
|
||||
const send = (message) =>
|
||||
process.stdout.write(JSON.stringify({ jsonrpc: "2.0", ...message }) + "\n");
|
||||
readline.createInterface({ input: process.stdin }).on("line", (line) => {
|
||||
const request = JSON.parse(line);
|
||||
if (request.id === undefined) return;
|
||||
let result = {};
|
||||
if (request.method === "initialize")
|
||||
result = { protocolVersion: 1, agentCapabilities: {}, authMethods: [] };
|
||||
if (request.method === "session/new" && request.params.cwd !== process.env.HOPLITE_TEST_CWD) {
|
||||
send({
|
||||
id: request.id,
|
||||
error: { code: -32602, message: "No Hoplite project for this directory" },
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (request.method === "session/new")
|
||||
result = {
|
||||
sessionId: "hoplite-fixture",
|
||||
configOptions,
|
||||
};
|
||||
if (request.method === "session/set_config_option") result = { configOptions };
|
||||
if (request.method === "session/prompt") {
|
||||
send({
|
||||
method: "_hoplite/run_phase",
|
||||
params: { runId: "fixture-run", phase: "provisioning", label: "Preparing fixture workspace" },
|
||||
});
|
||||
result = { stopReason: "end_turn" };
|
||||
}
|
||||
send({ id: request.id, result });
|
||||
});
|
||||
@@ -1,8 +1,7 @@
|
||||
import { describe, test, expect } from "vitest";
|
||||
import { mkdtemp, rm, readFile, writeFile } from "node:fs/promises";
|
||||
import { mkdtemp, rm } from "node:fs/promises";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { loadConfig } from "../config.js";
|
||||
import { findExecutable } from "../../executable-resolution/executable-resolution.js";
|
||||
import { BuiltinPluginLoader } from "../plugins/builtin/index.js";
|
||||
import { createTestPaseoDaemon } from "../test-utils/paseo-daemon.js";
|
||||
@@ -166,133 +165,3 @@ test("Antigravity creates an agent and answers a prompt with real agy", async ({
|
||||
await rm(cwd, { recursive: true, force: true });
|
||||
}
|
||||
}, 120000);
|
||||
|
||||
test("bundled Hoplite requires a config entry and removal survives restart", async () => {
|
||||
const root = await mkdtemp(path.join(os.tmpdir(), "paseo-hoplite-optin-"));
|
||||
const record = path.join(root, "launches.txt");
|
||||
await writeFile(record, "");
|
||||
const options = {
|
||||
paseoHomeRoot: root,
|
||||
cleanup: false,
|
||||
mcpEnabled: false,
|
||||
builtinPlugins: new BuiltinPluginLoader(undefined, [
|
||||
"hoplite-provider",
|
||||
"antigravity-provider",
|
||||
]),
|
||||
};
|
||||
let daemon = await createTestPaseoDaemon(options);
|
||||
const connect = async () => {
|
||||
const client = new DaemonClient({
|
||||
url: `ws://127.0.0.1:${daemon.port}/ws`,
|
||||
appVersion: "0.11.2",
|
||||
});
|
||||
await client.connect();
|
||||
await client.fetchAgents({ subscribe: {} });
|
||||
return client;
|
||||
};
|
||||
let client = await connect();
|
||||
try {
|
||||
const before = await client.getProvidersSnapshot();
|
||||
expect(before.entries.some((entry) => entry.provider === "hoplite")).toBe(false);
|
||||
expect(before.entries.some((entry) => entry.provider === "antigravity")).toBe(true);
|
||||
expect(await readFile(record, "utf8")).toBe("");
|
||||
|
||||
await client.patchDaemonConfig({
|
||||
providers: {
|
||||
hoplite: {
|
||||
enabled: true,
|
||||
command: [process.execPath, path.resolve(import.meta.dirname, "hoplite-fixture.cjs")],
|
||||
env: { HOPLITE_TEST_RECORD: record, HOPLITE_TEST_CWD: root },
|
||||
},
|
||||
},
|
||||
});
|
||||
const globalModels = await client.listProviderModels("hoplite");
|
||||
expect(globalModels.error).toBeNull();
|
||||
expect(globalModels.models).toEqual([]);
|
||||
await expect
|
||||
.poll(
|
||||
async () =>
|
||||
(await client.getProvidersSnapshot()).entries.find(
|
||||
(entry) => entry.provider === "hoplite",
|
||||
)?.status,
|
||||
)
|
||||
.toBe("ready");
|
||||
const workspaceModels = await client.listProviderModels("hoplite", { cwd: root });
|
||||
expect(workspaceModels.error).toBeNull();
|
||||
expect(workspaceModels.models.map((model) => model.id)).toEqual(["fixture-model"]);
|
||||
await client.refreshProvidersSnapshot({ providers: ["hoplite"] });
|
||||
expect((await client.listProviderModels("hoplite")).models).toEqual([]);
|
||||
expect(
|
||||
(await client.listProviderModels("hoplite", { cwd: root })).models.map((model) => model.id),
|
||||
).toEqual(["fixture-model"]);
|
||||
const agent = await client.createAgent({
|
||||
provider: "hoplite",
|
||||
cwd: root,
|
||||
model: "fixture-model",
|
||||
});
|
||||
await client.sendMessage(agent.id, "Exercise the contributor transformer");
|
||||
await client.waitForFinish(agent.id, 10000);
|
||||
const timeline = await client.fetchAgentTimeline(agent.id, { limit: 100 });
|
||||
expect(timeline.entries.map((entry) => entry.item)).toContainEqual(
|
||||
expect.objectContaining({
|
||||
type: "tool_call",
|
||||
name: "Hoplite workspace",
|
||||
status: "completed",
|
||||
}),
|
||||
);
|
||||
await client.archiveAgent(agent.id);
|
||||
expect(await readFile(record, "utf8")).toContain("launch");
|
||||
|
||||
await client.patchDaemonConfig({ providers: { hoplite: { enabled: false } } });
|
||||
expect(
|
||||
(await client.getProvidersSnapshot()).entries.find((entry) => entry.provider === "hoplite")
|
||||
?.enabled,
|
||||
).toBe(false);
|
||||
await client.close();
|
||||
await daemon.close();
|
||||
daemon = await createTestPaseoDaemon({
|
||||
...options,
|
||||
staticDir: daemon.staticDir,
|
||||
providerOverrides: loadConfig(daemon.paseoHome, { env: {} }).providerOverrides,
|
||||
});
|
||||
client = await connect();
|
||||
expect(
|
||||
(await client.getProvidersSnapshot()).entries.find((entry) => entry.provider === "hoplite")
|
||||
?.enabled,
|
||||
).toBe(false);
|
||||
await client.patchDaemonConfig({ removeProviders: ["hoplite"] });
|
||||
expect(
|
||||
(await client.getProvidersSnapshot()).entries.some((entry) => entry.provider === "hoplite"),
|
||||
).toBe(false);
|
||||
expect((await client.getDaemonConfig()).config.providers?.hoplite).toBeUndefined();
|
||||
const persisted = JSON.parse(
|
||||
await readFile(path.join(daemon.paseoHome, "config.json"), "utf8"),
|
||||
);
|
||||
expect(persisted.agents?.providers?.hoplite).toBeUndefined();
|
||||
const launchesAfterRemoval = await readFile(record, "utf8");
|
||||
await client.close();
|
||||
await daemon.close();
|
||||
daemon = await createTestPaseoDaemon({
|
||||
...options,
|
||||
staticDir: daemon.staticDir,
|
||||
providerOverrides: loadConfig(daemon.paseoHome, { env: {} }).providerOverrides,
|
||||
});
|
||||
client = await connect();
|
||||
const restarted = await client.getProvidersSnapshot();
|
||||
expect(restarted.entries.some((entry) => entry.provider === "hoplite")).toBe(false);
|
||||
expect(restarted.entries.map((entry) => entry.provider)).toEqual(
|
||||
before.entries.map((entry) => entry.provider),
|
||||
);
|
||||
expect(await readFile(record, "utf8")).toBe(launchesAfterRemoval);
|
||||
await client.patchDaemonConfig({ providers: { hoplite: { enabled: false } } });
|
||||
expect(
|
||||
(await client.getProvidersSnapshot()).entries.find((entry) => entry.provider === "hoplite")
|
||||
?.enabled,
|
||||
).toBe(false);
|
||||
} finally {
|
||||
await client.close();
|
||||
await daemon.close();
|
||||
await rm(root, { recursive: true, force: true });
|
||||
await rm(daemon.staticDir, { recursive: true, force: true });
|
||||
}
|
||||
}, 60000);
|
||||
|
||||
@@ -9,7 +9,6 @@ export const builtinPlugins = [
|
||||
"copilot-usage-source",
|
||||
"cursor-usage-source",
|
||||
"grok-usage-source",
|
||||
"hoplite-provider",
|
||||
"kimi-usage-source",
|
||||
"minimax-usage-source",
|
||||
"muse-provider",
|
||||
|
||||
@@ -629,7 +629,6 @@ export class PluginService {
|
||||
label: provider.label,
|
||||
description: provider.description,
|
||||
command: provider.command,
|
||||
requiresConfiguration: provider.requiresConfiguration,
|
||||
status: provider.hasStatus
|
||||
? (request) => {
|
||||
if (!this.runtime.getProviderStatus)
|
||||
|
||||
@@ -14,7 +14,6 @@ import {
|
||||
import { z } from "zod";
|
||||
|
||||
export interface PluginProviderMetadata {
|
||||
requiresConfiguration?: boolean;
|
||||
hasCatalogCacheKey?: boolean;
|
||||
hasStatus?: boolean;
|
||||
command?: readonly [string, ...string[]];
|
||||
@@ -113,7 +112,6 @@ const providerMetadataSchema = z
|
||||
label: z.string().min(1),
|
||||
description: z.string().optional(),
|
||||
iconPath: z.string().optional(),
|
||||
requiresConfiguration: z.boolean().optional(),
|
||||
hasCatalogCacheKey: z.boolean().optional(),
|
||||
hasStatus: z.boolean().optional(),
|
||||
command: z.tuple([z.string().min(1)], z.string()).optional(),
|
||||
|
||||
@@ -158,7 +158,6 @@ export function createPluginWorker(options: {
|
||||
label: provider.label,
|
||||
description: provider.description,
|
||||
iconPath: provider.icon,
|
||||
requiresConfiguration: provider.requiresConfiguration,
|
||||
hasCatalogCacheKey: provider.getCatalogCacheKey !== undefined,
|
||||
hasStatus: provider.status !== undefined,
|
||||
command: provider.command,
|
||||
|
||||
@@ -239,7 +239,6 @@ export function createProviderSnapshotManagerStub(): {
|
||||
const off = vi.fn();
|
||||
const destroy = vi.fn<ProviderSnapshotManager["destroy"]>();
|
||||
const stub = {
|
||||
supportsConfigRequiredProvider: () => false,
|
||||
getSnapshot,
|
||||
refreshSnapshotForCwd,
|
||||
refreshSettingsSnapshot,
|
||||
|
||||
@@ -1141,7 +1141,6 @@ describe("relay external socket reconnect behavior", () => {
|
||||
expect(serverInfo.features?.stableProjectIdentity).toBe(true);
|
||||
expect(serverInfo.features?.canonicalSubmittedPrompts).toBe(true);
|
||||
expect(serverInfo.features?.providersSnapshotCwd).toBe(true);
|
||||
expect(serverInfo.features?.hopliteProvider).toBe(false);
|
||||
expect(serverInfo.features?.pluginLogs).toBe(true);
|
||||
expect(serverInfo.features?.workspaceMarkUnread).toBe(true);
|
||||
expect(serverInfo.features?.["terminal-input-mode-replay"]).toBe(true);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user