mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-22 00:05:15 +00:00
Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f2e4580e6 | ||
|
|
bde4f407f7 | ||
|
|
744878bf62 | ||
|
|
e1ce819d11 | ||
|
|
6d7aaf5461 | ||
|
|
9e596e3377 | ||
|
|
e5efa7324d | ||
|
|
303ee418cc | ||
|
|
b282bbb944 | ||
|
|
3e977b5e7b |
+11
-47
@@ -1,92 +1,56 @@
|
||||
# Changelog
|
||||
|
||||
## 0.17.1 - 2026-11-21
|
||||
## 0.17.0-beta.1 - 2026-11-19
|
||||
|
||||
- **Use existing worktrees:** Start a workspace in a worktree you already have, or create one from a branch or pull request. Plugins can manage worktree creation, removal, and restoration. When you branch off a fork PR or MR, choose Run setup to approve workspace automation. ([#10190](https://github.com/getpaseo/paseo/pull/10190), [#10278](https://github.com/getpaseo/paseo/pull/10278))
|
||||
- **Update providers in Paseo:** See each provider's status, installed version, and available updates in the provider list. Open a provider's settings from Settings, setup, or the model picker to update supported CLIs and watch their output. ([#9568](https://github.com/getpaseo/paseo/pull/9568), [#9661](https://github.com/getpaseo/paseo/pull/9661))
|
||||
- **Provider quota forecasts:** Usage estimates when a quota will run out before reset based on your current pace, shown inline with the reset time. Healthy quota bars now show in green, and reset and exhaustion times include the weekday and calendar date when needed. ([#10289](https://github.com/getpaseo/paseo/pull/10289), [#10385](https://github.com/getpaseo/paseo/pull/10385), [#10397](https://github.com/getpaseo/paseo/pull/10397))
|
||||
- **Watch PRs and MRs:** Ask an agent to watch a GitHub, GitLab, Gitea, Forgejo, or Codeberg change request for updates to checks, reviews, or comments. Stop a watch from Background work. ([#10148](https://github.com/getpaseo/paseo/pull/10148), [#10279](https://github.com/getpaseo/paseo/pull/10279), [#10280](https://github.com/getpaseo/paseo/pull/10280))
|
||||
- **Use existing worktrees:** Start a workspace in a worktree you already have, or create one from any branch or pull request. ([#10190](https://github.com/getpaseo/paseo/pull/10190))
|
||||
- **Antigravity approvals and history:** Pick a permission mode, answer tool approvals, import CLI sessions and see your history when you reopen a chat. ([#10193](https://github.com/getpaseo/paseo/pull/10193))
|
||||
- **Watch pull requests:** Agents can watch a GitHub PR and get notified when checks, reviews or comments change. ([#10148](https://github.com/getpaseo/paseo/pull/10148))
|
||||
- **Heartbeats in Background work:** See and stop an agent's heartbeats next to its background tasks. ([#10097](https://github.com/getpaseo/paseo/pull/10097), [#10216](https://github.com/getpaseo/paseo/pull/10216))
|
||||
- **Agent messages wait their turn:** Reports and notifications from other agents arrive in order when the current turn ends instead of interrupting it. An interrupt or your own prompt carries earlier queued messages in the same turn, and Stop holds queued messages until the next prompt instead of starting a new turn. ([#9757](https://github.com/getpaseo/paseo/pull/9757), [#10404](https://github.com/getpaseo/paseo/pull/10404))
|
||||
- **Antigravity approvals and history:** Choose a permission mode, respond to tool approvals, and import or reopen sessions. Use Antigravity CLI 1.5.0 or later on the daemon host, and include `acp` if you override its command. In Hub, reselect the model and thinking level if a saved model ID includes an old effort suffix. ([#10193](https://github.com/getpaseo/paseo/pull/10193))
|
||||
- **More goose models:** Select models from all providers configured in goose. Existing goose settings and sessions carry over to the bundled plugin. ([#9719](https://github.com/getpaseo/paseo/pull/9719) by [@i386](https://github.com/i386))
|
||||
- **Agent messages wait their turn:** Reports and notifications from other agents arrive when the current turn ends instead of interrupting it. ([#9757](https://github.com/getpaseo/paseo/pull/9757))
|
||||
- **Plugin agent instructions:** Plugins can add their own instructions to agents. ([#9781](https://github.com/getpaseo/paseo/pull/9781))
|
||||
|
||||
### Added
|
||||
|
||||
- Added OpenRouter credit balances and API key spending to Usage and `paseo usage` ([#10269](https://github.com/getpaseo/paseo/pull/10269))
|
||||
- Added Antigravity account quotas to Usage ([#10232](https://github.com/getpaseo/paseo/pull/10232) by [@luoph](https://github.com/luoph), [@RRD-dev](https://github.com/RRD-dev))
|
||||
- Added Antigravity skill suggestions when you type `/` inside a prompt ([#10383](https://github.com/getpaseo/paseo/pull/10383))
|
||||
- Added bundled orchestration skills to Antigravity on hosts where Paseo skills are installed ([#10273](https://github.com/getpaseo/paseo/pull/10273))
|
||||
- Added shortcuts to open the model picker and cycle thinking levels with Cmd/Ctrl+/ and Cmd/Ctrl+Shift+/ ([#10147](https://github.com/getpaseo/paseo/pull/10147))
|
||||
- Added agent settings to Command Center search before the first message ([#10182](https://github.com/getpaseo/paseo/pull/10182) by [@cleiter](https://github.com/cleiter))
|
||||
- Added Rewind to Command Center for the latest turn ([#10144](https://github.com/getpaseo/paseo/pull/10144))
|
||||
- Added a separate Ultracode toggle for eligible Claude models ([#10150](https://github.com/getpaseo/paseo/pull/10150) by [@fivetaku](https://github.com/fivetaku))
|
||||
- Added Flex speed for Codex ([#9809](https://github.com/getpaseo/paseo/pull/9809) by [@qjqqyy](https://github.com/qjqqyy))
|
||||
- Added syntax highlighting for shell scripts and Dockerfiles ([#10178](https://github.com/getpaseo/paseo/pull/10178))
|
||||
- Added project listing on connected daemons for Hub sessions with `hub.execute` ([#10392](https://github.com/getpaseo/paseo/pull/10392))
|
||||
- Added labels and workspace IDs to `paseo ls --json` ([#10076](https://github.com/getpaseo/paseo/pull/10076))
|
||||
|
||||
### Changed
|
||||
|
||||
- Changed Appearance content width to Default (820 px), Wide (1,200 px), and Full presets that resize open chats, the composer, and Markdown previews together ([#10231](https://github.com/getpaseo/paseo/pull/10231))
|
||||
- Changed Antigravity tool cards to show shell commands and output, file diffs, and Paseo tool details ([#10379](https://github.com/getpaseo/paseo/pull/10379))
|
||||
- Changed Clone from GitHub to show matching private repositories first ([#10264](https://github.com/getpaseo/paseo/pull/10264))
|
||||
- Changed worktree teardown to keep the worktree when the command exceeds one minute or the `worktree.teardownTimeoutMs` limit in `paseo.json` ([#9852](https://github.com/getpaseo/paseo/pull/9852) by [@ragokan](https://github.com/ragokan))
|
||||
- Changed workspace navigation to acknowledge taps promptly and initially load fewer offscreen chat rows on mobile ([#9887](https://github.com/getpaseo/paseo/pull/9887))
|
||||
- Changed workspace Git status to reuse its snapshot after a short reconnect when the checkout has not changed ([#10142](https://github.com/getpaseo/paseo/pull/10142) by [@VladimirGVP](https://github.com/VladimirGVP))
|
||||
- Changed `browser_new_tab` to ask agents to choose a Desktop when several are connected ([#10189](https://github.com/getpaseo/paseo/pull/10189))
|
||||
- Changed workspace Git status to reuse its snapshot after a short reconnect when the checkout has not changed ([#10142](https://github.com/getpaseo/paseo/pull/10142) by [@VladimirGVP](https://github.com/VladimirGVP))
|
||||
- Changed workspace navigation to acknowledge taps promptly and initially load fewer offscreen chat rows on mobile ([#9887](https://github.com/getpaseo/paseo/pull/9887))
|
||||
- Changed worktree teardown to stop after one minute by default and keep the worktree; set `worktree.teardownTimeoutMs` in `paseo.json` for longer commands ([#9852](https://github.com/getpaseo/paseo/pull/9852) by [@ragokan](https://github.com/ragokan))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed an online host's workspaces staying missing after the app evicts its cached directory ([#10318](https://github.com/getpaseo/paseo/pull/10318))
|
||||
- Fixed chat history timing out when many open chats refresh at once after reconnecting ([#10368](https://github.com/getpaseo/paseo/pull/10368))
|
||||
- Fixed slow reopening of long Claude chats while the daemon is busy ([#10369](https://github.com/getpaseo/paseo/pull/10369))
|
||||
- Fixed images from a live reply waiting for images in another chat's history to load ([#10371](https://github.com/getpaseo/paseo/pull/10371))
|
||||
- Fixed agent recovery failing and idle agents showing errors after stopping a foreground daemon with Ctrl+C on macOS or Linux ([#10381](https://github.com/getpaseo/paseo/pull/10381))
|
||||
- Fixed reopening a long Antigravity chat after a daemon restart losing the end of its history ([#10428](https://github.com/getpaseo/paseo/pull/10428))
|
||||
- Fixed Antigravity turns ending while a background command is still running ([#10310](https://github.com/getpaseo/paseo/pull/10310))
|
||||
- Fixed the Add model sheet staying open after saving a custom model when provider discovery is slow or fails ([#10432](https://github.com/getpaseo/paseo/pull/10432))
|
||||
- Fixed slash suggestions failing when a provider reports duplicate command names ([#10275](https://github.com/getpaseo/paseo/pull/10275))
|
||||
- Fixed resumed Codex sessions keeping their previous working directory for configuration and MCP servers when opened in a different directory ([#10390](https://github.com/getpaseo/paseo/pull/10390) by [@tabulius-ux](https://github.com/tabulius-ux))
|
||||
- Fixed stale Codex subagent statuses after reopening or rewinding the parent chat ([#10171](https://github.com/getpaseo/paseo/pull/10171) by [@AnalyticETH](https://github.com/AnalyticETH))
|
||||
- Fixed Usage showing the previous Claude account's quota after switching accounts ([#10236](https://github.com/getpaseo/paseo/pull/10236))
|
||||
- Fixed the sidebar usage row dropping period labels such as `5h` and `wk` when multiple usage windows are pinned ([#10274](https://github.com/getpaseo/paseo/pull/10274))
|
||||
- Fixed Changes failing to recognize a checkout immediately after restoring its worktree ([#10224](https://github.com/getpaseo/paseo/pull/10224), [#10304](https://github.com/getpaseo/paseo/pull/10304), [#10406](https://github.com/getpaseo/paseo/pull/10406))
|
||||
- Fixed split-pane dividers stopping or lagging during drags after adding panes to a previously resized row ([#5996](https://github.com/getpaseo/paseo/pull/5996))
|
||||
- Fixed double-click word selection and triple-click line selection in diffs ([#10252](https://github.com/getpaseo/paseo/pull/10252) by [@pedrovieira](https://github.com/pedrovieira))
|
||||
- Fixed the composer and chat column losing alignment when Chat outline is enabled ([#10277](https://github.com/getpaseo/paseo/pull/10277))
|
||||
- Fixed the web composer focus shortcut hint overlapping the placeholder text at narrow widths or in longer translations ([#6200](https://github.com/getpaseo/paseo/pull/6200))
|
||||
- Fixed the archive shortcut failing when the active workspace's sidebar group is collapsed ([#10356](https://github.com/getpaseo/paseo/pull/10356) by [@hiennd-ctrl](https://github.com/hiennd-ctrl), [@neihyud](https://github.com/neihyud))
|
||||
- Fixed other sessions and plugins seeing a workspace as active while another session is archiving it ([#10391](https://github.com/getpaseo/paseo/pull/10391) by [@tabulius-ux](https://github.com/tabulius-ux))
|
||||
- Fixed Android composer buttons requiring a second tap after typing or zooming a chat image ([#10057](https://github.com/getpaseo/paseo/pull/10057), [#10308](https://github.com/getpaseo/paseo/pull/10308))
|
||||
- Fixed swiping a terminal in an Android browser opening the keyboard when it was closed ([#10225](https://github.com/getpaseo/paseo/pull/10225) by [@tonylt](https://github.com/tonylt))
|
||||
- Fixed Collapse turns hiding a finished OMP or Pi reply when an idle provider notice appears ([#10135](https://github.com/getpaseo/paseo/pull/10135))
|
||||
- Fixed repeated finish notifications while an agent responds to background tasks and its earlier finish is unread ([#10200](https://github.com/getpaseo/paseo/pull/10200))
|
||||
- Fixed an empty chat losing the prompt and start of a reply after reconnecting mid-reply ([#9723](https://github.com/getpaseo/paseo/pull/9723) by [@ragokan](https://github.com/ragokan))
|
||||
- Fixed changes between Claude thinking levels stopping its background work ([#10008](https://github.com/getpaseo/paseo/pull/10008) by [@gilad-rubin](https://github.com/gilad-rubin))
|
||||
- Fixed OpenCode turns staying running after a shared OpenCode service stops ([#10187](https://github.com/getpaseo/paseo/pull/10187))
|
||||
- Fixed OMP denying an approved tool call when session or grant choices were offered ([#10126](https://github.com/getpaseo/paseo/pull/10126) by [@dsingal0](https://github.com/dsingal0))
|
||||
- Fixed a Codex message stopped before its turn starts showing an error instead of canceled ([#9931](https://github.com/getpaseo/paseo/pull/9931) by [@3ae3ae](https://github.com/3ae3ae))
|
||||
- Fixed Changes failing to open when Git metadata watching reaches its limit ([#10188](https://github.com/getpaseo/paseo/pull/10188))
|
||||
- Fixed copying selected reply text into plain-text targets with unwanted Markdown syntax ([#10079](https://github.com/getpaseo/paseo/pull/10079) by [@danberindei](https://github.com/danberindei))
|
||||
- Fixed file views losing their scroll position when switching Preview and Source, except HTML previews on iOS ([#10195](https://github.com/getpaseo/paseo/pull/10195) by [@apple-ouyang](https://github.com/apple-ouyang))
|
||||
- Fixed file tabs in split panes showing or focusing the wrong file ([#9888](https://github.com/getpaseo/paseo/pull/9888) by [@KosmoCHE](https://github.com/KosmoCHE))
|
||||
- Fixed touch-screen submenus closing as soon as they open ([#10175](https://github.com/getpaseo/paseo/pull/10175) by [@christiantwu](https://github.com/christiantwu))
|
||||
- Fixed dictation failing after another chat that used the microphone closes ([#10185](https://github.com/getpaseo/paseo/pull/10185) by [@Brandon168](https://github.com/Brandon168))
|
||||
- Fixed composer taps being lost on Android after zooming a chat image ([#10057](https://github.com/getpaseo/paseo/pull/10057))
|
||||
- Fixed clipped text on Samsung DeX ([#9995](https://github.com/getpaseo/paseo/pull/9995) by [@easyhunjune](https://github.com/easyhunjune))
|
||||
- Fixed workspace images in chat failing to load after a slow host connection ([#10111](https://github.com/getpaseo/paseo/pull/10111) by [@ragokan](https://github.com/ragokan))
|
||||
- Fixed desktop browser screenshots returning fully transparent images ([#9807](https://github.com/getpaseo/paseo/pull/9807) by [@monarchmaisuriya](https://github.com/monarchmaisuriya))
|
||||
- Fixed Mermaid flowcharts with `@` in labels showing source instead of the diagram ([#10165](https://github.com/getpaseo/paseo/pull/10165) by [@monarchmaisuriya](https://github.com/monarchmaisuriya))
|
||||
- Fixed hidden background workspaces triggering the dock badge and favicon ([#9983](https://github.com/getpaseo/paseo/pull/9983))
|
||||
- Fixed desktop sidebar navigation crowding out workspaces ([#9903](https://github.com/getpaseo/paseo/pull/9903) by [@pentatonic-alex](https://github.com/pentatonic-alex))
|
||||
- Fixed historical closed PR badges appearing on a repository's default branch ([#10053](https://github.com/getpaseo/paseo/pull/10053))
|
||||
- Fixed plugin agents failing to reopen after their provider closes the session ([#10153](https://github.com/getpaseo/paseo/pull/10153))
|
||||
- Fixed plugin screens and settings failing to use plugin state hooks ([#10049](https://github.com/getpaseo/paseo/pull/10049))
|
||||
|
||||
### Plugins
|
||||
|
||||
- Added a `focusHost` navigation option for plugins to select the destination host in the sidebar when opening a workspace or agent ([#5574](https://github.com/getpaseo/paseo/pull/5574) by [@discwl](https://github.com/discwl))
|
||||
- Fixed a Codex message stopped before its turn starts showing an error instead of canceled ([#9931](https://github.com/getpaseo/paseo/pull/9931) by [@3ae3ae](https://github.com/3ae3ae))
|
||||
- Fixed historical closed PR badges appearing on a repository's default branch ([#10053](https://github.com/getpaseo/paseo/pull/10053))
|
||||
|
||||
## 0.16.2 - 2026-11-18
|
||||
|
||||
|
||||
+11
-47
@@ -1,92 +1,56 @@
|
||||
# Changelog
|
||||
|
||||
## 0.17.1 - 2026-11-21
|
||||
## 0.17.0-beta.1 - 2026-11-19
|
||||
|
||||
- **使用现有 worktree**:在已有的 worktree 中启动工作区,或从分支或 PR 创建 worktree。插件可以管理 worktree 的创建、移除和恢复。从 fork 的 PR 或 MR 创建分支时,选择“运行设置”以批准工作区自动化。([#10190](https://github.com/getpaseo/paseo/pull/10190), [#10278](https://github.com/getpaseo/paseo/pull/10278))
|
||||
- **在 Paseo 中更新 Provider**:在 Provider 列表中查看各 Provider 的状态、已安装版本和可用更新。从设置、初次配置或模型选择器打开 Provider 设置,即可更新受支持的 CLI 并查看输出。([#9568](https://github.com/getpaseo/paseo/pull/9568), [#9661](https://github.com/getpaseo/paseo/pull/9661))
|
||||
- **Provider 配额预测**:“使用情况”页面会根据当前使用速度估算配额在重置前何时用完,并显示在重置时间同一行中。健康的配额进度条现已改为绿色,重置与用尽时间也会在需要时显示星期和具体日期。([#10289](https://github.com/getpaseo/paseo/pull/10289), [#10385](https://github.com/getpaseo/paseo/pull/10385), [#10397](https://github.com/getpaseo/paseo/pull/10397))
|
||||
- **监视 PR 和 MR**:让 Agent 监视 GitHub、GitLab、Gitea、Forgejo 或 Codeberg 上的 PR 或 MR,跟踪检查、审查或评论的变化。你可以在后台任务中停止监视。([#10148](https://github.com/getpaseo/paseo/pull/10148), [#10279](https://github.com/getpaseo/paseo/pull/10279), [#10280](https://github.com/getpaseo/paseo/pull/10280))
|
||||
- **使用现有 worktree**:在已有的 worktree 中启动工作区,或从任意分支或 PR 创建 worktree。([#10190](https://github.com/getpaseo/paseo/pull/10190))
|
||||
- **Antigravity 审批和历史记录**:选择权限模式、回复工具审批、导入 CLI 会话,并在重新打开对话时查看历史记录。([#10193](https://github.com/getpaseo/paseo/pull/10193))
|
||||
- **监视 PR**:Agent 可以监视 GitHub PR,在检查、审查或评论有变化时收到通知。([#10148](https://github.com/getpaseo/paseo/pull/10148))
|
||||
- **在后台任务中查看 heartbeat**:在 Agent 的后台任务旁查看和停止 heartbeat。([#10097](https://github.com/getpaseo/paseo/pull/10097), [#10216](https://github.com/getpaseo/paseo/pull/10216))
|
||||
- **Agent 消息排队等待**:其他 Agent 的报告和通知会在当前轮次结束后按顺序到达,不再打断当前轮次。中断消息或你发送的新提示词会在同一轮次中一并带入此前排队的其他消息;点击“停止”则会暂存排队中的消息直到下一次提示词,而不会开启新轮次。([#9757](https://github.com/getpaseo/paseo/pull/9757), [#10404](https://github.com/getpaseo/paseo/pull/10404))
|
||||
- **Antigravity 审批和历史记录**:选择权限模式、回复工具审批,以及导入或重新打开会话。请在 daemon 主机上使用 Antigravity CLI 1.5.0 或更新版本,如果覆盖了启动命令请包含 `acp`。如果 Hub 中保存的模型 ID 含有旧的推理强度后缀,请重新选择模型和思考级别。([#10193](https://github.com/getpaseo/paseo/pull/10193))
|
||||
- **更多 goose 模型**:从 goose 中已配置的所有 Provider 选择模型。现有 goose 设置和会话会迁移到内置插件。([#9719](https://github.com/getpaseo/paseo/pull/9719),贡献者:[@i386](https://github.com/i386))
|
||||
- **Agent 消息排队等待**:其他 Agent 的报告和通知会在当前轮次结束后到达,不会打断当前轮次。([#9757](https://github.com/getpaseo/paseo/pull/9757))
|
||||
- **插件 Agent 指令**:插件可以向 Agent 添加自己的指令。([#9781](https://github.com/getpaseo/paseo/pull/9781))
|
||||
|
||||
### 新增
|
||||
|
||||
- 在“使用情况”页面和 `paseo usage` 中新增 OpenRouter 余额和 API 密钥支出 ([#10269](https://github.com/getpaseo/paseo/pull/10269))
|
||||
- 在“使用情况”页面新增 Antigravity 账号配额 ([#10232](https://github.com/getpaseo/paseo/pull/10232),贡献者:[@luoph](https://github.com/luoph), [@RRD-dev](https://github.com/RRD-dev))
|
||||
- 在提示词中输入 `/` 时,新增 Antigravity 技能建议 ([#10383](https://github.com/getpaseo/paseo/pull/10383))
|
||||
- 在已安装 Paseo 技能的主机上,为 Antigravity 新增内置编排技能 ([#10273](https://github.com/getpaseo/paseo/pull/10273))
|
||||
- 新增 Cmd/Ctrl+/ 和 Cmd/Ctrl+Shift+/ 快捷键,用于打开模型选择器和切换思考级别 ([#10147](https://github.com/getpaseo/paseo/pull/10147))
|
||||
- 新增在发送第一条消息前通过命令中心搜索 Agent 设置 ([#10182](https://github.com/getpaseo/paseo/pull/10182),贡献者:[@cleiter](https://github.com/cleiter))
|
||||
- 新增在命令中心回退最近轮次的操作 ([#10144](https://github.com/getpaseo/paseo/pull/10144))
|
||||
- 新增符合条件的 Claude 模型的独立 Ultracode 开关 ([#10150](https://github.com/getpaseo/paseo/pull/10150),贡献者:[@fivetaku](https://github.com/fivetaku))
|
||||
- 新增 Codex Flex 速度选项 ([#9809](https://github.com/getpaseo/paseo/pull/9809),贡献者:[@qjqqyy](https://github.com/qjqqyy))
|
||||
- 新增 shell 脚本和 Dockerfile 的语法高亮 ([#10178](https://github.com/getpaseo/paseo/pull/10178))
|
||||
- 为具有 `hub.execute` 权限的 Hub 会话新增列出已连接 daemon 活跃项目的能力 ([#10392](https://github.com/getpaseo/paseo/pull/10392))
|
||||
- 新增 `paseo ls --json` 输出的标签和工作区 ID ([#10076](https://github.com/getpaseo/paseo/pull/10076))
|
||||
|
||||
### 变更
|
||||
|
||||
- 将“外观”中的内容宽度改为默认(820 px)、宽版(1,200 px)和全宽预设,同时调整已打开对话、Composer 和 Markdown 预览的宽度 ([#10231](https://github.com/getpaseo/paseo/pull/10231))
|
||||
- Antigravity 工具卡片现在显示 shell 命令及输出、文件 diff 和 Paseo 工具详情 ([#10379](https://github.com/getpaseo/paseo/pull/10379))
|
||||
- 从 GitHub 克隆时,优先显示匹配的私有仓库 ([#10264](https://github.com/getpaseo/paseo/pull/10264))
|
||||
- worktree 清理命令在超过默认的一分钟或 `paseo.json` 中 `worktree.teardownTimeoutMs` 限制时保留 worktree ([#9852](https://github.com/getpaseo/paseo/pull/9852),贡献者:[@ragokan](https://github.com/ragokan))
|
||||
- 工作区导航会立即响应点击,并在手机端初始加载时减少屏幕外的对话行数 ([#9887](https://github.com/getpaseo/paseo/pull/9887))
|
||||
- 工作区 Git 状态在短暂重连且检出的内容未更改时复用之前的快照 ([#10142](https://github.com/getpaseo/paseo/pull/10142),贡献者:[@VladimirGVP](https://github.com/VladimirGVP))
|
||||
- 连接多个 Desktop 时,`browser_new_tab` 会让 Agent 选择打开标签页的 Desktop ([#10189](https://github.com/getpaseo/paseo/pull/10189))
|
||||
- 工作区 Git 状态在短暂重连且检出的内容未更改时复用之前的快照 ([#10142](https://github.com/getpaseo/paseo/pull/10142),贡献者:[@VladimirGVP](https://github.com/VladimirGVP))
|
||||
- 工作区导航会立即响应点击,并在手机端初始加载时减少屏幕外的对话行数 ([#9887](https://github.com/getpaseo/paseo/pull/9887))
|
||||
- worktree 清理命令默认在一分钟后停止并保留 worktree;如需更长时间,可在 `paseo.json` 中设置 `worktree.teardownTimeoutMs` ([#9852](https://github.com/getpaseo/paseo/pull/9852),贡献者:[@ragokan](https://github.com/ragokan))
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复应用清除主机目录缓存后,在线主机的工作区一直不显示的问题 ([#10318](https://github.com/getpaseo/paseo/pull/10318))
|
||||
- 修复重新连接后多个已打开的对话同时刷新时,历史记录加载超时的问题 ([#10368](https://github.com/getpaseo/paseo/pull/10368))
|
||||
- 修复 daemon 繁忙时,重新打开较长的 Claude 对话速度慢的问题 ([#10369](https://github.com/getpaseo/paseo/pull/10369))
|
||||
- 修复当前回复中的图片等待另一个对话的历史图片加载的问题 ([#10371](https://github.com/getpaseo/paseo/pull/10371))
|
||||
- 修复在 macOS 或 Linux 上用 Ctrl+C 停止前台 daemon 后,Agent 恢复失败且空闲 Agent 显示错误的问题 ([#10381](https://github.com/getpaseo/paseo/pull/10381))
|
||||
- 修复 daemon 重启后重新打开较长的 Antigravity 对话时丢失末尾历史记录的问题 ([#10428](https://github.com/getpaseo/paseo/pull/10428))
|
||||
- 修复 Antigravity 后台命令仍在运行时轮次就已结束的问题 ([#10310](https://github.com/getpaseo/paseo/pull/10310))
|
||||
- 修复保存自定义模型后,在 Provider 发现较慢或失败时“添加模型”弹窗一直保持打开的问题 ([#10432](https://github.com/getpaseo/paseo/pull/10432))
|
||||
- 修复 Provider 返回重复命令名称时,斜杠建议列表出错的问题 ([#10275](https://github.com/getpaseo/paseo/pull/10275))
|
||||
- 修复在不同目录中恢复 Codex 会话时,配置和 MCP 服务器仍沿用旧工作目录的问题 ([#10390](https://github.com/getpaseo/paseo/pull/10390),贡献者:[@tabulius-ux](https://github.com/tabulius-ux))
|
||||
- 修复重新打开或回退父对话后,Codex 子 Agent 状态未更新的问题 ([#10171](https://github.com/getpaseo/paseo/pull/10171),贡献者:[@AnalyticETH](https://github.com/AnalyticETH))
|
||||
- 修复切换 Claude 账号后,“使用情况”页面仍显示上一个账号配额的问题 ([#10236](https://github.com/getpaseo/paseo/pull/10236))
|
||||
- 修复固定多个用量窗口时,侧边栏用量行隐藏 `5h` 和 `wk` 等周期标签的问题 ([#10274](https://github.com/getpaseo/paseo/pull/10274))
|
||||
- 修复恢复 worktree 后,“更改”无法立即识别检出目录的问题 ([#10224](https://github.com/getpaseo/paseo/pull/10224), [#10304](https://github.com/getpaseo/paseo/pull/10304), [#10406](https://github.com/getpaseo/paseo/pull/10406))
|
||||
- 修复向调整过宽度的分屏行添加新窗格后,分隔条无法拖动或跟手缓慢的问题 ([#5996](https://github.com/getpaseo/paseo/pull/5996))
|
||||
- 修复 diff 中双击选词和三击选行的问题 ([#10252](https://github.com/getpaseo/paseo/pull/10252),贡献者:[@pedrovieira](https://github.com/pedrovieira))
|
||||
- 修复启用聊天大纲时,Composer 与对话栏对不齐的问题 ([#10277](https://github.com/getpaseo/paseo/pull/10277))
|
||||
- 修复网页版 Composer 在较窄宽度或较长译文下聚焦快捷键提示遮挡占位符文字的问题 ([#6200](https://github.com/getpaseo/paseo/pull/6200))
|
||||
- 修复当前工作区所在的侧边栏分组折叠时,归档快捷键失效的问题 ([#10356](https://github.com/getpaseo/paseo/pull/10356),贡献者:[@hiennd-ctrl](https://github.com/hiennd-ctrl), [@neihyud](https://github.com/neihyud))
|
||||
- 修复一个会话正在归档工作区时,其他会话和插件仍将其显示为活跃状态的问题 ([#10391](https://github.com/getpaseo/paseo/pull/10391),贡献者:[@tabulius-ux](https://github.com/tabulius-ux))
|
||||
- 修复在 Android 上输入文字或缩放对话图片后,首次点击 Composer 按钮无效的问题 ([#10057](https://github.com/getpaseo/paseo/pull/10057), [#10308](https://github.com/getpaseo/paseo/pull/10308))
|
||||
- 修复在 Android 浏览器中滑动终端时弹出已关闭的键盘的问题 ([#10225](https://github.com/getpaseo/paseo/pull/10225),贡献者:[@tonylt](https://github.com/tonylt))
|
||||
- 修复启用“折叠轮次”时,空闲的 Provider 通知导致已完成的 OMP 或 Pi 回复被隐藏的问题 ([#10135](https://github.com/getpaseo/paseo/pull/10135))
|
||||
- 修复 Agent 响应后台任务时,在之前的完成状态未读的情况下重复发送完成通知的问题 ([#10200](https://github.com/getpaseo/paseo/pull/10200))
|
||||
- 修复空对话在回复中途重连后丢失提示词和回复开头的问题 ([#9723](https://github.com/getpaseo/paseo/pull/9723),贡献者:[@ragokan](https://github.com/ragokan))
|
||||
- 修复切换 Claude 思考级别时停止后台任务的问题 ([#10008](https://github.com/getpaseo/paseo/pull/10008),贡献者:[@gilad-rubin](https://github.com/gilad-rubin))
|
||||
- 修复共享 OpenCode 服务停止后轮次一直显示为运行中的问题 ([#10187](https://github.com/getpaseo/paseo/pull/10187))
|
||||
- 修复 OMP 提供会话或授权选项时拒绝已批准工具调用的问题 ([#10126](https://github.com/getpaseo/paseo/pull/10126),贡献者:[@dsingal0](https://github.com/dsingal0))
|
||||
- 修复 Codex 消息在轮次开始前停止时显示错误而非已取消的问题 ([#9931](https://github.com/getpaseo/paseo/pull/9931),贡献者:[@3ae3ae](https://github.com/3ae3ae))
|
||||
- 修复 Git 元数据监听达到上限时无法打开“更改”的问题 ([#10188](https://github.com/getpaseo/paseo/pull/10188))
|
||||
- 修复将选中的回复复制到纯文本目标时出现多余 Markdown 语法的问题 ([#10079](https://github.com/getpaseo/paseo/pull/10079),贡献者:[@danberindei](https://github.com/danberindei))
|
||||
- 修复在预览和源码之间切换时文件视图丢失滚动位置的问题,iOS 的 HTML 预览除外 ([#10195](https://github.com/getpaseo/paseo/pull/10195),贡献者:[@apple-ouyang](https://github.com/apple-ouyang))
|
||||
- 修复拆分窗格中的文件标签页显示或聚焦错误文件的问题 ([#9888](https://github.com/getpaseo/paseo/pull/9888),贡献者:[@KosmoCHE](https://github.com/KosmoCHE))
|
||||
- 修复触摸屏上的子菜单打开后立即关闭的问题 ([#10175](https://github.com/getpaseo/paseo/pull/10175),贡献者:[@christiantwu](https://github.com/christiantwu))
|
||||
- 修复关闭另一个使用过麦克风的对话后无法听写的问题 ([#10185](https://github.com/getpaseo/paseo/pull/10185),贡献者:[@Brandon168](https://github.com/Brandon168))
|
||||
- 修复 Android 缩放对话图片后 Composer 点击失效的问题 ([#10057](https://github.com/getpaseo/paseo/pull/10057))
|
||||
- 修复 Samsung DeX 上的文字被裁剪的问题 ([#9995](https://github.com/getpaseo/paseo/pull/9995),贡献者:[@easyhunjune](https://github.com/easyhunjune))
|
||||
- 修复主机连接缓慢后对话中的工作区图片无法加载的问题 ([#10111](https://github.com/getpaseo/paseo/pull/10111),贡献者:[@ragokan](https://github.com/ragokan))
|
||||
- 修复桌面浏览器截图返回全透明图片的问题 ([#9807](https://github.com/getpaseo/paseo/pull/9807),贡献者:[@monarchmaisuriya](https://github.com/monarchmaisuriya))
|
||||
- 修复 Mermaid 流程图标签含有 `@` 时显示源码而非图表的问题 ([#10165](https://github.com/getpaseo/paseo/pull/10165),贡献者:[@monarchmaisuriya](https://github.com/monarchmaisuriya))
|
||||
- 修复隐藏的后台工作区触发程序坞徽标和网站图标状态的问题 ([#9983](https://github.com/getpaseo/paseo/pull/9983))
|
||||
- 修复桌面侧边栏导航占满工作区列表空间的问题 ([#9903](https://github.com/getpaseo/paseo/pull/9903),贡献者:[@pentatonic-alex](https://github.com/pentatonic-alex))
|
||||
- 修复仓库默认分支显示历史已关闭 PR 徽标的问题 ([#10053](https://github.com/getpaseo/paseo/pull/10053))
|
||||
- 修复 Provider 关闭会话后插件 Agent 无法重新打开的问题 ([#10153](https://github.com/getpaseo/paseo/pull/10153))
|
||||
- 修复插件页面和设置无法使用插件状态钩子的问题 ([#10049](https://github.com/getpaseo/paseo/pull/10049))
|
||||
|
||||
### 插件
|
||||
|
||||
- 新增插件导航 `focusHost` 选项,打开工作区或 Agent 时在侧边栏选中目标主机 ([#5574](https://github.com/getpaseo/paseo/pull/5574),贡献者:[@discwl](https://github.com/discwl))
|
||||
- 修复 Codex 消息在轮次开始前停止时显示错误而非已取消的问题 ([#9931](https://github.com/getpaseo/paseo/pull/9931),贡献者:[@3ae3ae](https://github.com/3ae3ae))
|
||||
- 修复仓库默认分支显示历史已关闭 PR 徽标的问题 ([#10053](https://github.com/getpaseo/paseo/pull/10053))
|
||||
|
||||
## 0.16.2 - 2026-11-18
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
- Use existing worktrees: Start a workspace in a worktree you already have, or create one from a branch or pull request. Plugins can manage worktree creation, removal, and restoration. When you branch off a fork PR or MR, choose Run setup to approve workspace automation.
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -1,3 +0,0 @@
|
||||
- Use existing worktrees: Start a workspace in a worktree you already have, or create one from a branch or pull request. Plugins can manage worktree creation, removal, and restoration. When you branch off a fork PR or MR, choose Run setup to approve workspace automation.
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -1,3 +0,0 @@
|
||||
- Use existing worktrees: Start a workspace in a worktree you already have, or create one from a branch or pull request. Plugins can manage worktree creation, removal, and restoration. When you branch off a fork PR or MR, choose Run setup to approve workspace automation.
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -1,3 +0,0 @@
|
||||
- Use existing worktrees: Start a workspace in a worktree you already have, or create one from a branch or pull request. Plugins can manage worktree creation, removal, and restoration. When you branch off a fork PR or MR, choose Run setup to approve workspace automation.
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
Generated
+28
-28
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "paseo",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "paseo",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
"workspaces": [
|
||||
@@ -37477,7 +37477,7 @@
|
||||
},
|
||||
"packages/app": {
|
||||
"name": "@getpaseo/app",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"dependencies": {
|
||||
"@codemirror/commands": "6.10.4",
|
||||
"@codemirror/language": "6.12.4",
|
||||
@@ -39647,13 +39647,13 @@
|
||||
},
|
||||
"packages/cli": {
|
||||
"name": "@getpaseo/cli",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@clack/prompts": "^1.0.0",
|
||||
"@getpaseo/client": "0.17.1",
|
||||
"@getpaseo/protocol": "0.17.1",
|
||||
"@getpaseo/server": "0.17.1",
|
||||
"@getpaseo/client": "0.17.0-beta.1",
|
||||
"@getpaseo/protocol": "0.17.0-beta.1",
|
||||
"@getpaseo/server": "0.17.0-beta.1",
|
||||
"chalk": "^5.3.0",
|
||||
"commander": "^12.0.0",
|
||||
"mime-types": "^2.1.35",
|
||||
@@ -39900,11 +39900,11 @@
|
||||
},
|
||||
"packages/client": {
|
||||
"name": "@getpaseo/client",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@getpaseo/protocol": "0.17.1",
|
||||
"@getpaseo/relay": "0.17.1",
|
||||
"@getpaseo/protocol": "0.17.0-beta.1",
|
||||
"@getpaseo/relay": "0.17.0-beta.1",
|
||||
"ws": "^8.20.0",
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
@@ -39916,7 +39916,7 @@
|
||||
},
|
||||
"packages/desktop": {
|
||||
"name": "@getpaseo/desktop",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@getpaseo/cli": "*",
|
||||
@@ -40159,7 +40159,7 @@
|
||||
},
|
||||
"packages/expo-two-way-audio": {
|
||||
"name": "@getpaseo/expo-two-way-audio",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.14",
|
||||
@@ -40205,7 +40205,7 @@
|
||||
},
|
||||
"packages/highlight": {
|
||||
"name": "@getpaseo/highlight",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@codemirror/language": "6.12.4",
|
||||
@@ -40235,7 +40235,7 @@
|
||||
},
|
||||
"packages/plugin": {
|
||||
"name": "@getpaseo/plugin",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "^1.4.0",
|
||||
@@ -40243,8 +40243,8 @@
|
||||
"use-sync-external-store": "^1.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@getpaseo/client": "0.17.1",
|
||||
"@getpaseo/protocol": "0.17.1",
|
||||
"@getpaseo/client": "0.17.0-beta.1",
|
||||
"@getpaseo/protocol": "0.17.0-beta.1",
|
||||
"@types/node": "^20.9.0",
|
||||
"@types/react": "~19.2.0",
|
||||
"react": "19.2.3",
|
||||
@@ -40254,8 +40254,8 @@
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@getpaseo/client": "0.17.1",
|
||||
"@getpaseo/protocol": "0.17.1",
|
||||
"@getpaseo/client": "0.17.0-beta.1",
|
||||
"@getpaseo/protocol": "0.17.0-beta.1",
|
||||
"react": ">=19.1.0 <20",
|
||||
"react-native": ">=0.81.5",
|
||||
"zod": "^4.4.3"
|
||||
@@ -40277,7 +40277,7 @@
|
||||
},
|
||||
"packages/protocol": {
|
||||
"name": "@getpaseo/protocol",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"semver": "^7.8.5",
|
||||
@@ -40305,7 +40305,7 @@
|
||||
},
|
||||
"packages/relay": {
|
||||
"name": "@getpaseo/relay",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@noble/ciphers": "^2.4.0",
|
||||
@@ -40527,17 +40527,17 @@
|
||||
},
|
||||
"packages/server": {
|
||||
"name": "@getpaseo/server",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "^0.17.1",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.326",
|
||||
"@anthropic-ai/sdk": "^0.104.2",
|
||||
"@getpaseo/client": "0.17.1",
|
||||
"@getpaseo/highlight": "0.17.1",
|
||||
"@getpaseo/plugin": "0.17.1",
|
||||
"@getpaseo/protocol": "0.17.1",
|
||||
"@getpaseo/relay": "0.17.1",
|
||||
"@getpaseo/client": "0.17.0-beta.1",
|
||||
"@getpaseo/highlight": "0.17.0-beta.1",
|
||||
"@getpaseo/plugin": "0.17.0-beta.1",
|
||||
"@getpaseo/protocol": "0.17.0-beta.1",
|
||||
"@getpaseo/relay": "0.17.0-beta.1",
|
||||
"@isaacs/ttlcache": "^2.1.4",
|
||||
"@modelcontextprotocol/sdk": "1.29.0",
|
||||
"@opencode-ai/sdk": "1.14.46",
|
||||
@@ -41484,7 +41484,7 @@
|
||||
},
|
||||
"packages/website": {
|
||||
"name": "@getpaseo/website",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"dependencies": {
|
||||
"@cloudflare/vite-plugin": "^1.29.1",
|
||||
"@cloudflare/workers-types": "^4.20260317.1",
|
||||
@@ -43095,7 +43095,7 @@
|
||||
},
|
||||
"plugins": {
|
||||
"name": "@getpaseo/builtin-plugins",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"dependencies": {
|
||||
"@getpaseo/plugin": "*",
|
||||
"zod": "^4.4.3"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "paseo",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"private": true,
|
||||
"description": "Paseo: voice-controlled development environment for local AI coding agents",
|
||||
"keywords": [
|
||||
|
||||
@@ -320,10 +320,12 @@ async function retryRestoredSubmission(page: Page, prompt: string): Promise<void
|
||||
}
|
||||
|
||||
async function expectRejectedPromptBeforeError(page: Page, prompt: string, errorMessage: string) {
|
||||
const messages = page.getByTestId("user-message").or(page.getByTestId("assistant-message"));
|
||||
const messages = page
|
||||
.getByTestId("user-message")
|
||||
.or(page.getByTestId("timeline-notification").filter({ hasText: errorMessage }));
|
||||
await expect(messages).toHaveCount(2);
|
||||
await expect(messages.nth(0)).toContainText(prompt);
|
||||
await expect(messages.nth(1)).toContainText(`[System Error] ${errorMessage}`);
|
||||
await expect(messages.nth(1)).toHaveText(errorMessage);
|
||||
}
|
||||
|
||||
async function configureSteerInSettings(page: Page): Promise<void> {
|
||||
|
||||
@@ -51,7 +51,7 @@ test.describe("Assistant fork menu", () => {
|
||||
await openAgentRoute(page, session);
|
||||
await expectComposerVisible(page);
|
||||
await submitMessage(page, "Emit a synthetic turn failure.");
|
||||
await expect(page.getByText("[System Error] Requested mock provider failure")).toBeVisible({
|
||||
await expect(page.getByText("Requested mock provider failure")).toBeVisible({
|
||||
timeout: 30_000,
|
||||
});
|
||||
|
||||
|
||||
@@ -189,8 +189,9 @@ export async function createCreationScenario(page: Page) {
|
||||
await requests.settled();
|
||||
await expect(
|
||||
page
|
||||
.getByTestId("assistant-message")
|
||||
.filter({ hasText: "[System Error] Requested mock prompt rejection", visible: true }),
|
||||
.getByTestId("timeline-notification")
|
||||
.filter({ hasText: "Requested mock prompt rejection" })
|
||||
.filter({ visible: true }),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page
|
||||
@@ -206,11 +207,15 @@ export async function createCreationScenario(page: Page) {
|
||||
async expectPromptBeforeError(prompt: string) {
|
||||
const messages = page
|
||||
.getByTestId("user-message")
|
||||
.or(page.getByTestId("assistant-message"))
|
||||
.or(
|
||||
page
|
||||
.getByTestId("timeline-notification")
|
||||
.filter({ hasText: "Requested mock prompt rejection" }),
|
||||
)
|
||||
.filter({ visible: true });
|
||||
await expect(messages).toHaveCount(2);
|
||||
await expect(messages.nth(0)).toContainText(prompt);
|
||||
await expect(messages.nth(1)).toContainText("[System Error]");
|
||||
await expect(messages.nth(1)).toHaveText("Requested mock prompt rejection");
|
||||
await expect(messages.nth(1)).toBeInViewport();
|
||||
},
|
||||
async reloadAgent() {
|
||||
@@ -220,10 +225,7 @@ export async function createCreationScenario(page: Page) {
|
||||
},
|
||||
async expectAssistantReply() {
|
||||
await expect(
|
||||
page
|
||||
.getByTestId("assistant-message")
|
||||
.filter({ visible: true, hasNotText: "[System Error]" })
|
||||
.first(),
|
||||
page.getByTestId("assistant-message").filter({ visible: true }).first(),
|
||||
).toBeVisible();
|
||||
},
|
||||
async expectStartupFailure() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/app",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"private": true,
|
||||
"main": "index.ts",
|
||||
"scripts": {
|
||||
|
||||
@@ -148,6 +148,35 @@ function findLayoutItem(layout: StreamLayout, id: string): StreamLayoutItem {
|
||||
}
|
||||
|
||||
describe("layoutStream", () => {
|
||||
it.each(["web", "android"] as const)(
|
||||
"hosts failed response footers on the error row on %s",
|
||||
(platform) => {
|
||||
const error: StreamItem = {
|
||||
kind: "notification",
|
||||
sourceType: "error",
|
||||
level: "error",
|
||||
id: "error-1",
|
||||
message: "Provider failed",
|
||||
timestamp: timestamp(2),
|
||||
timelineCursor: { epoch: "timeline-1", seq: 42 },
|
||||
};
|
||||
const user = userMessage("user-1", 1);
|
||||
const latest = layoutFor({ platform, tail: [user, error] });
|
||||
expect(latest.auxiliaryTurnFooter?.itemId).toBe(error.id);
|
||||
const completed = layoutFor({
|
||||
platform,
|
||||
tail: [user, error, userMessage("user-2", 3)],
|
||||
isTurnActive: true,
|
||||
});
|
||||
expect(findLayoutItem(completed, error.id).completedFooter?.itemId).toBe(error.id);
|
||||
const afterReply = layoutFor({
|
||||
platform,
|
||||
tail: [user, assistantMessage("assistant-1", 2), error],
|
||||
});
|
||||
expect(afterReply.auxiliaryTurnFooter?.itemId).toBe(error.id);
|
||||
},
|
||||
);
|
||||
|
||||
it("keeps separate footers for an assistant turn and an adjacent tool-only turn", () => {
|
||||
const priorAssistant = assistantMessage("prior", 1, undefined, "turn-1");
|
||||
const nextTool = toolCall("next-tool", 2, "turn-2");
|
||||
|
||||
@@ -102,7 +102,10 @@ function findTurnFooterSource(input: {
|
||||
if (!item || (laterItem && !continuesResponse(item, laterItem))) {
|
||||
return toolFallback;
|
||||
}
|
||||
if (item.kind === "assistant_message") {
|
||||
if (
|
||||
item.kind === "assistant_message" ||
|
||||
(item.kind === "notification" && item.sourceType === "error")
|
||||
) {
|
||||
return { item, items, index };
|
||||
}
|
||||
laterItem = item;
|
||||
|
||||
@@ -32,7 +32,12 @@ function assistantMessage(
|
||||
describe("resolveAssistantTurnForkBoundary", () => {
|
||||
it("forks a failed assistant turn from its Paseo timeline cursor without a provider message id", () => {
|
||||
const failedTurn = {
|
||||
...assistantMessage("assistant-error", 2),
|
||||
kind: "notification" as const,
|
||||
sourceType: "error" as const,
|
||||
level: "error" as const,
|
||||
message: "Provider failed",
|
||||
id: "error-1",
|
||||
timestamp: timestamp(2),
|
||||
timelineCursor: { epoch: "timeline-1", seq: 42 },
|
||||
};
|
||||
|
||||
|
||||
@@ -10,6 +10,11 @@ export function resolveAssistantTurnForkBoundary(input: {
|
||||
supportsTimelineCursor: boolean;
|
||||
}): AssistantTurnForkBoundary | undefined {
|
||||
const item = input.items[input.startIndex];
|
||||
if (item?.kind === "notification" && item.sourceType === "error") {
|
||||
return input.supportsTimelineCursor && item.timelineCursor
|
||||
? { boundaryCursor: item.timelineCursor }
|
||||
: undefined;
|
||||
}
|
||||
if (item?.kind !== "assistant_message") {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React, { act } from "react";
|
||||
import { createRoot, type Root } from "react-dom/client";
|
||||
import { afterEach, beforeEach, expect, it, vi } from "vitest";
|
||||
import { page } from "vitest/browser";
|
||||
import { i18n } from "@/i18n/i18next";
|
||||
import type { TurnTiming } from "@/timeline/turn-time";
|
||||
import type { StreamItem } from "@/types/stream";
|
||||
@@ -40,14 +41,14 @@ const reply: StreamItem = {
|
||||
timestamp: FRIDAY_NIGHT,
|
||||
};
|
||||
|
||||
function renderCompletedFooter(timing: TurnTiming): void {
|
||||
function renderCompletedFooter(timing: TurnTiming, items: StreamItem[] = [reply]): void {
|
||||
act(() =>
|
||||
root.render(
|
||||
<CompletedTurnFooterRow
|
||||
strategy={createNativeStreamStrategy()}
|
||||
items={[reply]}
|
||||
items={items}
|
||||
timing={timing}
|
||||
startIndex={0}
|
||||
startIndex={items.length - 1}
|
||||
supportsTimelineCursor={false}
|
||||
/>,
|
||||
),
|
||||
@@ -92,3 +93,22 @@ it.each([
|
||||
"Friday 11:11 PM": 1,
|
||||
});
|
||||
});
|
||||
|
||||
it("offers Copy turn for a reply followed by an error", async () => {
|
||||
const error: StreamItem = {
|
||||
kind: "notification",
|
||||
sourceType: "error",
|
||||
level: "error",
|
||||
id: "failure",
|
||||
message: "Provider failed",
|
||||
timestamp: FRIDAY_NIGHT,
|
||||
turnId: "failed-turn",
|
||||
};
|
||||
const timing = { completedAt: FRIDAY_NIGHT, durationMs: 26_000 };
|
||||
|
||||
renderCompletedFooter(timing, [{ ...reply, turnId: "failed-turn" }, error]);
|
||||
await expect.element(page.getByRole("button", { name: "Copy turn" })).toBeVisible();
|
||||
|
||||
renderCompletedFooter(timing, [{ ...reply, turnId: "earlier-turn" }, error]);
|
||||
await expect.element(page.getByRole("button", { name: "Copy turn" })).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
@@ -184,6 +184,13 @@ function CompletedTurnFooter({
|
||||
}),
|
||||
[strategy, items, startIndex],
|
||||
);
|
||||
const source = items[startIndex];
|
||||
const hasCopyContent = useMemo(
|
||||
() =>
|
||||
source?.kind === "assistant_message" ||
|
||||
(source?.kind === "notification" && source.sourceType === "error" && getContent().length > 0),
|
||||
[getContent, source],
|
||||
);
|
||||
const boundary = resolveAssistantTurnForkBoundary({
|
||||
items,
|
||||
startIndex,
|
||||
@@ -201,7 +208,7 @@ function CompletedTurnFooter({
|
||||
return (
|
||||
<View style={stylesheet.turnFooterSlot}>
|
||||
<AssistantTurnFooter
|
||||
getContent={items[startIndex]?.kind === "assistant_message" ? getContent : undefined}
|
||||
getContent={hasCopyContent ? getContent : undefined}
|
||||
completedAt={timing?.completedAt}
|
||||
durationMs={timing?.durationMs}
|
||||
onFork={boundary && onForkAssistantTurn ? handleFork : undefined}
|
||||
|
||||
@@ -1404,7 +1404,7 @@ export const Notification = memo(function Notification({
|
||||
[resolvedDisableOuterSpacing, config.bg],
|
||||
);
|
||||
return (
|
||||
<View style={containerStyle}>
|
||||
<View style={containerStyle} testID="timeline-notification">
|
||||
<View style={notificationStylesheet.content}>
|
||||
<View style={notificationStylesheet.row}>
|
||||
<View style={notificationStylesheet.iconContainer}>
|
||||
|
||||
@@ -22,6 +22,31 @@ function assistant(id: string, timestamp: Date, text = id): StreamItem {
|
||||
}
|
||||
|
||||
describe("deriveStreamTurnTiming", () => {
|
||||
it("retains completed timing for a failed response with or without assistant text", () => {
|
||||
const userAt = new Date("2026-05-15T00:00:00.000Z");
|
||||
const failedAt = new Date("2026-05-15T00:00:07.000Z");
|
||||
const error: StreamItem = {
|
||||
kind: "notification",
|
||||
sourceType: "error",
|
||||
level: "error",
|
||||
id: "error-1",
|
||||
message: "Provider failed",
|
||||
timestamp: failedAt,
|
||||
};
|
||||
for (const replies of [[], [assistant("assistant-1", new Date("2026-05-15T00:00:03.000Z"))]]) {
|
||||
const timing = deriveStreamTurnTiming({
|
||||
isTurnActive: false,
|
||||
activeTurnStartedAt: null,
|
||||
tail: [user("user-1", userAt), ...replies, error],
|
||||
head: [],
|
||||
});
|
||||
assert.deepEqual(timing.byItemId.get(error.id), {
|
||||
completedAt: failedAt,
|
||||
durationMs: 7000,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
it("starts elapsed time from the submitted prompt", () => {
|
||||
const submittedAt = new Date("2026-05-15T00:00:00.000Z");
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ export interface StreamTurnTiming {
|
||||
interface OpenTurn {
|
||||
userAt: Date | null;
|
||||
lastItemAt: Date | null;
|
||||
assistantIds: readonly string[];
|
||||
responseIds: readonly string[];
|
||||
previousItem: StreamItem | null;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ interface TailTurnTiming {
|
||||
const EMPTY_OPEN_TURN: OpenTurn = {
|
||||
userAt: null,
|
||||
lastItemAt: null,
|
||||
assistantIds: [],
|
||||
responseIds: [],
|
||||
previousItem: null,
|
||||
};
|
||||
|
||||
@@ -44,7 +44,7 @@ function closeTurn(turn: OpenTurn, into: Map<string, TurnTiming>): void {
|
||||
completedAt: turn.lastItemAt,
|
||||
durationMs: turn.userAt ? Math.max(0, turn.lastItemAt.getTime() - turn.userAt.getTime()) : null,
|
||||
};
|
||||
let footerIds = turn.assistantIds;
|
||||
let footerIds = turn.responseIds;
|
||||
if (footerIds.length === 0 && turn.previousItem?.kind === "tool_call") {
|
||||
footerIds = [turn.previousItem.id];
|
||||
}
|
||||
@@ -60,22 +60,25 @@ function walkTurns(
|
||||
): OpenTurn {
|
||||
let userAt = from.userAt;
|
||||
let lastItemAt = from.lastItemAt;
|
||||
let assistantIds = [...from.assistantIds];
|
||||
let responseIds = [...from.responseIds];
|
||||
let previousItem = from.previousItem;
|
||||
for (const item of items) {
|
||||
if (startsNewTurn(item, previousItem)) {
|
||||
closeTurn({ userAt, lastItemAt, assistantIds, previousItem }, into);
|
||||
closeTurn({ userAt, lastItemAt, responseIds, previousItem }, into);
|
||||
userAt = isTurnTrigger(item) ? item.timestamp : null;
|
||||
lastItemAt = null;
|
||||
assistantIds = [];
|
||||
responseIds = [];
|
||||
}
|
||||
lastItemAt = item.timestamp;
|
||||
if (item.kind === "assistant_message") {
|
||||
assistantIds.push(item.id);
|
||||
if (
|
||||
item.kind === "assistant_message" ||
|
||||
(item.kind === "notification" && item.sourceType === "error")
|
||||
) {
|
||||
responseIds.push(item.id);
|
||||
}
|
||||
previousItem = item;
|
||||
}
|
||||
return { userAt, lastItemAt, assistantIds, previousItem };
|
||||
return { userAt, lastItemAt, responseIds, previousItem };
|
||||
}
|
||||
|
||||
function areTimingsEqual(a: Map<string, TurnTiming>, b: Map<string, TurnTiming>): boolean {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/cli",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"description": "Paseo CLI - control your AI coding agents from the command line",
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
@@ -29,9 +29,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@clack/prompts": "^1.0.0",
|
||||
"@getpaseo/client": "0.17.1",
|
||||
"@getpaseo/protocol": "0.17.1",
|
||||
"@getpaseo/server": "0.17.1",
|
||||
"@getpaseo/client": "0.17.0-beta.1",
|
||||
"@getpaseo/protocol": "0.17.0-beta.1",
|
||||
"@getpaseo/server": "0.17.0-beta.1",
|
||||
"chalk": "^5.3.0",
|
||||
"commander": "^12.0.0",
|
||||
"mime-types": "^2.1.35",
|
||||
|
||||
@@ -187,7 +187,12 @@ try {
|
||||
if (agent?.status === "error" && agent.attentionReason === "error") return agent;
|
||||
}, "unexpected provider exit did not raise error attention");
|
||||
const failure = await daemon.client.fetchAgentTimeline(crashing.id, { limit: 20 });
|
||||
assert.match(JSON.stringify(failure.entries), /\[System Error\].*ACP process exited/);
|
||||
assert(
|
||||
failure.entries.some(
|
||||
({ item }) => item.type === "error" && item.message.includes("ACP process exited"),
|
||||
),
|
||||
"unexpected provider exit did not add an error row",
|
||||
);
|
||||
console.log("Unexpected ACP exit raised error attention and added a timeline entry.");
|
||||
|
||||
await daemon.client.sendMessage(running.id, "Hold the turn open.");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/client",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"description": "Paseo client SDK package",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
@@ -49,8 +49,8 @@
|
||||
"measure:diff-materialization": "tsx scripts/measure-diff-materialization.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@getpaseo/protocol": "0.17.1",
|
||||
"@getpaseo/relay": "0.17.1",
|
||||
"@getpaseo/protocol": "0.17.0-beta.1",
|
||||
"@getpaseo/relay": "0.17.0-beta.1",
|
||||
"ws": "^8.20.0",
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/desktop",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"private": true,
|
||||
"description": "Paseo desktop app (Electron wrapper)",
|
||||
"homepage": "https://paseo.sh",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/expo-two-way-audio",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"description": "Native module for two way audio streaming",
|
||||
"keywords": [
|
||||
"ExpoTwoWayAudio",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/highlight",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
"dist",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/plugin",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"description": "Paseo plugin SDK package",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
@@ -78,8 +78,8 @@
|
||||
"use-sync-external-store": "^1.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@getpaseo/client": "0.17.1",
|
||||
"@getpaseo/protocol": "0.17.1",
|
||||
"@getpaseo/client": "0.17.0-beta.1",
|
||||
"@getpaseo/protocol": "0.17.0-beta.1",
|
||||
"@types/node": "^20.9.0",
|
||||
"@types/react": "~19.2.0",
|
||||
"react": "19.2.3",
|
||||
@@ -89,8 +89,8 @@
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@getpaseo/client": "0.17.1",
|
||||
"@getpaseo/protocol": "0.17.1",
|
||||
"@getpaseo/client": "0.17.0-beta.1",
|
||||
"@getpaseo/protocol": "0.17.0-beta.1",
|
||||
"react": ">=19.1.0 <20",
|
||||
"react-native": ">=0.81.5",
|
||||
"zod": "^4.4.3"
|
||||
|
||||
@@ -334,7 +334,7 @@ async function openSession(
|
||||
onRetired: () => retireSession(state, input.sessionId),
|
||||
});
|
||||
try {
|
||||
const capabilities = await runtime.open(input, state.capabilities, state.isClosed);
|
||||
const capabilities = await runtime.open(input, state.capabilities);
|
||||
if (state.isClosed()) {
|
||||
await runtime.closeSession();
|
||||
return;
|
||||
@@ -454,14 +454,12 @@ class AcpRuntime {
|
||||
* Once ready, suppress late replay rows until the first prompt.
|
||||
*/
|
||||
private replayWindow: "replay" | "skip" | null = null;
|
||||
private lastLoadHistoryAt = 0;
|
||||
private lastPartialWireAt = 0;
|
||||
private lastLoadUpdateAt = 0;
|
||||
private closing = false;
|
||||
private closePromise: Promise<void> | null = null;
|
||||
private deferredRetirement: Promise<boolean> | null = null;
|
||||
private deferredFinalized = false;
|
||||
private processFailed = false;
|
||||
private processFailureMessage: string | null = null;
|
||||
private configTransaction = false;
|
||||
private stagedTransformerConfig: ProviderConfigState | null = null;
|
||||
private readonly closeConnector: (options?: {
|
||||
@@ -485,7 +483,6 @@ class AcpRuntime {
|
||||
timeoutMs?: number;
|
||||
}) => Promise<void> = async () => {};
|
||||
let whenConnectorClosed: () => Promise<void> | null = () => null;
|
||||
let onPartialWireRead: (() => void) | null = null;
|
||||
if (options.options.command) {
|
||||
// COMPAT(pluginProviderLaunch): added in v0.10.0, remove after 2027-03-29 once plugin host floor >= v0.10.0.
|
||||
// Standalone callers and older hosts do not send a daemon-resolved launch.
|
||||
@@ -502,10 +499,7 @@ class AcpRuntime {
|
||||
spawnFailure = new Promise<never>((_resolve, reject) => child!.once("error", reject));
|
||||
child.stderr.on("data", () => undefined);
|
||||
const output = Writable.toWeb(child.stdin) as unknown as Parameters<typeof ndJsonStream>[0];
|
||||
const rawInput = Readable.toWeb(child.stdout) as unknown as ReadableStream<Uint8Array>;
|
||||
const input = observePartialWireReads(rawInput, () => onPartialWireRead?.()) as Parameters<
|
||||
typeof ndJsonStream
|
||||
>[1];
|
||||
const input = Readable.toWeb(child.stdout) as unknown as Parameters<typeof ndJsonStream>[1];
|
||||
stream = ndJsonStream(output, input);
|
||||
} else {
|
||||
const owned = ownConnectorStream(await options.options.connector());
|
||||
@@ -514,7 +508,6 @@ class AcpRuntime {
|
||||
whenConnectorClosed = owned.whenClosed;
|
||||
}
|
||||
const runtime = new AcpRuntime(stream, child, closeConnector, whenConnectorClosed, options);
|
||||
onPartialWireRead = () => runtime.notePartialWireRead();
|
||||
try {
|
||||
const initialize = withTimeout(
|
||||
runtime.call(
|
||||
@@ -569,7 +562,6 @@ class AcpRuntime {
|
||||
child?.on("error", (error) => {
|
||||
const message = describeError(error);
|
||||
this.processFailed = true;
|
||||
this.processFailureMessage = message;
|
||||
this.settlePendingWork(message);
|
||||
if (this.closing || !this.nativeSessionId) return;
|
||||
this.emit({
|
||||
@@ -582,7 +574,6 @@ class AcpRuntime {
|
||||
if (this.closing || this.processFailed || !this.nativeSessionId) return;
|
||||
const message = `ACP process exited (${signal ?? code ?? "unknown"})`;
|
||||
this.processFailed = true;
|
||||
this.processFailureMessage = message;
|
||||
this.settlePendingWork(message);
|
||||
this.emit({
|
||||
type: "session.runtime_failed",
|
||||
@@ -595,7 +586,6 @@ class AcpRuntime {
|
||||
async open(
|
||||
input: Extract<ProviderInput, { type: "session.open" }>,
|
||||
connectionCapabilities: readonly ProviderCapability[],
|
||||
isConnectionClosed: () => boolean,
|
||||
): Promise<readonly ProviderCapability[]> {
|
||||
const mcpServers = toAcpMcpServers(input.config);
|
||||
this.mcpServerNames = mcpServers.map((server) => server.name);
|
||||
@@ -666,22 +656,15 @@ class AcpRuntime {
|
||||
cwd: input.config.cwd,
|
||||
});
|
||||
this.emitConfig();
|
||||
await this.finishSessionOpen(isConnectionClosed);
|
||||
return sessionCapabilities;
|
||||
}
|
||||
|
||||
private async finishSessionOpen(isConnectionClosed: () => boolean): Promise<void> {
|
||||
if (this.options.options.acpOptions?.waitForInitialCommands) {
|
||||
await this.waitForInitialCommands();
|
||||
}
|
||||
const quietPeriod = this.options.options.acpOptions?.loadReplayQuietPeriodMs;
|
||||
if (this.replayWindow && quietPeriod && quietPeriod > 0) {
|
||||
await this.waitForLoadReplay(quietPeriod, isConnectionClosed);
|
||||
await this.waitForLoadReplay(quietPeriod);
|
||||
this.replayWindow = "skip";
|
||||
}
|
||||
if (this.processFailed && !isConnectionClosed()) {
|
||||
throw new Error(this.processFailureMessage ?? "ACP process exited during session open");
|
||||
}
|
||||
return sessionCapabilities;
|
||||
}
|
||||
|
||||
async discover(cwd?: string): Promise<ProviderCatalog> {
|
||||
@@ -1299,12 +1282,16 @@ class AcpRuntime {
|
||||
|
||||
private sessionUpdate(notification: SessionNotification, wireSeq: number): void {
|
||||
if (notification.sessionId !== this.nativeSessionId) return;
|
||||
if (this.replayWindow && isReplayHistoryUpdate(notification.update)) {
|
||||
this.lastLoadHistoryAt = performance.now();
|
||||
}
|
||||
if (this.replayWindow) this.lastLoadUpdateAt = performance.now();
|
||||
if (this.replayWindow === "skip") {
|
||||
if (isSessionStateUpdate(notification.update)) {
|
||||
this.reduceStateUpdate(notification.update, wireSeq);
|
||||
const update = notification.update;
|
||||
if (
|
||||
update.sessionUpdate === "available_commands_update" ||
|
||||
update.sessionUpdate === "config_option_update" ||
|
||||
update.sessionUpdate === "current_mode_update" ||
|
||||
update.sessionUpdate === "usage_update"
|
||||
) {
|
||||
this.reduceStateUpdate(update, wireSeq);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1647,7 +1634,6 @@ class AcpRuntime {
|
||||
if (this.closing || this.processFailed) return;
|
||||
const message = "ACP transport closed unexpectedly";
|
||||
this.processFailed = true;
|
||||
this.processFailureMessage = message;
|
||||
this.settlePendingWork(message);
|
||||
if (!this.nativeSessionId) return;
|
||||
this.emit({
|
||||
@@ -1959,86 +1945,19 @@ class AcpRuntime {
|
||||
});
|
||||
}
|
||||
|
||||
private notePartialWireRead(): void {
|
||||
if (this.replayWindow) this.lastPartialWireAt = performance.now();
|
||||
}
|
||||
|
||||
// An agent that streams history after its session/load response sends no end marker,
|
||||
// so the history ends once a quiet period passes without a history update.
|
||||
private async waitForLoadReplay(
|
||||
quietPeriod: number,
|
||||
isConnectionClosed: () => boolean,
|
||||
): Promise<void> {
|
||||
private async waitForLoadReplay(quietPeriod: number): Promise<void> {
|
||||
const start = performance.now();
|
||||
while (!this.closing && !this.processFailed && !isConnectionClosed()) {
|
||||
const lastActivityAt = Math.max(start, this.lastLoadHistoryAt, this.lastPartialWireAt);
|
||||
const remaining = lastActivityAt + quietPeriod - performance.now();
|
||||
// A stalled event loop reaches the quiet period with history still unread in the pipe.
|
||||
// setImmediate lets the loop read pending input once before the silence is trusted.
|
||||
await new Promise<void>((resolve) => {
|
||||
if (remaining > 0) setTimeout(resolve, remaining);
|
||||
else setImmediate(resolve);
|
||||
});
|
||||
const deadline = start + 5 * quietPeriod;
|
||||
while (!this.closing && !this.processFailed) {
|
||||
const idleAt = Math.max(start, this.lastLoadUpdateAt) + quietPeriod;
|
||||
const remaining = Math.min(deadline, idleAt) - performance.now();
|
||||
if (remaining <= 0) return;
|
||||
await new Promise<void>((resolve) => setTimeout(resolve, remaining));
|
||||
await this.notificationLane;
|
||||
if (
|
||||
remaining <= 0 &&
|
||||
Math.max(start, this.lastLoadHistoryAt, this.lastPartialWireAt) === lastActivityAt
|
||||
) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function observePartialWireReads(
|
||||
input: ReadableStream<Uint8Array>,
|
||||
onPartialRead: () => void,
|
||||
): ReadableStream<Uint8Array> {
|
||||
let incompleteLine = false;
|
||||
return input.pipeThrough(
|
||||
new TransformStream<Uint8Array, Uint8Array>({
|
||||
transform(chunk, controller) {
|
||||
const wasIncomplete = incompleteLine;
|
||||
incompleteLine = hasTrailingIncompleteLine(chunk, incompleteLine);
|
||||
if (wasIncomplete || incompleteLine) onPartialRead();
|
||||
controller.enqueue(chunk);
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
function hasTrailingIncompleteLine(chunk: Uint8Array, incompleteLine: boolean): boolean {
|
||||
const newline = chunk.lastIndexOf(0x0a);
|
||||
const start = newline === -1 ? 0 : newline + 1;
|
||||
if (newline !== -1) incompleteLine = false;
|
||||
for (let index = start; index < chunk.length; index += 1) {
|
||||
const byte = chunk[index];
|
||||
if (byte !== 0x20 && byte !== 0x09 && byte !== 0x0d) return true;
|
||||
}
|
||||
return incompleteLine;
|
||||
}
|
||||
|
||||
function isReplayHistoryUpdate(update: SessionUpdate): boolean {
|
||||
return (
|
||||
update.sessionUpdate === "user_message_chunk" ||
|
||||
update.sessionUpdate === "agent_message_chunk" ||
|
||||
update.sessionUpdate === "agent_thought_chunk" ||
|
||||
update.sessionUpdate === "tool_call" ||
|
||||
update.sessionUpdate === "tool_call_update" ||
|
||||
update.sessionUpdate === "plan" ||
|
||||
update.sessionUpdate === "compaction_update"
|
||||
);
|
||||
}
|
||||
|
||||
function isSessionStateUpdate(update: SessionUpdate): boolean {
|
||||
return (
|
||||
update.sessionUpdate === "available_commands_update" ||
|
||||
update.sessionUpdate === "config_option_update" ||
|
||||
update.sessionUpdate === "current_mode_update" ||
|
||||
update.sessionUpdate === "usage_update"
|
||||
);
|
||||
}
|
||||
|
||||
function routeIncomingMessages(
|
||||
stream: Stream,
|
||||
receiveVendor: (method: string, params: unknown) => void,
|
||||
|
||||
@@ -303,378 +303,6 @@ describe("runAcpProvider", () => {
|
||||
},
|
||||
);
|
||||
|
||||
it("keeps history that streams after session/load for longer than five quiet periods", async () => {
|
||||
const sessionId = "connector-session";
|
||||
const historyLength = 40;
|
||||
let stream: ReturnType<typeof setInterval> | undefined;
|
||||
const { connector } = connectorHarness({
|
||||
capabilities: { loadSession: true },
|
||||
handleRequest(runtime, request) {
|
||||
if (request.method !== "session/load") return false;
|
||||
runtime.respond(request, { configOptions: [] });
|
||||
let sent = 0;
|
||||
stream = setInterval(() => {
|
||||
runtime.notify("session/update", {
|
||||
sessionId,
|
||||
update: {
|
||||
sessionUpdate: "agent_message_chunk",
|
||||
messageId: `answer-${sent}`,
|
||||
content: { type: "text", text: `previous answer ${sent}` },
|
||||
},
|
||||
});
|
||||
sent += 1;
|
||||
if (sent === historyLength) clearInterval(stream);
|
||||
}, 20);
|
||||
return true;
|
||||
},
|
||||
});
|
||||
const connection = await runAcpProvider({
|
||||
id: "load",
|
||||
label: "Load",
|
||||
connector,
|
||||
acpOptions: { loadReplayQuietPeriodMs: 100 },
|
||||
}).connect({ versions: [1], capabilities: ["prompt.message", "session.persistence"] });
|
||||
const events: ProviderEvent[] = [];
|
||||
connection.onEvent((event) => events.push(event));
|
||||
try {
|
||||
await connection.send({
|
||||
...openInput(),
|
||||
history: "replay",
|
||||
persistence: { version: 1, data: { sessionId } },
|
||||
});
|
||||
await waitForEvent(events, (event) => event.type === "session.ready");
|
||||
expect(events.filter((event) => event.type === "timeline.item")).toHaveLength(historyLength);
|
||||
} finally {
|
||||
clearInterval(stream);
|
||||
await connection.close();
|
||||
}
|
||||
});
|
||||
|
||||
it("closes without waiting for history that is still streaming after session/load", async () => {
|
||||
const sessionId = "connector-session";
|
||||
let stream: ReturnType<typeof setInterval> | undefined;
|
||||
const { connector } = connectorHarness({
|
||||
capabilities: { loadSession: true },
|
||||
handleRequest(runtime, request) {
|
||||
if (request.method !== "session/load") return false;
|
||||
runtime.respond(request, { configOptions: [] });
|
||||
stream = setInterval(() => {
|
||||
if (runtime.readsCanceled) return;
|
||||
runtime.notify("session/update", {
|
||||
sessionId,
|
||||
update: {
|
||||
sessionUpdate: "agent_message_chunk",
|
||||
content: { type: "text", text: "previous answer" },
|
||||
},
|
||||
});
|
||||
}, 20);
|
||||
return true;
|
||||
},
|
||||
});
|
||||
const connection = await runAcpProvider({
|
||||
id: "load",
|
||||
label: "Load",
|
||||
connector,
|
||||
acpOptions: { loadReplayQuietPeriodMs: 100 },
|
||||
}).connect({ versions: [1], capabilities: ["prompt.message", "session.persistence"] });
|
||||
const events: ProviderEvent[] = [];
|
||||
connection.onEvent((event) => events.push(event));
|
||||
try {
|
||||
await connection.send({
|
||||
...openInput(),
|
||||
history: "replay",
|
||||
persistence: { version: 1, data: { sessionId } },
|
||||
});
|
||||
await waitForEvent(events, (event) => event.type === "timeline.item");
|
||||
const outcome = await Promise.race([
|
||||
connection.close().then(() => "closed"),
|
||||
new Promise((resolve) => setTimeout(() => resolve("still replaying"), 1_000)),
|
||||
]);
|
||||
expect(outcome).toBe("closed");
|
||||
} finally {
|
||||
clearInterval(stream);
|
||||
}
|
||||
});
|
||||
|
||||
it("keeps history left unread while the event loop stalled past the quiet period", async () => {
|
||||
const sessionId = "connector-session";
|
||||
const notifyAnswer = (runtime: ConnectorInstance, text: string) =>
|
||||
runtime.notify("session/update", {
|
||||
sessionId,
|
||||
update: {
|
||||
sessionUpdate: "agent_message_chunk",
|
||||
messageId: text,
|
||||
content: { type: "text", text },
|
||||
},
|
||||
});
|
||||
const { connector } = connectorHarness({
|
||||
capabilities: { loadSession: true },
|
||||
handleRequest(runtime, request) {
|
||||
if (request.method !== "session/load") return false;
|
||||
runtime.respond(request, { configOptions: [] });
|
||||
notifyAnswer(runtime, "read before the stall");
|
||||
// Stall after the timers phase, so the overdue quiet timer runs before the next I/O poll.
|
||||
const stall = () => {
|
||||
// Like bytes waiting in the agent's pipe: readable only once the loop polls I/O again.
|
||||
setImmediate(() => notifyAnswer(runtime, "unread during the stall"));
|
||||
const stalledUntil = performance.now() + 250;
|
||||
while (performance.now() < stalledUntil);
|
||||
};
|
||||
setTimeout(() => setImmediate(stall), 30);
|
||||
return true;
|
||||
},
|
||||
});
|
||||
const connection = await runAcpProvider({
|
||||
id: "load",
|
||||
label: "Load",
|
||||
connector,
|
||||
acpOptions: { loadReplayQuietPeriodMs: 100 },
|
||||
}).connect({ versions: [1], capabilities: ["prompt.message", "session.persistence"] });
|
||||
const events: ProviderEvent[] = [];
|
||||
connection.onEvent((event) => events.push(event));
|
||||
try {
|
||||
await connection.send({
|
||||
...openInput(),
|
||||
history: "replay",
|
||||
persistence: { version: 1, data: { sessionId } },
|
||||
});
|
||||
await waitForEvent(events, (event) => event.type === "session.ready");
|
||||
expect(
|
||||
events.filter((event) => event.type === "timeline.item").map((event) => event.item),
|
||||
).toEqual([
|
||||
expect.objectContaining({ text: "read before the stall" }),
|
||||
expect.objectContaining({ text: "unread during the stall" }),
|
||||
]);
|
||||
} finally {
|
||||
await connection.close();
|
||||
}
|
||||
});
|
||||
|
||||
it("does not extend the load replay wait for session_info_update notifications", async () => {
|
||||
const sessionId = "connector-session";
|
||||
let stream: ReturnType<typeof setInterval> | undefined;
|
||||
const { connector } = connectorHarness({
|
||||
capabilities: { loadSession: true },
|
||||
handleRequest(runtime, request) {
|
||||
if (request.method !== "session/load") return false;
|
||||
runtime.respond(request, { configOptions: [] });
|
||||
runtime.notify("session/update", {
|
||||
sessionId,
|
||||
update: {
|
||||
sessionUpdate: "agent_message_chunk",
|
||||
messageId: "answer-1",
|
||||
content: { type: "text", text: "previous answer" },
|
||||
},
|
||||
});
|
||||
stream = setInterval(() => {
|
||||
if (runtime.readsCanceled) return;
|
||||
runtime.notify("session/update", {
|
||||
sessionId,
|
||||
update: {
|
||||
sessionUpdate: "session_info_update",
|
||||
title: "Updated title",
|
||||
},
|
||||
});
|
||||
}, 20);
|
||||
return true;
|
||||
},
|
||||
});
|
||||
const connection = await runAcpProvider({
|
||||
id: "load",
|
||||
label: "Load",
|
||||
connector,
|
||||
acpOptions: { loadReplayQuietPeriodMs: 100 },
|
||||
}).connect({ versions: [1], capabilities: ["prompt.message", "session.persistence"] });
|
||||
const events: ProviderEvent[] = [];
|
||||
connection.onEvent((event) => events.push(event));
|
||||
try {
|
||||
await connection.send({
|
||||
...openInput(),
|
||||
history: "replay",
|
||||
persistence: { version: 1, data: { sessionId } },
|
||||
});
|
||||
const outcome = await Promise.race([
|
||||
waitForEvent(events, (event) => event.type === "session.ready").then(() => "ready"),
|
||||
new Promise((resolve) => setTimeout(() => resolve("still waiting"), 1_000)),
|
||||
]);
|
||||
expect(outcome).toBe("ready");
|
||||
expect(events.filter((event) => event.type === "timeline.item")).toHaveLength(1);
|
||||
} finally {
|
||||
clearInterval(stream);
|
||||
await connection.close();
|
||||
}
|
||||
});
|
||||
|
||||
it("fails session open without emitting session.ready or leaking the session when the ACP process crashes mid-replay", async () => {
|
||||
const dir = await mkdtemp(path.join(tmpdir(), "paseo-acp-crash-replay-"));
|
||||
const script = path.join(dir, "crash-replay-agent.mjs");
|
||||
await writeFile(
|
||||
script,
|
||||
`
|
||||
import { createInterface } from "node:readline";
|
||||
const send = (msg) => process.stdout.write(JSON.stringify({ jsonrpc: "2.0", ...msg }) + "\\n");
|
||||
createInterface({ input: process.stdin }).on("line", (line) => {
|
||||
if (!line.trim()) return;
|
||||
const msg = JSON.parse(line);
|
||||
if (msg.method === "initialize") {
|
||||
send({ id: msg.id, result: { protocolVersion: 1, agentCapabilities: { loadSession: true } } });
|
||||
} else if (msg.method === "session/load") {
|
||||
const sid = msg.params.sessionId;
|
||||
send({ id: msg.id, result: { configOptions: [] } });
|
||||
send({
|
||||
method: "session/update",
|
||||
params: {
|
||||
sessionId: sid,
|
||||
update: {
|
||||
sessionUpdate: "agent_message_chunk",
|
||||
messageId: "m-1",
|
||||
content: { type: "text", text: "partial history" },
|
||||
},
|
||||
},
|
||||
});
|
||||
if (sid === "crash-session") {
|
||||
setTimeout(() => process.exit(1), 20);
|
||||
}
|
||||
} else if (msg.method === "session/close") {
|
||||
send({ id: msg.id, result: {} });
|
||||
}
|
||||
});
|
||||
`,
|
||||
);
|
||||
const connection = await runAcpProvider({
|
||||
id: "crash-replay",
|
||||
label: "Crash Replay",
|
||||
command: [process.execPath, script],
|
||||
acpOptions: { loadReplayQuietPeriodMs: 100 },
|
||||
}).connect({ versions: [1], capabilities: ["prompt.message", "session.persistence"] });
|
||||
const events: ProviderEvent[] = [];
|
||||
connection.onEvent((event) => events.push(event));
|
||||
try {
|
||||
await connection.send({
|
||||
...openInput(),
|
||||
requestId: "req-crash",
|
||||
sessionId: "session-1",
|
||||
history: "replay",
|
||||
persistence: { version: 1, data: { sessionId: "crash-session" } },
|
||||
});
|
||||
await waitForEvent(
|
||||
events,
|
||||
(event) => event.type === "request.failed" && event.requestId === "req-crash",
|
||||
);
|
||||
expect(events.some((event) => event.type === "session.ready")).toBe(false);
|
||||
|
||||
// The failed open must not leave a dead session registered under "session-1".
|
||||
await connection.send({
|
||||
...openInput(),
|
||||
requestId: "req-retry",
|
||||
sessionId: "session-1",
|
||||
history: "replay",
|
||||
persistence: { version: 1, data: { sessionId: "healthy-session" } },
|
||||
});
|
||||
await waitForEvent(
|
||||
events,
|
||||
(event) => event.type === "session.ready" && event.requestId === "req-retry",
|
||||
);
|
||||
} finally {
|
||||
await connection.close();
|
||||
await rm(dir, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
it("keeps a multi-read tool result started during an event-loop stall past the quiet period", async () => {
|
||||
const dir = await mkdtemp(path.join(tmpdir(), "paseo-acp-large-stall-replay-"));
|
||||
const script = path.join(dir, "large-stall-agent.mjs");
|
||||
const outputBytes = 256 * 1024;
|
||||
await writeFile(
|
||||
script,
|
||||
`
|
||||
import { createInterface } from "node:readline";
|
||||
const send = (msg) => process.stdout.write(JSON.stringify({ jsonrpc: "2.0", ...msg }) + "\\n");
|
||||
createInterface({ input: process.stdin }).on("line", (line) => {
|
||||
if (!line.trim()) return;
|
||||
const msg = JSON.parse(line);
|
||||
if (msg.method === "initialize") {
|
||||
send({ id: msg.id, result: { protocolVersion: 1, agentCapabilities: { loadSession: true } } });
|
||||
} else if (msg.method === "session/load") {
|
||||
const sid = msg.params.sessionId;
|
||||
send({
|
||||
method: "session/update",
|
||||
params: {
|
||||
sessionId: sid,
|
||||
update: {
|
||||
sessionUpdate: "agent_message_chunk",
|
||||
messageId: "m-before",
|
||||
content: { type: "text", text: "before the stall" },
|
||||
},
|
||||
},
|
||||
});
|
||||
send({ id: msg.id, result: { configOptions: [] } });
|
||||
setTimeout(() => {
|
||||
send({
|
||||
method: "session/update",
|
||||
params: {
|
||||
sessionId: sid,
|
||||
update: {
|
||||
sessionUpdate: "tool_call",
|
||||
toolCallId: "shell-large",
|
||||
name: "run_command",
|
||||
title: "Large output",
|
||||
kind: "execute",
|
||||
status: "completed",
|
||||
rawInput: { CommandLine: "cat large.log" },
|
||||
rawOutput: { output: "x".repeat(${outputBytes}), exit_code: 0 },
|
||||
},
|
||||
},
|
||||
});
|
||||
}, 50);
|
||||
} else if (msg.method === "session/close") {
|
||||
send({ id: msg.id, result: {} });
|
||||
}
|
||||
});
|
||||
`,
|
||||
);
|
||||
const connection = await runAcpProvider({
|
||||
id: "large-stall",
|
||||
label: "Large Stall",
|
||||
command: [process.execPath, script],
|
||||
acpOptions: { loadReplayQuietPeriodMs: 200 },
|
||||
}).connect({ versions: [1], capabilities: ["prompt.message", "session.persistence"] });
|
||||
const events: ProviderEvent[] = [];
|
||||
let stalled = false;
|
||||
const stallEventLoop = () => {
|
||||
const until = performance.now() + 350;
|
||||
while (performance.now() < until);
|
||||
};
|
||||
const scheduleStall = () => setImmediate(stallEventLoop);
|
||||
connection.onEvent((event) => {
|
||||
events.push(event);
|
||||
if (!stalled && event.type === "session.config") {
|
||||
stalled = true;
|
||||
// Stall after the timers phase so the overdue quiet timer runs before the next I/O poll;
|
||||
// the 256 KiB tool result fills the pipe during the stall and spans multiple stdout reads.
|
||||
setTimeout(scheduleStall, 20);
|
||||
}
|
||||
});
|
||||
try {
|
||||
await connection.send({
|
||||
...openInput(),
|
||||
history: "replay",
|
||||
persistence: { version: 1, data: { sessionId: "large-session" } },
|
||||
});
|
||||
await waitForEvent(events, (event) => event.type === "session.ready");
|
||||
const items = events
|
||||
.filter((event) => event.type === "timeline.item")
|
||||
.map((event) => event.item);
|
||||
expect(items).toEqual([
|
||||
expect.objectContaining({ type: "assistant_message", text: "before the stall" }),
|
||||
expect.objectContaining({ type: "tool_call", callId: "shell-large", status: "completed" }),
|
||||
]);
|
||||
} finally {
|
||||
await connection.close();
|
||||
await rm(dir, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
it("auto-accepts ordinary permissions only in the unattended mode and refuses to switch while busy", async () => {
|
||||
const modeConfig = {
|
||||
id: "mode",
|
||||
|
||||
@@ -51,10 +51,7 @@ export interface AcpOptions {
|
||||
workspaceOnlyCatalog?: boolean;
|
||||
waitForInitialCommands?: boolean;
|
||||
initialCommandsTimeoutMs?: number;
|
||||
/**
|
||||
* For an agent that streams history after its session/load response: publish the session
|
||||
* as ready once this long passes without a history update.
|
||||
*/
|
||||
/** Allow delayed session/load updates before publishing the session as ready. */
|
||||
loadReplayQuietPeriodMs?: number;
|
||||
/**
|
||||
* Keep a turn open after `end_turn` while qualifying tool calls are still running,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/protocol",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"description": "Paseo shared protocol schemas and wire types",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/relay",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"description": "Paseo relay for bridging daemon and client connections",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/server",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"description": "Paseo backend server",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
@@ -109,11 +109,11 @@
|
||||
"@agentclientprotocol/sdk": "^0.17.1",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.326",
|
||||
"@anthropic-ai/sdk": "^0.104.2",
|
||||
"@getpaseo/client": "0.17.1",
|
||||
"@getpaseo/highlight": "0.17.1",
|
||||
"@getpaseo/plugin": "0.17.1",
|
||||
"@getpaseo/protocol": "0.17.1",
|
||||
"@getpaseo/relay": "0.17.1",
|
||||
"@getpaseo/client": "0.17.0-beta.1",
|
||||
"@getpaseo/highlight": "0.17.0-beta.1",
|
||||
"@getpaseo/plugin": "0.17.0-beta.1",
|
||||
"@getpaseo/protocol": "0.17.0-beta.1",
|
||||
"@getpaseo/relay": "0.17.0-beta.1",
|
||||
"@isaacs/ttlcache": "^2.1.4",
|
||||
"@modelcontextprotocol/sdk": "1.29.0",
|
||||
"@opencode-ai/sdk": "1.14.46",
|
||||
|
||||
@@ -4907,11 +4907,7 @@ test("a prompt after provider replacement reopens the stale session", async () =
|
||||
expect(timeline.filter((item) => item.type === "user_message")).toMatchObject([
|
||||
{ text: "continue after reload", clientMessageId: "stale-session-retry" },
|
||||
]);
|
||||
expect(
|
||||
timeline.some(
|
||||
(item) => item.type === "assistant_message" && item.text.includes("[System Error]"),
|
||||
),
|
||||
).toBe(false);
|
||||
expect(timeline.some((item) => item.type === "error")).toBe(false);
|
||||
} finally {
|
||||
await manager.closeAgent(created.id).catch(() => undefined);
|
||||
await manager.flush().catch(() => undefined);
|
||||
@@ -8413,47 +8409,78 @@ test("ignores stale autonomous terminals without lowering the active turn lifecy
|
||||
});
|
||||
});
|
||||
|
||||
test("preserves terminal fallback when no active turn identity was observed", async () => {
|
||||
const workdir = mkdtempSync(join(tmpdir(), "agent-manager-untracked-terminal-"));
|
||||
const storage = new AgentStorage(join(workdir, "agents"), logger);
|
||||
let capturedSession: TestAgentSession | null = null;
|
||||
test.each(["Task completed.", "[System Error] untracked failure"])(
|
||||
"preserves terminal fallback and separates untracked failure activity after %s",
|
||||
async (assistantText) => {
|
||||
const workdir = mkdtempSync(join(tmpdir(), "agent-manager-untracked-terminal-"));
|
||||
const storage = new AgentStorage(join(workdir, "agents"), logger);
|
||||
let capturedSession: TestAgentSession | null = null;
|
||||
|
||||
class LiveEventClient extends TestAgentClient {
|
||||
override async createSession(config: AgentSessionConfig): Promise<AgentSession> {
|
||||
capturedSession = new TestAgentSession(config);
|
||||
return capturedSession;
|
||||
class LiveEventClient extends TestAgentClient {
|
||||
override async createSession(config: AgentSessionConfig): Promise<AgentSession> {
|
||||
capturedSession = new TestAgentSession(config);
|
||||
return capturedSession;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const manager = new AgentManager({
|
||||
clients: { codex: new LiveEventClient() },
|
||||
registry: storage,
|
||||
logger,
|
||||
idFactory: () => "00000000-0000-4000-8000-000000000136",
|
||||
});
|
||||
const snapshot = await manager.createAgent({ provider: "codex", cwd: workdir }, undefined, {
|
||||
workspaceId: undefined,
|
||||
});
|
||||
|
||||
capturedSession!.pushEvent({
|
||||
type: "turn_failed",
|
||||
provider: "codex",
|
||||
turnId: "untracked-turn",
|
||||
error: "untracked failure",
|
||||
});
|
||||
|
||||
await vi.waitFor(() => {
|
||||
const failed = manager.getAgent(snapshot.id);
|
||||
expect(failed?.lifecycle).toBe("error");
|
||||
expect(failed?.lastError).toBe("untracked failure");
|
||||
});
|
||||
expect(manager.getTimeline(snapshot.id)).toContainEqual(
|
||||
expect.objectContaining({
|
||||
const manager = new AgentManager({
|
||||
clients: { codex: new LiveEventClient() },
|
||||
registry: storage,
|
||||
logger,
|
||||
idFactory: () => "00000000-0000-4000-8000-000000000136",
|
||||
});
|
||||
const snapshot = await manager.createAgent({ provider: "codex", cwd: workdir }, undefined, {
|
||||
workspaceId: undefined,
|
||||
});
|
||||
const events: AgentManagerEvent[] = [];
|
||||
manager.subscribe((event) => events.push(event), { agentId: snapshot.id, replayState: false });
|
||||
await manager.appendTimelineItem(snapshot.id, {
|
||||
type: "assistant_message",
|
||||
text: expect.stringContaining("untracked failure"),
|
||||
}),
|
||||
);
|
||||
});
|
||||
text: assistantText,
|
||||
messageId: "assistant-1",
|
||||
});
|
||||
|
||||
capturedSession!.pushEvent({
|
||||
type: "turn_failed",
|
||||
provider: "codex",
|
||||
turnId: "untracked-turn",
|
||||
error: "untracked failure",
|
||||
});
|
||||
|
||||
await vi.waitFor(() => {
|
||||
const failed = manager.getAgent(snapshot.id);
|
||||
expect(failed?.lifecycle).toBe("error");
|
||||
expect(failed?.lastError).toBe("untracked failure");
|
||||
});
|
||||
expect(manager.getTimeline(snapshot.id)).toContainEqual(
|
||||
expect.objectContaining({
|
||||
type: "error",
|
||||
message: expect.stringContaining("untracked failure"),
|
||||
}),
|
||||
);
|
||||
const projected = projectTimelineRows({
|
||||
rows: await manager.getTimelineRows(snapshot.id),
|
||||
mode: "projected",
|
||||
});
|
||||
expect(projected.map((entry) => entry.item)).toEqual([
|
||||
{
|
||||
type: "assistant_message",
|
||||
text: assistantText,
|
||||
messageId: "assistant-1",
|
||||
},
|
||||
{ type: "error", message: "untracked failure" },
|
||||
]);
|
||||
expect(events).toContainEqual(
|
||||
expect.objectContaining({
|
||||
type: "agent_stream",
|
||||
event: expect.objectContaining({
|
||||
type: "timeline",
|
||||
item: { type: "error", message: "untracked failure" },
|
||||
}),
|
||||
}),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
test("cancelAgentRun waits for an acknowledged autonomous interrupt to settle", async () => {
|
||||
const workdir = mkdtempSync(join(tmpdir(), "agent-manager-live-cancel-"));
|
||||
@@ -9969,7 +9996,7 @@ test("streamAgent clears pending run when startTurn fails before a turn id exist
|
||||
clientMessageId: "rejected-prompt",
|
||||
messageId: "rejected-prompt",
|
||||
},
|
||||
{ type: "assistant_message", text: "[System Error] Invalid request: missing field `text`" },
|
||||
{ type: "error", message: "Invalid request: missing field `text`" },
|
||||
]);
|
||||
|
||||
await expect(manager.runAgent(agent.id, "second turn")).resolves.toEqual(
|
||||
@@ -11330,7 +11357,7 @@ test("archiveAgent cascade surfaces partial child archive failures", async () =>
|
||||
);
|
||||
});
|
||||
|
||||
test("turn_failed emits a system error assistant timeline message and keeps error lifecycle", async () => {
|
||||
test("turn_failed emits error activity and keeps error lifecycle", async () => {
|
||||
const workdir = mkdtempSync(join(tmpdir(), "agent-manager-turn-failed-"));
|
||||
const storagePath = join(workdir, "agents");
|
||||
const storage = new AgentStorage(storagePath, logger);
|
||||
@@ -11398,12 +11425,15 @@ test("turn_failed emits a system error assistant timeline message and keeps erro
|
||||
|
||||
const systemErrors = manager
|
||||
.getTimeline(agent.id)
|
||||
.filter(
|
||||
(item): item is Extract<AgentTimelineItem, { type: "assistant_message" }> =>
|
||||
item.type === "assistant_message" && item.text.includes("[System Error]"),
|
||||
);
|
||||
.filter((item): item is Extract<AgentTimelineItem, { type: "error" }> => item.type === "error");
|
||||
expect(systemErrors).toHaveLength(1);
|
||||
expect(systemErrors[0]?.text).toContain("invalid model id");
|
||||
expect(systemErrors[0]?.message).toContain("invalid model id");
|
||||
expect(await manager.getTimelineRows(agent.id)).toContainEqual(
|
||||
expect.objectContaining({
|
||||
turnId: "turn-failed-1",
|
||||
item: { type: "error", message: "invalid model id" },
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
test("turn_failed surfaces provider code and diagnostic in system error message", async () => {
|
||||
@@ -11470,17 +11500,16 @@ test("turn_failed surfaces provider code and diagnostic in system error message"
|
||||
|
||||
await expect(manager.runAgent(agent.id, "hello")).rejects.toThrow("Provider execution failed");
|
||||
|
||||
expect(manager.getAgent(agent.id)?.lastError).toBe("Provider execution failed");
|
||||
expect(manager.getAgent(agent.id)?.lastError).toBe(
|
||||
"Provider execution failed\n\ncode: 126\n\nNo preset version installed for command claude",
|
||||
);
|
||||
|
||||
const systemError = manager
|
||||
.getTimeline(agent.id)
|
||||
.find(
|
||||
(item): item is Extract<AgentTimelineItem, { type: "assistant_message" }> =>
|
||||
item.type === "assistant_message" && item.text.includes("[System Error]"),
|
||||
);
|
||||
expect(systemError?.text).toContain("Provider execution failed");
|
||||
expect(systemError?.text).toContain("code: 126");
|
||||
expect(systemError?.text).toContain("No preset version installed for command claude");
|
||||
.find((item): item is Extract<AgentTimelineItem, { type: "error" }> => item.type === "error");
|
||||
expect(systemError?.message).toContain("Provider execution failed");
|
||||
expect(systemError?.message).toContain("code: 126");
|
||||
expect(systemError?.message).toContain("No preset version installed for command claude");
|
||||
});
|
||||
|
||||
test("permission request notifies once without forcing unread attention state", async () => {
|
||||
|
||||
@@ -641,8 +641,6 @@ interface AgentMetadataPatch {
|
||||
metadata?: Record<string, JsonValue | null>;
|
||||
}
|
||||
|
||||
const SYSTEM_ERROR_PREFIX = "[System Error]";
|
||||
|
||||
function normalizePersistenceForConfig(
|
||||
handle: AgentPersistenceHandle | null,
|
||||
config: AgentSessionConfig,
|
||||
@@ -5587,13 +5585,10 @@ export class AgentManager {
|
||||
if (!isForegroundEvent && !agent.activeForegroundTurnId) {
|
||||
agent.lifecycle = "error";
|
||||
}
|
||||
agent.lastError = event.error;
|
||||
await this.appendSystemErrorTimelineMessage(
|
||||
agent,
|
||||
event.provider,
|
||||
this.formatTurnFailedMessage(event),
|
||||
options,
|
||||
);
|
||||
agent.lastError = this.formatTurnFailedMessage(event);
|
||||
if (!options?.fromHistory) {
|
||||
await this.recordTurnFailure(agent.id, event.provider, agent.lastError, eventTurnId);
|
||||
}
|
||||
this.resolvePendingPermissionsForAgent(agent, event.provider, options, "Turn failed");
|
||||
}
|
||||
|
||||
@@ -5823,42 +5818,17 @@ export class AgentManager {
|
||||
return existing;
|
||||
}
|
||||
|
||||
private async appendSystemErrorTimelineMessage(
|
||||
agent: ActiveManagedAgent,
|
||||
private async recordTurnFailure(
|
||||
agentId: string,
|
||||
provider: AgentProvider,
|
||||
message: string,
|
||||
options?: { fromHistory?: boolean },
|
||||
turnId: string | undefined,
|
||||
): Promise<void> {
|
||||
if (options?.fromHistory) {
|
||||
const lastItem = await this.getLastItemFromStores(agentId);
|
||||
if (lastItem?.type === "error" && lastItem.message === message) {
|
||||
return;
|
||||
}
|
||||
|
||||
const normalized = message.trim();
|
||||
if (!normalized) {
|
||||
return;
|
||||
}
|
||||
|
||||
const text = `${SYSTEM_ERROR_PREFIX} ${normalized}`;
|
||||
const lastItem = await this.getLastItemFromStores(agent.id);
|
||||
if (lastItem?.type === "assistant_message" && lastItem.text === text) {
|
||||
return;
|
||||
}
|
||||
|
||||
const item: AgentTimelineItem = { type: "assistant_message", text };
|
||||
const row = this.recordTimeline(agent.id, item);
|
||||
this.dispatchStream(
|
||||
agent.id,
|
||||
{
|
||||
type: "timeline",
|
||||
item,
|
||||
provider,
|
||||
},
|
||||
{
|
||||
seq: row.seq,
|
||||
epoch: this.timelineStore.getEpoch(agent.id),
|
||||
timestamp: row.timestamp,
|
||||
},
|
||||
);
|
||||
this.recordAndDispatchTimelineItem(agentId, { type: "error", message }, provider, turnId);
|
||||
}
|
||||
|
||||
private formatTurnFailedMessage(
|
||||
|
||||
@@ -298,9 +298,18 @@ test("error and missing-child notifications never claim successful completion",
|
||||
const state = await scenario();
|
||||
await state.service.register(intent);
|
||||
await until(() => state.observation.waits.length === 1);
|
||||
state.observation.waits[0]!.result.resolve(outcome("error"));
|
||||
const failed = outcome("error");
|
||||
failed.error = "Provider failed: " + "x".repeat(4100);
|
||||
state.observation.waits[0]!.result.resolve(failed);
|
||||
await until(() => state.delivery.prompts.length === 1);
|
||||
expect(state.delivery.prompts[0]).toContain("errored");
|
||||
expect(state.delivery.prompts[0]).toContain(
|
||||
`<agent-error>
|
||||
${failed.error.slice(0, 4000)}
|
||||
[truncated 117 chars; use get_agent_activity for the full response]
|
||||
</agent-error>`,
|
||||
);
|
||||
expect(state.delivery.prompts[0]).not.toContain("Partial work saved");
|
||||
await state.service.register({ ...intent, childAgentId: "missing-child" });
|
||||
await until(() => state.observation.waits.length === 2);
|
||||
state.observation.waits[1]!.result.resolve({
|
||||
|
||||
@@ -190,6 +190,7 @@ export function createFinishSubscriptions(deps: Dependencies): FinishSubscriptio
|
||||
title,
|
||||
reason,
|
||||
lastAssistantMessage: result.lastMessage,
|
||||
error: result.error,
|
||||
permissionRequest: request,
|
||||
}),
|
||||
source: {
|
||||
|
||||
@@ -29,6 +29,7 @@ interface FinishNotificationBodyInput {
|
||||
title: string;
|
||||
reason: FinishNotificationReason;
|
||||
lastAssistantMessage: string | null;
|
||||
error: string | null;
|
||||
permissionRequest?: AgentPermissionRequest;
|
||||
}
|
||||
|
||||
@@ -58,13 +59,15 @@ export function formatFinishNotificationBody(params: FinishNotificationBodyInput
|
||||
)}\n</permission-request>`,
|
||||
);
|
||||
}
|
||||
let lastAssistantMessage = params.lastAssistantMessage?.trim();
|
||||
if (lastAssistantMessage) {
|
||||
if (lastAssistantMessage.length > FINISH_NOTIFICATION_MESSAGE_LIMIT) {
|
||||
const omitted = lastAssistantMessage.length - FINISH_NOTIFICATION_MESSAGE_LIMIT;
|
||||
lastAssistantMessage = `${lastAssistantMessage.slice(0, FINISH_NOTIFICATION_MESSAGE_LIMIT)}\n[truncated ${omitted} chars; use get_agent_activity for the full response]`;
|
||||
const failed = params.reason === "errored";
|
||||
let outcome = (failed ? params.error : params.lastAssistantMessage)?.trim();
|
||||
if (outcome) {
|
||||
if (outcome.length > FINISH_NOTIFICATION_MESSAGE_LIMIT) {
|
||||
const omitted = outcome.length - FINISH_NOTIFICATION_MESSAGE_LIMIT;
|
||||
outcome = `${outcome.slice(0, FINISH_NOTIFICATION_MESSAGE_LIMIT)}\n[truncated ${omitted} chars; use get_agent_activity for the full response]`;
|
||||
}
|
||||
sections.push(`<agent-response>\n${lastAssistantMessage}\n</agent-response>`);
|
||||
const tag = failed ? "agent-error" : "agent-response";
|
||||
sections.push(`<${tag}>\n${outcome}\n</${tag}>`);
|
||||
}
|
||||
return sections.join("\n\n");
|
||||
}
|
||||
|
||||
@@ -1295,188 +1295,3 @@ test.each(["reject", "stall"] as const)(
|
||||
},
|
||||
30_000,
|
||||
);
|
||||
|
||||
test("shutdown finishes promptly when a persisted ACP plugin reopen is still streaming history replay", async () => {
|
||||
const root = await mkdtemp(path.join(os.tmpdir(), "paseo-shutdown-acp-replay-"));
|
||||
const pluginDirectory = path.join(root, "plugin");
|
||||
const agentScriptPath = path.join(root, "streaming-acp-agent.mjs");
|
||||
const replayStartedPath = path.join(root, "replay-started.pid");
|
||||
const workspace = path.join(root, "workspace");
|
||||
await mkdir(pluginDirectory, { recursive: true });
|
||||
await mkdir(workspace, { recursive: true });
|
||||
const pluginId = "streaming-replay-plugin";
|
||||
const providerId = "streaming-replay-acp";
|
||||
|
||||
await writeFile(
|
||||
agentScriptPath,
|
||||
`
|
||||
import { writeFileSync } from "node:fs";
|
||||
import { createInterface } from "node:readline";
|
||||
const send = (msg) => process.stdout.write(JSON.stringify({ jsonrpc: "2.0", ...msg }) + "\\n");
|
||||
let stream;
|
||||
createInterface({ input: process.stdin }).on("line", (line) => {
|
||||
if (!line.trim()) return;
|
||||
const msg = JSON.parse(line);
|
||||
if (msg.method === "initialize") {
|
||||
send({ id: msg.id, result: { protocolVersion: 1, agentCapabilities: { loadSession: true } } });
|
||||
} else if (msg.method === "session/new") {
|
||||
send({ id: msg.id, result: { sessionId: "new-session", configOptions: [] } });
|
||||
} else if (msg.method === "session/load") {
|
||||
const sid = msg.params.sessionId;
|
||||
send({ id: msg.id, result: { configOptions: [] } });
|
||||
writeFileSync(${JSON.stringify(replayStartedPath)}, String(process.pid));
|
||||
let count = 0;
|
||||
stream = setInterval(() => {
|
||||
count += 1;
|
||||
send({
|
||||
method: "session/update",
|
||||
params: {
|
||||
sessionId: sid,
|
||||
update: {
|
||||
sessionUpdate: "agent_message_chunk",
|
||||
messageId: "chunk-" + count,
|
||||
content: { type: "text", text: "replayed message " + count },
|
||||
},
|
||||
},
|
||||
});
|
||||
}, 20);
|
||||
} else if (msg.method === "session/close") {
|
||||
clearInterval(stream);
|
||||
send({ id: msg.id, result: {} });
|
||||
}
|
||||
});
|
||||
process.on("SIGTERM", () => {
|
||||
clearInterval(stream);
|
||||
process.exit(0);
|
||||
});
|
||||
`,
|
||||
);
|
||||
await writeFile(
|
||||
path.join(pluginDirectory, "paseo-plugin.json"),
|
||||
JSON.stringify({
|
||||
id: pluginId,
|
||||
requirements: { paseo: `>=${resolveDaemonVersion(import.meta.url)}` },
|
||||
}),
|
||||
);
|
||||
await writeFile(
|
||||
path.join(pluginDirectory, "index.server.ts"),
|
||||
`import { runAcpProvider } from "@getpaseo/plugin/server/acp";
|
||||
import type { ProviderRegistration } from "@getpaseo/plugin/server/provider";
|
||||
|
||||
const provider: ProviderRegistration = runAcpProvider({
|
||||
id: ${JSON.stringify(providerId)},
|
||||
label: "Streaming replay ACP",
|
||||
command: [${JSON.stringify(process.execPath)}, ${JSON.stringify(agentScriptPath)}],
|
||||
acpOptions: { loadReplayQuietPeriodMs: 100 },
|
||||
});
|
||||
|
||||
export default function contribute(server: { registerProvider(p: ProviderRegistration): void }) {
|
||||
server.registerProvider(provider);
|
||||
return () => undefined;
|
||||
}
|
||||
`,
|
||||
);
|
||||
|
||||
const paseoHomeRoot = path.join(root, "home");
|
||||
const paseoHome = path.join(paseoHomeRoot, ".paseo");
|
||||
const logger = pino({ level: "silent" });
|
||||
const storage = new AgentStorage(path.join(paseoHome, "agents"), logger);
|
||||
const agentId = randomUUID();
|
||||
const persistence = { version: 1, data: { sessionId: "persisted-acp-session" } };
|
||||
await storage.upsert({
|
||||
id: agentId,
|
||||
workspaceId: "workspace-1",
|
||||
provider: providerId,
|
||||
cwd: workspace,
|
||||
createdAt: "2025-01-01T00:00:00.000Z",
|
||||
updatedAt: "2025-01-02T00:00:00.000Z",
|
||||
lastActivityAt: "2025-01-02T00:00:00.000Z",
|
||||
lastStatus: "closed",
|
||||
title: "Streaming replay agent",
|
||||
labels: {},
|
||||
metadata: {},
|
||||
persistence: {
|
||||
provider: providerId,
|
||||
sessionId: `plugin:${JSON.stringify(persistence)}`,
|
||||
metadata: { pluginProviderPersistence: persistence },
|
||||
},
|
||||
config: {},
|
||||
requiresAttention: false,
|
||||
attentionReason: null,
|
||||
attentionTimestamp: null,
|
||||
archivedAt: null,
|
||||
});
|
||||
|
||||
const handle = await createTestPaseoDaemon({
|
||||
paseoHomeRoot,
|
||||
staticDir: path.join(root, "static"),
|
||||
pluginsEnabled: true,
|
||||
plugins: {
|
||||
[pluginId]: { source: "directory", path: pluginDirectory, enabled: true },
|
||||
},
|
||||
});
|
||||
const client = new DaemonClient({ url: `ws://127.0.0.1:${handle.port}/ws` });
|
||||
let stopped = false;
|
||||
let childPid: number | null = null;
|
||||
try {
|
||||
await client.connect();
|
||||
const timelineRequest = client
|
||||
.fetchAgentTimeline(agentId, { direction: "tail", limit: 20 })
|
||||
.catch(() => "rejected");
|
||||
|
||||
await expect
|
||||
.poll(
|
||||
async () => {
|
||||
try {
|
||||
const raw = (await readFile(replayStartedPath, "utf8")).trim();
|
||||
const pid = Number(raw);
|
||||
if (Number.isInteger(pid) && pid > 0) {
|
||||
childPid = pid;
|
||||
return pid;
|
||||
}
|
||||
return null;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
{ timeout: 10_000 },
|
||||
)
|
||||
.not.toBeNull();
|
||||
|
||||
const outcome = await Promise.race([
|
||||
handle.daemon.stop().then(() => {
|
||||
stopped = true;
|
||||
return "stopped";
|
||||
}),
|
||||
new Promise<string>((resolve) => setTimeout(() => resolve("timed_out"), 12_000)),
|
||||
]);
|
||||
expect(outcome).toBe("stopped");
|
||||
await expect(timelineRequest).resolves.toBe("rejected");
|
||||
// The ACP child process must be terminated when provider shutdown cancels replay.
|
||||
await expect
|
||||
.poll(
|
||||
() => {
|
||||
if (!childPid) return false;
|
||||
try {
|
||||
process.kill(childPid, 0);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
{ timeout: 3_000 },
|
||||
)
|
||||
.toBe(false);
|
||||
} finally {
|
||||
await client.close().catch(() => undefined);
|
||||
if (!stopped && childPid) {
|
||||
try {
|
||||
process.kill(childPid, "SIGKILL");
|
||||
} catch {
|
||||
// already exited
|
||||
}
|
||||
}
|
||||
if (!stopped) await handle.daemon.stop().catch(() => undefined);
|
||||
await rm(root, { recursive: true, force: true });
|
||||
}
|
||||
}, 30_000);
|
||||
|
||||
@@ -2061,28 +2061,10 @@ export async function createPaseoDaemon(
|
||||
timeoutMs: AGENT_CLOSE_TIMEOUT_MS,
|
||||
label: "drain plugin lifecycle events",
|
||||
}).catch((error) => logger.warn({ err: error }, "Plugin lifecycle events did not finish"));
|
||||
let shutdownFlushTimedOut = false;
|
||||
await withTimeout({
|
||||
promise: agentManager.flushForShutdown(),
|
||||
timeoutMs: AGENT_CLOSE_TIMEOUT_MS,
|
||||
label: "flush agent shutdown tasks",
|
||||
}).catch((error) => {
|
||||
shutdownFlushTimedOut = true;
|
||||
logger.warn({ err: error }, "Agent shutdown tasks did not finish before provider shutdown");
|
||||
});
|
||||
await agentManager.flushForShutdown().catch(() => undefined);
|
||||
detachAgentStoragePersistence();
|
||||
await agentStorage.flush().catch(() => undefined);
|
||||
await agentProviderRuntime.shutdown();
|
||||
if (shutdownFlushTimedOut) {
|
||||
await withTimeout({
|
||||
promise: agentManager.flushForShutdown(),
|
||||
timeoutMs: AGENT_CLOSE_TIMEOUT_MS,
|
||||
label: "flush agent shutdown tasks after provider shutdown",
|
||||
}).catch((error) =>
|
||||
logger.warn({ err: error }, "Agent shutdown tasks did not finish after provider shutdown"),
|
||||
);
|
||||
await agentStorage.flush().catch(() => undefined);
|
||||
}
|
||||
await pluginRuntime.stopAllPlugins();
|
||||
try {
|
||||
if (keepTerminals) {
|
||||
|
||||
@@ -374,7 +374,7 @@ test.each(["agent", "workspace"] as const)(
|
||||
clientMessageId: agent.clientMessageId,
|
||||
messageId: agent.clientMessageId,
|
||||
},
|
||||
{ type: "assistant_message", text: `[System Error] ${rejection}` },
|
||||
{ type: "error", message: rejection },
|
||||
];
|
||||
expect(
|
||||
(await client.fetchAgentTimeline(created.id)).entries.map((entry) => entry.item),
|
||||
|
||||
@@ -63,12 +63,7 @@ test("keeps two concurrent startup steer messages in one real Codex turn", async
|
||||
expect(
|
||||
events.filter((event) => event.type === "turn_canceled" || event.type === "turn_failed"),
|
||||
).toHaveLength(0);
|
||||
expect(
|
||||
timeline.entries.some(
|
||||
(entry) =>
|
||||
entry.item.type === "assistant_message" && entry.item.text.includes("[System Error]"),
|
||||
),
|
||||
).toBe(false);
|
||||
expect(timeline.entries.some(({ item }) => item.type === "error")).toBe(false);
|
||||
}
|
||||
} finally {
|
||||
await Promise.all(subscriptions.map((subscription) => subscription.release()));
|
||||
|
||||
@@ -33,20 +33,16 @@ function hasRunningBashToolCall(messages: SessionOutboundMessage[], agentId: str
|
||||
);
|
||||
}
|
||||
|
||||
function getAssistantTexts(messages: SessionOutboundMessage[], agentId: string): string[] {
|
||||
function getStreamErrors(messages: SessionOutboundMessage[], agentId: string): string[] {
|
||||
return messages
|
||||
.filter(
|
||||
(message) =>
|
||||
message.type === "agent_stream" &&
|
||||
message.payload.agentId === agentId &&
|
||||
message.payload.event.type === "timeline" &&
|
||||
message.payload.event.item.type === "assistant_message",
|
||||
message.payload.event.item.type === "error",
|
||||
)
|
||||
.map((message) => message.payload.event.item.text);
|
||||
}
|
||||
|
||||
function findSystemErrorText(texts: string[]): string | null {
|
||||
return texts.find((text) => text.includes("[System Error]")) ?? null;
|
||||
.map((message) => message.payload.event.item.message);
|
||||
}
|
||||
|
||||
function getTimelineAssistantTexts(
|
||||
@@ -121,7 +117,7 @@ async function waitForRunningBashToolCall(
|
||||
while (Date.now() < deadline) {
|
||||
await approvePendingPermissions(client, agentId, handledPermissionIds);
|
||||
|
||||
const streamSystemError = findSystemErrorText(getAssistantTexts(collector.messages, agentId));
|
||||
const streamSystemError = getStreamErrors(collector.messages, agentId)[0];
|
||||
if (streamSystemError) {
|
||||
throw new Error(`OpenCode failed before tool call started: ${streamSystemError}`);
|
||||
}
|
||||
@@ -131,11 +127,13 @@ async function waitForRunningBashToolCall(
|
||||
}
|
||||
|
||||
const timeline = await client.fetchAgentTimeline(agentId, { limit: 120 }).catch(() => null);
|
||||
const timelineSystemError = timeline
|
||||
? findSystemErrorText(getTimelineAssistantTexts(timeline).slice(-8))
|
||||
: null;
|
||||
if (timelineSystemError) {
|
||||
throw new Error(`OpenCode failed before tool call started: ${timelineSystemError}`);
|
||||
const timelineSystemError = timeline?.entries
|
||||
.slice(-8)
|
||||
.find(({ item }) => item.type === "error");
|
||||
if (timelineSystemError?.item.type === "error") {
|
||||
throw new Error(
|
||||
`OpenCode failed before tool call started: ${timelineSystemError.item.message}`,
|
||||
);
|
||||
}
|
||||
if (
|
||||
timeline?.entries.some(
|
||||
@@ -314,16 +312,12 @@ describe("daemon E2E (real opencode) - send while working and interrupt", () =>
|
||||
const finish = await waitForIdleResolvingPermissions(client, agent.id, 240_000);
|
||||
expect(finish.status).toBe("idle");
|
||||
|
||||
const postSendAssistantTexts = getAssistantTexts(collector.messages, agent.id);
|
||||
expect(postSendAssistantTexts.some((text) => text.includes("[System Error]"))).toBe(false);
|
||||
expect(postSendAssistantTexts.some((text) => text.includes(SYSTEM_ERROR_SNIPPET))).toBe(
|
||||
false,
|
||||
);
|
||||
expect(getStreamErrors(collector.messages, agent.id)).toEqual([]);
|
||||
|
||||
const timeline = await client.fetchAgentTimeline(agent.id, { limit: 160 });
|
||||
const assistantTexts = getTimelineAssistantTexts(timeline);
|
||||
expect(assistantTexts.some((text) => text.includes(followUpToken))).toBe(true);
|
||||
expect(assistantTexts.some((text) => text.includes("[System Error]"))).toBe(false);
|
||||
expect(timeline.entries.some(({ item }) => item.type === "error")).toBe(false);
|
||||
expect(assistantTexts.some((text) => text.includes(SYSTEM_ERROR_SNIPPET))).toBe(false);
|
||||
} finally {
|
||||
collector.unsubscribe();
|
||||
@@ -383,18 +377,12 @@ describe("daemon E2E (real opencode) - send while working and interrupt", () =>
|
||||
const finish = await waitForIdleResolvingPermissions(client, agent.id, 240_000);
|
||||
expect(finish.status).toBe("idle");
|
||||
|
||||
const postInterruptAssistantTexts = getAssistantTexts(collector.messages, agent.id);
|
||||
expect(postInterruptAssistantTexts.some((text) => text.includes("[System Error]"))).toBe(
|
||||
false,
|
||||
);
|
||||
expect(postInterruptAssistantTexts.some((text) => text.includes(SYSTEM_ERROR_SNIPPET))).toBe(
|
||||
false,
|
||||
);
|
||||
expect(getStreamErrors(collector.messages, agent.id)).toEqual([]);
|
||||
|
||||
const timeline = await client.fetchAgentTimeline(agent.id, { limit: 200 });
|
||||
const assistantTexts = getTimelineAssistantTexts(timeline);
|
||||
expect(assistantTexts.some((text) => text.includes(followUpToken))).toBe(true);
|
||||
expect(assistantTexts.some((text) => text.includes("[System Error]"))).toBe(false);
|
||||
expect(timeline.entries.some(({ item }) => item.type === "error")).toBe(false);
|
||||
expect(assistantTexts.some((text) => text.includes(SYSTEM_ERROR_SNIPPET))).toBe(false);
|
||||
} finally {
|
||||
collector.unsubscribe();
|
||||
|
||||
+10
-3
@@ -957,9 +957,16 @@ describe("daemon E2E (real claude) - send message during tool call", () => {
|
||||
});
|
||||
|
||||
// No system error messages should leak into the timeline
|
||||
const hasSystemError = assistantTexts.some((text) => text.includes("[System Error]"));
|
||||
expect(hasSystemError).toBe(false);
|
||||
expect(postSendAssistantTexts.some((text) => text.includes("[System Error]"))).toBe(false);
|
||||
expect(timeline.entries.some(({ item }) => item.type === "error")).toBe(false);
|
||||
expect(
|
||||
postSendMessages.some(
|
||||
(message) =>
|
||||
message.type === "agent_stream" &&
|
||||
message.payload.agentId === agent.id &&
|
||||
message.payload.event.type === "timeline" &&
|
||||
message.payload.event.item.type === "error",
|
||||
),
|
||||
).toBe(false);
|
||||
|
||||
const responded = assistantTexts.some((text) =>
|
||||
text.toUpperCase().includes("INTERRUPT_RECEIVED"),
|
||||
|
||||
@@ -450,7 +450,7 @@ describe("daemon E2E (real codex) - send message during tool call", () => {
|
||||
const item = entry.item as Extract<AgentTimelineItem, { type: "assistant_message" }>;
|
||||
return item.text;
|
||||
});
|
||||
expect(assistantTexts.some((text) => text.includes("[System Error]"))).toBe(false);
|
||||
expect(timeline.entries.some(({ item }) => item.type === "error")).toBe(false);
|
||||
expect(assistantTexts.some((text) => text.toUpperCase().includes("INTERRUPT_RECEIVED"))).toBe(
|
||||
true,
|
||||
);
|
||||
@@ -527,7 +527,7 @@ describe("daemon E2E (real codex) - send message during tool call", () => {
|
||||
const item = entry.item as Extract<AgentTimelineItem, { type: "assistant_message" }>;
|
||||
return item.text;
|
||||
});
|
||||
expect(assistantTexts.some((text) => text.includes("[System Error]"))).toBe(false);
|
||||
expect(timeline.entries.some(({ item }) => item.type === "error")).toBe(false);
|
||||
expect(
|
||||
assistantTexts.some((text) => text.toUpperCase().includes("QUICK_FOLLOW_UP_RECEIVED")),
|
||||
).toBe(true);
|
||||
|
||||
@@ -1937,6 +1937,57 @@ describe("ScheduleService", () => {
|
||||
expect(storedAgent?.archivedAt).toBeTruthy();
|
||||
});
|
||||
|
||||
test.each(["new-agent", "agent"] as const)(
|
||||
"scheduled %s failures preserve the provider reason",
|
||||
async (targetType) => {
|
||||
const manager = new AgentManager({
|
||||
logger: createTestLogger(),
|
||||
clients: createTestAgentClients({
|
||||
turnFailure: {
|
||||
error: "Requested fake provider failure",
|
||||
code: "126",
|
||||
diagnostic: "Provider executable failed",
|
||||
},
|
||||
}),
|
||||
registry: agentStorage,
|
||||
});
|
||||
const service = createScheduleService({
|
||||
paseoHome: tempDir,
|
||||
logger: createTestLogger(),
|
||||
agentManager: manager,
|
||||
agentStorage,
|
||||
providerSnapshotManager: NO_UNATTENDED_SCHEDULE_POLICY,
|
||||
now: () => now,
|
||||
});
|
||||
const agent = await manager.createAgent(
|
||||
{ provider: "claude", cwd: tempDir, modeId: "bypassPermissions" },
|
||||
undefined,
|
||||
{ workspaceId: undefined },
|
||||
);
|
||||
await manager.runAgent(agent.id, "Earlier successful request");
|
||||
const earlierReply = await manager.getLastAssistantMessage(agent.id);
|
||||
expect(earlierReply).toBeTruthy();
|
||||
const schedule = await service.create({
|
||||
prompt: "Emit a turn failure",
|
||||
cadence: { type: "every", everyMs: 60_000 },
|
||||
target:
|
||||
targetType === "agent"
|
||||
? { type: "agent", agentId: agent.id }
|
||||
: {
|
||||
type: "new-agent",
|
||||
config: { provider: "claude", cwd: tempDir, archiveOnFinish: false },
|
||||
},
|
||||
maxRuns: 1,
|
||||
});
|
||||
await service.runOnce(schedule.id);
|
||||
expect((await service.inspect(schedule.id)).runs[0]).toMatchObject({
|
||||
status: "failed",
|
||||
error: "Requested fake provider failure\n\ncode: 126\n\nProvider executable failed",
|
||||
});
|
||||
await manager.closeAgent(agent.id);
|
||||
},
|
||||
);
|
||||
|
||||
test("records prompt-start failures as failed and archives the scheduled agent", async () => {
|
||||
class StartFailureScheduleSession implements AgentSession {
|
||||
readonly provider = "claude";
|
||||
|
||||
@@ -986,6 +986,12 @@ export class ScheduleService {
|
||||
requireSchedule(updatedSchedule, params.scheduleId);
|
||||
}
|
||||
|
||||
private scheduledAgentFailure(agentId: string): Error {
|
||||
return new Error(
|
||||
this.agentManager.getAgent(agentId)?.lastError ?? `Scheduled agent ${agentId} failed`,
|
||||
);
|
||||
}
|
||||
|
||||
private async executeSchedule(
|
||||
schedule: StoredSchedule,
|
||||
runId: string,
|
||||
@@ -1019,7 +1025,7 @@ export class ScheduleService {
|
||||
throw new Error(`Scheduled agent ${agent.id} is waiting for permission`);
|
||||
}
|
||||
if (waitResult.status === "error") {
|
||||
throw new Error(waitResult.lastMessage ?? `Scheduled agent ${agent.id} failed`);
|
||||
throw this.scheduledAgentFailure(agent.id);
|
||||
}
|
||||
return {
|
||||
agentId: agent.id,
|
||||
@@ -1086,7 +1092,7 @@ export class ScheduleService {
|
||||
throw new Error(`Scheduled agent ${agent.id} is waiting for permission`);
|
||||
}
|
||||
if (waitResult.status === "error") {
|
||||
throw new Error(waitResult.lastMessage ?? `Scheduled agent ${agent.id} failed`);
|
||||
throw this.scheduledAgentFailure(agent.id);
|
||||
}
|
||||
const timelineText = curateAgentActivity(result.timeline);
|
||||
return {
|
||||
|
||||
@@ -74,6 +74,7 @@ interface Deferred<T> {
|
||||
}
|
||||
|
||||
interface FakeAgentSessionOptions {
|
||||
turnFailure?: TestAgentClientOptions["turnFailure"];
|
||||
providerName: string;
|
||||
config: AgentSessionConfig;
|
||||
supportsMcpServers?: boolean;
|
||||
@@ -89,6 +90,10 @@ interface FakeAgentSessionOptions {
|
||||
}
|
||||
|
||||
export interface TestAgentClientOptions {
|
||||
turnFailure?: Pick<
|
||||
Extract<AgentStreamEvent, { type: "turn_failed" }>,
|
||||
"error" | "code" | "diagnostic"
|
||||
>;
|
||||
beforeCreateSession?: (config: AgentSessionConfig) => Promise<void>;
|
||||
beforeResumeSession?: (handle: AgentPersistenceHandle) => Promise<void>;
|
||||
closeSession?: () => Promise<void>;
|
||||
@@ -375,6 +380,7 @@ class FakeAgentSession implements AgentSession {
|
||||
private readonly closeSession: (() => Promise<void>) | undefined;
|
||||
private readonly onStartTurn: TestAgentClientOptions["onStartTurn"];
|
||||
private readonly beforeTurnComplete: ((prompt: AgentPromptInput) => Promise<void>) | undefined;
|
||||
private readonly turnFailure: TestAgentClientOptions["turnFailure"];
|
||||
private readonly historyEvents: readonly AgentStreamEvent[] | undefined;
|
||||
|
||||
constructor(options: FakeAgentSessionOptions) {
|
||||
@@ -393,6 +399,7 @@ class FakeAgentSession implements AgentSession {
|
||||
this.onStartTurn = options.onStartTurn;
|
||||
this.beforeTurnComplete = options.beforeTurnComplete;
|
||||
this.historyEvents = options.historyEvents;
|
||||
this.turnFailure = options.turnFailure;
|
||||
this.historyPath = path.join(
|
||||
tmpdir(),
|
||||
"paseo-fake-provider-history",
|
||||
@@ -842,6 +849,7 @@ class FakeAgentSession implements AgentSession {
|
||||
type: "turn_failed",
|
||||
provider: this.providerName,
|
||||
error: "Requested fake provider failure",
|
||||
...this.turnFailure,
|
||||
};
|
||||
await this.appendHistoryEvent(failed);
|
||||
this.notifySubscribers(failed);
|
||||
@@ -1318,6 +1326,7 @@ class FakeAgentClient implements AgentClient {
|
||||
onInterrupt: this.options.onInterrupt,
|
||||
beforeSetMode: this.options.beforeSetMode,
|
||||
historyEvents: this.options.historyEvents,
|
||||
turnFailure: this.options.turnFailure,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1349,6 +1358,7 @@ class FakeAgentClient implements AgentClient {
|
||||
onInterrupt: this.options.onInterrupt,
|
||||
beforeSetMode: this.options.beforeSetMode,
|
||||
historyEvents: this.options.historyEvents,
|
||||
turnFailure: this.options.turnFailure,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/website",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/builtin-plugins",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.0-beta.1",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -623,9 +623,8 @@ translated change to `apply(change)`. Applying a change this way uses the shared
|
||||
mapping and skips the transformers for that change.
|
||||
|
||||
Set `acpOptions.loadReplayQuietPeriodMs` for an agent that streams history after its `session/load`
|
||||
response. Paseo publishes the session as ready once that interval passes without a history update.
|
||||
Non-history state and metadata updates (such as commands, configuration, mode, usage, and session
|
||||
info) do not extend the wait.
|
||||
response. Paseo waits for that interval without session updates before it publishes the session as
|
||||
ready. The wait is bounded at five times the interval.
|
||||
|
||||
Set `acpOptions.autoAcceptMode` to offer an unattended mode backed by a specific native mode.
|
||||
The adapter selects an unambiguous ACP `allow_once` action without opening a Paseo approval.
|
||||
|
||||
Reference in New Issue
Block a user