Compare commits

..
Author SHA1 Message Date
paseo-bot[bot] 919700c6a2 test(opencode): reproduce #6006, a model OpenCode 2 dropped stays in the picker and fails to apply
Run with OPENCODE_V2_BIN pointing at an OpenCode 2.x binary. Fails on main.
2026-10-06 22:59:55 +02:00
125 changed files with 1011 additions and 3748 deletions
+8 -54
View File
@@ -1,34 +1,12 @@
# Changelog
## 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))
@@ -38,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))
@@ -73,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))
@@ -99,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))
@@ -120,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))
@@ -139,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))
@@ -168,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))
+9 -21
View File
@@ -39,33 +39,21 @@
<img src="https://paseo.sh/mobile-mockup.png" alt="Paseo mobile app" width="100%">
</p>
Paseo is a desktop, mobile, web, and CLI app for coding agents. Open the desktop app and work: agents, editor, terminals, diffs, pull requests, and a browser in one window. Run many agents at once, each in its own worktree, on one machine or several. The mobile app is the full app, native on iOS and Android.
Run agents in parallel on your own machines. Ship from your phone or your desk.
- **Parallel agents:** Run many agents at once, each in its own worktree.
- **Built-in orchestration:** Agents in Paseo can create worktrees, launch other agents, and talk to them, across providers.
- **Full IDE:** Edit files, review diffs, open pull requests, and run terminals, in split panes you arrange how you want.
- **Self-hosted:** Agents run on your machine with your full dev environment. Use your tools, your configs, and your skills.
- **Multi-provider:** Claude Code, Codex, Copilot, OpenCode, Pi, Antigravity, and Muse Code through the same interface. Pick the right model for each job.
- **Voice control:** Dictate tasks or talk through problems in voice mode. Hands-free when you need it.
- **Cross-device:** iOS, Android, desktop, web, and CLI. Start work at your desk, check in from your phone, script it from the terminal.
- **Privacy-first:** Paseo doesn't have any telemetry, tracking, or forced log-ins.
[Run parallel tasks in Paseo](https://paseo.sh/docs/parallel-development): start agents in separate worktrees, review their diffs, run each app, and check it in the built-in browser.
## Plugins
Plugins run on the daemon and show up in every client you connect, with the same UI on desktop, web,
iOS, and Android. Write a plugin once and it is on your phone.
Add themes, workspace panels, commands, settings screens, and coding-agent providers with trusted
TypeScript plugins. Install from npm, Git, or a local directory with `paseo plugin install <source>`.
- **UI:** screens, sidebar items, workspace panels, Command Center items, slash commands, composer pills, attachment sources, timeline items, themes.
- **Agent lifecycle:** change configuration, environment, and MCP servers, answer permissions, follow up when a turn ends.
- **Providers:** add a coding agent as a provider.
Install from the registry with `paseo plugin add owner/slug`, or from Git or a local directory.
**[Browse plugins](https://paseo.sh/plugins)** · **[Plugin docs](https://paseo.sh/docs/plugins)**
Plugins run with access to your daemon machine and inside connected clients; install only code you trust.
Start with the [plugin quickstart](https://paseo.sh/docs/plugins). Plugins run with access to your daemon
machine and inside connected clients; install only code you trust.
## Getting Started
@@ -89,16 +77,16 @@ Download it from [paseo.sh/download](https://paseo.sh/download) or the [GitHub r
To connect from your phone, open **Settings → your host → Pair Device**.
### Server
### CLI / headless
For a server, a VM, or any machine without the desktop app. Install the CLI and start the daemon:
Install the CLI and start Paseo:
```bash
npm install -g @getpaseo/cli
paseo
```
Paseo starts, then asks whether to enable the end-to-end encrypted relay for device pairing. If you decline, connect directly over TCP, Tailscale, or another VPN. The desktop, mobile, and web apps connect to this daemon like any other host.
Paseo starts locally, then asks whether to enable the end-to-end encrypted relay for device pairing. If you decline, connect directly over TCP, Tailscale, or another VPN. This path is useful for servers and remote machines.
For full setup and configuration, see:
@@ -209,7 +197,7 @@ npm run typecheck
## Sponsors
Paseo is an independent project used by tens of thousands of developers daily, built by one person and funded by the people who use it. Support the work on [GitHub Sponsors](https://github.com/sponsors/boudra). Companies can [sponsor Paseo](https://paseo.sh/sponsor#spot) monthly and have their logo shown here and on the paseo.sh homepage.
Paseo is built by one person and funded by the people who use it. Support the work on [GitHub Sponsors](https://github.com/sponsors/boudra). Companies can [sponsor Paseo](https://paseo.sh/sponsor#spot) monthly and have their logo shown here and on the paseo.sh homepage.
<!-- Sponsor logos go here, in the same order as packages/website/src/data/sponsors.ts -->
+1 -2
View File
@@ -197,11 +197,10 @@ Claude Code announces subagent lifecycle on the SDK stream (`task_started` / `ta
- **Not every announced task belongs in the track.** Task subagents announce as `local_agent` and workflows as `local_workflow`; a backgrounded shell announces as `local_bash` with the same `tool_use_id` shape, and ambient housekeeping sets `skip_transcript`. The Claude provider normalizes a workflow to a generic provider-subagent descriptor titled `Workflow`, using Claude's summary as its description and timeline opener. Shared storage, protocol, and UI do not distinguish it from another provider subagent.
- **A task that was never declared gets no descriptor, by any route.** Filtered tasks still emit `task_notification`s carrying a `tool_use_id`, and still emit frames carrying `parent_tool_use_id`. Attributing either produces a descriptor with no identity and a defaulted `running` status — a nameless row that never finishes. Status, presentation updates, and sidechain frames all route through the declaration table.
- **Task ids are session-scoped, not turn-scoped.** Cancelling a turn must not clear the routing table: a backgrounded child settles after the interrupt and needs its descriptor to still exist. Cancellation instead terminalizes the declared children that were running in the foreground, and a later `task_notification` is free to correct that guess. Backgrounded children are identified by `is_backgrounded` on `task_started` (set at spawn; a resumed subagent is always background) or, when moved there later, on `task_updated.patch`.
- **Task ids are session-scoped, not turn-scoped.** Cancelling a turn must not clear the routing table: a backgrounded child settles after the interrupt and needs its descriptor to still exist. Cancellation instead terminalizes the declared children that were running in the foreground, and a later `task_notification` is free to correct that guess. Backgrounded children are identified by `task_updated.patch.is_backgrounded`.
- **A resumed task can be announced again with a new `tool_use_id`.** The first Task tool id remains the canonical descriptor and later ids are routing aliases for the same session-scoped task. The resumed prompt is added to that child timeline.
- **Effort is only reachable through hooks.** It appears nowhere on the message stream at any depth, and the level Paseo requests is not necessarily the level that runs — a model that does not support it is silently downgraded. A hook firing inside a subagent reports the active post-downgrade level next to its `agent_id`, which is the same id `task_started` calls `task_id`.
- **Backgrounded subagents emit no frames carrying `parent_tool_use_id` at all.** Everything keyed off that field sees nothing for one; they are visible only because the task protocol announces them.
- **Only `system/init` and `result` bracket a main-session turn.** Background subagents emit neither on the main stream, while their task frames, their own background jobs' `task_notification`, and `rate_limit_event` arrive with no `parent_tool_use_id`, the same shape as main-session work. `session_state_changed` stays `running` for as long as any background subagent lives (Claude Code 2.1.280), so it cannot open a turn; its `idle` can close one.
- **Nested ownership comes from the launching sidechain, not `spawn_depth` alone.** A sidechain's Agent or Bash tool call records the direct owner of that `tool_use_id`; the following `task_started` inherits it. This routes a grandchild descriptor and child-owned background notifications without relying on labels or flattening them into the managed parent.
- **On replay, `<session>/subagents/` holds every descendant beside the root.** Resolve the tree one proven generation at a time: the root transcript admits direct children, then each admitted sidechain transcript admits its children by `toolUseId`. `spawnDepth` orders candidates but does not establish ownership. Unresolved sidecars remain excluded as ambient or unrelated work.
- **Replay `totalTokens` is a context-size reading, not cumulative spend.** Claude Code finalizes a subagent by summing the _last_ assistant message's usage block and shipping that as `usage.total_tokens`. Summing per-entry usage instead multiplies the cached prefix by the turn count and reports a number several times larger than the live path.
+1 -1
View File
@@ -103,7 +103,7 @@ OpenCode owns user message IDs. Do not pass Paseo-generated IDs to OpenCode prom
Active-turn steering is an optional `AgentSession.steerActiveTurn` operation. The manager owns admission against its exact foreground turn, canonical user-message creation, echo reconciliation, and falls back to the normal interrupt-and-replace path only when the adapter reports `unavailable`. An adapter error leaves the steer's fate ambiguous and must surface without an interrupt or retry. Codex calls `turn/steer` with the native expected turn and Paseo client user-message ID. Claude pushes an admitted steer into the exact active SDK query input; isolated control commands remain unavailable. OpenCode calls `session/prompt_async` with an OpenCode-generated message ID; the server queues the prompt while busy and the next LLM call in the same Paseo turn includes it. Pi sends its native `steer` RPC, which queues the message for delivery after the in-flight assistant turn's tool calls. Slash-command inputs report `unavailable` because pi rejects extension commands on the steer path, and echo identity is correlated by message text because pi's steer RPC takes no message ID. A missing session reports `unavailable` and uses the normal interrupt fallback.
A steering adapter also owes its interrupt: stopping a turn must discard the steers the provider has not read yet, or one of them resumes the turn the user just stopped. Codex clears pending input when it aborts a turn; Claude does not, so its adapter cancels the SDK messages it queued before calling `query.interrupt()`. It calls `query.interrupt()` only while a main-session turn is in flight (between `system/init` and that turn's `result`): with the main session idle, an interrupt reaches only background subagents and no result follows it, so the adapter withdraws its unstarted messages and stops there. The adapter also declares `perTaskStopAffordance`, because without it the CLI kills every background subagent on interrupt. Pi requires `clear_queue` before `abort`; older binaries without that RPC retain their native queue behavior until the pi compatibility floor reaches 0.84.4.
A steering adapter also owes its interrupt: stopping a turn must discard the steers the provider has not read yet, or one of them resumes the turn the user just stopped. Codex clears pending input when it aborts a turn; Claude does not, so its adapter cancels the SDK messages it queued before calling `query.interrupt()`. Pi requires `clear_queue` before `abort`; older binaries without that RPC retain their native queue behavior until the pi compatibility floor reaches 0.84.4.
`SteerActiveTurnOptions.clearPendingPermissions` makes permission release part of the provider contract. A provider that accepts such a steer queues it first, denies permissions blocking its delivery, and stops once the steer is read. Steers without the flag leave permissions open. A denied plan remains in the timeline because the pending card was the only other copy of its text.
@@ -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 -1
View File
@@ -1 +1 @@
sha256-AKY6OMZgHeyn/To/2zsmtfb5C4fKniUp8gvpEYaR7/o=
sha256-zL3+gbScK8eMkjQUtKDX4UJTXt4BMeqMSyeWB017MA4=
+28 -28
View File
@@ -1,12 +1,12 @@
{
"name": "paseo",
"version": "0.11.2",
"version": "0.11.0-beta.5",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "paseo",
"version": "0.11.2",
"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.2",
"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.2",
"version": "0.11.0-beta.5",
"dependencies": {
"@clack/prompts": "^1.0.0",
"@getpaseo/client": "0.11.2",
"@getpaseo/protocol": "0.11.2",
"@getpaseo/server": "0.11.2",
"@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.2",
"version": "0.11.0-beta.5",
"dependencies": {
"@getpaseo/protocol": "0.11.2",
"@getpaseo/relay": "0.11.2",
"@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.2",
"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.2",
"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.2",
"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.2",
"version": "0.11.0-beta.5",
"dependencies": {
"@agentclientprotocol/sdk": "^1.4.0",
"use-sync-external-store": "^1.6.0"
},
"devDependencies": {
"@getpaseo/client": "0.11.2",
"@getpaseo/protocol": "0.11.2",
"@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.2",
"@getpaseo/protocol": "0.11.2",
"@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.2",
"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.2",
"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.2",
"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.2",
"@getpaseo/highlight": "0.11.2",
"@getpaseo/plugin": "0.11.2",
"@getpaseo/protocol": "0.11.2",
"@getpaseo/relay": "0.11.2",
"@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.2",
"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.2",
"version": "0.11.0-beta.5",
"dependencies": {
"@getpaseo/plugin": "*",
"zod": "^4.4.3"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "paseo",
"version": "0.11.2",
"version": "0.11.0-beta.5",
"private": true,
"description": "Paseo: voice-controlled development environment for local AI coding agents",
"keywords": [
@@ -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"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/app",
"version": "0.11.2",
"version": "0.11.0-beta.5",
"private": true,
"main": "index.ts",
"scripts": {
@@ -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) => {
@@ -3047,34 +3047,6 @@ describe("HostRuntimeStore", () => {
useSessionStore.getState().clearSession(host.serverId);
});
it("drains a queued message as a steer so a turn the agent just started is not interrupted", async () => {
const host = makeHost({ serverId: "srv_steer_queue_drain" });
const fakeClient = new FakeDaemonClient();
const store = new HostRuntimeStore({
deps: {
createClient: () => fakeClient as unknown as DaemonClient,
connectToDaemon: async () => ({
client: fakeClient as unknown as DaemonClient,
serverId: host.serverId,
hostname: null,
}),
getClientId: async () => "cid_steer_queue_drain",
},
});
const sessionStore = useSessionStore.getState();
sessionStore.initializeSession(host.serverId, fakeClient as unknown as DaemonClient, 1);
sessionStore.setQueuedMessages(
host.serverId,
new Map([["agent", [{ id: "queued", text: "next task", attachments: [] }]]]),
);
store.drainQueuedAgentMessage(host.serverId, "agent");
await fakeClient.waitForSentMessages(1);
expect(fakeClient.sentAgentMessages[0]?.[2]?.activeTurnBehavior).toBe("steer");
sessionStore.clearSession(host.serverId);
});
it("uses legacy GitHub attachments when draining a queue for an old daemon", async () => {
const host = makeHost({ serverId: "srv_legacy_queue_attachment" });
const fakeClient = new FakeDaemonClient();
-5
View File
@@ -2426,11 +2426,6 @@ export class HostRuntimeStore {
}),
encodeImages,
submission: createMessageSubmissionWriter(serverId),
// The queue drains when the agent goes idle, but the agent can start a turn of its own
// in that same moment (a wake-up after background work). Steering folds the message
// into that turn instead of interrupting it; with no turn running, the daemon starts
// a normal one.
activeTurnBehavior: "steer",
});
},
})
@@ -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);
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/cli",
"version": "0.11.2",
"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.2",
"@getpaseo/protocol": "0.11.2",
"@getpaseo/server": "0.11.2",
"@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",
@@ -93,8 +93,6 @@ describe("plugin scaffold", () => {
expect(JSON.parse(await readFile(path.join(directory, "paseo-plugin.json"), "utf8"))).toEqual(
{
id: "hello-plugin",
$comment: expect.stringContaining('"icon": "assets/icon.png"'),
media: [],
requirements: { paseo: `>=${cliPackageJson.version}` },
},
);
+1 -11
View File
@@ -206,17 +206,7 @@ export async function scaffoldPluginDirectory(
const files = new Map<string, string>([
[
"paseo-plugin.json",
`${JSON.stringify(
{
id,
$comment:
'Add "name": "My plugin" to set a display name. Add "icon": "assets/icon.png" for a PNG inside the package. Add image or video paths (relative to this manifest) or HTTPS URLs to media. Include local assets in package.json files.',
media: [],
requirements: { paseo: `>=${version}` },
},
null,
2,
)}\n`,
`${JSON.stringify({ id, requirements: { paseo: `>=${version}` } }, null, 2)}\n`,
],
["OVERVIEW.md", OVERVIEW],
["package.json", `${JSON.stringify(packageJson, null, 2)}\n`],
+3 -8
View File
@@ -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");
}
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/client",
"version": "0.11.2",
"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.2",
"@getpaseo/relay": "0.11.2",
"@getpaseo/protocol": "0.11.0-beta.5",
"@getpaseo/relay": "0.11.0-beta.5",
"zod": "^4.4.3"
},
"devDependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/desktop",
"version": "0.11.2",
"version": "0.11.0-beta.5",
"private": true,
"description": "Paseo desktop app (Electron wrapper)",
"homepage": "https://paseo.sh",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/expo-two-way-audio",
"version": "0.11.2",
"version": "0.11.0-beta.5",
"description": "Native module for two way audio streaming",
"keywords": [
"ExpoTwoWayAudio",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/highlight",
"version": "0.11.2",
"version": "0.11.0-beta.5",
"files": [
"dist",
"!dist/**/*.map",
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/plugin",
"version": "0.11.2",
"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.2",
"@getpaseo/protocol": "0.11.2",
"@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.2",
"@getpaseo/protocol": "0.11.2",
"@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"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/protocol",
"version": "0.11.2",
"version": "0.11.0-beta.5",
"description": "Paseo shared protocol schemas and wire types",
"files": [
"dist",
@@ -23,27 +23,6 @@ describe("plugin protocol compatibility", () => {
expect(SessionOutboundMessageSchema.parse(message)).toEqual(message);
},
);
it("preserves manifest metadata in plugin list responses", () => {
const message = {
type: "plugin.list.response",
payload: {
requestId: "metadata",
plugins: [
{
id: "review",
name: "Review tools",
icon: "assets/icon.png",
media: ["screenshot.png", "https://example.com/demo.mp4"],
path: "/plugins/review",
enabled: false,
status: "disabled",
},
],
},
};
expect(SessionOutboundMessageSchema.parse(message)).toEqual(message);
});
it("parses plugin timeline append messages and advertises the capability", () => {
expect(
SessionInboundMessageSchema.parse({
-3
View File
@@ -6632,9 +6632,6 @@ export const PluginNpmInstallationSchema = z.object({
export const PluginListItemSchema = z.object({
id: PluginIdSchema,
name: z.string().optional(),
icon: z.string().optional(),
media: z.array(z.string()).optional(),
description: z.string().optional(),
path: z.string(),
enabled: z.boolean(),
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/relay",
"version": "0.11.2",
"version": "0.11.0-beta.5",
"description": "Paseo relay for bridging daemon and client connections",
"files": [
"dist",
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/server",
"version": "0.11.2",
"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.2",
"@getpaseo/highlight": "0.11.2",
"@getpaseo/plugin": "0.11.2",
"@getpaseo/protocol": "0.11.2",
"@getpaseo/relay": "0.11.2",
"@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",
@@ -628,11 +628,6 @@ export interface AgentCreateSessionOptions {
* Defaults to true. Providers that cannot honor false should no-op.
*/
persistSession?: boolean;
/**
* Model ids added by provider configuration (`models` / `additionalModels`).
* Providers that validate against runtime-advertised models must accept these.
*/
configuredModelIds?: readonly string[];
}
/** What a resumed session is for: driving the agent, or reading what it already did. */
@@ -642,8 +637,6 @@ export type AgentResumePurpose = "interactive" | "history";
export interface AgentResumeSessionOptions {
/** Defaults to interactive. History loading may be read-only for archived native sessions. */
purpose?: AgentResumePurpose;
/** See AgentCreateSessionOptions.configuredModelIds. */
configuredModelIds?: readonly string[];
}
/**
@@ -723,57 +723,6 @@ describe("AgentStreamCoalescer", () => {
]);
});
test("keeps a known tool call detail when a later update in the window has none", () => {
const { coalescer, flushes } = createHarness();
primeLeadingEdge(coalescer, flushes);
coalescer.handle(
"agent-1",
timeline({
type: "tool_call",
callId: "agent-call",
name: "Task",
status: "running",
error: null,
detail: {
type: "sub_agent",
subAgentType: "general-purpose",
description: "List files",
log: "",
actions: [],
},
}),
);
coalescer.handle(
"agent-1",
timeline({
type: "tool_call",
callId: "agent-call",
name: "Agent",
status: "completed",
error: null,
detail: { type: "unknown", input: { description: "List files" }, output: null },
}),
);
expect(flushes.map((flush) => flush.item)).toEqual([
{
type: "tool_call",
callId: "agent-call",
name: "Agent",
status: "completed",
error: null,
detail: {
type: "sub_agent",
subAgentType: "general-purpose",
description: "List files",
log: "",
actions: [],
},
},
]);
});
test("preserves mixed text and tool call arrival order within a flush", async () => {
const { coalescer, flushes } = createHarness();
primeLeadingEdge(coalescer, flushes);
@@ -1,5 +1,4 @@
import type { AgentProvider, AgentStreamEvent, AgentTimelineItem } from "./agent-sdk-types.js";
import { mergeToolCallItems } from "./timeline-projection.js";
export const AGENT_STREAM_COALESCE_DEFAULT_WINDOW_MS = 60;
@@ -184,16 +183,9 @@ export class AgentStreamCoalescer {
}
const existingIndex = buffer.toolCallEntryIndexes.get(event.item.callId);
const existing = existingIndex !== undefined ? buffer.entries[existingIndex] : undefined;
// Merge rather than replace, so an update that carries less (an unknown detail after a
// labeled one) cannot erase what the timeline would have kept had both been flushed.
let item = event.item;
if (existing?.kind === "tool_call") {
item = mergeToolCallItems(existing.item, event.item);
}
const entry: PendingToolCallEntry = {
kind: "tool_call",
item,
item: event.item,
provider: event.provider,
...(event.turnId !== undefined ? { turnId: event.turnId } : {}),
};
@@ -492,7 +492,6 @@ function wrapClientProvider(
const listFeatures = inner.listFeatures?.bind(inner);
const archiveNativeSession = inner.archiveNativeSession?.bind(inner);
const unarchiveNativeSession = inner.unarchiveNativeSession?.bind(inner);
const configuredModelIds = [...profileModels, ...additionalModels].map((model) => model.id);
return {
provider,
@@ -510,7 +509,7 @@ function wrapClientProvider(
providerOptions: mergeProviderOptions(providerOptions, config.providerOptions),
},
launchContext,
{ ...options, configuredModelIds },
options,
),
),
resumeSession: async (handle, overrides, launchContext, options) =>
@@ -527,7 +526,7 @@ function wrapClientProvider(
providerOptions: mergeProviderOptions(providerOptions, overrides?.providerOptions),
},
launchContext,
{ ...options, configuredModelIds },
options,
),
),
fetchCatalog: async (options, context) => {
@@ -5,7 +5,7 @@ import { createRequire } from "node:module";
import { tmpdir } from "node:os";
import path from "node:path";
import { pathToFileURL } from "node:url";
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
import { afterEach, describe, expect, test, vi } from "vitest";
import {
AgentSideConnection,
ClientSideConnection,
@@ -54,10 +54,8 @@ import type { AgentStreamEvent } from "../agent-sdk-types.js";
import type {
AgentCapabilityFlags,
AgentPersistenceHandle,
AgentSession,
ProviderRefreshContext,
} from "../agent-sdk-types.js";
import { buildProviderRegistry } from "../provider-registry.js";
import { createTestLogger } from "../../../test-utils/test-logger.js";
import { buildStringCommandShellInvocation } from "../../../utils/string-command-shell.js";
import { asInternals } from "../../test-utils/class-mocks.js";
@@ -4372,151 +4370,3 @@ describe("ACPAgentSession close() with an unresponsive provider", () => {
expect(isProcessAlive(pid)).toBe(false);
}, 15_000);
});
// An ACP agent that advertises two models (or none, with ACP_ADVERTISE_MODELS=none) but,
// like Cline, runs any model id it is given.
const PERMISSIVE_MODEL_ACP_AGENT = `
import { Readable, Writable } from "node:stream";
const { AgentSideConnection, PROTOCOL_VERSION, ndJsonStream } = await import(process.env.ACP_SDK_URL);
let currentModelId = "advertised-default";
const modelState = () =>
process.env.ACP_ADVERTISE_MODELS === "none"
? undefined
: {
currentModelId,
availableModels: [
{ modelId: "advertised-default", name: "Advertised default" },
{ modelId: "advertised-other", name: "Advertised other" },
],
};
new AgentSideConnection(
() => ({
async initialize() {
return { protocolVersion: PROTOCOL_VERSION, agentCapabilities: { loadSession: true } };
},
async newSession() {
return { sessionId: "permissive-session", models: modelState() };
},
async loadSession() {
return { models: modelState() };
},
async unstable_setSessionModel({ modelId }) {
currentModelId = modelId;
return {};
},
async authenticate() {},
async cancel() {},
async prompt() {
return { stopReason: "end_turn" };
},
}),
ndJsonStream(Writable.toWeb(process.stdout), Readable.toWeb(process.stdin)),
);
`;
describe("custom ACP provider with configured models", () => {
let dir: string;
let agentScript: string;
let session: AgentSession | null = null;
beforeEach(async () => {
dir = await mkdtemp(path.join(tmpdir(), "paseo-acp-configured-models-"));
agentScript = path.join(dir, "agent.mjs");
await writeFile(agentScript, PERMISSIVE_MODEL_ACP_AGENT);
});
afterEach(async () => {
await session?.close();
session = null;
await rm(dir, { recursive: true, force: true });
});
function buildRegistry(
override: {
models?: Array<{ id: string; label: string }>;
additionalModels?: Array<{ id: string; label: string }>;
},
agentEnv: Record<string, string> = {},
) {
return buildProviderRegistry(createTestLogger(), {
providerOverrides: {
permissive: {
extends: "acp",
label: "Permissive",
command: [process.execPath, agentScript],
env: {
ACP_SDK_URL: pathToFileURL(
createRequire(import.meta.url).resolve("@agentclientprotocol/sdk"),
).href,
...agentEnv,
},
...override,
},
},
});
}
async function createSessionOnModel(
registry: ReturnType<typeof buildRegistry>,
model: string,
): Promise<AgentSession> {
const client = registry.permissive.createClient(createTestLogger());
session = await client.createSession({ provider: "permissive", cwd: dir, model });
return session;
}
test("runs on a model added through additionalModels that the agent does not advertise", async () => {
const registry = buildRegistry({
additionalModels: [{ id: "stealth/pixel-canary", label: "Pixel Canary" }],
});
const created = await createSessionOnModel(registry, "stealth/pixel-canary");
expect((await created.getRuntimeInfo()).model).toBe("stealth/pixel-canary");
});
test("runs on a model from a replacement models list that the agent does not advertise", async () => {
const registry = buildRegistry({
models: [{ id: "stealth/pixel-canary", label: "Pixel Canary" }],
});
const created = await createSessionOnModel(registry, "stealth/pixel-canary");
expect((await created.getRuntimeInfo()).model).toBe("stealth/pixel-canary");
});
test("runs on a model from additionalModels when the agent advertises no models", async () => {
const registry = buildRegistry(
{ additionalModels: [{ id: "stealth/pixel-canary", label: "Pixel Canary" }] },
{ ACP_ADVERTISE_MODELS: "none" },
);
const created = await createSessionOnModel(registry, "stealth/pixel-canary");
expect((await created.getRuntimeInfo()).model).toBe("stealth/pixel-canary");
});
test("resumes on a model added through additionalModels that the agent does not advertise", async () => {
const registry = buildRegistry({
additionalModels: [{ id: "stealth/pixel-canary", label: "Pixel Canary" }],
});
const client = registry.permissive.createClient(createTestLogger());
session = await client.resumeSession(
{ provider: "permissive", sessionId: "permissive-session", metadata: { cwd: dir } },
{ model: "stealth/pixel-canary" },
);
expect((await session.getRuntimeInfo()).model).toBe("stealth/pixel-canary");
});
test("keeps the agent's model when the requested model is neither advertised nor configured", async () => {
const registry = buildRegistry({
additionalModels: [{ id: "stealth/pixel-canary", label: "Pixel Canary" }],
});
const created = await createSessionOnModel(registry, "stale/removed-model");
expect((await created.getRuntimeInfo()).model).toBe("advertised-default");
});
});
@@ -77,7 +77,6 @@ import {
type AgentPromptContentBlock,
type AgentPromptInput,
type AgentResumePurpose,
type AgentCreateSessionOptions,
type AgentResumeSessionOptions,
type AgentRunOptions,
type AgentRunResult,
@@ -513,7 +512,6 @@ interface ACPAgentSessionOptions {
extensionCommandsParser?: ACPExtensionCommandsParser;
handle?: AgentPersistenceHandle;
resumePurpose?: AgentResumePurpose;
configuredModelIds?: readonly string[];
agentId?: string;
launchEnv?: Record<string, string>;
waitForInitialCommands?: boolean;
@@ -981,7 +979,6 @@ export class ACPAgentClient implements AgentClient {
async createSession(
config: AgentSessionConfig,
launchContext?: AgentLaunchContext,
options?: AgentCreateSessionOptions,
): Promise<AgentSession> {
this.assertProvider(config);
const providerOptions = ACPProviderOptionsSchema.parse(config.providerOptions ?? {});
@@ -1009,7 +1006,6 @@ export class ACPAgentClient implements AgentClient {
supportsMcpServers:
providerOptions.supportsMcpServers ?? this.capabilities.supportsMcpServers,
},
configuredModelIds: options?.configuredModelIds,
agentId: launchContext?.agentId,
launchEnv: launchContext?.env,
extensionCommandsParser: this.extensionCommandsParser,
@@ -1068,7 +1064,6 @@ export class ACPAgentClient implements AgentClient {
},
handle,
resumePurpose: options?.purpose,
configuredModelIds: options?.configuredModelIds,
agentId: launchContext?.agentId,
launchEnv: launchContext?.env,
extensionCommandsParser: this.extensionCommandsParser,
@@ -1697,7 +1692,6 @@ export class ACPAgentSession implements AgentSession, ACPClient {
configOptions: SessionConfigOption[],
) => SessionConfigOption[];
private readonly configFeatureOptions: ACPConfigFeatureOption[];
private readonly configuredModelIds: ReadonlySet<string>;
private readonly clientCapabilities?: ACPClientCapabilities;
private readonly clientCapabilityMeta?: ACPClientCapabilityMeta;
private readonly modeIdTransformer?: (modeId: string) => string | null;
@@ -1766,7 +1760,6 @@ export class ACPAgentSession implements AgentSession, ACPClient {
this.sessionResponseTransformer = options.sessionResponseTransformer;
this.configOptionsTransformer = options.configOptionsTransformer;
this.configFeatureOptions = options.configFeatureOptions ?? [];
this.configuredModelIds = new Set(options.configuredModelIds);
this.clientCapabilities = options.clientCapabilities;
this.clientCapabilityMeta = options.clientCapabilityMeta;
this.modeIdTransformer = options.modeIdTransformer;
@@ -2201,20 +2194,12 @@ export class ACPAgentSession implements AgentSession, ACPClient {
return;
}
await this.setModelWithSelection({ modelId, selection: this.resolveModelSelection(modelId) });
}
private resolveModelSelection(modelId: string): ACPModelSelection {
const selection = resolveACPModelSelection({
modelId,
availableModels: this.availableModels,
configOptions: this.configOptions,
});
if (selection.availableModel || !this.configuredModelIds.has(modelId)) {
return selection;
}
// A model the user added in provider config is applied even when the agent does not advertise it.
return { ...selection, availableModel: { modelId, name: modelId } };
await this.setModelWithSelection({ modelId, selection });
}
private async setModelWithSelection({
@@ -2228,20 +2213,21 @@ export class ACPAgentSession implements AgentSession, ACPClient {
throw new Error("ACP session not initialized");
}
if (selection.hasAvailableModels && !selection.availableModel) {
this.warnInvalidSelection(
modelId,
`is not a valid ${this.provider} model. Available options: ${this.availableModels
?.map((model) => model.modelId)
.join(", ")}`,
);
return;
}
if (selection.hasAvailableModels) {
if (!selection.availableModel) {
this.warnInvalidSelection(
modelId,
`is not a valid ${this.provider} model. Available options: ${this.availableModels
?.map((model) => model.modelId)
.join(", ")}`,
);
return;
}
if (typeof this.connection.unstable_setSessionModel !== "function") {
throw new Error(this.modelSelectionUnavailableMessage());
}
if (
selection.availableModel &&
typeof this.connection.unstable_setSessionModel === "function"
) {
try {
await this.connection.unstable_setSessionModel({
sessionId: this.sessionId,
@@ -2936,11 +2922,13 @@ export class ACPAgentSession implements AgentSession, ACPClient {
const configuredModelId = this.config.model;
let switchedModel = false;
if (configuredModelId && configuredModelId !== this.currentModel) {
const selection = resolveACPModelSelection({
modelId: configuredModelId,
availableModels: this.availableModels,
configOptions: this.configOptions,
});
try {
await this.setModelWithSelection({
modelId: configuredModelId,
selection: this.resolveModelSelection(configuredModelId),
});
await this.setModelWithSelection({ modelId: configuredModelId, selection });
switchedModel = true;
} catch (error) {
if (!this.isModelSelectionUnavailableError(error)) {
@@ -31,7 +31,6 @@ function createQueryMock(events: unknown[]): Query {
describe("Claude SDK env", () => {
test("forwards launch-context env through Claude process env", async () => {
let capturedEnv: Record<string, string | undefined> | undefined;
let capturedPerTaskStopAffordance: boolean | undefined;
const launchContext: AgentLaunchContext = {
env: {
PASEO_AGENT_ID: "00000000-0000-4000-8000-000000000201",
@@ -40,7 +39,6 @@ describe("Claude SDK env", () => {
};
const queryFactory = vi.fn(({ options }: ClaudeQueryInput) => {
capturedEnv = options.env;
capturedPerTaskStopAffordance = options.perTaskStopAffordance;
return createQueryMock([
{
type: "system",
@@ -93,10 +91,6 @@ describe("Claude SDK env", () => {
expect(capturedEnv?.MCP_TIMEOUT).toBe("claude-startup-timeout");
expect(capturedEnv?.MCP_TOOL_TIMEOUT).toBe("claude-tool-timeout");
expect(session.usageSession?.()?.env).toBe(capturedEnv);
// Paseo reads session_state_changed to know when an autonomous turn is over.
expect(capturedEnv?.CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS).toBe("1");
// Without it, Stop and replace kill every background subagent along with the turn.
expect(capturedPerTaskStopAffordance).toBe(true);
} finally {
await session.close();
expect(session.usageSession?.()).toBeNull();
@@ -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") }),
}),
);
},
);
});
@@ -91,17 +91,6 @@ function buildUsage() {
};
}
/** Claude opening a turn of its own. Every main-session turn starts with one. */
function buildTurnInit(sessionId: string) {
return {
type: "system",
subtype: "init",
session_id: sessionId,
permissionMode: "default",
model: "opus",
};
}
function buildSuccessResult(sessionId: string) {
return {
type: "result",
@@ -164,7 +153,13 @@ function createScriptedQuery(params: {
},
} satisfies ScriptedQuery;
scriptedQuery.emit(buildTurnInit(params.sessionId));
scriptedQuery.emit({
type: "system",
subtype: "init",
session_id: params.sessionId,
permissionMode: "default",
model: "opus",
});
void (async () => {
for await (const prompt of params.prompt) {
@@ -257,21 +252,6 @@ async function waitFor(
}
}
/**
* Paseo interrupts Claude only while a main-session turn is in flight, which it learns from the
* init. The pump asks for its next frame only after routing the last one, so a second next() call
* proves the init was read.
*/
async function waitForInitRouted(
query: () => { next: ReturnType<typeof vi.fn> } | null | undefined,
) {
await waitFor(() => (query()?.next.mock.calls.length ?? 0) >= 2);
}
function buildCommandLifecycle(commandUuid: string | null | undefined, state: string) {
return { type: "command_lifecycle", command_uuid: commandUuid, state };
}
afterEach(() => {
queryFactory.mockReset();
});
@@ -302,7 +282,6 @@ test("interrupt only calls query.interrupt and leaves the query open", async ()
const firstTurn = streamSession(session, "first prompt");
await firstTurn.next();
await waitFor(() => queries[0]?.prompts.length === 1);
await waitForInitRouted(() => queries[0]);
await session.interrupt();
await waitFor(() => queries[0]?.interrupt.mock.calls.length === 1);
@@ -343,7 +322,6 @@ async function startSteeredTurn(sessionId: string): Promise<{
throw new Error("Expected the original Claude turn to start");
}
await waitFor(() => query?.prompts.length === 1);
await waitForInitRouted(() => query);
const steered = await session.steerActiveTurn!("queued steer", {
expectedTurnId: start.value.turnId,
@@ -393,8 +371,11 @@ test("interrupt still stops the turn when Claude has already dequeued the steer"
test("a steer Claude has already read is no longer discardable on interrupt", async () => {
const { session, query, turn } = await startSteeredTurn("queued-steer-completed-session");
query()?.emit(buildCommandLifecycle(query()?.prompts[0]?.uuid, "started"));
query()?.emit(buildCommandLifecycle(query()?.prompts[1]?.uuid, "completed"));
query()?.emit({
type: "command_lifecycle",
command_uuid: query()?.prompts[1]?.uuid,
state: "completed",
});
// Frames are translated in order, so the marker landing proves the lifecycle frame was read.
query()?.emit({ type: "assistant", message: { content: "STEER_READ" } });
await consumeUntil(turn, (event) => collectAssistantText([event]).includes("STEER_READ"));
@@ -407,23 +388,6 @@ test("a steer Claude has already read is no longer discardable on interrupt", as
await session.close();
});
test("a steer Claude cancelled is no longer withdrawn on interrupt", async () => {
const { session, query, turn } = await startSteeredTurn("queued-steer-cancelled-session");
query()?.emit(buildCommandLifecycle(query()?.prompts[0]?.uuid, "started"));
// "cancelled" is terminal: API errors, interrupts and "now" pre-emption all end a message.
query()?.emit(buildCommandLifecycle(query()?.prompts[1]?.uuid, "cancelled"));
query()?.emit({ type: "assistant", message: { content: "STEER_CANCELLED" } });
await consumeUntil(turn, (event) => collectAssistantText([event]).includes("STEER_CANCELLED"));
await session.interrupt();
await waitFor(() => query()?.interrupt.mock.calls.length === 1);
expect(query()?.cancelAsyncMessage).not.toHaveBeenCalled();
await collectUntilTerminal(turn);
await session.close();
});
function buildStoppedTaskNotification(sessionId: string) {
return {
type: "system",
@@ -509,7 +473,6 @@ async function startInterruptedToolTurn(sessionId: string): Promise<{
const turn = streamSession(session, "run the slow tool");
await turn.next();
await waitFor(() => query?.prompts.length === 1);
await waitForInitRouted(() => query);
await session.interrupt();
await collectUntilTerminal(turn);
@@ -560,7 +523,6 @@ test("Claude can still wake into an autonomous turn once the interrupted request
query()?.emit(buildStoppedTaskNotification(sessionId));
query()?.emit(buildAbortedResult(sessionId));
query()?.emit(buildTurnInit(sessionId));
query()?.emit({
type: "assistant",
message: { content: "AUTONOMOUS_WAKE_RESPONSE" },
@@ -617,7 +579,6 @@ test("reuses the existing query after interrupt before starting the next prompt"
const firstTurn = streamSession(session, "first prompt");
await firstTurn.next();
await waitFor(() => queries[0]?.prompts.length === 1);
await waitForInitRouted(() => queries[0]);
await session.interrupt();
await collectUntilTerminal(firstTurn);
@@ -691,7 +652,6 @@ test("recovers when the query pump sees a single interrupt abort before the next
const output = createAsyncQueue<Record<string, unknown>>();
const prompts: PromptRecord[] = [];
let throwAbortOnNext = false;
let queryRef: Pick<ScriptedQuery, "next"> | null = null;
queryFactory.mockImplementation(({ prompt }: { prompt: AsyncIterable<unknown> }) => {
const scriptedQuery = {
@@ -725,8 +685,13 @@ test("recovers when the query pump sees a single interrupt abort before the next
},
} satisfies ScriptedQuery;
queryRef = scriptedQuery;
scriptedQuery.emit(buildTurnInit("interrupt-abort-recovery-session"));
scriptedQuery.emit({
type: "system",
subtype: "init",
session_id: "interrupt-abort-recovery-session",
permissionMode: "default",
model: "opus",
});
void (async () => {
for await (const promptMessage of prompt) {
@@ -765,7 +730,6 @@ test("recovers when the query pump sees a single interrupt abort before the next
const firstTurn = streamSession(session, "first prompt");
await firstTurn.next();
await waitForInitRouted(() => queryRef);
await session.interrupt();
await collectUntilTerminal(firstTurn);
@@ -804,7 +768,6 @@ test("stale abort result after replacement start does not poison the new foregro
const firstTurn = streamSession(session, "first prompt");
const firstStarted = await firstTurn.next();
await waitFor(() => queryRef?.prompts.length === 1);
await waitForInitRouted(() => queryRef);
await session.interrupt();
const firstTurnEvents = [firstStarted.value!, ...(await collectUntilTerminal(firstTurn))];
@@ -849,7 +812,7 @@ test("stale abort result after replacement start does not poison the new foregro
await session.close();
});
test("creates an autonomous live turn when Claude starts a turn without a foreground run", async () => {
test("creates an autonomous live turn when assistant output arrives without a foreground run", async () => {
const logger = createTestLogger();
let queryRef: ScriptedQuery | null = null;
@@ -885,7 +848,6 @@ test("creates an autonomous live turn when Claude starts a turn without a foregr
await collectUntilTerminal(streamSession(session, "seed prompt"));
const subscribedEvents = subscribeToEvents(session);
queryRef?.emit(buildTurnInit("autonomous-live-session"));
queryRef?.emit({
type: "assistant",
message: { content: "AUTONOMOUS_WAKE_RESPONSE" },
@@ -954,7 +916,6 @@ test("steers an autonomous turn through its existing query without restarting it
await collectUntilTerminal(streamSession(session, "seed prompt"));
const autonomousEvents = subscribeToEvents(session);
queryRef?.emit(buildTurnInit("autonomous-steer-session"));
queryRef?.emit({
type: "assistant",
message: { content: "AUTONOMOUS_RESPONSE" },
@@ -1038,7 +999,6 @@ test("auto-completes an open autonomous turn when a foreground prompt starts", a
await collectUntilTerminal(streamSession(session, "seed prompt"));
const subscribedEvents = subscribeToEvents(session);
queryRef?.emit(buildTurnInit("autonomous-handoff-session"));
queryRef?.emit({
type: "assistant",
message: { content: "BACKGROUND_ONLY_RESPONSE" },
@@ -327,57 +327,6 @@ test("fails an auto mode turn when Claude Code uses Vertex", async () => {
}
});
test("switches an auto mode session to another mode when Claude Code uses Bedrock", async () => {
const previousBedrock = process.env.CLAUDE_CODE_USE_BEDROCK;
process.env.CLAUDE_CODE_USE_BEDROCK = "1";
const queryMock = createBaseQueryMock(vi.fn(async () => ({ done: true, value: undefined })));
sdkQueryFactory.mockImplementation(() => queryMock);
const client = new ClaudeAgentClient({
logger: createTestLogger(),
queryFactory: sdkQueryFactory,
resolveBinary: async () => "/test/claude/bin",
});
const session = await client.createSession({
provider: "claude",
cwd: process.cwd(),
modeId: "auto",
});
try {
await session.setMode("acceptEdits");
expect(await session.getCurrentMode()).toBe("acceptEdits");
expect(sdkQueryFactory).toHaveBeenCalledTimes(1);
expect(sdkQueryFactory.mock.calls[0]?.[0]?.options?.permissionMode).toBe("acceptEdits");
} finally {
restoreEnvValue("CLAUDE_CODE_USE_BEDROCK", previousBedrock);
await session.close();
}
});
test("does not keep a query started in a mode that Claude Code rejected", async () => {
const launchedModes: Array<string | undefined> = [];
sdkQueryFactory.mockImplementation(({ options }: { options: { permissionMode?: string } }) => {
launchedModes.push(options.permissionMode);
const queryMock = createBaseQueryMock(vi.fn(async () => ({ done: true, value: undefined })));
if (launchedModes.length === 1) {
queryMock.setPermissionMode.mockRejectedValue(new Error("bypass refused"));
}
return queryMock;
});
const session = await createSession();
try {
await expect(session.setMode("bypassPermissions")).rejects.toThrow("bypass refused");
await session.listCommands();
expect(await session.getCurrentMode()).toBe("default");
expect(launchedModes).toEqual(["bypassPermissions", "default"]);
} finally {
await session.close();
}
});
test("logs redacted query summary and never leaks sentinel secrets", async () => {
const envSecret = "PASEO_ENV_SENTINEL_SECRET";
const runtimeSecret = "PASEO_RUNTIME_SENTINEL_SECRET";
@@ -486,7 +435,6 @@ test("interruptActiveTurn only interrupts the active query without info logs", a
} | null;
input: { end: () => void } | null;
queryRestartNeeded: boolean;
mainTurnInFlight: boolean;
interruptActiveTurn: () => Promise<void>;
} = asInternals(session);
const interrupt = vi.fn(async () => undefined);
@@ -499,7 +447,6 @@ test("interruptActiveTurn only interrupts the active query without info logs", a
};
internal.input = { end };
internal.queryRestartNeeded = false;
internal.mainTurnInFlight = true;
try {
await internal.interruptActiveTurn();
@@ -1090,11 +1037,11 @@ test("preserves bypass capability across query restarts triggered by thinking ch
expect(capturedOptions).toHaveLength(2);
expect(capturedOptions[0]).toMatchObject({
permissionMode: "bypassPermissions",
permissionMode: "default",
allowDangerouslySkipPermissions: true,
});
expect(capturedOptions[1]).toMatchObject({
permissionMode: "bypassPermissions",
permissionMode: "acceptEdits",
allowDangerouslySkipPermissions: true,
effort: "high",
});
@@ -1193,7 +1140,6 @@ test("reuses one autonomous run for unbound stream_event bursts with no foregrou
const queryMock = createBaseQueryMock(vi.fn(async () => ({ done: true, value: undefined })));
internal.turnState = "idle";
await internal.routeSdkMessageFromPump(claudeTurnInit(), queryMock);
await internal.routeSdkMessageFromPump(
{
type: "stream_event",
@@ -1236,468 +1182,6 @@ test("reuses one autonomous run for unbound stream_event bursts with no foregrou
await session.close();
});
interface SessionStateInternals {
turnState: "idle" | "foreground" | "autonomous";
routeSdkMessageFromPump: (
message: Record<string, unknown>,
activeQuery: QueryMock,
) => Promise<void>;
autonomousTurn: { id: string } | null;
activeForegroundTurnId: string | null;
}
function sessionState(state: "idle" | "running" | "requires_action") {
return {
type: "system",
subtype: "session_state_changed",
state,
uuid: `state-${state}`,
session_id: "sess-1",
};
}
/** Claude opening a turn of its own. Every main-session turn starts with one. */
function claudeTurnInit() {
return {
type: "system",
subtype: "init",
session_id: "sess-1",
permissionMode: "default",
model: "opus",
};
}
function successResult() {
return { type: "result", subtype: "success", usage: buildUsage(), total_cost_usd: 0 };
}
function commandLifecycle(
commandUuid: string,
state: "queued" | "started" | "completed" | "cancelled",
) {
return { type: "command_lifecycle", command_uuid: commandUuid, state };
}
function unboundTextDelta(text: string) {
return {
type: "stream_event",
parent_tool_use_id: null,
event: { type: "content_block_delta", delta: { type: "text_delta", text } },
};
}
// What a background subagent emits on the main stream with no parent tool use id, so by frame
// shape alone each looks like main-session work. Verified on the wire: none arrives inside a turn
// Claude opened, and no result follows any of them.
const helperTaskStarted = {
type: "system",
subtype: "task_started",
task_id: "helper-task",
tool_use_id: "toolu_helper",
task_type: "local_agent",
subagent_type: "general-purpose",
description: "Background helper",
is_backgrounded: true,
uuid: "uuid-task-started",
session_id: "sess-1",
};
const helperTaskProgress = {
type: "system",
subtype: "task_progress",
task_id: "helper-task",
tool_use_id: "toolu_helper",
description: "Background helper",
usage: { total_tokens: 1200, tool_uses: 3, duration_ms: 900 },
last_tool_name: "Bash",
uuid: "uuid-task-progress",
session_id: "sess-1",
};
// A subagent's own background Bash job completing.
const subagentOwnedTaskNotification = {
type: "system",
subtype: "task_notification",
task_id: "bg-job-of-subagent",
tool_use_id: "toolu_subagent_bash",
status: "completed",
summary: "Background command completed",
output_file: "/tmp/bg-job-of-subagent.output",
uuid: "uuid-task-notification",
session_id: "sess-1",
};
const helperCompleted = {
type: "system",
subtype: "task_notification",
task_id: "helper-task",
tool_use_id: "toolu_helper",
status: "completed",
summary: "Background helper finished",
output_file: "/tmp/helper-task.output",
uuid: "uuid-helper-completed",
session_id: "sess-1",
};
const rateLimitEvent = {
type: "rate_limit_event",
rate_limit_info: { status: "allowed" },
uuid: "uuid-rate-limit",
session_id: "sess-1",
};
function createPendingQueryMock(): QueryMock {
return createBaseQueryMock(vi.fn(() => new Promise<never>(() => {})));
}
test("a main-session frame opens no turn until Claude starts one", async () => {
const session = await createSession();
const internal: SessionStateInternals = asInternals(session);
const queryMock = createPendingQueryMock();
// Main-session output only ever arrives inside a turn Claude opened with system/init, so a
// stray unbound frame is not the start of one.
await internal.routeSdkMessageFromPump(unboundTextDelta("stray"), queryMock);
expect(internal.autonomousTurn).toBeNull();
// The wake-up case autonomous turns exist for: a completed background subagent makes the main
// session start a turn of its own, with no prompt from the user.
await internal.routeSdkMessageFromPump(claudeTurnInit(), queryMock);
await internal.routeSdkMessageFromPump(unboundTextDelta("picking this up"), queryMock);
expect(internal.autonomousTurn?.id).toBe("autonomous-turn-1");
await internal.routeSdkMessageFromPump(successResult(), queryMock);
expect(internal.autonomousTurn).toBeNull();
await session.close();
});
test("a background subagent's frames never open a turn while the main session is idle", async () => {
sdkQueryFactory.mockImplementation(() => createPendingQueryMock());
const session = await createSession();
const internal: SessionStateInternals = asInternals(session);
const queryMock = createPendingQueryMock();
// Claude Code 2.1.280 reports "running" for as long as any background subagent is alive.
await internal.routeSdkMessageFromPump(sessionState("running"), queryMock);
for (const frame of [
helperTaskStarted,
helperTaskProgress,
subagentOwnedTaskNotification,
rateLimitEvent,
helperCompleted,
]) {
await internal.routeSdkMessageFromPump(frame, queryMock);
expect(internal.autonomousTurn).toBeNull();
expect(internal.turnState).toBe("idle");
}
// The next user message starts its own foreground turn rather than landing on a phantom one.
const { turnId } = await session.startTurn("PING");
expect(internal.activeForegroundTurnId).toBe(turnId);
expect(internal.autonomousTurn).toBeNull();
expect(internal.turnState).toBe("foreground");
await session.close();
});
test("Claude waking up after a helper finishes gets an autonomous turn that its result closes", async () => {
const session = await createSession();
const internal: SessionStateInternals = asInternals(session);
const queryMock = createPendingQueryMock();
const events: AgentStreamEvent[] = [];
session.subscribe((event) => events.push(event));
// The helper's completion arrives outside any turn. Claude then starts one to react to it.
await internal.routeSdkMessageFromPump(helperTaskStarted, queryMock);
await internal.routeSdkMessageFromPump(helperCompleted, queryMock);
expect(internal.autonomousTurn).toBeNull();
await internal.routeSdkMessageFromPump(claudeTurnInit(), queryMock);
expect(internal.autonomousTurn?.id).toBe("autonomous-turn-1");
expect(internal.turnState).toBe("autonomous");
await internal.routeSdkMessageFromPump(unboundTextDelta("the helper is done"), queryMock);
await internal.routeSdkMessageFromPump(successResult(), queryMock);
expect(internal.autonomousTurn).toBeNull();
expect(internal.turnState).toBe("idle");
expect(events.filter((event) => event.type === "turn_started")).toHaveLength(1);
expect(events.filter((event) => event.type === "turn_completed")).toHaveLength(1);
await session.close();
});
test("a steer folded into a turn keeps one turn, and a turn Claude starts after it gets its own", async () => {
sdkQueryFactory.mockImplementation(() => createPendingQueryMock());
const session = await createSession();
const internal: SessionStateInternals = asInternals(session);
const queryMock = createPendingQueryMock();
const events: AgentStreamEvent[] = [];
session.subscribe((event) => events.push(event));
const { turnId } = await session.startTurn("hello");
await internal.routeSdkMessageFromPump(claudeTurnInit(), queryMock);
// A message pushed mid-turn is folded in at the next tool boundary: Claude acknowledges it, but
// starts no new turn.
await internal.routeSdkMessageFromPump(commandLifecycle("folded-steer", "queued"), queryMock);
await internal.routeSdkMessageFromPump(commandLifecycle("folded-steer", "started"), queryMock);
expect(internal.activeForegroundTurnId).toBe(turnId);
expect(internal.autonomousTurn).toBeNull();
await internal.routeSdkMessageFromPump(successResult(), queryMock);
expect(internal.activeForegroundTurnId).toBeNull();
expect(internal.turnState).toBe("idle");
// A message that arrived while Claude wrote its final answer runs as a turn of its own.
await internal.routeSdkMessageFromPump(claudeTurnInit(), queryMock);
expect(internal.autonomousTurn?.id).toBe("autonomous-turn-2");
await internal.routeSdkMessageFromPump(successResult(), queryMock);
expect(internal.autonomousTurn).toBeNull();
expect(internal.turnState).toBe("idle");
expect(events.filter((event) => event.type === "turn_started")).toHaveLength(2);
expect(events.filter((event) => event.type === "turn_completed")).toHaveLength(2);
await session.close();
});
test("session state never opens a turn", async () => {
const session = await createSession();
const internal: SessionStateInternals = asInternals(session);
const queryMock = createPendingQueryMock();
const events: AgentStreamEvent[] = [];
session.subscribe((event) => events.push(event));
// "running" covers background subagents too, so it says nothing about the main session.
for (const state of ["idle", "running", "requires_action", "idle"] as const) {
await internal.routeSdkMessageFromPump(sessionState(state), queryMock);
expect(internal.autonomousTurn).toBeNull();
expect(internal.turnState).toBe("idle");
}
// State frames are bookkeeping, never timeline content.
expect(events).toEqual([]);
await session.close();
});
test("an idle session state closes an autonomous turn that no result closed", async () => {
const session = await createSession();
const internal: SessionStateInternals = asInternals(session);
const queryMock = createPendingQueryMock();
const events: AgentStreamEvent[] = [];
session.subscribe((event) => events.push(event));
await internal.routeSdkMessageFromPump(claudeTurnInit(), queryMock);
expect(internal.autonomousTurn?.id).toBe("autonomous-turn-1");
// Safety net: Claude says nothing at all is running any more.
await internal.routeSdkMessageFromPump(sessionState("idle"), queryMock);
expect(internal.autonomousTurn).toBeNull();
expect(internal.turnState).toBe("idle");
expect(events.filter((event) => event.type === "turn_completed")).toHaveLength(1);
await session.close();
});
test("session state never opens or closes a foreground turn", async () => {
sdkQueryFactory.mockImplementation(() => createPendingQueryMock());
const session = await createSession();
const internal: SessionStateInternals = asInternals(session);
const queryMock = createPendingQueryMock();
await internal.routeSdkMessageFromPump(sessionState("idle"), queryMock);
const { turnId } = await session.startTurn("hello");
// The send's own running, then an idle that trails the previous turn and lands late.
await internal.routeSdkMessageFromPump(sessionState("running"), queryMock);
await internal.routeSdkMessageFromPump(sessionState("idle"), queryMock);
expect(internal.activeForegroundTurnId).toBe(turnId);
expect(internal.autonomousTurn).toBeNull();
expect(internal.turnState).toBe("foreground");
await internal.routeSdkMessageFromPump(
{ type: "result", subtype: "success", usage: buildUsage(), total_cost_usd: 0 },
queryMock,
);
expect(internal.activeForegroundTurnId).toBeNull();
expect(internal.turnState).toBe("idle");
await session.close();
});
interface InterruptInternals extends SessionStateInternals {
pendingInterruptAbort: boolean;
}
type InterruptibleQueryMock = QueryMock & { cancelAsyncMessage: ReturnType<typeof vi.fn> };
function createInterruptibleQueryMock(): InterruptibleQueryMock {
return Object.assign(createPendingQueryMock(), {
cancelAsyncMessage: vi.fn(async () => true),
});
}
/** The uuid Paseo stamped on the first message it pushed into the SDK input. */
async function readFirstPromptUuid(): Promise<string | null> {
const input = sdkQueryFactory.mock.calls[0]?.[0] as { prompt: AsyncIterable<unknown> };
return await createPromptUuidReader(input.prompt)();
}
function abortedResult() {
return {
type: "result",
subtype: "error_during_execution",
errors: [],
usage: buildUsage(),
total_cost_usd: 0,
};
}
test("an interrupt before Claude starts the message withdraws it instead of interrupting", async () => {
const queryMock = createInterruptibleQueryMock();
sdkQueryFactory.mockImplementation(() => queryMock);
const session = await createSession();
const internal: InterruptInternals = asInternals(session);
const events: AgentStreamEvent[] = [];
session.subscribe((event) => events.push(event));
await session.startTurn("hello");
// Claude has not acknowledged the message yet: no init, no command_lifecycle "started".
await session.interrupt();
await vi.waitFor(() => expect(queryMock.cancelAsyncMessage).toHaveBeenCalledTimes(1));
expect(queryMock.cancelAsyncMessage).toHaveBeenCalledWith(await readFirstPromptUuid());
expect(queryMock.interrupt).not.toHaveBeenCalled();
// No result follows an interrupt that never happened, so no flag may wait for one.
expect(internal.pendingInterruptAbort).toBe(false);
expect(events.filter((event) => event.type === "turn_canceled")).toHaveLength(1);
await session.close();
});
test("an interrupt after Claude took the message but before it started stops it", async () => {
const queryMock = createInterruptibleQueryMock();
// Claude has dequeued the message for its next turn, so withdrawing it is a no-op.
queryMock.cancelAsyncMessage.mockImplementation(async () => false);
sdkQueryFactory.mockImplementation(() => queryMock);
const session = await createSession();
const internal: InterruptInternals = asInternals(session);
await session.startTurn("hello");
// No command_lifecycle "started" or init has reached Paseo yet.
await session.interrupt();
await vi.waitFor(() => expect(queryMock.interrupt).toHaveBeenCalledTimes(1));
expect(queryMock.cancelAsyncMessage).toHaveBeenCalledWith(await readFirstPromptUuid());
expect(internal.pendingInterruptAbort).toBe(true);
await session.close();
});
test("a prompt sent while a stopped prompt is being withdrawn is not withdrawn too", async () => {
const queryMock = createInterruptibleQueryMock();
let settleWithdrawal: (cancelled: boolean) => void = () => {};
queryMock.cancelAsyncMessage.mockImplementationOnce(
() => new Promise<boolean>((resolve) => (settleWithdrawal = resolve)),
);
sdkQueryFactory.mockImplementation(() => queryMock);
const session = await createSession();
await session.startTurn("first");
const firstUuid = await readFirstPromptUuid();
await session.interrupt();
await vi.waitFor(() => expect(queryMock.cancelAsyncMessage).toHaveBeenCalledTimes(1));
await session.startTurn("second");
settleWithdrawal(false);
await vi.waitFor(() => expect(queryMock.interrupt).toHaveBeenCalledTimes(1));
expect(queryMock.cancelAsyncMessage).toHaveBeenCalledTimes(1);
expect(queryMock.cancelAsyncMessage).toHaveBeenCalledWith(firstUuid);
await session.close();
});
test("an interrupt while only background subagents run never reaches Claude", async () => {
const queryMock = createInterruptibleQueryMock();
sdkQueryFactory.mockImplementation(() => queryMock);
const session = await createSession();
const internal: InterruptInternals = asInternals(session);
await session.startTurn("delegate to a helper");
const promptUuid = await readFirstPromptUuid();
await internal.routeSdkMessageFromPump(commandLifecycle(promptUuid ?? "", "started"), queryMock);
await internal.routeSdkMessageFromPump(claudeTurnInit(), queryMock);
await internal.routeSdkMessageFromPump(helperTaskStarted, queryMock);
await internal.routeSdkMessageFromPump(successResult(), queryMock);
// The main session is done; its helper keeps working.
await internal.routeSdkMessageFromPump(sessionState("running"), queryMock);
await internal.routeSdkMessageFromPump(helperTaskProgress, queryMock);
// Without perTaskStopAffordance, an interrupt here kills every running helper.
await session.interrupt();
expect(queryMock.interrupt).not.toHaveBeenCalled();
expect(queryMock.cancelAsyncMessage).not.toHaveBeenCalled();
expect(internal.pendingInterruptAbort).toBe(false);
await session.close();
});
test("an interrupt during a main turn interrupts Claude once and drops the aborted result", async () => {
const queryMock = createInterruptibleQueryMock();
sdkQueryFactory.mockImplementation(() => queryMock);
const session = await createSession();
const internal: InterruptInternals = asInternals(session);
const events: AgentStreamEvent[] = [];
session.subscribe((event) => events.push(event));
await session.startTurn("long task");
const promptUuid = await readFirstPromptUuid();
await internal.routeSdkMessageFromPump(commandLifecycle(promptUuid ?? "", "started"), queryMock);
await internal.routeSdkMessageFromPump(claudeTurnInit(), queryMock);
await session.interrupt();
await vi.waitFor(() => expect(queryMock.interrupt).toHaveBeenCalledTimes(1));
// Claude already started the message, so there is nothing to withdraw.
expect(queryMock.cancelAsyncMessage).not.toHaveBeenCalled();
expect(internal.pendingInterruptAbort).toBe(true);
// A replacement starts before the aborted turn reports its result.
const { turnId } = await session.startTurn("replacement");
await internal.routeSdkMessageFromPump(abortedResult(), queryMock);
expect(internal.activeForegroundTurnId).toBe(turnId);
expect(internal.pendingInterruptAbort).toBe(false);
expect(events.filter((event) => event.type === "turn_failed")).toHaveLength(0);
await internal.routeSdkMessageFromPump(claudeTurnInit(), queryMock);
await internal.routeSdkMessageFromPump(successResult(), queryMock);
expect(internal.activeForegroundTurnId).toBeNull();
expect(queryMock.interrupt).toHaveBeenCalledTimes(1);
await session.close();
});
test("a new turn clears an interrupt flag no result will consume", async () => {
const session = await createSession();
const internal: InterruptInternals = asInternals(session);
const queryMock = createPendingQueryMock();
const events: AgentStreamEvent[] = [];
session.subscribe((event) => events.push(event));
// An interrupt that landed just after its turn had ended: Claude emits no result for it.
internal.pendingInterruptAbort = true;
await internal.routeSdkMessageFromPump(claudeTurnInit(), queryMock);
expect(internal.pendingInterruptAbort).toBe(false);
expect(internal.autonomousTurn?.id).toBe("autonomous-turn-1");
// This turn's own failure is reported, not swallowed as the interrupted turn's leftover.
await internal.routeSdkMessageFromPump(
{ ...abortedResult(), errors: ["API Error: 500 upstream failure"] },
queryMock,
);
expect(events.filter((event) => event.type === "turn_failed")).toHaveLength(1);
expect(internal.autonomousTurn).toBeNull();
await session.close();
});
test("tracks run lifecycle transitions for success, error, and interrupt", async () => {
const session = await createSession();
let streamCase: "success" | "error" | "interrupt" = "success";
@@ -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");
});
});
@@ -78,7 +78,7 @@ describe("subagent lifecycle across an interrupt", () => {
queryFactory.mockReset();
});
async function startInterruptibleTurn(taskStarted: Record<string, unknown> = {}) {
async function startInterruptibleTurn() {
const channel = buildOpenQueryMock();
queryFactory.mockImplementation(() => channel.query);
const session = await new ClaudeAgentClient({
@@ -107,7 +107,6 @@ describe("subagent lifecycle across an interrupt", () => {
task_type: "local_agent",
subagent_type: "general-purpose",
description: "Reply with banana",
...taskStarted,
});
await vi.waitFor(() => expect(subagentEvents.length).toBeGreaterThan(0));
@@ -170,31 +169,6 @@ describe("subagent lifecycle across an interrupt", () => {
await session.close();
});
test("a child spawned in the background is not canceled with the turn that spawned it", async () => {
// Claude announces a background spawn on task_started itself and sends no task_updated patch.
const { channel, session, subagentEvents } = await startInterruptibleTurn({
is_backgrounded: true,
});
await session.interrupt();
channel.push({
type: "system",
subtype: "task_notification",
task_id: TASK_ID,
tool_use_id: SUBAGENT_ID,
status: "completed",
});
await vi.waitFor(() =>
expect(subagentEvents).toContainEqual(
expect.objectContaining({ id: SUBAGENT_ID, status: "completed" }),
),
);
expect(statuses(subagentEvents, SUBAGENT_ID)).toEqual(["running", "completed"]);
await session.close();
});
test("a foreground child is canceled with the turn that spawned it", async () => {
const { session, subagentEvents } = await startInterruptibleTurn();
@@ -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],
@@ -3170,15 +3160,10 @@ describe("ClaudeAgentSession context window usage", () => {
});
test("a compaction abandoned in an autonomous turn does not suppress the next marker", async () => {
// Claude starts a turn of its own after the foreground result, which starts compacting and is
// then ended by the next foreground turn, never reaching a boundary.
// Trailing output after the foreground result opens an autonomous turn, which starts
// compacting and is then ended by the next foreground turn, never reaching a boundary.
const session = await createSessionForTurns([
[
createSuccessResult(),
createInitMessage(),
createMessageStartEvent(),
createCompactingStatus(),
],
[createSuccessResult(), createMessageStartEvent(), createCompactingStatus()],
[createCompactingStatus(), createSuccessResult()],
]);
@@ -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,
@@ -452,15 +452,6 @@ function errorToMessageString(error: unknown): string {
return "";
}
/**
* Claude opens every main-session turn with system/init and closes it with exactly one result:
* a prompt, a wake-up after background work, a slash command, an API error. Background subagents
* never emit either on the main stream.
*/
function isClaudeTurnInit(message: SDKMessage): boolean {
return message.type === "system" && message.subtype === "init";
}
function firstStringField(
input: Record<string, unknown>,
primaryKey: string,
@@ -1916,11 +1907,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;
}
@@ -2084,12 +2070,11 @@ class ClaudeAgentSession implements AgentSession {
private activeForegroundQuery: Query | null = null;
private activeForegroundInput: AsyncMessageInput<SDKUserMessage> | 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
* dequeues one and resumes the turn we just stopped. SDK user UUIDs are provider-private; never
* let them escape the adapter boundary.
* Steers pushed into the live SDK input that Claude may not have read yet. Interrupting the turn
* has to discard them, or the SDK dequeues one and resumes the turn we just stopped. SDK user
* UUIDs are provider-private; never let them escape the adapter boundary.
*/
private readonly unstartedMessageUuids = new Set<string>();
private readonly queuedSteerUuids = new Set<string>();
/** Human steers whose text has not reached Claude yet and therefore supersede blocking cards. */
private readonly permissionClearingSteerUuids = new Set<string>();
private claudeSessionId: string | null;
@@ -2141,12 +2126,6 @@ class ClaudeAgentSession implements AgentSession {
private queryPumpPromise: Promise<void> | null = null;
private queryRestartNeeded = false;
private pendingInterruptAbort = false;
/**
* Whether Claude's main session is inside one of its own turns: set by system/init and by a
* pushed message's command_lifecycle "started" (/compact works for seconds before its init),
* cleared by the turn's result or an idle session state. See observeMainTurnBracket.
*/
private mainTurnInFlight = false;
private foregroundHasVisibleActivity = false;
private activeTurnHasAssistantText = false;
private readonly contextUsage: ClaudeContextUsageState;
@@ -2293,7 +2272,6 @@ class ClaudeAgentSession implements AgentSession {
this.contextUsage.beginTurn();
this.transitionTurnState("foreground", "foreground turn started");
this.clearRecentStderr();
if (sdkUserMessageId) this.unstartedMessageUuids.add(sdkUserMessageId);
let cancelIssued = false;
const requestCancel = () => {
@@ -2304,18 +2282,13 @@ class ClaudeAgentSession implements AgentSession {
if (this.cancelCurrentTurn === requestCancel) {
this.cancelCurrentTurn = null;
}
// Whether Claude has this message in hand. A late idle from the previous turn can clear
// mainTurnInFlight after Claude started it, so the message's own lifecycle counts too.
const claudeStartedTurn =
this.mainTurnInFlight ||
(sdkUserMessageId !== null && !this.unstartedMessageUuids.has(sdkUserMessageId));
this.rejectAllPendingPermissions(new Error("Permission request canceled"));
this.finishForegroundTurn({
type: "turn_canceled",
provider: "claude",
reason: "Interrupted",
});
void this.interruptActiveTurn(claudeStartedTurn).catch((error) => {
void this.interruptActiveTurn().catch((error) => {
this.logger.warn({ err: error }, "Failed to interrupt during cancel");
});
};
@@ -2325,11 +2298,6 @@ class ClaudeAgentSession implements AgentSession {
try {
await this.ensureQuery();
if (cancelIssued) {
// Stopped while Claude was still starting up: withdrawn by never sending it.
if (sdkUserMessageId) this.unstartedMessageUuids.delete(sdkUserMessageId);
return { turnId };
}
if (!this.input) {
throw new Error("Claude session input stream not initialized");
}
@@ -2343,7 +2311,6 @@ 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"),
);
@@ -2392,7 +2359,7 @@ class ClaudeAgentSession implements AgentSession {
clearPendingPermissions: boolean,
): void {
const uuid = message.uuid;
if (uuid) this.unstartedMessageUuids.add(uuid);
if (uuid) this.queuedSteerUuids.add(uuid);
if (uuid && clearPendingPermissions) {
this.permissionClearingSteerUuids.add(uuid);
}
@@ -2403,7 +2370,7 @@ class ClaudeAgentSession implements AgentSession {
}
} catch (error) {
if (uuid) {
this.unstartedMessageUuids.delete(uuid);
this.queuedSteerUuids.delete(uuid);
this.permissionClearingSteerUuids.delete(uuid);
}
throw error;
@@ -2474,15 +2441,8 @@ 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 activeQuery = await this.ensureQuery(normalized);
try {
await activeQuery.setPermissionMode(normalized);
} catch (error) {
// The query was launched in the rejected mode; relaunch in the current mode next time.
if (launchesQuery) this.queryRestartNeeded = true;
throw error;
}
const activeQuery = await this.ensureQuery();
await activeQuery.setPermissionMode(normalized);
if (normalized === "plan") {
if (previousMode !== "plan") {
this.planResumeMode = previousMode;
@@ -3168,7 +3128,7 @@ class ClaudeAgentSession implements AgentSession {
return { kind: "fresh-session" };
}
private async ensureQuery(launchMode: PermissionMode = this.currentMode): Promise<Query> {
private async ensureQuery(): Promise<Query> {
if (this.query && !this.queryRestartNeeded) {
return this.query;
}
@@ -3212,11 +3172,9 @@ class ClaudeAgentSession implements AgentSession {
this.persistence = null;
const input = createAsyncMessageInput<SDKUserMessage>();
const options = await this.buildOptions(launchMode);
const options = await this.buildOptions();
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(
{ prompt: input.iterable, options },
{
@@ -3336,16 +3294,11 @@ class ClaudeAgentSession implements AgentSession {
return createProviderEnv({
baseEnv: process.env,
runtimeSettings: this.runtimeSettings,
overlays: [
this.launchEnv,
// Makes the CLI announce session_state_changed, whose "idle" is the safety net that closes
// an autonomous turn (see consumeSessionStateChange).
{ CLAUDE_CODE_EMIT_SESSION_STATE_EVENTS: "1" },
],
overlays: [this.launchEnv],
});
}
private async buildOptions(permissionMode: PermissionMode): Promise<ClaudeOptions> {
private async buildOptions(): Promise<ClaudeOptions> {
const { thinking, effort, ultracode } = this.resolveThinkingConfig();
const appendedSystemPrompt = this.buildAppendedSystemPrompt();
const providerOptions = applyClaudeToolPolicy(
@@ -3354,7 +3307,7 @@ class ClaudeAgentSession implements AgentSession {
);
const settingsOptions = this.buildSettingsOptions(providerOptions, { ultracode });
const sdkEnv = this.harnessEnvironment;
assertClaudeModeCanRun(permissionMode, sdkEnv);
assertClaudeModeCanRun(this.currentMode, sdkEnv);
const claudeBinary = await this.resolveBinary();
this.logger.debug(
@@ -3377,7 +3330,7 @@ class ClaudeAgentSession implements AgentSession {
const base: ClaudeOptions = {
cwd: this.config.cwd,
includePartialMessages: true,
permissionMode,
permissionMode: this.currentMode,
// Dynamic mode switching can recreate the underlying Claude query. Keep the
// bypass launch capability available so later setPermissionMode("bypassPermissions")
// calls do not fail after a model/thinking/rewind-driven restart.
@@ -3408,10 +3361,6 @@ class ClaudeAgentSession implements AgentSession {
...settingsOptions,
// Provider subagent panes render the child's nested transcript.
forwardSubagentText: true,
// Stop and replace abort only the main turn, like Esc in Claude Code, and background
// subagents keep running. Without this declaration an interrupt kills every one of them.
// Claude stops a helper itself with its TaskStop tool.
perTaskStopAffordance: true,
hooks: this.buildSubagentEffortHooks(),
...(this.persistSession === undefined ? {} : { persistSession: this.persistSession }),
env: sdkEnv,
@@ -3942,67 +3891,35 @@ class ClaudeAgentSession implements AgentSession {
return false;
}
private isAssistantishMessage(message: SDKMessage): boolean {
return (
message.type === "assistant" ||
message.type === "stream_event" ||
message.type === "tool_progress" ||
(message.type === "system" && message.subtype === "task_notification")
);
}
/**
* Claude's account of whether anything in the session is working, which is not the same as the
* main session working: Claude Code 2.1.280 stays "running" for as long as any background
* subagent is alive. So "running" never opens a turn.
*
* "idle" means nothing at all is running, so it closes an autonomous turn whatever opened it.
* It never closes a foreground turn: an idle can trail the previous turn and land just after a
* new send, and it must not end that send.
*
* Returns true when the frame was a state change, which is bookkeeping and never reaches the
* timeline.
* Claude keeps talking about the request it was told to kill — the notification for the tool it
* just stopped, trailing assistant output. That is not new work, so it must not open a turn: the
* only message that would close that turn is the result shouldSuppressStaleResult drops, leaving
* the agent stuck reporting "running" forever.
*/
private consumeSessionStateChange(message: SDKMessage): boolean {
if (message.type !== "system" || message.subtype !== "session_state_changed") {
private shouldStartAutonomousTurn(message: SDKMessage): boolean {
if (this.activeForegroundTurnId || this.pendingInterruptAbort) {
return false;
}
if (message.state === "idle") {
this.mainTurnInFlight = false;
this.completeAutonomousTurn();
}
return true;
}
/** Tracks mainTurnInFlight from Claude's own turn brackets (isClaudeTurnInit). */
private observeMainTurnBracket(message: SDKMessage): void {
if (message.type === "result") {
this.mainTurnInFlight = false;
return;
}
if (isClaudeTurnInit(message)) {
this.mainTurnInFlight = true;
// A new turn has begun, so the interrupted one is over. An interrupt that landed after its
// turn had already ended gets no result, and the leftover flag would swallow this turn's.
this.pendingInterruptAbort = false;
return;
}
if (readClaudeCommandLifecycle(message)?.state === "started") {
this.mainTurnInFlight = true;
}
}
/**
* Only the main session's own turn start opens an autonomous turn. Everything a background
* subagent emits (its task frames, its own background jobs' notifications, rate limit events)
* arrives outside one, and no result would ever close a turn it opened.
*/
private opensAutonomousTurn(message: SDKMessage): boolean {
return isClaudeTurnInit(message) && !this.activeForegroundTurnId;
return this.isAssistantishMessage(message);
}
private async routeSdkMessageFromPump(message: SDKMessage): Promise<void> {
if (this.consumeSessionStateChange(message)) {
return;
}
this.observeMainTurnBracket(message);
if (this.shouldSuppressStaleResult(message)) {
return;
}
const isForeground = Boolean(this.activeForegroundTurnId);
if (this.opensAutonomousTurn(message)) {
if (this.shouldStartAutonomousTurn(message)) {
this.startAutonomousTurn();
}
if (!isForeground && !this.autonomousTurn && message.type === "result") {
@@ -4144,13 +4061,7 @@ class ClaudeAgentSession implements AgentSession {
return true;
}
/**
* Interrupts Claude only when a turn of its main session is running. With nothing running there
* is nothing to stop but our own queued messages, so those are withdrawn instead: an interrupt
* would reach only background helpers (and kill them on a CLI that ignores
* perTaskStopAffordance), and no result would follow to consume pendingInterruptAbort.
*/
private async interruptActiveTurn(claudeStartedTurn = this.mainTurnInFlight): Promise<void> {
private async interruptActiveTurn(): Promise<void> {
const queryToInterrupt = this.query;
if (!queryToInterrupt || typeof queryToInterrupt.interrupt !== "function") {
this.logger.trace(
@@ -4164,16 +4075,8 @@ class ClaudeAgentSession implements AgentSession {
);
return;
}
if (claudeStartedTurn) {
this.pendingInterruptAbort = true;
await this.withdrawUnstartedMessages(queryToInterrupt);
} else {
// Claude can dequeue a message for its next turn before announcing it started; withdrawing
// it is then a no-op, and only an interrupt stops it. Withdraw once: a prompt sent while
// this withdrawal was in flight belongs to the next turn.
if (await this.withdrawUnstartedMessages(queryToInterrupt)) return;
this.pendingInterruptAbort = true;
}
this.pendingInterruptAbort = true;
await this.discardQueuedSteers(queryToInterrupt);
try {
await this.awaitWithTimeout(
queryToInterrupt.interrupt(),
@@ -4185,15 +4088,14 @@ class ClaudeAgentSession implements AgentSession {
}
/**
* Interrupt means interrupt: a message Claude never started dies with the turn instead of
* resuming it. One already dequeued cannot be recalled, and does not need to be, since the
* interrupt kills it. Returns whether Claude confirmed every message withdrawn.
* Interrupt means interrupt: a steer Claude never read dies with the turn instead of resuming it.
* A steer already dequeued cannot be recalled, and does not need to be — the interrupt kills it.
*/
private async withdrawUnstartedMessages(query: Query): Promise<boolean> {
const uuids = [...this.unstartedMessageUuids];
this.unstartedMessageUuids.clear();
private async discardQueuedSteers(query: Query): Promise<void> {
const uuids = [...this.queuedSteerUuids];
this.queuedSteerUuids.clear();
this.permissionClearingSteerUuids.clear();
if (uuids.length === 0) return true;
if (uuids.length === 0) return;
// The SDK runtime supports this, but its public Query type has not caught up. Keep the
// compatibility escape hatch inside the Claude adapter.
const cancelAsyncMessage = (
@@ -4201,17 +4103,14 @@ class ClaudeAgentSession implements AgentSession {
cancelAsyncMessage?: (uuid: string) => Promise<boolean>;
}
).cancelAsyncMessage;
if (!cancelAsyncMessage) return false;
let withdrewAll = true;
if (!cancelAsyncMessage) return;
for (const uuid of uuids) {
try {
if (!(await cancelAsyncMessage.call(query, uuid))) withdrewAll = false;
await cancelAsyncMessage.call(query, uuid);
} catch (error) {
withdrewAll = false;
this.logger.warn({ err: error }, "Failed to withdraw a queued Claude message");
this.logger.warn({ err: error }, "Failed to discard a queued Claude steer");
}
}
return withdrewAll;
}
private translateMessageToEvents(
@@ -4260,7 +4159,7 @@ class ClaudeAgentSession implements AgentSession {
}
}
this.forgetStartedMessage(message);
this.forgetReadSteer(message);
switch (message.type) {
case "system":
@@ -4294,14 +4193,11 @@ class ClaudeAgentSession implements AgentSession {
return events;
}
/**
* Once Claude has started a message, or cancelled it, there is nothing left to withdraw on
* interrupt.
*/
private forgetStartedMessage(message: unknown): void {
/** Once Claude has read a steer there is nothing left to discard on interrupt. */
private forgetReadSteer(message: unknown): void {
const lifecycle = readClaudeCommandLifecycle(message);
if (!lifecycle || lifecycle.state === "queued") return;
this.unstartedMessageUuids.delete(lifecycle.commandUuid);
this.queuedSteerUuids.delete(lifecycle.commandUuid);
this.permissionClearingSteerUuids.delete(lifecycle.commandUuid);
}
@@ -5221,11 +5117,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[] {
@@ -6601,8 +6512,7 @@ function extractClaudeUserText(messageRaw: unknown): string | null {
interface ClaudeCommandLifecycle {
commandUuid: string;
/** "cancelled" is terminal too: API errors, interrupts and "now" pre-emption end a message. */
state: "queued" | "started" | "completed" | "cancelled";
state: "queued" | "started" | "completed";
}
/** Runtime-only Claude frames are validated here because the SDK's public union omits them. */
@@ -6611,7 +6521,7 @@ function readClaudeCommandLifecycle(message: unknown): ClaudeCommandLifecycle |
if (record?.type !== "command_lifecycle") return null;
if (
typeof record.command_uuid !== "string" ||
!["queued", "started", "completed", "cancelled"].includes(String(record.state))
!["queued", "started", "completed"].includes(String(record.state))
) {
return null;
}
@@ -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));
@@ -511,33 +511,6 @@ describe("ClaudeTaskProtocolSource", () => {
expect(source.cancelRunningForegroundTasks()).toEqual([]);
});
it("does not cancel a subagent announced as backgrounded at spawn", () => {
// Claude sets is_backgrounded on task_started for a child spawned in the background, and
// sends no task_updated patch for it.
const source = new ClaudeTaskProtocolSource();
source.observe(taskStarted({ is_backgrounded: true }));
expect(source.cancelRunningForegroundTasks()).toEqual([]);
});
it("does not cancel a resumed subagent, which Claude always runs in the background", () => {
const source = new ClaudeTaskProtocolSource();
source.observe(taskStarted({ tool_use_id: "toolu_original", is_backgrounded: false }));
source.observe(taskUpdated("completed"));
source.observe(taskStarted({ tool_use_id: "toolu_resumed", is_backgrounded: true }));
expect(source.cancelRunningForegroundTasks()).toEqual([]);
});
it("still cancels a subagent announced in the foreground", () => {
const source = new ClaudeTaskProtocolSource();
source.observe(taskStarted({ is_backgrounded: false }));
expect(source.cancelRunningForegroundTasks()).toEqual([
{ kind: "status", id: "toolu_01DgLoPMW9", status: "canceled" },
]);
});
it("still routes a backgrounded subagent that settles after the interrupt", () => {
// The headline case: interrupt, continue, and the child that was told to outlive the turn
// reports completion later. Wiping the routing table on cancel drops this on the floor and
@@ -16,8 +16,7 @@ import {
*
* Verified on the wire (Claude Code 2.1.220, Paseo's own query options):
*
* task_started task_id, tool_use_id, description, subagent_type, task_type,
* is_backgrounded
* task_started task_id, tool_use_id, description, subagent_type, task_type
* task_updated task_id, patch.status, patch.is_backgrounded
* task_notification task_id, tool_use_id, status
*
@@ -40,11 +39,6 @@ interface TaskStartedMessage {
task_type?: string;
prompt?: string;
skip_transcript?: boolean;
/**
* Set at spawn: true for a task registered in the background. A resumed subagent is always
* registered in the background.
*/
is_backgrounded?: boolean;
}
/** Task-tool subagents. Backgrounded shell commands announce as `local_bash`. */
@@ -77,8 +71,8 @@ interface TaskUpdatedMessage {
task_id: string;
/**
* `is_backgrounded` is declared on `SDKTaskUpdatedMessage["patch"]`: it flips when a foreground
* task is moved to the background after `task_started`. Together with `task_started`'s own
* flag it separates a child that dies with its turn from one told to outlive it.
* task is backgrounded, which is the only signal that separates a child that dies with its turn
* from one that was explicitly told to outlive it.
*/
patch?: { status?: string; is_backgrounded?: boolean };
}
@@ -177,8 +171,8 @@ export class ClaudeTaskProtocolSource {
/** Workflow invocations already own a real Workflow card in the parent timeline. */
private readonly idsWithExistingParentToolCard = new Set<string>();
/**
* Declared subagents running in the background, whether spawned there or moved there later.
* They outlive the turn that spawned them, so a turn ending is not evidence that they stopped.
* Declared subagents that were moved to the background. They outlive the turn that spawned
* them, so a turn ending is not evidence that they stopped.
*/
private readonly backgroundedIds = new Set<string>();
/** Last status emitted per subagent, so a redundant announcement is not re-broadcast. */
@@ -337,7 +331,6 @@ export class ClaudeTaskProtocolSource {
this.sawTaskStarted = true;
const existingId = this.subagentIdByTaskId.get(message.task_id);
this.recordBackgrounded(existingId ?? id, message.is_backgrounded);
if (existingId) {
return this.observeExistingTaskStart(message, id, existingId);
}
@@ -421,15 +414,14 @@ export class ClaudeTaskProtocolSource {
private observeTaskUpdated(message: TaskUpdatedMessage): SubagentObservation[] {
const id = this.subagentIdByTaskId.get(message.task_id);
if (id) this.recordBackgrounded(id, message.patch?.is_backgrounded);
const backgrounded = message.patch?.is_backgrounded;
if (id && typeof backgrounded === "boolean") {
if (backgrounded) this.backgroundedIds.add(id);
else this.backgroundedIds.delete(id);
}
return this.observeStatus(message.task_id, message.patch?.status);
}
private recordBackgrounded(id: string, backgrounded: boolean | undefined): void {
if (backgrounded === true) this.backgroundedIds.add(id);
else if (backgrounded === false) this.backgroundedIds.delete(id);
}
private observeTaskNotification(message: TaskNotificationMessage): SubagentObservation[] {
const observations = this.observeWorkflowResult(message);
observations.push(...this.observeUsage(message.task_id, message.usage));
@@ -459,9 +459,7 @@ describe("OMP agent client and session", () => {
test("fails a turn when the provider idle gate passes its deadline", async () => {
const scheduler = new ManualIdleScheduler();
// Long enough that the gate's first check, made right after the turn ends, cannot already
// be past it on a slow runner.
const omp = new OmpHarness({ providerIdleScheduler: scheduler, providerIdleDeadlineMs: 50 });
const omp = new OmpHarness({ providerIdleScheduler: scheduler, providerIdleDeadlineMs: 1 });
await omp.start();
const { completion } = await omp.startPromptUntilProviderIdle("first", "first done", {
isStreaming: true,
@@ -475,7 +473,7 @@ describe("OMP agent client and session", () => {
args: { command: "sleep 30" },
});
expect(omp.runningToolCallIds()).toEqual(["tool-at-deadline"]);
await new Promise((resolve) => setTimeout(resolve, 60));
await new Promise((resolve) => setTimeout(resolve, 2));
scheduler.retry();
await expect(completion).rejects.toThrow(/provider idle/i);
expect(omp.runningToolCallIds()).toEqual([]);
@@ -87,8 +87,7 @@ function mergeToolCallDetail(existing: ToolCallDetail, incoming: ToolCallDetail)
return incoming;
}
/** Fold a later update for the same tool call into the one it follows. */
export function mergeToolCallItems(
function mergeToolCallItems(
existing: Extract<AgentTimelineItem, { type: "tool_call" }>,
incoming: Extract<AgentTimelineItem, { type: "tool_call" }>,
): Extract<AgentTimelineItem, { type: "tool_call" }> {
+2 -2
View File
@@ -126,7 +126,6 @@ import { createPaseoWorktree as createRegisteredPaseoWorktree } from "./paseo-wo
import { createWorkspaceProvisioningService } from "./session/workspace-provisioning/workspace-provisioning-service.js";
import { createPaseoWorktreeWorkflow } from "./worktree-session.js";
import { DownloadTokenStore } from "./file-download/token-store.js";
import { formatAttachmentContentDisposition } from "./file-download/content-disposition.js";
import type { OpenAiSpeechProviderConfig } from "./speech/providers/openai/config.js";
import type { LocalSpeechProviderConfig } from "./speech/providers/local/config.js";
import type { RequestedSpeechProviders } from "./speech/speech-types.js";
@@ -837,8 +836,9 @@ export async function createPaseoDaemon(
return;
}
const safeFileName = entry.fileName.replace(/["\r\n]/g, "_");
res.setHeader("Content-Type", entry.mimeType);
res.setHeader("Content-Disposition", formatAttachmentContentDisposition(entry.fileName));
res.setHeader("Content-Disposition", `attachment; filename="${safeFileName}"`);
res.setHeader("Content-Length", fileStats.size.toString());
const stream = fileHandle.createReadStream();
@@ -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);
});
@@ -24,77 +24,42 @@ describe("daemon E2E", () => {
}, 60000);
describe("file download tokens", () => {
test.each([
{ fileName: "download.txt", disposition: 'attachment; filename="download.txt"' },
{
fileName: "café.txt",
disposition: "attachment; filename=\"caf?.txt\"; filename*=UTF-8''caf%C3%A9.txt",
},
{
fileName: "中文报告 (最终版).txt",
disposition:
"attachment; filename=\"???? (???).txt\"; filename*=UTF-8''%E4%B8%AD%E6%96%87%E6%8A%A5%E5%91%8A%20%28%E6%9C%80%E7%BB%88%E7%89%88%29.txt",
},
{
fileName: "報告書.md",
disposition:
"attachment; filename=\"???.md\"; filename*=UTF-8''%E5%A0%B1%E5%91%8A%E6%9B%B8.md",
},
{
fileName: "보고서.txt",
disposition:
"attachment; filename=\"???.txt\"; filename*=UTF-8''%EB%B3%B4%EA%B3%A0%EC%84%9C.txt",
},
{
fileName: "report-📄.txt",
disposition:
"attachment; filename=\"report-??.txt\"; filename*=UTF-8''report-%F0%9F%93%84.txt",
},
])(
"issues token over WS and downloads $fileName via HTTP",
async ({ fileName, disposition }) => {
const cwd = tmpCwd();
try {
const filePath = path.join(cwd, fileName);
const fileContents = "download test payload";
writeFileSync(filePath, fileContents, "utf-8");
test("issues token over WS and downloads via HTTP", async () => {
const cwd = tmpCwd();
const filePath = path.join(cwd, "download.txt");
const fileContents = "download test payload";
writeFileSync(filePath, fileContents, "utf-8");
const agent = await ctx.client.createAgent({
provider: "codex",
model: CODEX_TEST_MODEL,
thinkingOptionId: CODEX_TEST_THINKING_OPTION_ID,
cwd,
title: "Download Token Test Agent",
});
const agent = await ctx.client.createAgent({
provider: "codex",
model: CODEX_TEST_MODEL,
thinkingOptionId: CODEX_TEST_THINKING_OPTION_ID,
cwd,
title: "Download Token Test Agent",
});
expect(agent.id).toMatch(
/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,
);
expect(agent.id).toBeTruthy();
const tokenResponse = await ctx.client.requestDownloadToken(cwd, fileName);
const tokenResponse = await ctx.client.requestDownloadToken(cwd, "download.txt");
expect(tokenResponse.error).toBeNull();
expect(tokenResponse.token).toMatch(
/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,
);
expect(tokenResponse.fileName).toBe(fileName);
expect(tokenResponse.error).toBeNull();
expect(tokenResponse.token).toBeTruthy();
expect(tokenResponse.fileName).toBe("download.txt");
const response = await fetch(
`http://127.0.0.1:${ctx.daemon.port}/api/files/download?token=${tokenResponse.token}`,
);
const response = await fetch(
`http://127.0.0.1:${ctx.daemon.port}/api/files/download?token=${tokenResponse.token}`,
);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe(tokenResponse.mimeType);
expect(response.headers.get("content-disposition")).toBe(disposition);
expect(response.status).toBe(200);
expect(response.headers.get("content-type")).toBe(tokenResponse.mimeType);
const disposition = response.headers.get("content-disposition") ?? "";
expect(disposition).toContain("download.txt");
const body = await response.text();
expect(body).toBe(fileContents);
} finally {
rmSync(cwd, { recursive: true, force: true });
}
},
60000,
);
const body = await response.text();
expect(body).toBe(fileContents);
rmSync(cwd, { recursive: true, force: true });
}, 60000);
test("rejects invalid token", async () => {
const response = await fetch(
@@ -0,0 +1,115 @@
import { mkdirSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import path from "node:path";
import pino from "pino";
import { expect, test } from "vitest";
import { OpenCodeV2AgentClient } from "../agent/providers/opencode/v2/agent.js";
import { DaemonClient } from "../test-utils/daemon-client.js";
import { createTestPaseoDaemon } from "../test-utils/paseo-daemon.js";
// Reproduction for #6006. Needs an OpenCode 2.x binary in OPENCODE_V2_BIN.
const OPENCODE_V2_BIN = process.env.OPENCODE_V2_BIN;
const PROVIDER = "paseo-catalog-drift";
const KEPT_MODEL = "kept-model";
const RETIRED_MODEL = "retired-model";
function catalog(modelIds: string[]) {
return {
[PROVIDER]: {
id: PROVIDER,
env: ["PASEO_CATALOG_DRIFT_KEY"],
npm: "@ai-sdk/openai-compatible",
api: "http://127.0.0.1:9/v1",
name: "Catalog drift",
models: Object.fromEntries(
modelIds.map((id) => [
id,
{
id,
name: id,
attachment: false,
reasoning: false,
tool_call: true,
temperature: true,
release_date: "2025-06-17",
last_updated: "2025-06-17",
modalities: { input: ["text"], output: ["text"] },
open_weights: false,
limit: { context: 128_000, output: 8_000 },
cost: { input: 0, output: 0 },
},
]),
),
},
};
}
test.runIf(OPENCODE_V2_BIN)(
"a model OpenCode dropped from its catalog stays in the picker and fails to apply",
async () => {
const logger = pino({ level: "silent" });
const root = realpathSync(mkdtempSync(path.join(tmpdir(), "opencode-v2-catalog-drift-")));
const modelsPath = path.join(root, "models.json");
const cwd = path.join(root, "work");
mkdirSync(cwd);
writeFileSync(modelsPath, JSON.stringify(catalog([KEPT_MODEL, RETIRED_MODEL])));
const provider = new OpenCodeV2AgentClient({
logger,
settings: {
command: { mode: "replace", argv: [OPENCODE_V2_BIN!] },
env: {
OPENCODE_MODELS_PATH: modelsPath,
OPENCODE_DISABLE_MODELS_FETCH: "1",
OPENCODE_DISABLE_AUTO_UPDATE: "1",
PASEO_CATALOG_DRIFT_KEY: "test",
XDG_CONFIG_HOME: path.join(root, "config"),
XDG_DATA_HOME: path.join(root, "data"),
XDG_CACHE_HOME: path.join(root, "cache"),
},
},
});
const daemon = await createTestPaseoDaemon({ agentClients: { opencode: provider }, logger });
const client = new DaemonClient({ url: `ws://127.0.0.1:${daemon.port}/ws` });
try {
await client.connect();
await client.fetchAgents({ subscribe: {} });
const before = await client.listProviderModels("opencode", { cwd });
expect(before.models?.map((entry) => entry.id)).toContain(`${PROVIDER}/${RETIRED_MODEL}`);
// OpenCode's catalog drops the model while Paseo sits idle.
writeFileSync(modelsPath, JSON.stringify(catalog([KEPT_MODEL])));
const agent = await client.createAgent({
provider: "opencode",
cwd,
title: "catalog drift",
model: `${PROVIDER}/${KEPT_MODEL}`,
modeId: "build",
});
const listed = await client.listProviderModels("opencode", { cwd });
const offered = listed.models?.map((entry) => entry.id) ?? [];
let switchError: string | null = null;
if (offered.includes(`${PROVIDER}/${RETIRED_MODEL}`)) {
try {
await client.setAgentModel(agent.id, `${PROVIDER}/${RETIRED_MODEL}`);
} catch (error) {
switchError = error instanceof Error ? error.message : String(error);
}
}
// Every model the picker offers must be one OpenCode accepts.
expect({ offered, switchError }).toEqual({
offered: [`${PROVIDER}/${KEPT_MODEL}`],
switchError: null,
});
} finally {
await client.close().catch(() => undefined);
await daemon.close().catch(() => undefined);
rmSync(root, { recursive: true, force: true });
}
},
180_000,
);
@@ -304,166 +304,6 @@ async function waitForRunningClaudeSleep(
);
}
// Explicit point-in-time polls of agent status, on top of (not instead of) the pushed
// agent_update events the collector already records. A phantom "running" flip that starts and
// ends between two polls would still be caught by the pushed-event scan the callers pair this
// with; polling here additionally proves the daemon answers fetchAgent with "idle" throughout,
// not just that it eventually pushes one.
async function sampleAgentStatuses(
client: DaemonClient,
agentId: string,
samples: number,
intervalMs: number,
): Promise<string[]> {
const statuses: string[] = [];
for (let i = 0; i < samples; i += 1) {
const snapshot = await client.fetchAgent({ agentId });
statuses.push(snapshot?.agent.status ?? "missing");
if (i < samples - 1) {
await sleep(intervalMs);
}
}
return statuses;
}
// NOTE: agent_stream events on the wire (AgentStreamEventPayloadSchema in
// packages/protocol/src/messages.ts) do not include a "provider_subagent" variant. A backgrounded
// subagent's descriptor updates are forwarded exclusively as separate "agent.provider_subagents.update"
// messages (see forwardProviderSubagentUpdate in session.ts), and that push channel's delivery is
// gated by capabilities this test's plain DaemonClient does not declare. list_provider_subagents is a
// plain request/response RPC unaffected by that gating, so status history below polls it directly
// instead of trying to reconstruct status transitions from the stream.
type ProviderSubagentDescriptor = Awaited<
ReturnType<DaemonClient["listProviderSubagents"]>
>["subagents"][number];
interface ProviderSubagentPoll {
subagent: ProviderSubagentDescriptor;
// Every status observed while polling, in order, so a transient cancel cannot hide behind a
// later "completed" read even though the store's status field is not expected to un-cancel.
history: string[];
}
// Polls agent.provider_subagents.list until the backgrounded helper is registered at all.
// "Main's turn is running" (waitForAgentUpsert) fires on generic turn-start bookkeeping, which
// can be true before Claude has actually issued the Agent tool call; canceling that early
// cancels a turn with no helper launched yet, which is not what "Stop spares a helper" means to
// test. This confirms the helper actually exists before the caller acts on it.
async function waitForProviderSubagentToExist(
client: DaemonClient,
agentId: string,
timeoutMs = 60_000,
): Promise<ProviderSubagentDescriptor> {
const deadline = Date.now() + timeoutMs;
while (Date.now() < deadline) {
const { subagents } = await client.listProviderSubagents(agentId);
if (subagents[0]) {
return subagents[0];
}
await sleep(300);
}
throw new Error(
`Timed out waiting for a background helper to be registered for agent ${agentId}`,
);
}
// Claude starts the wake-up turn a moment after the helper's completion lands (0.1 to 5 s in
// recorded traces), so poll for it instead of checking the instant the helper reads completed.
// The daemon announces an autonomous turn to subscribers as a pushed "running" agent_update,
// not as an agent_stream turn_started (that stream reaches the client that started a run).
async function waitForWakeTurn(
collector: ReturnType<typeof createMessageCollector>,
agentId: string,
fromIndex: number,
timeoutMs = 30_000,
): Promise<boolean> {
const deadline = Date.now() + timeoutMs;
while (Date.now() < deadline) {
const window = collector.messages.slice(fromIndex);
const woke =
getAgentStatuses(window, agentId).includes("running") ||
window.some(
(message) =>
message.type === "agent_stream" &&
message.payload.agentId === agentId &&
message.payload.event.type === "turn_started",
);
if (woke) return true;
await sleep(500);
}
return false;
}
// The wake-up turn runs briefly after it opens, so the final state is read once it settles.
async function waitForAgentStatus(
client: DaemonClient,
agentId: string,
status: string,
timeoutMs = 60_000,
): Promise<string | undefined> {
const deadline = Date.now() + timeoutMs;
let last: string | undefined;
while (Date.now() < deadline) {
last = (await client.fetchAgent({ agentId }))?.agent.status;
if (last === status) return last;
await sleep(500);
}
return last;
}
// Polls agent.provider_subagents.list until the single backgrounded helper leaves "running".
// Scenarios in this file always launch exactly one background helper, so subagents[0] is it.
async function waitForProviderSubagentTerminal(
client: DaemonClient,
agentId: string,
timeoutMs = 90_000,
): Promise<ProviderSubagentPoll> {
const deadline = Date.now() + timeoutMs;
const history: string[] = [];
let lastSeen: ProviderSubagentDescriptor[] = [];
while (Date.now() < deadline) {
const { subagents } = await client.listProviderSubagents(agentId);
lastSeen = subagents;
const subagent = subagents[0];
if (subagent) {
history.push(subagent.status);
if (subagent.status !== "running") {
return { subagent, history };
}
}
await sleep(1_000);
}
throw new Error(
`Timed out waiting for the background helper to leave "running". history=${JSON.stringify(history)} lastSeen=${JSON.stringify(lastSeen)}`,
);
}
// Pulls the main agent's own assistant text via fetchAgentTimeline rather than the push
// collector. Assistant text delivery is paced (docs/agent-stream-performance.md), so checking
// the collector immediately after waitForFinish resolves can still miss the final text; the
// timeline fetch is authoritative and matches what the pre-existing tests in this file do.
async function fetchAssistantTexts(
client: DaemonClient,
agentId: string,
limit = 100,
): Promise<string[]> {
const timeline = await client.fetchAgentTimeline(agentId, { limit });
return timeline.entries
.filter((entry) => entry.item.type === "assistant_message")
.map((entry) => (entry.item as Extract<AgentTimelineItem, { type: "assistant_message" }>).text);
}
async function fetchSubagentAssistantTexts(
client: DaemonClient,
agentId: string,
subagentId: string,
): Promise<string[]> {
const timeline = await client.fetchProviderSubagentTimeline(agentId, subagentId, { limit: 50 });
return timeline.rows
.filter((row) => row.item.type === "assistant_message")
.map((row) => (row.item as Extract<AgentTimelineItem, { type: "assistant_message" }>).text);
}
describe("daemon E2E (real claude) - send message during tool call", () => {
let canRun = false;
interface SteeringResources {
@@ -664,141 +504,6 @@ describe("daemon E2E (real claude) - send message during tool call", () => {
}
}, 210_000);
test("a background subagent keeps running after a message is sent while it works", async () => {
// The scenario the rest of this file explicitly rules out: every other test here tells Claude
// "Do not use a background task", so steering during a backgrounded subagent was never
// covered. A subagent streams on the parent's channel, so a parent that mistakes the child's
// frames for its own work reports "running" after it has already finished, and the message
// sent into that window is refused, or delivered by cancelling the turn and taking the
// subagent with it. Both outcomes are user-visible, and both are what this asserts against.
const logger = pino({ level: "silent" });
const resources: SteeringResources = {
cwd: tmpCwd(),
daemon: null,
client: null,
collector: null,
};
try {
resources.daemon = await createTestPaseoDaemon({
agentClients: { claude: new ClaudeAgentClient({ logger }) },
logger,
});
resources.client = new DaemonClient({ url: `ws://127.0.0.1:${resources.daemon.port}/ws` });
const { client, cwd } = resources;
if (!client) throw new Error("Claude background-subagent test client was not created");
await within("connect background-subagent test client", 15_000, client.connect());
await within(
"subscribe background-subagent test client",
15_000,
client.fetchAgents({ subscribe: {} }),
);
const agent = await within(
"create background-subagent test agent",
30_000,
client.createAgent({
cwd: cwd ?? process.cwd(),
title: "claude-background-survives-send",
...getRealProviderConfig("claude"),
}),
);
resources.collector = createMessageCollector(client);
await within(
"launch one background subagent and end the turn",
30_000,
client.sendAgentMessage(
agent.id,
[
"Use the Agent tool exactly once with run_in_background: true.",
"subagent_type: general-purpose.",
`description: "bg survivor".`,
`prompt: "Use the Bash tool with run_in_background: true to run exactly: sleep 40.`,
`Wait for its completion notification, then reply exactly: CHILD_DONE."`,
"Immediately after launching it, reply with the single word LAUNCHED and end your turn.",
"Do not wait for it. Do not call any other tools.",
].join(" "),
{ messageId: generateClientMessageId() },
),
);
// The main session has ended its turn. It must read as idle even though the subagent it
// launched is still streaming on the shared channel.
const afterLaunch = await within(
"wait for the main session to go idle after launching the subagent",
120_000,
client.waitForFinish(agent.id, 110_000),
);
expect(
afterLaunch.status,
"a main session that finished its turn must not report busy because a subagent is running",
).not.toBe("running");
// And a message sent in that window must be accepted rather than refused.
const followUpId = generateClientMessageId();
await within(
"send a message to the idle main session while the subagent runs",
30_000,
client.sendAgentMessage(agent.id, "Are you there? Reply exactly: MAIN_ALIVE.", {
messageId: followUpId,
}),
);
await within(
"wait for the main session to answer",
120_000,
client.waitForFinish(agent.id, 110_000),
);
const timeline = await within(
"fetch background-subagent timeline",
15_000,
client.fetchAgentTimeline(agent.id, { limit: 200 }),
);
const assistantText = timeline.entries
.filter((entry) => entry.item.type === "assistant_message")
.map(
(entry) => (entry.item as Extract<AgentTimelineItem, { type: "assistant_message" }>).text,
)
.join("\\n");
expect(
assistantText,
"the main session must be reachable while its background subagent still runs",
).toContain("MAIN_ALIVE");
// The subagent must have survived the send rather than being cancelled with the turn. Its
// status is read from agent.provider_subagents.list (see the note above
// waitForProviderSubagentToExist): agent_stream carries no provider_subagent events.
const { subagents } = await within(
"list provider subagents after the send",
15_000,
client.listProviderSubagents(agent.id),
);
expect(subagents.length, "the background subagent must be tracked").toBeGreaterThan(0);
expect(
subagents.map((subagent) => subagent.status),
"a backgrounded subagent must not be canceled by a message sent to the main session",
).not.toContain("canceled");
const { subagent, history } = await within(
"wait for the background subagent to finish",
90_000,
waitForProviderSubagentTerminal(client, agent.id, 80_000),
);
expect(subagent.status, "the helper must complete, not be canceled or fail").toBe(
"completed",
);
expect(history, "no status poll may read canceled").not.toContain("canceled");
} finally {
const cleanup = await Promise.allSettled([
Promise.resolve(resources.collector?.unsubscribe()),
resources.client?.close() ?? Promise.resolve(),
resources.daemon?.close() ?? Promise.resolve(),
]);
if (resources.cwd) rmSync(resources.cwd, { recursive: true, force: true });
const failures = cleanup.flatMap((result) =>
result.status === "rejected" ? [result.reason] : [],
);
expect(failures, "Claude background-subagent E2E cleanup failures").toEqual([]);
}
}, 300_000);
test("Stop cancels a queued Claude steer before it can resume the interrupted turn", async () => {
const logger = pino({ level: "silent" });
const cwd = tmpCwd();
@@ -973,430 +678,4 @@ describe("daemon E2E (real claude) - send message during tool call", () => {
rmSync(cwd, { recursive: true, force: true });
}
}, 300_000);
test("a helper's own nested background job does not phantom-run the parent or kill the helper", async () => {
// The exact reported bug: main backgrounds a helper, the helper itself starts its OWN
// background job (a grandchild from main's perspective) and then keeps working in the
// foreground. The grandchild's completion is bookkeeping that belongs to the helper, not to
// main, and must not make main phantom-report "running" or get treated as busy.
const logger = pino({ level: "silent" });
const resources: SteeringResources = {
cwd: tmpCwd(),
daemon: null,
client: null,
collector: null,
};
try {
resources.daemon = await createTestPaseoDaemon({
agentClients: { claude: new ClaudeAgentClient({ logger }) },
logger,
});
resources.client = new DaemonClient({ url: `ws://127.0.0.1:${resources.daemon.port}/ws` });
const { client, cwd } = resources;
if (!client) throw new Error("nested background-job test client was not created");
await within("connect nested background-job test client", 15_000, client.connect());
await within(
"subscribe nested background-job test client",
15_000,
client.fetchAgents({ subscribe: {} }),
);
const agent = await within(
"create nested background-job test agent",
30_000,
client.createAgent({
cwd: cwd ?? process.cwd(),
title: "claude-nested-background-job",
...getRealProviderConfig("claude"),
}),
);
resources.collector = createMessageCollector(client);
await within(
"launch a helper with its own nested background job and end the turn",
30_000,
client.sendAgentMessage(
agent.id,
[
"Use the Agent tool exactly once with run_in_background: true.",
"subagent_type: general-purpose.",
`description: "nested bg survivor".`,
`prompt: "Use the Bash tool with run_in_background: true to run exactly:`,
`python3 -c 'import time; time.sleep(5)'.`,
`Immediately after starting it, without waiting for it, use the Bash tool again`,
`in the foreground to run exactly: python3 -c 'import time; time.sleep(50)'.`,
`After that foreground command finishes, reply exactly: CHILD_DONE."`,
"Immediately after launching it, reply with the single word LAUNCHED and end your turn.",
"Do not wait for it. Do not call any other tools.",
].join(" "),
{ messageId: generateClientMessageId() },
),
);
const afterLaunch = await within(
"wait for the main session to go idle after launching the nested-background helper",
120_000,
client.waitForFinish(agent.id, 110_000),
);
expect(afterLaunch.status, "the main session must be idle once it replied LAUNCHED").toBe(
"idle",
);
// The helper's own nested background job (5s) finishes while the helper is still busy
// in its unrelated foreground sleep (50s). Sample for 30s, well past the nested job's
// completion even when the helper is slow to start it,
// both by polling and by scanning every pushed agent_update in the window, so a brief
// phantom flip cannot slip between polls.
const sampleWindowStart = resources.collector.messages.length;
const polledStatuses = await sampleAgentStatuses(client, agent.id, 11, 3_000);
const pushedStatuses = getAgentStatuses(
resources.collector.messages.slice(sampleWindowStart),
agent.id,
);
const observedRunning = [...polledStatuses, ...pushedStatuses].filter(
(status) => status === "running",
);
expect(
observedRunning,
`the parent must stay idle across the nested job's completion; polled=${JSON.stringify(polledStatuses)} pushed=${JSON.stringify(pushedStatuses)}`,
).toEqual([]);
// A message sent in that window must still be answered normally.
await within(
"send PONG request while the nested job settles",
30_000,
client.sendMessage(agent.id, "Reply with exactly PONG.", {
messageId: generateClientMessageId(),
}),
);
await within("wait for the PONG reply", 60_000, client.waitForFinish(agent.id, 50_000));
// Pulled via fetchAgentTimeline, not the push collector: assistant text delivery is paced
// (docs/agent-stream-performance.md) and can trail waitForFinish's own completion signal,
// so the collector can still be missing the final text the instant waitForFinish resolves.
const pongTexts = await within(
"fetch timeline for the PONG reply",
15_000,
fetchAssistantTexts(client, agent.id, 20),
);
expect(
pongTexts.join("\n"),
"the agent must answer PONG while the helper is still running",
).toContain("PONG");
const messagesBeforeWake = resources.collector.messages.length;
// The helper itself must survive: never recorded canceled, and it eventually reports
// CHILD_DONE from its own foreground sleep finishing.
const { subagent, history } = await within(
"wait for the nested-background helper to finish",
90_000,
waitForProviderSubagentTerminal(client, agent.id, 80_000),
);
expect(subagent.status, "the helper must complete, not be canceled or fail").toBe(
"completed",
);
expect(
history,
`no provider subagent status poll may ever read canceled; history=${JSON.stringify(history)}`,
).not.toContain("canceled");
const subagentTexts = await fetchSubagentAssistantTexts(client, agent.id, subagent.id);
expect(
subagentTexts.join("\n"),
"the helper's own transcript must contain its final CHILD_DONE reply",
).toContain("CHILD_DONE");
// The helper's completion should wake the main session with a fresh turn (the
// session-state-driven autonomous turn), separate from the PONG exchange above.
const wokeMainAgent = await waitForWakeTurn(
resources.collector,
agent.id,
messagesBeforeWake,
);
if (!wokeMainAgent) {
const wakeWindowMessages = resources.collector.messages.slice(messagesBeforeWake);
const wakeWindowEventTypes = wakeWindowMessages
.filter(
(message) => message.type === "agent_stream" && message.payload.agentId === agent.id,
)
.map((message) =>
message.type === "agent_stream" ? message.payload.event.type : "unknown",
);
const timeline = await client
.fetchAgentTimeline(agent.id, { limit: 100 })
.catch(() => null);
throw new Error(
`the helper's completion must wake the main session with a new turn. ` +
`wakeWindowEventTypes=${JSON.stringify(wakeWindowEventTypes)} ` +
`recentTimeline=${JSON.stringify(timeline ? summarizeTimelineItems(timeline) : null)}`,
);
}
expect(await waitForAgentStatus(client, agent.id, "idle"), "the agent must end idle").toBe(
"idle",
);
} finally {
const cleanup = await Promise.allSettled([
Promise.resolve(resources.collector?.unsubscribe()),
resources.client?.close() ?? Promise.resolve(),
resources.daemon?.close() ?? Promise.resolve(),
]);
if (resources.cwd) rmSync(resources.cwd, { recursive: true, force: true });
const failures = cleanup.flatMap((result) =>
result.status === "rejected" ? [result.reason] : [],
);
expect(failures, "nested background-job E2E cleanup failures").toEqual([]);
}
}, 300_000);
test("the app's default steer survives a backgrounded helper while the main session works", async () => {
// appSettings.sendBehavior defaults to "steer" (packages/app/src/hooks/use-settings/storage.ts),
// so this is what the app actually sends when a user replies while an agent looks busy.
const logger = pino({ level: "silent" });
const resources: SteeringResources = {
cwd: tmpCwd(),
daemon: null,
client: null,
collector: null,
};
try {
resources.daemon = await createTestPaseoDaemon({
agentClients: { claude: new ClaudeAgentClient({ logger }) },
logger,
});
resources.client = new DaemonClient({ url: `ws://127.0.0.1:${resources.daemon.port}/ws` });
const { client, cwd } = resources;
if (!client) throw new Error("default-steer background-helper test client was not created");
await within("connect default-steer test client", 15_000, client.connect());
await within(
"subscribe default-steer test client",
15_000,
client.fetchAgents({ subscribe: {} }),
);
const agent = await within(
"create default-steer test agent",
30_000,
client.createAgent({
cwd: cwd ?? process.cwd(),
title: "claude-default-steer-background-helper",
...getRealProviderConfig("claude"),
}),
);
resources.collector = createMessageCollector(client);
await within(
"launch the background helper and start the main session's own foreground sleep",
30_000,
client.sendAgentMessage(
agent.id,
[
"Use the Agent tool exactly once with run_in_background: true.",
"subagent_type: general-purpose.",
`description: "bg survivor b".`,
`prompt: "Use the Bash tool in the foreground to run exactly:`,
`python3 -c 'import time; time.sleep(42)'. After it finishes, reply exactly: CHILD_DONE."`,
"Do not wait for that background helper to finish before continuing.",
"After launching it, use the Bash tool one more time yourself, WITHOUT run_in_background,",
"to run exactly: python3 -c 'import time; time.sleep(16)'.",
// Matching the proven pattern from the first test in this file: tell Claude to wait
// for a later message rather than relying on the sleep call itself to block, since a
// Bash call can resolve through Claude Code's own async task_notification path once a
// background subagent is already active instead of blocking the turn.
"Do not reply or finish your turn until a later user message arrives, no matter how",
"quickly that Bash command finishes. When that later message arrives, address it and",
"end your turn. Do not call any other tools.",
].join(" "),
{ messageId: generateClientMessageId() },
),
);
// Confirm the daemon considers main's own turn active before steering it. This does not
// wait for a specific "sleep 16" shell call to show as running: Claude Code 2.1.280 can
// report a slower Bash call through its own async task_notification tool instead of a
// classic blocking call once a background subagent is already active, so pinning to a
// literal running shell tool_call is not reliable here. Busy at the daemon level is what
// "while main is busy with its own sleep" actually needs.
await within(
"confirm main's own turn is active before steering",
30_000,
client.waitForAgentUpsert(agent.id, (snapshot) => snapshot.status === "running", 25_000),
);
// The running status precedes the Agent tool call, so a steer sent on it alone can reach
// Claude before the helper exists and prove nothing about a helper surviving it.
await within(
"confirm the background helper is registered before steering",
60_000,
waitForProviderSubagentToExist(client, agent.id, 55_000),
);
await within(
"send the app's default steer while main is busy with its own sleep",
30_000,
client.sendMessage(agent.id, "Reply with exactly PONG.", {
messageId: generateClientMessageId(),
activeTurnBehavior: "steer",
}),
);
const finish = await within(
"wait for the main session to finish after the steer",
120_000,
client.waitForFinish(agent.id, 110_000),
);
expect(finish.status, "the main session must end idle after the steer").toBe("idle");
// Pulled via fetchAgentTimeline, not the push collector: see fetchAssistantTexts.
const postSteerTexts = await within(
"fetch timeline for the post-steer PONG reply",
15_000,
fetchAssistantTexts(client, agent.id, 20),
);
expect(postSteerTexts.join("\n"), "PONG must be answered after the steer").toContain("PONG");
const { subagent, history } = await within(
"wait for the background helper to finish",
90_000,
waitForProviderSubagentTerminal(client, agent.id, 80_000),
);
expect(subagent.status, "the helper must complete, not be canceled or fail").toBe(
"completed",
);
expect(
history,
`no provider subagent status poll may ever read canceled; history=${JSON.stringify(history)}`,
).not.toContain("canceled");
const subagentTexts = await fetchSubagentAssistantTexts(client, agent.id, subagent.id);
expect(
subagentTexts.join("\n"),
"the helper's own transcript must contain its final CHILD_DONE reply",
).toContain("CHILD_DONE");
} finally {
const cleanup = await Promise.allSettled([
Promise.resolve(resources.collector?.unsubscribe()),
resources.client?.close() ?? Promise.resolve(),
resources.daemon?.close() ?? Promise.resolve(),
]);
if (resources.cwd) rmSync(resources.cwd, { recursive: true, force: true });
const failures = cleanup.flatMap((result) =>
result.status === "rejected" ? [result.reason] : [],
);
expect(failures, "default-steer background-helper E2E cleanup failures").toEqual([]);
}
}, 300_000);
test("Stop cancels the main session's own turn but spares its background helper", async () => {
const logger = pino({ level: "silent" });
const resources: SteeringResources = {
cwd: tmpCwd(),
daemon: null,
client: null,
collector: null,
};
try {
resources.daemon = await createTestPaseoDaemon({
agentClients: { claude: new ClaudeAgentClient({ logger }) },
logger,
});
resources.client = new DaemonClient({ url: `ws://127.0.0.1:${resources.daemon.port}/ws` });
const { client, cwd } = resources;
if (!client) throw new Error("Stop-spares-helper test client was not created");
await within("connect Stop-spares-helper test client", 15_000, client.connect());
await within(
"subscribe Stop-spares-helper test client",
15_000,
client.fetchAgents({ subscribe: {} }),
);
const agent = await within(
"create Stop-spares-helper test agent",
30_000,
client.createAgent({
cwd: cwd ?? process.cwd(),
title: "claude-stop-spares-helper",
...getRealProviderConfig("claude"),
}),
);
resources.collector = createMessageCollector(client);
await within(
"launch the background helper and start the main session's own foreground sleep",
30_000,
client.sendAgentMessage(
agent.id,
[
"Use the Agent tool exactly once with run_in_background: true.",
"subagent_type: general-purpose.",
`description: "bg survivor c".`,
`prompt: "Use the Bash tool in the foreground to run exactly:`,
`python3 -c 'import time; time.sleep(43)'. After it finishes, reply exactly: CHILD_DONE."`,
"Do not wait for that background helper to finish before continuing.",
"After launching it, use the Bash tool one more time yourself, WITHOUT run_in_background,",
"to run exactly: python3 -c 'import time; time.sleep(23)'.",
"Do not call any other tools.",
].join(" "),
{ messageId: generateClientMessageId() },
),
);
// Confirm the helper has actually been launched (registered) before Stop, not just that
// main's turn shows "running": that status can flip true on generic turn-start bookkeeping
// before Claude has issued the Agent tool call, and canceling that early cancels a turn
// with no helper to spare yet.
await within(
"confirm the background helper is registered before Stop",
60_000,
waitForProviderSubagentToExist(client, agent.id, 55_000),
);
const messagesBeforeStop = resources.collector.messages.length;
await within("Stop the main session's own turn", 30_000, client.cancelAgent(agent.id));
const afterStop = await within(
"wait for the agent to go idle after Stop",
60_000,
client.waitForFinish(agent.id, 50_000),
);
expect(afterStop.status, "Stop must leave the agent idle").toBe("idle");
// The helper must survive Stop: it keeps running and later reports CHILD_DONE, which
// wakes the main session with a fresh autonomous turn.
const { subagent, history } = await within(
"wait for the background helper to finish after Stop",
90_000,
waitForProviderSubagentTerminal(client, agent.id, 80_000),
);
expect(subagent.status, "Stop must not cancel or fail the background helper").toBe(
"completed",
);
expect(
history,
`no provider subagent status poll may ever read canceled; history=${JSON.stringify(history)}`,
).not.toContain("canceled");
const subagentTexts = await fetchSubagentAssistantTexts(client, agent.id, subagent.id);
expect(
subagentTexts.join("\n"),
"the helper's own transcript must contain its final CHILD_DONE reply",
).toContain("CHILD_DONE");
const wokeMainAgent = await waitForWakeTurn(
resources.collector,
agent.id,
messagesBeforeStop,
);
expect(
wokeMainAgent,
"the helper's completion after Stop must wake the main session with a new turn",
).toBe(true);
expect(await waitForAgentStatus(client, agent.id, "idle"), "the agent must end idle").toBe(
"idle",
);
} finally {
const cleanup = await Promise.allSettled([
Promise.resolve(resources.collector?.unsubscribe()),
resources.client?.close() ?? Promise.resolve(),
resources.daemon?.close() ?? Promise.resolve(),
]);
if (resources.cwd) rmSync(resources.cwd, { recursive: true, force: true });
const failures = cleanup.flatMap((result) =>
result.status === "rejected" ? [result.reason] : [],
);
expect(failures, "Stop-spares-helper E2E cleanup failures").toEqual([]);
}
}, 300_000);
});
@@ -3,7 +3,7 @@ import { existsSync } from "node:fs";
import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
import { tmpdir, uptime } from "node:os";
import { join } from "node:path";
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
import { afterEach, beforeEach, describe, expect, test } from "vitest";
import { readDaemonInstance, stopDaemonInstance } from "./daemon-instance.js";
import { acquirePidLock, getPidLockInfo, isLocked, type PidLockInfo } from "./pid-lock.js";
@@ -94,42 +94,3 @@ describe("daemon instance identity across a reboot", () => {
await expect(readFile(join(paseoHome, "paseo.pid"), "utf-8")).rejects.toThrow(/ENOENT/);
});
});
// Linux keeps a boot's id while a VM is paused for a host sleep, though the VM's wall clock
// runs ahead of its uptime once it resumes. A sleep longer than the time between boot and
// the supervisor's start puts the wall-clock boot instant after the lock's startedAt.
describe.runIf(process.platform === "linux")("daemon instance identity on Linux", () => {
let paseoHome: string;
beforeEach(async () => {
paseoHome = await mkdtemp(join(tmpdir(), "paseo-daemon-instance-linux-"));
});
afterEach(async () => {
vi.useRealTimers();
await rm(paseoHome, { recursive: true, force: true });
});
test("a supervisor still holds the lock after its paused VM resumes", async () => {
await acquirePidLock(paseoHome, null, { ownerPid: process.pid });
vi.useFakeTimers({ toFake: ["Date"] });
vi.setSystemTime(Date.now() + uptime() * 1000 + 12 * 60 * 60_000);
expect(await readDaemonInstance(paseoHome)).toMatchObject({ pid: process.pid });
expect(await isLocked(paseoHome)).toMatchObject({ locked: true });
await expect(
acquirePidLock(paseoHome, null, { ownerPid: process.pid + 10_000 }),
).rejects.toThrow("Another Paseo daemon is already running");
});
test("a lock written during another boot has no running owner", async () => {
await writeLock(paseoHome, {
...lockFor(process.pid, new Date()),
bootId: "00000000-0000-0000-0000-000000000000",
});
expect(await readDaemonInstance(paseoHome)).toBeNull();
expect(await isLocked(paseoHome)).toMatchObject({ locked: false });
});
});
@@ -1,42 +0,0 @@
import { describe, expect, test } from "vitest";
import { formatAttachmentContentDisposition } from "./content-disposition.js";
describe("formatAttachmentContentDisposition", () => {
test.each([
{ fileName: "report.txt", disposition: 'attachment; filename="report.txt"' },
{
fileName: "café.txt",
disposition: "attachment; filename=\"caf?.txt\"; filename*=UTF-8''caf%C3%A9.txt",
},
{
fileName: "Résumé Ångström.pdf",
disposition:
"attachment; filename=\"R?sum? ?ngstr?m.pdf\"; filename*=UTF-8''R%C3%A9sum%C3%A9%20%C3%85ngstr%C3%B6m.pdf",
},
{
fileName: "中文报告 (最终版).txt",
disposition:
"attachment; filename=\"???? (???).txt\"; filename*=UTF-8''%E4%B8%AD%E6%96%87%E6%8A%A5%E5%91%8A%20%28%E6%9C%80%E7%BB%88%E7%89%88%29.txt",
},
{
fileName: "report-📄.txt",
disposition:
"attachment; filename=\"report-??.txt\"; filename*=UTF-8''report-%F0%9F%93%84.txt",
},
{
fileName: 'say "hi" \\ bye.txt',
disposition: 'attachment; filename="say \\"hi\\" \\\\ bye.txt"',
},
{
fileName: "100%25 done.txt",
disposition: "attachment; filename=\"100%25 done.txt\"; filename*=UTF-8''100%2525%20done.txt",
},
{
fileName: "l'été (1)*.txt",
disposition:
"attachment; filename=\"l'?t? (1)*.txt\"; filename*=UTF-8''l%27%C3%A9t%C3%A9%20%281%29%2A.txt",
},
])("$fileName", ({ fileName, disposition }) => {
expect(formatAttachmentContentDisposition(fileName)).toBe(disposition);
});
});
@@ -1,32 +0,0 @@
const NON_PRINTABLE_ASCII = /[^\x20-\x7e]/g;
const PERCENT_ESCAPE = /%[0-9A-Fa-f]{2}/;
const QUOTED_STRING_SPECIALS = /[\\"]/g;
const NON_ATTR_CHARS_LEFT_BY_URI_ENCODING = /['()*]/g;
/**
* Content-Disposition for a file download (RFC 6266).
*
* Any name that is not plain ASCII also gets `filename*=UTF-8''…`, because
* browsers do not read raw Latin-1 bytes in `filename` and fall back to a name
* taken from the URL. A name with a percent escape gets it too, so browsers do
* not decode the escape in `filename`.
*/
export function formatAttachmentContentDisposition(fileName: string): string {
const asciiFileName = fileName.replace(NON_PRINTABLE_ASCII, "?");
const disposition = `attachment; filename=${quote(asciiFileName)}`;
if (asciiFileName === fileName && !PERCENT_ESCAPE.test(fileName)) {
return disposition;
}
return `${disposition}; filename*=UTF-8''${encodeExtendedValue(fileName)}`;
}
function quote(value: string): string {
return `"${value.replace(QUOTED_STRING_SPECIALS, "\\$&")}"`;
}
function encodeExtendedValue(value: string): string {
return encodeURIComponent(value).replace(
NON_ATTR_CHARS_LEFT_BY_URI_ENCODING,
(char) => `%${char.charCodeAt(0).toString(16).toUpperCase()}`,
);
}
+2 -28
View File
@@ -1,4 +1,3 @@
import { readFileSync } from "node:fs";
import { open, readFile, stat, unlink, utimes } from "node:fs/promises";
import type { FileHandle } from "node:fs/promises";
import { ensurePrivateDirectory } from "./private-files.js";
@@ -16,7 +15,6 @@ export const pidLockInfoSchema = z.object({
serverId: z.string().nullable().optional(),
desktopManaged: z.boolean().optional(),
heartbeat: z.literal(true).optional(),
bootId: z.string().optional(),
});
export interface PidLockInfo extends z.infer<typeof pidLockInfoSchema> {}
@@ -64,38 +62,16 @@ function precedesThisBoot(startedAt: string): boolean {
return stamped < Date.now() - uptime() * 1000 - BOOT_INSTANT_TOLERANCE_MS;
}
let cachedBootId: string | null | undefined;
// Linux names each boot. The wall-clock boot instant is not enough there: a VM paused while
// its host sleeps keeps its uptime, so after it resumes the instant lands after locks its
// running supervisor wrote.
function currentBootId(): string | null {
if (cachedBootId === undefined) {
try {
cachedBootId = readFileSync("/proc/sys/kernel/random/boot_id", "utf-8").trim() || null;
} catch {
cachedBootId = null;
}
}
return cachedBootId;
}
function writtenDuringThisBoot(lock: PidLockInfo): boolean {
const thisBoot = currentBootId();
if (lock.bootId && thisBoot) return lock.bootId === thisBoot;
return !precedesThisBoot(lock.startedAt);
}
/**
* Whether the process that wrote this lock is still running.
*
* A PID alone does not identify the supervisor: the operating system hands the number to
* something else once the supervisor is gone, and a reboot reassigns it freely. A process
* cannot predate the boot it runs under, so a lock written during another boot is abandoned
* cannot predate the boot it runs under, so a lock stamped before this boot is abandoned
* however alive its PID looks.
*/
export function isPidLockOwnerRunning(lock: PidLockInfo): boolean {
if (!writtenDuringThisBoot(lock)) return false;
if (precedesThisBoot(lock.startedAt)) return false;
return isPidRunning(lock.pid);
}
@@ -238,7 +214,6 @@ export async function acquirePidLock(
}
// Create new lock with exclusive flag
const bootId = currentBootId();
const lockInfo: PidLockInfo = {
pid: lockOwnerPid,
startedAt: new Date().toISOString(),
@@ -246,7 +221,6 @@ export async function acquirePidLock(
uid: process.getuid?.() ?? 0,
listen,
heartbeat: true,
...(bootId ? { bootId } : {}),
...(process.env.PASEO_DESKTOP_MANAGED === "1" ? { desktopManaged: true } : {}),
};
@@ -419,7 +419,7 @@ describe("PluginService", () => {
await service.stopAllPlugins();
}, 20_000);
it("lists manifest metadata for running and disabled plugins without hiding malformed entries", async () => {
it("lists manifest descriptions for running and disabled plugins without hiding malformed entries", async () => {
const home = await mkdtemp(path.join(tmpdir(), "paseo-plugin-home-"));
roots.push(home);
const running = await createPlugin("running", "export default () => () => {};");
@@ -427,13 +427,7 @@ describe("PluginService", () => {
const malformed = await createPlugin("malformed", "export default () => () => {};");
await writeFile(
path.join(running, "paseo-plugin.json"),
JSON.stringify({
id: "running",
description: "Runs checks",
name: "Checks",
icon: "icon.png",
media: ["screenshot.png", "https://example.com/demo.mp4"],
}),
JSON.stringify({ id: "running", description: "Runs checks" }),
);
await writeFile(
path.join(disabled, "paseo-plugin.json"),
@@ -449,23 +443,11 @@ describe("PluginService", () => {
await service.start();
expect(
(await service.listPlugins()).map(({ id, description, name, icon, media }) => ({
id,
description,
name,
icon,
media,
})),
(await service.listPlugins()).map(({ id, description }) => ({ id, description })),
).toEqual([
{ id: "disabled", description: "Waits until enabled" },
{ id: "malformed", description: undefined },
{
id: "running",
description: "Runs checks",
name: "Checks",
icon: "icon.png",
media: ["screenshot.png", "https://example.com/demo.mp4"],
},
{ id: "running", description: "Runs checks" },
]);
await service.stopAllPlugins();
});
+1 -6
View File
@@ -216,12 +216,7 @@ export class PluginService {
}),
};
const manifest = await readPluginManifest(path.resolve(source.path)).catch(() => null);
if (manifest) {
item.name = manifest.name;
item.description = manifest.description;
item.icon = manifest.icon;
item.media = manifest.media;
}
if (manifest?.description) item.description = manifest.description;
item.installation = await this.managedSources
?.describe(id, source.path)
.catch(() => undefined);
@@ -24,69 +24,6 @@ describe("plugin manifest", () => {
});
});
it("reads display metadata and ignores future top-level fields", async () => {
const directory = await mkdtemp(path.join(tmpdir(), "paseo-plugin-manifest-"));
directories.push(directory);
const manifest = {
id: "review",
name: "Review tools",
icon: "assets/icon.png",
media: ["assets/screenshot.webp", "demo.mp4", "https://example.com/media?id=1"],
};
await writeFile(
path.join(directory, "paseo-plugin.json"),
JSON.stringify({ ...manifest, futureField: { enabled: true } }),
);
await expect(readPluginManifest(directory)).resolves.toEqual(manifest);
});
it.each([
{ name: " " },
{ name: 42 },
{ icon: "" },
{ icon: 42 },
{ icon: "icon.svg" },
{ icon: "/icon.png" },
{ icon: "../icon.png" },
{ icon: "assets/../../icon.png" },
{ icon: "https://example.com/icon.png" },
{ icon: "C:/icon.png" },
{ icon: "assets\\icon.png" },
{ icon: "icon.png?query" },
{ media: "screenshot.png" },
{ media: [42] },
{ media: [""] },
{ media: ["../demo.mp4"] },
{ media: ["/demo.mp4"] },
{ media: ["http://example.com/demo.mp4"] },
{ media: ["https://"] },
{ media: ["//example.com/demo.mp4"] },
{ media: ["file:///demo.mp4"] },
{ media: ["data:image/png;base64,abc"] },
{ media: ["."] },
{ media: ["assets/"] },
{ id: "INVALID" },
{ description: 42 },
{ requirements: { paseoo: ">=0.11.0" } },
])("rejects invalid known fields: %j", async (fields) => {
const directory = await mkdtemp(path.join(tmpdir(), "paseo-plugin-manifest-"));
directories.push(directory);
await writeFile(
path.join(directory, "paseo-plugin.json"),
JSON.stringify({ id: "example", futureField: true, ...fields }),
);
await expect(readPluginManifest(directory)).rejects.toThrow();
});
it("accepts omitted metadata and empty media", async () => {
const directory = await mkdtemp(path.join(tmpdir(), "paseo-plugin-manifest-"));
directories.push(directory);
for (const manifest of [{ id: "example" }, { id: "example", media: [] }]) {
await writeFile(path.join(directory, "paseo-plugin.json"), JSON.stringify(manifest));
await expect(readPluginManifest(directory)).resolves.toEqual(manifest);
}
});
it("reads and validates requirements before any plugin code runs", async () => {
const directory = await mkdtemp(path.join(tmpdir(), "paseo-plugin-manifest-"));
directories.push(directory);
+8 -27
View File
@@ -8,33 +8,14 @@ const MANIFEST_FILENAME = "paseo-plugin.json";
const PluginBuildCommandSchema = z
.array(z.string().refine((argument) => argument.trim().length > 0))
.min(1);
// Manifest asset paths use forward slashes and stay inside the plugin package.
const PluginAssetPathSchema = z
.string()
.min(1)
.refine(
(value) =>
value === value.trim() &&
!value.startsWith("/") &&
!/[\\:?#\p{Cc}]/u.test(value) &&
!value.split("/").includes("..") &&
!value.endsWith("/") &&
value.split("/").at(-1) !== ".",
"Expected a relative file path inside the plugin package",
);
const PluginManifestSchema = z.object({
id: PluginIdSchema,
name: z.string().trim().min(1).optional(),
description: z.string().trim().min(1).optional(),
icon: PluginAssetPathSchema.refine(
(value) => /\.png$/i.test(value),
"Expected a relative path to a PNG",
).optional(),
media: z.array(z.union([PluginAssetPathSchema, z.url({ protocol: /^https$/ })])).optional(),
// A misspelled requirement must not silently disable compatibility checks.
requirements: PluginRequirementsSchema.strict().optional(),
build: z.array(PluginBuildCommandSchema).min(1).optional(),
});
const PluginManifestSchema = z
.object({
id: PluginIdSchema,
description: z.string().trim().min(1).optional(),
requirements: PluginRequirementsSchema.strict().optional(),
build: z.array(PluginBuildCommandSchema).min(1).optional(),
})
.strict();
export type PluginManifest = z.infer<typeof PluginManifestSchema>;
@@ -1,5 +1,5 @@
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
import pino from "pino";
import type pino from "pino";
import { createClientChannel, type Transport } from "@getpaseo/relay/e2ee";
import { exportPublicKey, generateKeyPair } from "@getpaseo/relay";
import { startRelayTransport } from "./relay-transport";
@@ -146,37 +146,6 @@ describe("relay-transport control lifecycle", () => {
vi.useRealTimers();
});
test("releases a stalled encrypted data connection without restarting control", async () => {
vi.useFakeTimers();
let attachments = 0;
controllers.push(
startRelayTransport({
logger: pino({ level: "silent" }),
attachSocket: async () => {
attachments += 1;
},
relayEndpoint: "relay.paseo.sh:443",
relayUseTls: true,
serverId: "srv_test",
daemonKeyPair: generateKeyPair(),
createWebSocket: relay.createWebSocket,
}),
);
const control = relay.sockets[0];
control.open();
const connected = JSON.stringify({ type: "connected", connectionId: "stalled" });
control.message(connected);
const stalled = relay.sockets[1];
stalled.open();
await vi.advanceTimersByTimeAsync(15_000);
expect(stalled.terminateCalls).toBe(1);
expect(attachments).toBe(0);
expect(control.terminateCalls).toBe(0);
control.message(connected);
expect(relay.sockets).toHaveLength(3);
expect(relay.sockets[2].url).toBe(stalled.url);
});
test("logs relay_control_connected only after first valid control message", () => {
const logger = createMockLogger();
const controller = startRelayTransport({
@@ -420,10 +420,6 @@ async function attachEncryptedSocket(
attachSocket: (ws: RelaySocketLike, metadata?: ExternalSocketMetadata) => Promise<void>,
metadata?: ExternalSocketMetadata,
): Promise<void> {
const handshakeTimeout = setTimeout(() => {
logger.warn("relay_e2ee_handshake_timeout_terminating");
socket.terminate();
}, 15_000);
try {
const relayTransport = createRelayTransportAdapter(socket, logger);
const emitter = new EventEmitter();
@@ -444,7 +440,6 @@ async function attachEncryptedSocket(
emitter.emit("error", error);
},
});
clearTimeout(handshakeTimeout);
const encryptedSocket = createEncryptedRelaySocket({
channel,
emitter,
@@ -464,8 +459,6 @@ async function attachEncryptedSocket(
} catch {
// ignore
}
} finally {
clearTimeout(handshakeTimeout);
}
}
@@ -510,7 +510,9 @@ it("starts the default shell through the worker and accepts quoted commands", as
session.send({ type: "input", data: `${command}\r` });
await expect.poll(() => readFileSync(markerPath, "utf8"), { timeout: 10000 }).toBe("shell-ok");
await waitForCondition(() => existsSync(markerPath), 10000);
expect(readFileSync(markerPath, "utf8")).toBe("shell-ok");
});
it("lists subdirectory terminals when querying the workspace root", async () => {
+18 -66
View File
@@ -8,13 +8,6 @@ async function openPlugins(page: Page) {
await expect(page.getByRole("heading", { level: 1, name: /^Plugins/ })).toBeVisible();
}
function pluginCards(page: Page, section: string): Locator {
return page
.getByRole("region", { name: section })
.getByRole("link")
.filter({ hasNotText: /^See all$/ });
}
test("browses from the directory into a category, a plugin, and its author", async ({
page,
context,
@@ -41,14 +34,14 @@ test("browses from the directory into a category, a plugin, and its author", asy
await page.getByRole("link", { name: /Fresh Worktrees/ }).click();
await expect(page).toHaveURL(/\/plugins\/omercnet\/fresh-worktrees$/);
await expect(page.getByRole("heading", { name: "Fresh Worktrees" })).toHaveCount(1);
await expect(page.getByText("paseo plugin add omercnet/fresh-worktrees")).toHaveCount(1);
await expect(page.getByText("paseo plugin install omercnet/fresh-worktrees")).toHaveCount(1);
await expect(
page.getByRole("heading", { level: 2, name: "Behavior", exact: true }),
).toBeVisible();
await page.getByRole("button", { name: "Copy to clipboard" }).click();
await expect
.poll(() => page.evaluate(() => (window as unknown as { __copied?: string }).__copied))
.toBe("paseo plugin add omercnet/fresh-worktrees");
.toBe("paseo plugin install omercnet/fresh-worktrees");
await expect(page.getByRole("link", { name: "Git", exact: true })).toHaveAttribute(
"href",
"/plugins/category/git",
@@ -113,35 +106,6 @@ test("keeps the directory's ranking window when searching", async ({ page }) =>
);
});
test("searches for a term typed before the page finished loading", async ({ page }) => {
const loadScripts = await holdScripts(page);
await page.goto("/plugins?window=month", { waitUntil: "domcontentloaded" });
await searchPlugins(page, "graphite");
await loadScripts();
await expect(page.getByRole("button", { name: "Clear search" })).toBeVisible();
await page.keyboard.press("Enter");
await expect(page).toHaveURL(/\/plugins\/all\?q=graphite&window=month$/);
});
test("filters browse results for a term typed before the page finished loading", async ({
page,
}) => {
await page.goto("/");
const loadScripts = await holdScripts(page);
await page.goto("/plugins/all", { waitUntil: "domcontentloaded" });
const entries = await historyLength(page);
await searchPlugins(page, "gra");
await loadScripts();
await expect(page).toHaveURL(/\/plugins\/all\?q=gra$/);
await expect(page.getByRole("heading", { level: 1, name: /^Results for “gra”/ })).toBeVisible();
await expect(page.getByRole("link", { name: /Dracula/ })).toHaveCount(0);
expect(await historyLength(page)).toBe(entries + 1);
await page.goBack();
await expect(page).toHaveURL(/\/plugins\/all$/);
await expect(page.getByRole("heading", { level: 1, name: /^All plugins/ })).toBeVisible();
});
test("clears the search with the clear button", async ({ page }) => {
await page.goto("/plugins/all");
const searchbox = page.getByRole("searchbox", { name: "Search plugins" });
@@ -242,7 +206,7 @@ test.describe("search engine visits without JavaScript", () => {
expect(response?.status()).toBe(200);
expect(response?.headers()["cache-control"]).toBe("private, no-store");
expect(response?.headers()["x-robots-tag"]).toBeUndefined();
await expect(page.getByText("paseo plugin add omercnet/fresh-worktrees")).toBeVisible();
await expect(page.getByText("paseo plugin install omercnet/fresh-worktrees")).toBeVisible();
await expect(
page.getByRole("heading", { level: 2, name: "Behavior", exact: true }),
).toBeVisible();
@@ -333,20 +297,6 @@ test.describe("search engine visits without JavaScript", () => {
});
});
/** Holds the page's scripts so typing lands before hydration; the returned function loads them. */
async function holdScripts(page: Page): Promise<() => Promise<void>> {
let release!: () => void;
const held = new Promise<void>((resolve) => (release = resolve));
await page.route(/\.js($|\?)/, async (route) => {
await held;
await route.continue();
});
return async () => {
release();
await page.waitForLoadState("load");
};
}
async function searchPlugins(page: Page, term: string) {
await page.getByRole("searchbox", { name: "Search plugins" }).fill(term);
}
@@ -388,18 +338,19 @@ async function expectPageMetadata(page: Page, title: string, path: string) {
);
}
test("links the directory from the site navigation", async ({ page }) => {
test("keeps the directory unlinked until the coordinated announcement", async ({ page }) => {
await page.goto("/");
await expect(
page.getByRole("navigation").getByRole("link", { name: "Plugins", exact: true }),
).toHaveAttribute("href", "/plugins");
page.getByRole("banner").getByRole("link", { name: "Plugins", exact: true }),
).toHaveCount(0);
await expect(
page.getByRole("contentinfo").getByRole("link", { name: "Plugins", exact: true }),
).toHaveAttribute("href", "/plugins");
await expect(page.getByRole("link", { name: "Browse plugins" })).toHaveAttribute(
).toHaveCount(0);
await expect(page.getByRole("link", { name: "Community plugins" })).toHaveAttribute(
"href",
"/plugins",
"https://paseo.cafe",
);
await expect(page.locator('a[href="/plugins"]')).toHaveCount(0);
const response = await page.goto("/plugins");
expect(response?.status()).toBe(200);
await expect(page.getByRole("heading", { level: 1, name: /^Plugins/ })).toBeVisible();
@@ -557,7 +508,11 @@ test.describe("registry fixture layout", () => {
await expect(page.getByRole("heading", { level: 2 }).first()).toHaveText("Featured");
const featured = page.getByRole("region", { name: "Featured" });
await expect(featured).toContainText("A selection of hand picked plugins");
await expect(pluginCards(page, "Featured")).toHaveText([/Dracula/, /Herald/, /launchd Jobs/]);
await expect(featured.getByRole("link", { name: /Added/ })).toHaveText([
/Dracula/,
/Herald/,
/launchd Jobs/,
]);
});
test("lists the nine categories in order with counts, and the newest plugins first", async ({
@@ -569,12 +524,9 @@ test.describe("registry fixture layout", () => {
CATEGORIES.map((category) => new RegExp(`^${category.label}\\s*\\d+$`)),
);
await expect(categories.getByRole("link", { name: /Extras/ })).toContainText("0");
await expect(pluginCards(page, "What’s new")).toHaveText([
/Base2Tone/,
/Sayr/,
/PromptKit/,
/Defer/,
]);
await expect(
page.getByRole("region", { name: "What’s new" }).getByRole("link", { name: /Added/ }),
).toHaveText([/Base2Tone/, /Sayr/, /PromptKit/, /Defer/]);
});
});
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/website",
"version": "0.11.2",
"version": "0.11.0-beta.5",
"private": true,
"type": "module",
"scripts": {
@@ -32,9 +32,7 @@ function AlternativePageContent({ slug }: { slug: string }) {
return (
<SiteShell width="default">
<div className="comparison-prose">
<DocsMarkdown>{page.content}</DocsMarkdown>
</div>
<DocsMarkdown>{page.content}</DocsMarkdown>
</SiteShell>
);
}
@@ -4,12 +4,13 @@ import {
ArrowRight,
Blocks,
Bot,
BookOpen,
Braces,
Coffee,
Compass,
ExternalLink,
Gem,
GitFork,
LayoutPanelLeft,
Laptop,
Lock,
Merge,
@@ -18,7 +19,6 @@ import {
Smartphone,
Terminal,
Users,
Workflow,
type LucideIcon,
} from "lucide-react";
import {
@@ -477,7 +477,7 @@ function TurnkeySection() {
<div className="space-y-0.5">
<h3 className="text-xl font-medium text-white/90">Desktop app</h3>
<p className="max-w-lg text-sm leading-relaxed text-white/50">
The one click experience, download the app and it just works, no server required
The one click experience, download the app and it just works
</p>
</div>
</div>
@@ -487,8 +487,8 @@ function TurnkeySection() {
<div className="grid gap-4 md:grid-cols-3">
<TurnkeyExtensionCard
icon={Smartphone}
title="Mobile"
description="Full client and native, not a WebView"
title="Mobile and web"
description="Connect to the same workspaces from any client"
ctaHref="/download"
ctaLabel="Download"
/>
@@ -793,105 +793,92 @@ function SdkAutomationExample() {
function ExtensibleSection() {
return (
<FeatureSection
title="Extend it with plugins"
description="Add new panels and functionality that work in desktop, web and mobile"
>
<div className="overflow-hidden rounded-2xl border border-white/10 bg-white/[0.02]">
<div className="flex flex-col gap-6 border-b border-white/10 p-6 sm:flex-row sm:items-center sm:justify-between md:p-8">
<div className="flex items-center gap-4">
<div className="rounded-xl border border-white/10 bg-white/[0.06] p-3 text-muted-foreground">
<Puzzle className="h-6 w-6" strokeWidth={1.5} />
</div>
<h3 className="text-xl font-medium text-white/90">Plugins</h3>
</div>
<div className="flex shrink-0 items-center gap-3">
<a
href={PLUGINS_BROWSE.href}
{...(PLUGINS_BROWSE.external ? { target: "_blank", rel: "noopener noreferrer" } : {})}
className="inline-flex items-center gap-1.5 rounded-full bg-foreground px-3 py-1.5 text-xs text-background transition-colors hover:bg-foreground/90"
>
Browse plugins
<ArrowRight className="h-3.5 w-3.5" />
</a>
<a
href="/docs/plugins"
className="inline-flex items-center gap-1.5 rounded-full border border-white/12 px-3 py-1.5 text-xs text-white/80 transition-colors hover:bg-white/10"
>
Plugin docs
</a>
</div>
</div>
<div className="p-6 md:p-8">
<div className="grid gap-4 md:grid-cols-3">
{PLUGIN_CAPABILITIES.map((capability) => (
<PluginCapabilityCard key={capability.title} {...capability} />
))}
</div>
</div>
<div className="flex flex-col gap-3 border-t border-white/10 px-6 py-5 sm:flex-row sm:items-center sm:justify-between md:px-8">
<p className="text-sm text-white/45">Paseo is Apache 2.0.</p>
<a
href="https://github.com/getpaseo/paseo"
target="_blank"
rel="noopener noreferrer"
className="inline-flex shrink-0 items-center gap-2 text-sm text-muted-foreground transition-colors hover:text-foreground"
>
<GitFork className="h-4 w-4" strokeWidth={1.5} />
Fork the repo
<ExternalLink className="h-3.5 w-3.5 opacity-70" />
</a>
</div>
<FeatureSection title="Make it yours" description="Extend Paseo to work just the way you want">
<div className="grid gap-4 md:grid-cols-2">
<ExtensibleCard
icon={Puzzle}
title="Plugins"
description="Plugins can add server-side functionality and modify the client with custom components. They work across all clients, including mobile"
links={PLUGIN_CARD_LINKS}
/>
<ExtensibleCard
icon={GitFork}
title="Fork the repo"
description="Paseo is licensed under Apache 2.0. You can inspect the implementation, fork the project, and adapt it to your workflow or organization"
links={FORK_CARD_LINKS}
/>
</div>
</FeatureSection>
);
}
const PLUGINS_BROWSE = PLUGINS_LINKED
? { href: "/plugins", external: false }
: { href: "https://paseo.cafe", external: true };
interface ExtensibleCardLink {
href: string;
label: string;
icon: React.ComponentType<{ className?: string }>;
external?: boolean;
/** Accent links stand out without hover, for destinations worth noticing. */
accent?: boolean;
}
const PLUGIN_CAPABILITIES: ReadonlyArray<{
icon: LucideIcon;
title: string;
description: string;
}> = [
const PLUGIN_CARD_LINKS: ReadonlyArray<ExtensibleCardLink> = [
{ href: "/docs/plugins", label: "Plugin documentation", icon: BookOpen },
PLUGINS_LINKED
? { href: "/plugins", label: "Community plugins", icon: Blocks, accent: true }
: {
href: "https://paseo.cafe",
label: "Community plugins",
icon: Coffee,
external: true,
accent: true,
},
];
const FORK_CARD_LINKS: ReadonlyArray<ExtensibleCardLink> = [
{
icon: LayoutPanelLeft,
title: "UI",
description: "Screens, workspace panels, sidebar items, slash commands, and themes",
},
{
icon: Workflow,
title: "Agent lifecycle",
description:
"Change configuration, environment, and MCP servers. Answer permissions. Follow up when a turn ends",
},
{
icon: Bot,
title: "Providers",
description: "Add a coding agent as a provider, used the same way as the built-in ones",
href: "https://github.com/getpaseo/paseo",
label: "View the repository",
icon: GitHubIcon,
external: true,
},
];
function PluginCapabilityCard({
function ExtensibleCard({
icon: Icon,
title,
description,
links,
}: {
icon: LucideIcon;
title: string;
description: string;
links: ReadonlyArray<ExtensibleCardLink>;
}) {
return (
<div className="flex flex-col rounded-xl border border-white/10 bg-white/[0.025] p-5">
<div className="mb-5 text-muted-foreground">
<Icon className="h-5 w-5" strokeWidth={1.5} />
<div className="flex min-h-64 flex-col rounded-xl border border-white/10 bg-white/[0.025] p-6">
<div className="mb-8 text-muted-foreground">
<Icon className="h-6 w-6" strokeWidth={1.5} />
</div>
<h3 className="font-medium text-white/85">{title}</h3>
<h3 className="text-lg font-medium text-white/85">{title}</h3>
<p className="mt-2 text-sm leading-relaxed text-white/45">{description}</p>
<div className="mt-auto flex flex-col items-start gap-3 pt-6">
{links.map((link) => (
<a
key={link.href}
href={link.href}
{...(link.external ? { target: "_blank", rel: "noopener noreferrer" } : {})}
className={
link.accent
? "inline-flex items-center gap-2 text-sm text-emerald-300/85 transition-colors hover:text-emerald-200"
: "inline-flex items-center gap-2 text-sm text-muted-foreground transition-colors hover:text-foreground"
}
>
<link.icon className="h-4 w-4" />
{link.label}
{link.external ? <ExternalLink className="h-3.5 w-3.5 opacity-70" /> : null}
</a>
))}
</div>
</div>
);
}
@@ -915,7 +902,8 @@ const PRINCIPLES: ReadonlyArray<{ icon: LucideIcon; title: string; description:
{
icon: Merge,
title: "Unified",
description: "Every coding agent, used the same way. Switch providers any time.",
description:
"Claude Code, Codex, OpenCode, Pi, Antigravity, Muse Code, and more, all used the same way.",
},
{
icon: Blocks,
@@ -935,17 +923,17 @@ function PhilosophySection() {
title="Philosophy"
description="What Paseo stands for, and what every feature is built on"
>
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
<div className="grid gap-4 md:grid-cols-2">
{PRINCIPLES.map((principle) => (
<div
key={principle.title}
className="rounded-xl border border-white/10 bg-white/[0.025] p-5"
className="rounded-xl border border-white/10 bg-white/[0.025] p-6"
>
<div className="flex items-center gap-3">
<principle.icon className="h-5 w-5 text-extra-muted-foreground" strokeWidth={1.5} />
<h3 className="font-medium text-white/85">{principle.title}</h3>
<div className="mb-8 text-extra-muted-foreground">
<principle.icon className="h-6 w-6" strokeWidth={1.5} />
</div>
<p className="mt-3 text-sm leading-relaxed text-white/45">{principle.description}</p>
<h3 className="text-lg font-medium text-white/85">{principle.title}</h3>
<p className="mt-2 text-sm leading-relaxed text-white/45">{principle.description}</p>
</div>
))}
</div>
@@ -19,7 +19,7 @@ export function SiteFooter({ width = "default" }: SiteFooterProps) {
<footer className={`${widthClasses} mx-auto mt-12 md:mt-16`}>
<div className="border-t border-white/10 pt-8 pb-4 grid grid-cols-2 sm:grid-cols-5 gap-8 text-sm">
<div className="space-y-3">
<p className="text-extra-muted-foreground">Product</p>
<p className="text-white/60 font-medium">Product</p>
<div className="space-y-2">
<a
href="/blog"
@@ -80,7 +80,7 @@ export function SiteFooter({ width = "default" }: SiteFooterProps) {
</div>
</div>
<div className="space-y-3">
<p className="text-extra-muted-foreground">Agents</p>
<p className="text-white/60 font-medium">Agents</p>
<div className="space-y-2">
<a
href="/claude-code"
@@ -121,7 +121,7 @@ export function SiteFooter({ width = "default" }: SiteFooterProps) {
</div>
</div>
<div className="space-y-3">
<p className="text-extra-muted-foreground">Alternatives</p>
<p className="text-white/60 font-medium">Alternatives</p>
<div className="space-y-2">
{alternatives.map((page) => (
<a
@@ -135,7 +135,7 @@ export function SiteFooter({ width = "default" }: SiteFooterProps) {
</div>
</div>
<div className="space-y-3">
<p className="text-extra-muted-foreground">Community</p>
<p className="text-white/60 font-medium">Community</p>
<div className="space-y-2">
<a
href="https://discord.gg/jz8T2uahpH"
@@ -164,7 +164,7 @@ export function SiteFooter({ width = "default" }: SiteFooterProps) {
</div>
</div>
<div className="space-y-3">
<p className="text-extra-muted-foreground">Download</p>
<p className="text-white/60 font-medium">Download</p>
<div className="space-y-2">
<a
href={appStoreUrl}
@@ -12,14 +12,6 @@ export function SiteHeader() {
<span className="text-lg font-medium">Paseo</span>
</a>
<div className="flex flex-wrap items-center justify-center gap-4">
{PLUGINS_LINKED && (
<a
href="/plugins"
className="text-sm text-muted-foreground hover:text-foreground transition-colors"
>
Plugins
</a>
)}
<a
href="/blog"
className="text-sm text-muted-foreground hover:text-foreground transition-colors"
@@ -32,6 +24,14 @@ export function SiteHeader() {
>
Docs
</a>
{PLUGINS_LINKED && (
<a
href="/plugins"
className="text-sm text-muted-foreground hover:text-foreground transition-colors"
>
Plugins
</a>
)}
<a
href="/changelog"
className="text-sm text-muted-foreground hover:text-foreground transition-colors"
@@ -53,10 +53,9 @@ const MAINTAINER_LINK = (
export function FounderNote() {
return (
<div className="max-w-2xl space-y-5 leading-relaxed text-white/70">
<p>Paseo is an independent project used by tens of thousands of developers daily.</p>
<p>
It is built by one person, full time, with no investors, no board and no company behind it.
I have turned down funding offers to keep it that way.
I build Paseo on my own. There are no investors, no board and no company behind it, and I
have turned down funding offers to keep it that way.
</p>
<p>
A tool that sits between you and your code, your keys and your machines has to stay neutral,
@@ -68,7 +67,7 @@ export function FounderNote() {
<a href="/hub" className="underline hover:text-white/90">
Paseo Hub
</a>
, an optional hosted service. Your support is what lets me keep working on it.
, an optional hosted service. Your support is what lets me work on Paseo full time.
</p>
<p className="text-white/50">{MAINTAINER_LINK}, maintainer</p>
</div>
@@ -80,6 +79,7 @@ interface BackingOption {
name: string;
icon: React.ComponentType<{ className?: string }>;
external: boolean;
primary?: boolean;
}
const BACKING_OPTIONS: ReadonlyArray<BackingOption> = [
@@ -88,6 +88,7 @@ const BACKING_OPTIONS: ReadonlyArray<BackingOption> = [
name: "GitHub Sponsors",
icon: GitHubIcon,
external: true,
primary: true,
},
{
href: OPEN_COLLECTIVE_URL,
@@ -126,7 +127,11 @@ export function BackingOptions() {
key={option.href}
href={option.href}
{...(option.external ? { target: "_blank", rel: "noopener noreferrer" } : {})}
className="flex items-center gap-4 rounded-xl border border-white/10 bg-white/[0.02] p-4 transition-colors hover:border-white/20 hover:bg-white/[0.05]"
className={`flex items-center gap-4 rounded-xl border p-4 transition-colors ${
option.primary
? "border-white/25 bg-white/[0.06] hover:border-white/40 hover:bg-white/[0.08]"
: "border-white/10 bg-white/[0.02] hover:border-white/20 hover:bg-white/[0.05]"
}`}
>
<option.icon className="h-6 w-6 shrink-0 text-white/60" />
<p className="flex items-center gap-1.5 font-medium text-white">
@@ -232,10 +237,9 @@ export function SponsorSection() {
<SectionHeading as="h2" title="Sponsor Paseo" />
<div className="space-y-10">
<div className="max-w-2xl space-y-5 leading-relaxed text-white/70">
<p>Paseo is an independent project used by tens of thousands of developers daily.</p>
<p>
It is built by one person, full time, with no investors and no company behind it. I have
turned down funding to keep it that way. A tool that sits between you and your code,
I build Paseo on my own, with no investors and no company behind it, and I have turned
down funding offers to keep it that way. A tool that sits between you and your code,
your keys and your machines has to stay neutral, and funding creates pressure to
monetize.
</p>
@@ -244,7 +248,7 @@ export function SponsorSection() {
<a href="/hub" className="underline hover:text-white/90">
Paseo Hub
</a>
. Your support is what lets me keep working on it.
, and your support is what lets me work on it full time.
</p>
<p className="text-white/50">{MAINTAINER_LINK}, maintainer</p>
</div>
@@ -45,7 +45,7 @@ Both Claude Desktop and Paseo are available on macOS, Windows, and Linux.
## Mobile
The mobile app is the full app, native on iOS and Android, with full feature parity with desktop.
Paseo ships native iOS and Android apps with the same agent workflow as the desktop app.
Claude has iOS and Android apps. Dispatch can start local Claude Code work through an active Claude Desktop host or start a cloud session on Anthropic's infrastructure.
@@ -84,7 +84,7 @@ paseo schedule create --cron "0 9 * * 1" "audit the codebase"
Both tools support parallel coding sessions, including Git worktrees.
Paseo also gives each worktree its own dev server URL. Two agents running their dev servers at the same time get `web--fix-auth--my-app.localhost` and `web--add-search--my-app.localhost` instead of port collisions.
Paseo also gives each worktree its own dev server URL. Two agents running their dev servers at the same time get `web.fix-auth.my-app.localhost` and `web.add-search.my-app.localhost` instead of port collisions.
## Voice
@@ -94,31 +94,25 @@ Claude supports voice in Claude's own mobile and app surfaces. Claude Code itsel
## Comparison
| | Paseo | Claude Desktop |
| ---------------------------- | -------------------------------------------------------------------------------------------------- | ------------------------------------------------ |
| License | Open source (Apache-2.0) | Not published as open source |
| Account required | No | Claude account |
| Desktop app | Yes (one click install, daemon bundled) | Yes (macOS, Linux, Windows) |
| Mobile app | Yes (native, full parity with desktop) | Claude app (Dispatch and Cowork) |
| CLI | Yes (everything the app does) | Yes (Claude Code CLI) |
| Remote machines | Yes (install the daemon anywhere) | Yes (SSH host, Anthropic-managed cloud sessions) |
| Built-in relay | Yes (opt-in, end-to-end encrypted, no account) | Anthropic Remote |
| Direct network access | Yes (LAN, Tailscale, VPN) | - |
| SSH access | Yes | Yes |
| Providers | Claude Code, Codex, OpenCode, Pi, Antigravity, Muse Code, 30+ more | Claude Code |
| Parallel agents | Yes (isolated worktrees, across machines) | Yes (Git worktrees) |
| Terminal agents | Yes (run any agent in a terminal, get notified when it finishes) | - |
| Agent orchestration | Yes (agents create worktrees and launch other agents, across providers) | - |
| Editor | Yes | Yes (file editor) |
| Terminals | Yes | Yes |
| Diff review | Yes (comments go to the agent) | Yes |
| Pull requests in app | GitHub, GitLab, Gitea, Forgejo, Codeberg | PR monitoring and merge workflows |
| In-app browser | Yes (element picker, agent browser tools) | Yes (live app preview) |
| Per-worktree dev server URLs | Yes (`web--fix-auth--my-app.localhost`) | No |
| Schedules and heartbeats | Yes | Yes (scheduled tasks) |
| Plan usage | Yes | - |
| Plugins | Yes (new screens, panels, agent hooks, and providers, one plugin runs on desktop, web, and mobile) | No |
| Voice | Yes (local dictation, realtime voice) | Yes (in Claude's mobile and app surfaces) |
| Telemetry | None | - |
| | Paseo | Claude Desktop |
| ---------------------------- | --------------------------------------------------------------------------------------- | ------------------------------------ |
| License | Open source (Apache-2.0) | Not published as open source |
| Desktop platforms | macOS, Linux, Windows | macOS, Linux, Windows |
| Mobile coding workflow | Native Paseo workspace on iOS and Android | Dispatch and Cowork in Claude mobile |
| Coding agents | Claude Code, Codex, OpenCode, Pi, Antigravity, Muse Code + 30+ via ACP catalog + custom | Claude Code |
| Product account required | No | Claude account |
| Cloud agent | Cloud waitlist | Claude Cowork and remote sessions |
| Required cloud connection | No | Claude account and services |
| Machines you control | Laptop, workstation, VM, server, or home lab | Local machine or SSH host |
| Git worktrees | Yes | Yes |
| Per-worktree dev server URLs | Yes | No |
| Split panes and tabs | Yes | Yes |
| In-app terminal | Yes | Yes |
| In-app browser / preview | Yes | Yes |
| GitHub workflow in app | Commit, push, PR, checks, reviews, merge | PR monitoring and merge workflows |
| CLI | Run, `--host`, ls, send, schedule, loop | Claude Code CLI |
| Remote transport | Direct connection or end-to-end encrypted relay | Anthropic Remote and cloud services |
| Application plugins | Server code and native client components | No |
| Self-hosted control plane | Daemon, web client, and relay | No |
See also: [Paseo vs Codex App](/alternatives/codex-app), [Paseo vs OpenCode Desktop](/alternatives/opencode-desktop), [Paseo vs Conductor](/alternatives/conductor).
@@ -45,7 +45,7 @@ OpenAI's desktop app and Paseo are available on macOS, Windows, and Linux.
## Mobile
The mobile app is the full app, native on iOS and Android, with full feature parity with desktop.
Paseo ships native iOS and Android apps with the same agent workflow as the desktop app.
ChatGPT Remote can start and continue Codex chats, approve actions, and review outputs from iOS and Android through a connected desktop host.
@@ -55,7 +55,7 @@ Both tools support Git worktrees for parallel work.
Codex App creates Codex-managed worktrees under `$CODEX_HOME/worktrees` and supports local environment setup scripts and project actions through `.codex` configuration.
Paseo creates worktrees under `$PASEO_HOME/worktrees`, runs setup and teardown hooks from `paseo.json`, and gives each worktree its own dev server URLs like `web--fix-auth--my-app.localhost` so parallel services don't fight for ports.
Paseo creates worktrees under `$PASEO_HOME/worktrees`, runs setup and teardown hooks from `paseo.json`, and gives each worktree its own dev server URLs like `web.fix-auth.my-app.localhost` so parallel services don't fight for ports.
## GitHub and review
@@ -88,31 +88,23 @@ Paseo supports dictation and realtime voice mode. Speech-to-text and text-to-spe
## Comparison
| | Paseo | Codex App |
| ---------------------------- | -------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| License | Open source (Apache-2.0) | Codex CLI is open source; application is proprietary |
| Account required | No | OpenAI account |
| Desktop app | Yes (one click install, daemon bundled) | Yes (macOS, Linux, Windows) |
| Mobile app | Yes (native, full parity with desktop) | ChatGPT app (Remote) |
| CLI | Yes (everything the app does) | Yes (Codex CLI) |
| Remote machines | Yes (install the daemon anywhere) | Yes (connected host, OpenAI-managed cloud) |
| Built-in relay | Yes (opt-in, end-to-end encrypted, no account) | OpenAI Remote |
| Direct network access | Yes (LAN, Tailscale, VPN) | - |
| SSH access | Yes | - |
| Providers | Claude Code, Codex, OpenCode, Pi, Antigravity, Muse Code, 30+ more | Codex |
| Parallel agents | Yes (isolated worktrees, across machines) | Yes (Git worktrees) |
| Terminal agents | Yes (run any agent in a terminal, get notified when it finishes) | - |
| Agent orchestration | Yes (agents create worktrees and launch other agents, across providers) | - |
| Editor | Yes | - |
| Terminals | Yes | Yes |
| Diff review | Yes (comments go to the agent) | Yes |
| Pull requests in app | GitHub, GitLab, Gitea, Forgejo, Codeberg | Commit, push, PR |
| In-app browser | Yes (element picker, agent browser tools) | Yes |
| Per-worktree dev server URLs | Yes (`web--fix-auth--my-app.localhost`) | No |
| Schedules and heartbeats | Yes | - |
| Plan usage | Yes | - |
| Plugins | Yes (new screens, panels, agent hooks, and providers, one plugin runs on desktop, web, and mobile) | No |
| Voice | Yes (local dictation, realtime voice) | Dictation |
| Telemetry | None | - |
| | Paseo | Codex App |
| ------------------------------- | --------------------------------------------------------------- | ---------------------------------------------------- |
| License | Open source (Apache-2.0) | Codex CLI is open source; application is proprietary |
| Desktop platforms | macOS, Linux, Windows | macOS, Linux, Windows |
| Mobile coding workflow | Native Paseo workspace on iOS and Android | ChatGPT Remote on iOS and Android |
| Providers | Codex, Claude Code, OpenCode, Pi + 30+ via ACP catalog + custom | Codex |
| Product account required | No | OpenAI account |
| Required Paseo cloud connection | No | Not applicable |
| Git worktrees | Yes | Yes |
| Per-worktree dev server URLs | Yes | No |
| In-app terminal | Yes | Yes |
| In-app browser | Yes | Yes |
| GitHub workflow in app | Commit, push, PR, checks, reviews, merge | Commit, push, PR |
| CLI | Run, `--host`, ls, send, schedule, loop | Codex CLI |
| Remote transport | Direct connection or end-to-end encrypted relay | OpenAI Remote |
| Application plugins | Server code and native client components | No |
| Voice | Dictation and realtime voice | Dictation |
| Self-hosted control plane | Daemon, web client, and relay | No |
See also: [Paseo vs Claude Desktop](/alternatives/claude-desktop), [Paseo vs OpenCode Desktop](/alternatives/opencode-desktop), [all supported providers](/agents).
@@ -67,11 +67,11 @@ Conductor lists its API as a Pro feature but does not document a user-facing CLI
Both tools isolate parallel agents in git worktrees.
Paseo also gives each worktree its own dev server URL. Two agents running their dev servers at the same time get `web--fix-auth--my-app.localhost` and `web--add-search--my-app.localhost` instead of port collisions.
Paseo also gives each worktree its own dev server URL. Two agents running their dev servers at the same time get `web.fix-auth.my-app.localhost` and `web.add-search.my-app.localhost` instead of port collisions.
## Mobile
The mobile app is the full app, native on iOS and Android, with full feature parity with desktop. Conductor lists its mobile app as coming soon under the Pro plan.
Paseo ships native iOS and Android apps today. Conductor lists its mobile app as coming soon under the Pro plan.
## Voice
@@ -79,31 +79,21 @@ Paseo supports local speech-to-text and text-to-speech. Conductor does not curre
## Comparison
| | Paseo | Conductor |
| ---------------------------- | -------------------------------------------------------------------------------------------------- | --------------------------------------- |
| License | Open source (Apache-2.0) | Closed source |
| Account required | No | Yes |
| Desktop app | Yes (one click install, daemon bundled) | Yes (macOS only) |
| Mobile app | Yes (native, full parity with desktop) | Coming soon under Pro |
| CLI | Yes (everything the app does) | API under Pro |
| Remote machines | Yes (install the daemon anywhere) | No (managed cloud workspaces under Pro) |
| Built-in relay | Yes (opt-in, end-to-end encrypted, no account) | - |
| Direct network access | Yes (LAN, Tailscale, VPN) | No |
| SSH access | Yes | No |
| Providers | Claude Code, Codex, OpenCode, Pi, Antigravity, Muse Code, 30+ more | Claude Code, Codex, Cursor, OpenCode |
| Parallel agents | Yes (isolated worktrees, across machines) | Yes (Git worktrees) |
| Terminal agents | Yes (run any agent in a terminal, get notified when it finishes) | - |
| Agent orchestration | Yes (agents create worktrees and launch other agents, across providers) | - |
| Editor | Yes | - |
| Terminals | Yes | Yes |
| Diff review | Yes (comments go to the agent) | - |
| Pull requests in app | GitHub, GitLab, Gitea, Forgejo, Codeberg | GitHub |
| In-app browser | Yes (element picker, agent browser tools) | - |
| Per-worktree dev server URLs | Yes (`web--fix-auth--my-app.localhost`) | - |
| Schedules and heartbeats | Yes | - |
| Plan usage | Yes | - |
| Plugins | Yes (new screens, panels, agent hooks, and providers, one plugin runs on desktop, web, and mobile) | No |
| Voice | Yes (local dictation, realtime voice) | - |
| Telemetry | None | - |
| | Paseo | Conductor |
| ---------------------------- | --------------------------------------------------------------------------------------- | ------------------------------------ |
| License | Open source (Apache-2.0) | Closed source |
| Platforms | macOS, Linux, Windows | macOS only |
| Native mobile | iOS, Android | Coming soon under Pro |
| Providers | Claude Code, Codex, OpenCode, Pi, Antigravity, Muse Code + 30+ via ACP catalog + custom | Claude Code, Codex, Cursor, OpenCode |
| Git worktrees | Yes | Yes |
| Per-worktree dev server URLs | Yes | — |
| Split panes and tabs | Yes | — |
| In-app terminal | Yes | Yes |
| In-app browser | Yes | — |
| GitHub workflow in app | Commit, push, PR, checks, reviews, merge | Yes |
| CLI | Run, `--host`, ls, send, schedule, loop | — |
| Application plugins | Server code and native client components | No |
| Local voice | Yes | Not documented |
| Self-hosted daemon | Yes | — |
See also: [Paseo vs Superset](/alternatives/superset), [Paseo vs OpenChamber](/alternatives/openchamber), [Paseo vs Happy Coder](/alternatives/happy-coder).
@@ -37,7 +37,7 @@ Paseo's app handles commit, push, opening PRs, watching checks and reviews, and
## Mobile
The mobile app is the full app, native on iOS and Android, with full feature parity with desktop. Happy Coder also ships native iOS and Android apps.
Both tools ship native iOS and Android apps.
## Providers
@@ -53,7 +53,7 @@ Happy Coder does not document an application extension API for adding both serve
## Worktrees and services
Paseo runs each agent in its own git worktree. Each worktree gets its own dev server URL like `web--fix-auth--my-app.localhost`, so parallel agents don't fight for the same port.
Paseo runs each agent in its own git worktree. Each worktree gets its own dev server URL like `web.fix-auth.my-app.localhost`, so parallel agents don't fight for the same port.
Happy Coder can start an agent in a selected machine path, including an existing Git worktree. It does not currently create or manage the worktree lifecycle.
@@ -79,31 +79,21 @@ Both products support voice interaction. Paseo can run speech-to-text and text-t
## Comparison
| | Paseo | Happy Coder |
| ---------------------------- | -------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
| License | Open source (Apache-2.0) | Open source (MIT) |
| Account required | No | - |
| Desktop app | Yes (one click install, daemon bundled) | Yes (macOS) |
| Mobile app | Yes (native, full parity with desktop) | Yes (native) |
| CLI | Yes (everything the app does) | Yes (launch and control sessions) |
| Remote machines | Yes (install the daemon anywhere) | - |
| Built-in relay | Yes (opt-in, end-to-end encrypted, no account) | Yes (end-to-end encrypted) |
| Direct network access | Yes (LAN, Tailscale, VPN) | - |
| SSH access | Yes | - |
| Providers | Claude Code, Codex, OpenCode, Pi, Antigravity, Muse Code, 30+ more | Claude Code, Codex |
| Parallel agents | Yes (isolated worktrees, across machines) | Existing worktree paths, no worktree management |
| Terminal agents | Yes (run any agent in a terminal, get notified when it finishes) | Yes (wraps the agent CLI) |
| Agent orchestration | Yes (agents create worktrees and launch other agents, across providers) | - |
| Editor | Yes | - |
| Terminals | Yes | Yes |
| Diff review | Yes (comments go to the agent) | Yes |
| Pull requests in app | GitHub, GitLab, Gitea, Forgejo, Codeberg | - |
| In-app browser | Yes (element picker, agent browser tools) | Yes (previews) |
| Per-worktree dev server URLs | Yes (`web--fix-auth--my-app.localhost`) | - |
| Schedules and heartbeats | Yes | - |
| Plan usage | Yes | - |
| Plugins | Yes (new screens, panels, agent hooks, and providers, one plugin runs on desktop, web, and mobile) | No |
| Voice | Yes (local dictation, realtime voice) | Yes |
| Telemetry | None | - |
| | Paseo | Happy Coder |
| ---------------------------- | --------------------------------------------------------------------------------------- | --------------------------- |
| License | Open source (Apache-2.0) | Open source (MIT) |
| Desktop app | macOS, Linux, Windows | macOS |
| Native mobile | iOS, Android | iOS, Android |
| Architecture | Daemon owns agent lifecycle | Wraps the agent CLI |
| Providers | Claude Code, Codex, OpenCode, Pi, Antigravity, Muse Code + 30+ via ACP catalog + custom | Claude Code, Codex |
| Split workspace | Yes | Yes |
| In-app terminal | Yes | Yes |
| In-app browser / preview | Yes | Yes |
| GitHub workflow in app | Commit, push, PR, checks, reviews, merge | — |
| Managed Git worktrees | Yes | Existing worktree paths |
| Per-worktree dev server URLs | Yes | — |
| CLI | Run, `--host`, ls, send, schedule, loop | Launch and control sessions |
| Application plugins | Server code and native client components | No |
| Voice | Local or configured cloud speech | Yes |
See also: [Paseo vs Conductor](/alternatives/conductor), [Paseo vs Superset](/alternatives/superset), [Paseo vs OpenChamber](/alternatives/openchamber).
@@ -51,35 +51,26 @@ OpenChamber's CLI runs and manages its server, remote access, and updates. Its A
## Mobile and voice
Both tools provide iOS and Android clients and support dictation and spoken replies. The mobile app is the full app, native on iOS and Android, with full feature parity with desktop. OpenChamber packages its web interface with Capacitor and adds native integrations around the WebView.
Both tools provide iOS and Android clients and support dictation and spoken replies. Paseo uses a React Native mobile interface. OpenChamber packages its web interface with Capacitor and adds native integrations around the WebView.
## Comparison
| | Paseo | OpenChamber |
| ---------------------------- | -------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
| License | Open source (Apache-2.0) | Open source (MIT) |
| Account required | No | - |
| Desktop app | Yes (one click install, daemon bundled) | Yes (macOS, Linux, Windows) |
| Mobile app | Yes (native, full parity with desktop) | Yes (Capacitor WebView) |
| CLI | Yes (everything the app does) | Yes (runs and manages the server) |
| Remote machines | Yes (install the daemon anywhere) | Yes (server on another machine) |
| Built-in relay | Yes (opt-in, end-to-end encrypted, no account) | - |
| Direct network access | Yes (LAN, Tailscale, VPN) | - |
| SSH access | Yes | - |
| Providers | Claude Code, Codex, OpenCode, Pi, Antigravity, Muse Code, 30+ more | OpenCode |
| Parallel agents | Yes (isolated worktrees, across machines) | Yes (Git worktrees, multi-run comparisons) |
| Terminal agents | Yes (run any agent in a terminal, get notified when it finishes) | - |
| Agent orchestration | Yes (agents create worktrees and launch other agents, across providers) | Yes (Agent Control Tool, OpenCode agents only) |
| Editor | Yes | - |
| Terminals | Yes | Yes |
| Diff review | Yes (comments go to the agent) | Yes |
| Pull requests in app | GitHub, GitLab, Gitea, Forgejo, Codeberg | GitHub (issue, PR, checks, review, merge) |
| In-app browser | Yes (element picker, agent browser tools) | Yes (previews) |
| Per-worktree dev server URLs | Yes (`web--fix-auth--my-app.localhost`) | Preview and port detection |
| Schedules and heartbeats | Yes | Yes (schedules) |
| Plan usage | Yes | - |
| Plugins | Yes (new screens, panels, agent hooks, and providers, one plugin runs on desktop, web, and mobile) | No |
| Voice | Yes (local dictation, realtime voice) | Dictation and spoken replies |
| Telemetry | None | - |
| | Paseo | OpenChamber |
| ---------------------------- | --------------------------------------------------------------------------------------- | -------------------------------- |
| License | Open source (Apache-2.0) | Open source (MIT) |
| Desktop platforms | macOS, Linux, Windows | macOS, Linux, Windows |
| Mobile implementation | React Native | Capacitor WebView |
| Agent harnesses | Claude Code, Codex, OpenCode, Pi, Antigravity, Muse Code + 30+ via ACP catalog + custom | OpenCode |
| Application plugins | Server code and native client components | No |
| Split panes and tabs | Yes | Workspace views |
| In-app terminal | Yes | Yes |
| In-app browser | Yes | Yes |
| GitHub workflow in app | Commit, push, PR, checks, reviews, merge | Issue, PR, checks, review, merge |
| Git worktrees | Yes | Yes |
| Per-worktree dev server URLs | Yes | Preview and port detection |
| Automation | CLI, SDK, MCP | Server CLI, Agent Control Tool |
| Schedules | Yes | Yes |
| Voice | Local dictation and realtime voice | Dictation and spoken replies |
| Self-hosted daemon | Yes | Yes |
See also: [Paseo vs Conductor](/alternatives/conductor), [Paseo vs Superset](/alternatives/superset), [Paseo vs Happy Coder](/alternatives/happy-coder).
@@ -43,7 +43,7 @@ Paseo ships on macOS, Linux, and Windows. OpenCode provides beta desktop builds
## Mobile
The mobile app is the full app, native on iOS and Android, with full feature parity with desktop.
Paseo ships native iOS and Android apps with the same agent workflow as the desktop app.
OpenCode Desktop is a desktop app. OpenCode also has web and share-link workflows, but not a native mobile app.
@@ -78,7 +78,7 @@ paseo schedule create --cron "0 9 * * 1" "audit the codebase"
## Worktrees and services
Paseo runs each agent in its own Git worktree. Each worktree gets its own dev server URL like `web--fix-auth--my-app.localhost`, so parallel agents don't fight for ports.
Paseo runs each agent in its own Git worktree. Each worktree gets its own dev server URL like `web.fix-auth.my-app.localhost`, so parallel agents don't fight for ports.
OpenCode supports multi-session work on the same project. If you want worktree isolation around OpenCode sessions, Paseo can provide that by launching OpenCode inside Paseo workspaces.
@@ -94,31 +94,23 @@ Paseo supports dictation and realtime voice mode. Speech-to-text and text-to-spe
## Comparison
| | Paseo | OpenCode Desktop |
| ---------------------------- | -------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
| License | Open source (Apache-2.0) | Open source (MIT) |
| Account required | No | - |
| Desktop app | Yes (one click install, daemon bundled) | Yes (beta, macOS, Linux, Windows) |
| Mobile app | Yes (native, full parity with desktop) | No |
| CLI | Yes (everything the app does) | Yes (OpenCode CLI) |
| Remote machines | Yes (install the daemon anywhere) | OpenCode server |
| Built-in relay | Yes (opt-in, end-to-end encrypted, no account) | - |
| Direct network access | Yes (LAN, Tailscale, VPN) | - |
| SSH access | Yes | - |
| Providers | Claude Code, Codex, OpenCode, Pi, Antigravity, Muse Code, 30+ more | OpenCode (many model providers) |
| Parallel agents | Yes (isolated worktrees, across machines) | Multiple sessions, no built-in worktree manager |
| Terminal agents | Yes (run any agent in a terminal, get notified when it finishes) | - |
| Agent orchestration | Yes (agents create worktrees and launch other agents, across providers) | MCP support inside OpenCode |
| Editor | Yes | - |
| Terminals | Yes | OpenCode terminal workflow |
| Diff review | Yes (comments go to the agent) | - |
| Pull requests in app | GitHub, GitLab, Gitea, Forgejo, Codeberg | GitHub, GitLab integrations |
| In-app browser | Yes (element picker, agent browser tools) | No |
| Per-worktree dev server URLs | Yes (`web--fix-auth--my-app.localhost`) | No |
| Schedules and heartbeats | Yes | - |
| Plan usage | Yes | - |
| Plugins | Yes (new screens, panels, agent hooks, and providers, one plugin runs on desktop, web, and mobile) | No |
| Voice | Yes (local dictation, realtime voice) | No |
| Telemetry | None | - |
| | Paseo | OpenCode Desktop |
| ---------------------------- | --------------------------------------------------------------------------------------- | ------------------------------- |
| License | Open source (Apache-2.0) | Open source (MIT) |
| Desktop platforms | macOS, Linux, Windows | macOS, Linux, Windows |
| Native mobile | iOS, Android | No |
| Agent harnesses | Claude Code, Codex, OpenCode, Pi, Antigravity, Muse Code + 30+ via ACP catalog + custom | OpenCode |
| Multi-model support | Through supported agent harnesses | Through OpenCode providers |
| Git worktrees | Yes | No built-in worktree manager |
| Per-worktree dev server URLs | Yes | No |
| Split panes and tabs | Yes | Desktop sessions |
| In-app terminal | Yes | OpenCode terminal workflow |
| In-app browser | Yes | No |
| GitHub workflow in app | Commit, push, PR, checks, reviews, merge | GitHub integration |
| CLI | Run, `--host`, ls, send, schedule, loop | OpenCode CLI |
| MCP server for orchestration | Yes | MCP support inside OpenCode |
| Application plugins | Server code and native client components | No |
| Local voice | Yes | No |
| Self-hosted daemon | Yes | OpenCode server / local runtime |
See also: [Paseo vs Codex App](/alternatives/codex-app), [Paseo vs Claude Desktop](/alternatives/claude-desktop), [Paseo vs OpenChamber](/alternatives/openchamber).
@@ -17,7 +17,7 @@ Paseo is an app for orchestrating coding agents, with native clients on desktop,
Orca is built around terminals. Each agent runs in a terminal pane, and an experimental Chat UI can show supported agents as a chat transcript. Orca ships a broad set of built-in tools around those terminals.
Paseo is built around agent chat. The app ships what every developer uses: editor, terminals, diffs, pull requests, and a browser. Features only some teams need, like issue boards or cloud VMs, are plugins you install, so nothing you do not use is in the way.
Paseo is built around agent chat. It keeps a small core for starting agents, following their work, giving direction, and reviewing results, and adds everything else through plugins that run on the daemon and every client.
Orca is made by Stably AI, a venture-funded company (Y Combinator). Paseo is independent and open source.
@@ -31,7 +31,7 @@ Orca runs inside its desktop app by default and reaches other machines in two wa
Both tools have iOS and Android apps.
The mobile app is the full app, native on iOS and Android, with full feature parity with desktop. They are on the App Store and Google Play. To connect from your phone, enable the relay and scan a QR code. The daemon connects outbound to the relay and your phone meets it there, so you do not need a VPN, port forwarding, SSH, or an account. Traffic is end-to-end encrypted, and the [relay server](https://github.com/getpaseo/paseo-relay) is open source. You can also connect directly over Tailscale.
Paseo ships native apps on the App Store and Google Play. To connect from your phone, enable the relay and scan a QR code. The daemon connects outbound to the relay and your phone meets it there, so you do not need a VPN, port forwarding, SSH, or an account. Traffic is end-to-end encrypted, and the [relay server](https://github.com/getpaseo/paseo-relay) is open source. You can also connect directly over Tailscale.
Orca's mobile companion is in beta, on the App Store for iOS and as an APK download for Android. It can reply to agents, open sessions as a terminal or Chat UI, commit changes, and create workspaces on the paired desktop. Orca Relay, also in beta, connects the phone when it is not on the same network as the desktop and requires signing in to an Orca account. Without Orca Relay, the phone needs a LAN or Tailscale path to the desktop.
@@ -51,7 +51,7 @@ Paseo runs Claude Code, Codex, OpenCode, Pi, Antigravity, and Muse Code through
[Paseo plugins](/docs/plugins) extend Paseo itself. A plugin can add workspace panels, sidebar items, Command Center items, slash commands, composer pills, settings screens, themes, attachment sources, and agent providers. Its server code runs beside the daemon, and its client code runs in every connected client: desktop, browser, iOS, and Android.
Community plugins are listed at [paseo.sh/plugins](/plugins).
Community plugins are listed at [paseo.cafe](https://paseo.cafe).
Orca has an experimental plugin system that is off by default. Orca plugins can add desktop panels rendered in a sandboxed frame, commands, keybindings, language packs, VM recipes, and agent profiles, and can be installed from git marketplaces. Plugin workers run on the desktop computer, and Orca does not document plugin surfaces in its mobile app.
@@ -59,13 +59,13 @@ Orca has an experimental plugin system that is off by default. Orca plugins can
Orca includes many tools in the core app: a Monaco code editor, Design Mode for sending page elements from its browser to an agent, computer use, Linear and Jira boards, agent account switching with usage tracking, and per-workspace cloud VM recipes. If you want these in one app without extensions, Orca provides them.
Paseo includes an editor, terminals, diff review with comments that go to the agent, pull requests on GitHub, GitLab, Gitea, Forgejo, and Codeberg, a browser with an element picker and agent browser tools, plan usage, schedules, and heartbeats. Boards and cloud VMs are what a plugin adds.
Paseo keeps a smaller core. A capability that serves a specialized workflow is meant to be a plugin, so the default app stays short to learn and each plugin can be maintained on its own schedule.
## Workspaces and review
Both tools provide Git worktrees, split panes, terminals, diff review, an in-app browser, pull-request workflows, and scheduled agent runs.
Paseo has diff review with comments that go to the agent and opens pull requests on GitHub, GitLab, Gitea, Forgejo, and Codeberg. It also gives each worktree its own service URL, such as `web--fix-auth--my-app.localhost`, so parallel development servers do not compete for ports. Orca has port forwarding for SSH worktrees and pull requests on GitLab, Bitbucket, Azure DevOps, and Gitea as well as GitHub.
Paseo also gives each worktree its own service URL, such as `web.fix-auth.my-app.localhost`, so parallel development servers do not compete for ports. Orca adds diff annotations that you send back to the agent, port forwarding for SSH worktrees, and pull requests on GitLab, Bitbucket, Azure DevOps, and Gitea as well as GitHub.
## Automation
@@ -89,31 +89,24 @@ Orca does not require an account for local use. Orca Relay and shared artifacts
## Comparison
| | Paseo | Orca |
| ---------------------------- | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------- |
| License | Open source (Apache-2.0) | Open source (MIT) |
| Account required | No | No for local use, Orca account for relay |
| Desktop app | Yes (one click install, daemon bundled) | Yes (macOS, Linux, Windows) |
| Mobile app | Yes (native, full parity with desktop) | Yes (companion app, beta) |
| CLI | Yes (everything the app does) | Yes (worktrees, browser, automations) |
| Remote machines | Yes (install the daemon anywhere) | Yes (SSH worktrees, Remote Orca Server in beta) |
| Built-in relay | Yes (opt-in, end-to-end encrypted, no account) | Yes (beta, Orca account required) |
| Direct network access | Yes (LAN, Tailscale, VPN) | Yes (LAN, Tailscale) |
| SSH access | Yes | Yes (SSH worktrees) |
| Providers | Claude Code, Codex, OpenCode, Pi, Antigravity, Muse Code, 30+ more | Any CLI agent in a terminal, 30+ listed |
| Parallel agents | Yes (isolated worktrees, across machines) | Yes (Git worktrees) |
| Terminal agents | Yes (run any agent in a terminal, get notified when it finishes) | Yes (main interface, experimental Chat UI) |
| Agent orchestration | Yes (agents create worktrees and launch other agents, across providers) | Yes (agents call the Orca CLI through installed skills) |
| Editor | Yes | Yes (Monaco) |
| Terminals | Yes | Yes |
| Diff review | Yes (comments go to the agent) | Yes |
| Pull requests in app | GitHub, GitLab, Gitea, Forgejo, Codeberg | GitHub, GitLab, Bitbucket, Azure DevOps, Gitea |
| In-app browser | Yes (element picker, agent browser tools) | Yes (Design Mode) |
| Per-worktree dev server URLs | Yes (`web--fix-auth--my-app.localhost`) | Port forwarding for SSH worktrees |
| Schedules and heartbeats | Yes | Yes (scheduled agent runs) |
| Plan usage | Yes | Yes (usage tracking, account switching) |
| Plugins | Yes (new screens, panels, agent hooks, and providers, one plugin runs on desktop, web, and mobile) | Experimental, desktop only |
| Voice | Yes (local dictation, realtime voice) | Dictation |
| Telemetry | None | Anonymous usage data, opt-out |
| | Paseo | Orca |
| ---------------------------- | --------------------------------------------------------------------------------------- | ------------------------------------- |
| License | Open source (Apache-2.0) | Open source (MIT) |
| Funding | Independent | Venture-funded (Y Combinator) |
| Desktop platforms | macOS, Linux, Windows | macOS, Linux, Windows |
| Native mobile | iOS, Android | iOS, Android APK (beta) |
| Main interface | Agent chat | Terminal, with experimental Chat UI |
| Remote machines | Daemon on any machine, direct, SSH, or relay | SSH worktrees, Remote Orca Server |
| Relay | Optional, end-to-end encrypted, no account | Beta, Orca account required |
| Agent harnesses | Claude Code, Codex, OpenCode, Pi, Antigravity, Muse Code + 30+ via ACP catalog + custom | Any CLI agent in a terminal |
| Application plugins | Server code and native client components on every client | Experimental, desktop only |
| In-app terminal | Yes | Yes |
| In-app browser | Yes | Yes, with Design Mode |
| GitHub workflow in app | Commit, push, PR, checks, reviews, merge | Yes, plus GitLab, Bitbucket, and more |
| Git worktrees | Yes | Yes |
| Per-worktree dev server URLs | Yes | Port forwarding for SSH worktrees |
| Automation | CLI, SDK, MCP | CLI, automations |
| Voice | Local dictation and realtime voice | Dictation |
| Telemetry | None | Anonymous usage data, opt-out |
See also: [Paseo vs Conductor](/alternatives/conductor), [Paseo vs Superset](/alternatives/superset), [Paseo vs OpenChamber](/alternatives/openchamber).
@@ -51,7 +51,7 @@ Both tools provide Git worktrees, split panes, terminals, diff review, an in-app
Paseo gives supported providers a structured chat interface with modes, slash commands, tool calls, and file attachments. Superset can run any CLI agent in terminal panes and adds lifecycle status for supported agents.
Paseo also gives each worktree its own service URL, such as `web--fix-auth--my-app.localhost`, so parallel development servers do not compete for ports.
Paseo also gives each worktree its own service URL, such as `web.fix-auth.my-app.localhost`, so parallel development servers do not compete for ports.
## Automation
@@ -65,31 +65,23 @@ Superset has a free individual tier. Team features, remote access, and integrati
## Comparison
| | Paseo | Superset |
| ---------------------------- | -------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
| License | Open source (Apache-2.0) | Source-available (Elastic License 2.0) |
| Account required | No | Yes, with GitHub sign-in |
| Desktop app | Yes (one click install, daemon bundled) | Yes (macOS, experimental Linux) |
| Mobile app | Yes (native, full parity with desktop) | Coming soon |
| CLI | Yes (everything the app does) | Yes (plus SDK and MCP server) |
| Remote machines | Yes (install the daemon anywhere) | Yes (host server, remote access through Superset cloud on paid plans) |
| Built-in relay | Yes (opt-in, end-to-end encrypted, no account) | Superset cloud services (paid plans) |
| Direct network access | Yes (LAN, Tailscale, VPN) | - |
| SSH access | Yes | - |
| Providers | Claude Code, Codex, OpenCode, Pi, Antigravity, Muse Code, 30+ more | CLI agents, custom terminal agents |
| Parallel agents | Yes (isolated worktrees, across machines) | Yes (Git worktrees) |
| Terminal agents | Yes (run any agent in a terminal, get notified when it finishes) | Yes (lifecycle status for supported agents) |
| Agent orchestration | Yes (agents create worktrees and launch other agents, across providers) | Yes (CLI, SDK, and MCP server create workspaces and launch agents) |
| Editor | Yes | - |
| Terminals | Yes | Yes |
| Diff review | Yes (comments go to the agent) | Yes |
| Pull requests in app | GitHub, GitLab, Gitea, Forgejo, Codeberg | GitHub |
| In-app browser | Yes (element picker, agent browser tools) | Yes |
| Per-worktree dev server URLs | Yes (`web--fix-auth--my-app.localhost`) | Port detection |
| Schedules and heartbeats | Yes | Yes (schedules) |
| Plan usage | Yes | - |
| Plugins | Yes (new screens, panels, agent hooks, and providers, one plugin runs on desktop, web, and mobile) | No |
| Voice | Yes (local dictation, realtime voice) | - |
| Telemetry | None | - |
| | Paseo | Superset |
| ---------------------------- | ---------------------------------------- | -------------------------------------- |
| License | Open source (Apache-2.0) | Source-available (Elastic License 2.0) |
| Desktop platforms | macOS, Linux, Windows | macOS, experimental Linux |
| Native mobile | iOS, Android | Coming soon |
| Account required | No | Yes, with GitHub sign-in |
| Agent harnesses | Native, ACP, and custom CLI | CLI agents |
| Application plugins | Server code and native client components | No |
| Split panes and tabs | Yes | Yes |
| In-app terminal | Yes | Yes |
| In-app browser | Yes | Yes |
| GitHub workflow in app | Commit, push, PR, checks, reviews, merge | Yes |
| Git worktrees | Yes | Yes |
| Per-worktree dev server URLs | Yes | Port detection |
| Automation | CLI, SDK, MCP | CLI, SDK, MCP |
| Schedules | Yes | Yes |
| Local voice | Dictation and realtime voice | No documented voice support |
| Self-hosted daemon | Yes | Host server |
See also: [Paseo vs Conductor](/alternatives/conductor), [Paseo vs OpenChamber](/alternatives/openchamber), [Paseo vs Happy Coder](/alternatives/happy-coder).
@@ -3,7 +3,6 @@ import { type ReactNode, useMemo } from "react";
import { type Author, authorAvatarUrl } from "./registry";
const SIZE_CLASS = {
xs: "h-4 w-4 text-[8px]",
sm: "h-5 w-5 text-[10px]",
lg: "h-14 w-14 text-xl",
} as const;
+11 -13
View File
@@ -3,7 +3,6 @@ import { SiteShell } from "~/components/site-shell";
import { ContributeLinks } from "./contribute-links";
import type { InstallCounts } from "./installs";
import { type BrowseQuery, browseHref } from "./links";
import { InstallCount } from "./install-count";
import { PLUGIN_GRID_CLASS, PluginCard } from "./plugin-card";
import { PluginSearch } from "./plugin-search";
import { PluginSection } from "./section";
@@ -47,11 +46,10 @@ export function BrowsePage({
query: BrowseQuery;
}) {
const category = query.category ? getCategory(query.category) : null;
const ordered =
query.sort === "new" ? newestFirst(plugins) : mostInstalled(plugins, installs, query.window);
// Search ranks by relevance; the tab's order breaks ties.
const matches = query.q ? searchPlugins(ordered, query.q) : ordered;
const results = category ? getPluginsInCategory(matches, category.slug) : matches;
const matches = query.q ? searchPlugins(plugins, query.q) : plugins;
const scoped = category ? getPluginsInCategory(matches, category.slug) : matches;
const results =
query.sort === "new" ? newestFirst(scoped) : mostInstalled(scoped, installs, query.window);
const title = category?.label ?? "All plugins";
const clearHref = browseHref({ ...query, q: undefined });
return (
@@ -66,7 +64,7 @@ export function BrowsePage({
<h1 className="text-3xl font-medium tracking-tight">
{query.q ? `Results for “${query.q}”${category ? ` in ${title}` : ""}` : title}
<span className="ml-3 align-middle text-sm font-normal tabular-nums text-extra-muted-foreground">
{results.length}
{scoped.length}
</span>
</h1>
{query.q && (
@@ -95,13 +93,13 @@ export function BrowsePage({
<div className={PLUGIN_GRID_CLASS}>
{results.map((plugin) =>
query.sort === "new" ? (
<PluginCard key={plugin.id} plugin={plugin}>
{addedAgo(plugin, now)}
</PluginCard>
<PluginCard key={plugin.id} plugin={plugin} added={addedAgo(plugin, now)} />
) : (
<PluginCard key={plugin.id} plugin={plugin}>
<InstallCount count={installs[plugin.id]?.[query.window] ?? 0} />
</PluginCard>
<PluginCard
key={plugin.id}
plugin={plugin}
installs={installs[plugin.id]?.[query.window] ?? 0}
/>
),
)}
</div>
@@ -21,21 +21,7 @@ export function ContributeLinks() {
);
}
/** "Submit a plugin" and "Read the docs", as a primary and a secondary button. */
export function ContributeButtons() {
return (
<>
<a href={SUBMIT_URL} className={PRIMARY_BUTTON_CLASS}>
Submit a plugin
</a>
<a href={DOCS_URL} className={SECONDARY_BUTTON_CLASS}>
Read the docs
</a>
</>
);
}
/** Closing section of the directory: what a plugin can do, with Submit and Read the docs buttons. */
/** Closing section of the directory: what a plugin can do, with Read the docs and Submit buttons. */
export function ContributeSection() {
return (
<section
@@ -50,7 +36,12 @@ export function ContributeSection() {
with the plugin docs, then submit it to get it listed here.
</p>
<div className="mt-6 flex flex-wrap justify-center gap-3">
<ContributeButtons />
<a href={DOCS_URL} className={PRIMARY_BUTTON_CLASS}>
Read the docs
</a>
<a href={SUBMIT_URL} className={SECONDARY_BUTTON_CLASS}>
Submit a plugin
</a>
</div>
</section>
);
-37
View File
@@ -1,37 +0,0 @@
import { ContributeButtons } from "./contribute-links";
import type { BrowseQuery } from "./links";
import { PluginSearch } from "./plugin-search";
interface PluginsHeroProps {
pluginCount: number;
authorCount: number;
/** Where the search box sends its term. */
searchScope: BrowseQuery;
}
function plural(count: number, word: string): string {
return `${count} ${word}${count === 1 ? "" : "s"}`;
}
/** Header of the plugin directory: title, counts, and copy, then the contribute buttons and search. */
export function PluginsHero({ pluginCount, authorCount, searchScope }: PluginsHeroProps) {
return (
<header>
<h1 className="flex flex-wrap items-baseline gap-x-3 gap-y-1">
<span className="text-3xl font-medium tracking-tight">Plugins</span>
<span className="text-sm font-normal tabular-nums text-extra-muted-foreground">
{plural(pluginCount, "plugin")} by {plural(authorCount, "author")}
</span>
</h1>
<p className="mt-3 max-w-xl text-sm leading-relaxed text-muted-foreground">
Browse community plugins that extend Paseo with new functionality.
</p>
<div className="mt-6 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
<div className="flex flex-wrap gap-3">
<ContributeButtons />
</div>
<PluginSearch scope={searchScope} className="w-full sm:w-64" />
</div>
</header>
);
}
@@ -1,13 +0,0 @@
import { Download } from "lucide-react";
import { formatInstalls } from "./registry";
/** An install count as a download icon and the number; inherits the surrounding text style. */
export function InstallCount({ count }: { count: number }) {
return (
<span className="inline-flex items-center gap-1 tabular-nums">
<Download aria-hidden className="h-3 w-3" />
{formatInstalls(count)}
<span className="sr-only">installs</span>
</span>
);
}
+2 -1
View File
@@ -1 +1,2 @@
export const PLUGINS_LINKED = true;
// Keep navigation on paseo.cafe until the coordinated directory announcement.
export const PLUGINS_LINKED = false;

Some files were not shown because too many files have changed in this diff Show More