mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-18 14:25:25 +00:00
Compare commits
34
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ee30f4164 | ||
|
|
ac54c07639 | ||
|
|
46bd5d8a3e | ||
|
|
9895e0c957 | ||
|
|
2e9921e0e0 | ||
|
|
b1a2a50d50 | ||
|
|
9493a4f436 | ||
|
|
a87bd7fc0c | ||
|
|
527be52f2b | ||
|
|
fa6c50063e | ||
|
|
d364dbecb5 | ||
|
|
8edd1f407d | ||
|
|
f284e9abe5 | ||
|
|
c5bfe79c33 | ||
|
|
8d66a7c52e | ||
|
|
7a5b8e68e3 | ||
|
|
d577594173 | ||
|
|
293fbf825d | ||
|
|
c09a3d81e7 | ||
|
|
8c91adeba8 | ||
|
|
0a8b7a6a1e | ||
|
|
18192dc48b | ||
|
|
162745d8e6 | ||
|
|
937a610006 | ||
|
|
2269c8a010 | ||
|
|
e0847ac82f | ||
|
|
9ba2950132 | ||
|
|
fbb7a2c094 | ||
|
|
4437186c49 | ||
|
|
4bba288c10 | ||
|
|
c48d1c1700 | ||
|
|
db3cfadc6c | ||
|
|
c54bc39e79 | ||
|
|
228e6f75ea |
+122
-29
@@ -1,45 +1,138 @@
|
||||
# Changelog
|
||||
|
||||
## 0.16.0-beta.2 - 2026-11-11
|
||||
## 0.16.2 - 2026-11-18
|
||||
|
||||
- **Background tasks:** Paseo now shows the background tasks an agent is running, such as shells and monitors, above the composer, with a Stop button for each. Works with Claude Code, Codex and OpenCode v2. ([#6220](https://github.com/getpaseo/paseo/pull/6220), [#9162](https://github.com/getpaseo/paseo/pull/9162) by [@fxlelouarn](https://github.com/fxlelouarn))
|
||||
- **Plugin sidebar views:** A plugin can replace the sidebar's content with its own layout of workspaces, agents, projects and terminals across every connected host. Pick the view per device under Settings → Sidebar; Paseo's sidebar header and footer stay in place. ([#8906](https://github.com/getpaseo/paseo/pull/8906))
|
||||
- **Plugin composer controls:** Plugins can add their own controls to the composer, and read and set its prompt, attachments, provider, model, mode and thinking. They can also put the cursor in any agent's composer, add items to New workspace, and store their own metadata on agents and workspaces. ([#8744](https://github.com/getpaseo/paseo/pull/8744), [#9209](https://github.com/getpaseo/paseo/pull/9209), [#9207](https://github.com/getpaseo/paseo/pull/9207))
|
||||
- **Faster diff loading:** Opening Changes shows the file tree right away while file contents load. Large diffs arrive in batches, so the rest of the app keeps responding while they load, and diffs take priority over the daemon's background worktree scans. ([#8907](https://github.com/getpaseo/paseo/pull/8907), [#9241](https://github.com/getpaseo/paseo/pull/9241), [#9243](https://github.com/getpaseo/paseo/pull/9243))
|
||||
- **Polish:** The chat stays still when a turn ends, and returning to a chat that has not changed shows it as it is with no refresh. Tool rows show their final title and icon from the first frame, the context window popover opens with usage already loaded, and sidebar hover cards open one at a time. ([#8944](https://github.com/getpaseo/paseo/pull/8944), [#9175](https://github.com/getpaseo/paseo/pull/9175), [#9242](https://github.com/getpaseo/paseo/pull/9242), [#9248](https://github.com/getpaseo/paseo/pull/9248), [#9212](https://github.com/getpaseo/paseo/pull/9212), [#9071](https://github.com/getpaseo/paseo/pull/9071))
|
||||
- **Rebuilt mobile chat timeline:** The chat timeline on iOS and Android was rebuilt. Expanding or collapsing a turn summary, todo card or tool-call group keeps the line you tapped in place, and on Android so do Show more, Show less and plan cards. ([#8717](https://github.com/getpaseo/paseo/pull/8717), [#9085](https://github.com/getpaseo/paseo/pull/9085))
|
||||
- **Keyboard shortcuts on mobile:** With a keyboard connected, iPad and Android now run the same shortcuts as desktop, including your custom bindings. Shortcut hints and Settings → Shortcuts appear when a keyboard is detected. Shortcuts also work in narrow desktop and browser windows. ([#8625](https://github.com/getpaseo/paseo/pull/8625) by [@jeroenfrenken](https://github.com/jeroenfrenken), [@lstroud](https://github.com/lstroud))
|
||||
- **Touch-sized tablet controls:** On iPad and other touch-screen devices, the wide layout now has touch-sized buttons, rows and bars. The composer toolbar folds its controls into the model menu when space runs out, and swiping right on the workspace reveals a collapsed sidebar as an overlay. ([#8748](https://github.com/getpaseo/paseo/pull/8748), [#8885](https://github.com/getpaseo/paseo/pull/8885), [#8891](https://github.com/getpaseo/paseo/pull/8891), [#8909](https://github.com/getpaseo/paseo/pull/8909), [#9151](https://github.com/getpaseo/paseo/pull/9151), [#9238](https://github.com/getpaseo/paseo/pull/9238), [#8739](https://github.com/getpaseo/paseo/pull/8739) by [@zeyugao](https://github.com/zeyugao))
|
||||
- **Undo workspace archive:** Archiving a workspace in the app now shows a "Workspace archived" toast for six seconds. Undo, or Cmd/Ctrl+Z, restores the workspace with its tabs and agents. On desktop, sidebar workspace rows also get an archive button on hover. ([#8904](https://github.com/getpaseo/paseo/pull/8904), [#9104](https://github.com/getpaseo/paseo/pull/9104))
|
||||
- **Fewer reconnects on return:** Returning to the app keeps a working connection, including one in the middle of a large response, and reconnects once when it has to. On a host with several saved connections, Paseo stays on the one that works. ([#8651](https://github.com/getpaseo/paseo/pull/8651), [#9086](https://github.com/getpaseo/paseo/pull/9086), [#8855](https://github.com/getpaseo/paseo/pull/8855), [#9116](https://github.com/getpaseo/paseo/pull/9116))
|
||||
### Fixed
|
||||
|
||||
- Fixed Collapse turns hiding a finished reply when Claude answers a later background task notification ([#10092](https://github.com/getpaseo/paseo/pull/10092))
|
||||
- Fixed detached worktree commits getting lost when archiving a workspace ([#10009](https://github.com/getpaseo/paseo/pull/10009) by [@ragokan](https://github.com/ragokan))
|
||||
- Fixed Desktop updates leaving an older daemon running when an earlier Desktop session started it ([#10067](https://github.com/getpaseo/paseo/pull/10067))
|
||||
- Fixed daemons losing their Hub connection after execution permissions changed ([#10113](https://github.com/getpaseo/paseo/pull/10113))
|
||||
- Fixed saved hosts disappearing when one stored entry could not be read ([#9847](https://github.com/getpaseo/paseo/pull/9847) by [@ragokan](https://github.com/ragokan))
|
||||
- Fixed worktree creation timing out while scanning large ignored folders that `.worktreeinclude` does not name ([#10020](https://github.com/getpaseo/paseo/pull/10020) by [@mgranderath](https://github.com/mgranderath))
|
||||
- Fixed Steer cancelling a Claude compaction in progress ([#10028](https://github.com/getpaseo/paseo/pull/10028) by [@NightMachinery](https://github.com/NightMachinery))
|
||||
- Fixed agents getting stuck after a second Stop when the provider reused the cancelled turn ID ([#9774](https://github.com/getpaseo/paseo/pull/9774) by [@DAnaeto](https://github.com/DAnaeto))
|
||||
- Fixed Desktop staying blank after its renderer exited unexpectedly ([#10035](https://github.com/getpaseo/paseo/pull/10035))
|
||||
- Fixed failed file downloads taking over the app window on web and Desktop ([#9937](https://github.com/getpaseo/paseo/pull/9937) by [@panta82](https://github.com/panta82))
|
||||
- Fixed Import Session losing its scroll position when you select Load more ([#9974](https://github.com/getpaseo/paseo/pull/9974))
|
||||
- Fixed terminals failing to open when the home filesystem refuses Unix sockets, such as on AFS ([#9214](https://github.com/getpaseo/paseo/pull/9214) by [@bendavid](https://github.com/bendavid))
|
||||
- Fixed timed-out Git watchers repeatedly rescanning large repositories ([#9828](https://github.com/getpaseo/paseo/pull/9828) by [@Spshulem](https://github.com/Spshulem))
|
||||
- Fixed `paseo workspace create --path .` using the local daemon's directory instead of the caller's ([#10010](https://github.com/getpaseo/paseo/pull/10010))
|
||||
- Fixed MCP agent status and list responses omitting background work for idle agents ([#10022](https://github.com/getpaseo/paseo/pull/10022) by [@ortschun](https://github.com/ortschun))
|
||||
- Fixed the thinking selector showing an old level after OMP changes it ([#9841](https://github.com/getpaseo/paseo/pull/9841) by [@dsingal0](https://github.com/dsingal0))
|
||||
|
||||
## 0.16.1 - 2026-11-17
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed Claude Bypass approving actions without a permission card when a `permissions.ask` rule or a hook that returns `ask` required one ([#9927](https://github.com/getpaseo/paseo/pull/9927))
|
||||
- Fixed controls being touch-sized on a touch-screen laptop when a trackpad or mouse is its primary input ([#9909](https://github.com/getpaseo/paseo/pull/9909) by [@michaelhthomas](https://github.com/michaelhthomas))
|
||||
- Fixed Claude sessions failing until `/login` when Paseo refreshed the Claude model list while Claude Code was renewing an expired access token ([#9855](https://github.com/getpaseo/paseo/pull/9855) by [@daysun-k](https://github.com/daysun-k))
|
||||
- Fixed Add host text fields on web drawing without a box, which left the host password field invisible ([#9865](https://github.com/getpaseo/paseo/pull/9865) by [@angusb93](https://github.com/angusb93))
|
||||
- Fixed an OpenCode question that could not be answered or dismissed after a new message steered the turn ([#9891](https://github.com/getpaseo/paseo/pull/9891))
|
||||
- Fixed Pi and OMP model names that contain `/` being cut to the text after the last slash ([#9823](https://github.com/getpaseo/paseo/pull/9823), [#9836](https://github.com/getpaseo/paseo/pull/9836) by [@rms523](https://github.com/rms523))
|
||||
- Fixed Changes leaving out an edit when the file was saved with the same size in the same second it was staged ([#9854](https://github.com/getpaseo/paseo/pull/9854))
|
||||
- Fixed an error toast that never closed when marking a chat as read failed ([#9837](https://github.com/getpaseo/paseo/pull/9837))
|
||||
- Fixed wait results and finish notifications after a daemon restart joining an agent's self-started reply to the reply before it ([#9846](https://github.com/getpaseo/paseo/pull/9846))
|
||||
- Fixed Codex chats staying loaded in the daemon until restart when a client opened them only to read their history ([#9859](https://github.com/getpaseo/paseo/pull/9859) by [@Spshulem](https://github.com/Spshulem))
|
||||
|
||||
## 0.16.0 - 2026-11-16
|
||||
|
||||
- **Background tasks:** See and stop background tasks above the composer for Claude Code, Codex and OpenCode v2. ([#6220](https://github.com/getpaseo/paseo/pull/6220), [#9162](https://github.com/getpaseo/paseo/pull/9162), [#9635](https://github.com/getpaseo/paseo/pull/9635) by [@fxlelouarn](https://github.com/fxlelouarn))
|
||||
- **Built-in plugin gallery:** Browse, search and install plugins without leaving Paseo. Manage their settings and updates from the same page. ([#9752](https://github.com/getpaseo/paseo/pull/9752))
|
||||
- **Command center tabs:** Switch between Workspaces, Files and Actions, with recent workspaces shown first. Search now includes archived workspaces and matches agent titles within their workspace. ([#9689](https://github.com/getpaseo/paseo/pull/9689))
|
||||
- **Plugin sidebar views:** Plugins can replace the sidebar with their own workspace and agent layout across connected hosts. Choose a view per device in Settings → Sidebar. ([#8906](https://github.com/getpaseo/paseo/pull/8906))
|
||||
- **Plugin composer controls:** Plugins can add composer controls, edit drafts and attachments, and change agent settings. They can also add New workspace items and save metadata on agents and workspaces. ([#8744](https://github.com/getpaseo/paseo/pull/8744), [#9209](https://github.com/getpaseo/paseo/pull/9209), [#9207](https://github.com/getpaseo/paseo/pull/9207), [#9734](https://github.com/getpaseo/paseo/pull/9734) by [@michaelmwu](https://github.com/michaelmwu))
|
||||
- **Arrange Usage cards:** Drag provider cards into your preferred order and turn off cards you do not want in the sidebar summary. Choose the host from Usage settings. ([#9660](https://github.com/getpaseo/paseo/pull/9660), [#9740](https://github.com/getpaseo/paseo/pull/9740), [#9748](https://github.com/getpaseo/paseo/pull/9748), [#9780](https://github.com/getpaseo/paseo/pull/9780))
|
||||
- **Quieter app reopening:** Returning to an unchanged chat no longer flashes “Updating messages.” Paseo keeps healthy connections open and recovers dropped connections when you return. After reconnecting, an up-to-date chat no longer shows an extra update toast. ([#9242](https://github.com/getpaseo/paseo/pull/9242), [#8651](https://github.com/getpaseo/paseo/pull/8651), [#9086](https://github.com/getpaseo/paseo/pull/9086), [#8855](https://github.com/getpaseo/paseo/pull/8855), [#9116](https://github.com/getpaseo/paseo/pull/9116), [#9558](https://github.com/getpaseo/paseo/pull/9558) by [@adamcstephens](https://github.com/adamcstephens))
|
||||
- **Rebuilt mobile chat:** Expanding turn summaries, todo cards and tool groups keeps your reading position on iOS and Android. Sending during a scroll moves to the new prompt. ([#8717](https://github.com/getpaseo/paseo/pull/8717), [#9085](https://github.com/getpaseo/paseo/pull/9085), [#9806](https://github.com/getpaseo/paseo/pull/9806), [#9693](https://github.com/getpaseo/paseo/pull/9693))
|
||||
- **Faster diff loading:** Changes shows the file tree before file contents finish loading. Large diffs load in batches and take priority over background worktree scans. ([#8907](https://github.com/getpaseo/paseo/pull/8907), [#9241](https://github.com/getpaseo/paseo/pull/9241), [#9243](https://github.com/getpaseo/paseo/pull/9243), [#9584](https://github.com/getpaseo/paseo/pull/9584))
|
||||
- **Faster composer menus:** Command and file suggestions open sooner in large lists and stay against the composer as it changes size. ([#9657](https://github.com/getpaseo/paseo/pull/9657), [#9647](https://github.com/getpaseo/paseo/pull/9647), [#9642](https://github.com/getpaseo/paseo/pull/9642))
|
||||
- **Keyboard shortcuts on mobile:** A connected keyboard gives iPad and Android the same shortcuts as desktop, including custom bindings. Shift+Tab in the iPad composer switches mode without typing a tab. ([#8625](https://github.com/getpaseo/paseo/pull/8625), [#9561](https://github.com/getpaseo/paseo/pull/9561) by [@jeroenfrenken](https://github.com/jeroenfrenken), [@lstroud](https://github.com/lstroud))
|
||||
- **Touch-sized tablet controls:** Wide layouts on touch devices have larger buttons and rows. The composer folds controls into the model menu when space runs out. ([#8748](https://github.com/getpaseo/paseo/pull/8748), [#8885](https://github.com/getpaseo/paseo/pull/8885), [#8891](https://github.com/getpaseo/paseo/pull/8891), [#8909](https://github.com/getpaseo/paseo/pull/8909), [#9151](https://github.com/getpaseo/paseo/pull/9151), [#9238](https://github.com/getpaseo/paseo/pull/9238), [#8739](https://github.com/getpaseo/paseo/pull/8739) by [@zeyugao](https://github.com/zeyugao))
|
||||
- **Undo workspace archive:** Restore an archived workspace with Undo or Cmd/Ctrl+Z during the six-second toast. Paseo checks for unsaved files and unpushed commits before removing a worktree. ([#8904](https://github.com/getpaseo/paseo/pull/8904), [#9104](https://github.com/getpaseo/paseo/pull/9104), [#9625](https://github.com/getpaseo/paseo/pull/9625), [#9753](https://github.com/getpaseo/paseo/pull/9753) by [@ragokan](https://github.com/ragokan))
|
||||
|
||||
### Added
|
||||
|
||||
- Added a Change base picker in Changes for worktree workspaces, so diffs, the commit list and Git actions can use another branch ([#8642](https://github.com/getpaseo/paseo/pull/8642), [#8934](https://github.com/getpaseo/paseo/pull/8934) by [@Myasuka](https://github.com/Myasuka))
|
||||
- Added links for issue and pull request references such as `#123` and `owner/repo#123` in agent replies, plans, the pull request panel and file previews, for GitHub, GitLab, Gitea, Forgejo and Codeberg ([#8636](https://github.com/getpaseo/paseo/pull/8636))
|
||||
- Added iPhone Duo layout support: workspace actions sit in the system vertical bar, and the sidebar and workspace split on either side of the fold ([#8741](https://github.com/getpaseo/paseo/pull/8741), [#8901](https://github.com/getpaseo/paseo/pull/8901) by [@zeyugao](https://github.com/zeyugao))
|
||||
- Added a Change base picker for worktree diffs, commits and Git actions ([#8642](https://github.com/getpaseo/paseo/pull/8642), [#8934](https://github.com/getpaseo/paseo/pull/8934) by [@Myasuka](https://github.com/Myasuka))
|
||||
- Added issue and pull request links that resolve SSH aliases and fork parent repositories ([#8636](https://github.com/getpaseo/paseo/pull/8636), [#9576](https://github.com/getpaseo/paseo/pull/9576))
|
||||
- Added an iPhone Duo layout with the sidebar and workspace on opposite sides of the fold ([#8741](https://github.com/getpaseo/paseo/pull/8741), [#8901](https://github.com/getpaseo/paseo/pull/8901) by [@zeyugao](https://github.com/zeyugao))
|
||||
- Added fx as a provider you can add from the provider catalog in Settings → Hosts → Providers ([#9160](https://github.com/getpaseo/paseo/pull/9160))
|
||||
- Added background agents: an agent or plugin can create a helper with `background: true` that opens no tab, sends no notification and stays out of the sidebar and default agent lists ([#8683](https://github.com/getpaseo/paseo/pull/8683))
|
||||
- Added background agents that stay out of tabs, notifications and default agent lists ([#8683](https://github.com/getpaseo/paseo/pull/8683))
|
||||
- Added syntax highlighting for Terraform and HCL files (`.tf`, `.tfvars`, `.hcl`) ([#9106](https://github.com/getpaseo/paseo/pull/9106))
|
||||
- Added `PASEO_WORKSPACE_ID` to each agent's environment so an agent can identify, rename or archive its own workspace ([#8939](https://github.com/getpaseo/paseo/pull/8939) by [@DTTerastar](https://github.com/DTTerastar))
|
||||
- Added plugin badges to sidebar workspace rows ([#7645](https://github.com/getpaseo/paseo/pull/7645) by [@jtomaszewski](https://github.com/jtomaszewski))
|
||||
- Added a Download button for files without a preview ([#9640](https://github.com/getpaseo/paseo/pull/9640))
|
||||
- Added Copilot premium-request usage and remaining quota to Usage ([#8489](https://github.com/getpaseo/paseo/pull/8489) by [@thisisryanswift](https://github.com/thisisryanswift))
|
||||
|
||||
### Changed
|
||||
|
||||
- Changed opening a workspace to restore the tab you left instead of jumping to the agent that needs attention ([#8935](https://github.com/getpaseo/paseo/pull/8935))
|
||||
- Changed question cards so picking an option no longer advances automatically; continue with Next or Submit ([#8525](https://github.com/getpaseo/paseo/pull/8525))
|
||||
- Changed the slash command menu to show loading and error states with Retry, and to stop selecting `/exit` by default ([#8905](https://github.com/getpaseo/paseo/pull/8905))
|
||||
- Changed the workspace header and tabs to switch to compact controls when Explorer or a split pane narrows the workspace ([#8740](https://github.com/getpaseo/paseo/pull/8740), [#9088](https://github.com/getpaseo/paseo/pull/9088) by [@zeyugao](https://github.com/zeyugao))
|
||||
- Changed question cards to wait for Next or Submit after you select an option ([#8525](https://github.com/getpaseo/paseo/pull/8525))
|
||||
- Changed the slash command menu to stop selecting `/exit` by default ([#8905](https://github.com/getpaseo/paseo/pull/8905))
|
||||
- Changed workspace header controls to fit narrow split panes ([#8740](https://github.com/getpaseo/paseo/pull/8740), [#9088](https://github.com/getpaseo/paseo/pull/9088) by [@zeyugao](https://github.com/zeyugao))
|
||||
- Changed sending a message to a Pi agent whose process has exited to fail immediately with an instruction to reload the agent ([#8718](https://github.com/getpaseo/paseo/pull/8718))
|
||||
- Changed Rename workspace in the sidebar on desktop and wide web layouts to edit the title in place instead of opening a dialog ([#9280](https://github.com/getpaseo/paseo/pull/9280))
|
||||
- Changed What's new and the website changelog to show a release's highlights first, with the full list behind Show all changes ([#9281](https://github.com/getpaseo/paseo/pull/9281))
|
||||
- Changed What's new to show highlights first, with the full list behind Show all changes ([#9281](https://github.com/getpaseo/paseo/pull/9281))
|
||||
- Changed Claude Bypass to approve execution requests from ask rules and hooks while keeping questions and plan review interactive ([#9760](https://github.com/getpaseo/paseo/pull/9760))
|
||||
- Changed Claude permission cards to show the reason supplied by the provider ([#3950](https://github.com/getpaseo/paseo/pull/3950) by [@codebutler](https://github.com/codebutler))
|
||||
- Changed the pull request pane so Activity can be resized or collapsed to give checks more space ([#9656](https://github.com/getpaseo/paseo/pull/9656))
|
||||
- Changed macOS desktop tab shortcuts to Cmd+Shift+[ and Cmd+Shift+] ([#7692](https://github.com/getpaseo/paseo/pull/7692) by [@jtomaszewski](https://github.com/jtomaszewski))
|
||||
- Changed Cmd/Ctrl+N on New workspace to open the project chooser without leaving the draft ([#9741](https://github.com/getpaseo/paseo/pull/9741))
|
||||
- Changed mobile Settings navigation to restore the sidebar where you left it ([#9641](https://github.com/getpaseo/paseo/pull/9641))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed long tool details hiding their collapse header or preventing scrolling through their output ([#9770](https://github.com/getpaseo/paseo/pull/9770))
|
||||
- Fixed image previews briefly showing an error or a stretched image while loading ([#9698](https://github.com/getpaseo/paseo/pull/9698))
|
||||
- Fixed web and desktop chats jumping to the beginning when older history became virtualized ([#9664](https://github.com/getpaseo/paseo/pull/9664) by [@luoph](https://github.com/luoph))
|
||||
- Fixed older chat history requiring another mouse-wheel movement after reaching the top ([#9570](https://github.com/getpaseo/paseo/pull/9570))
|
||||
- Fixed losing code indentation and line breaks when copying a selection across part of a code block ([#9515](https://github.com/getpaseo/paseo/pull/9515) by [@michaelmwu](https://github.com/michaelmwu))
|
||||
- Fixed overlapping axis titles and clipped labels in Mermaid XY charts ([#9483](https://github.com/getpaseo/paseo/pull/9483) by [@FluidXin](https://github.com/FluidXin))
|
||||
- Fixed the iOS command menu staying open after tapping a command ([#9755](https://github.com/getpaseo/paseo/pull/9755))
|
||||
- Fixed retrying an edited agent draft after a failed start ([#9534](https://github.com/getpaseo/paseo/pull/9534) by [@michaelmwu](https://github.com/michaelmwu))
|
||||
- Fixed model profile buttons ignoring taps on Android tablets ([#9526](https://github.com/getpaseo/paseo/pull/9526) by [@moevis](https://github.com/moevis))
|
||||
- Fixed Settings losing scroll position and edits after appearance changes ([#9605](https://github.com/getpaseo/paseo/pull/9605))
|
||||
- Fixed unreadable selected rows in light plugin themes and barely visible highlights in Pure Black ([#9579](https://github.com/getpaseo/paseo/pull/9579) by [@nathansgreen](https://github.com/nathansgreen))
|
||||
- Fixed missing keyboard focus rings on header and toolbar icon buttons on web and desktop ([#9745](https://github.com/getpaseo/paseo/pull/9745) by [@junjzhang](https://github.com/junjzhang))
|
||||
- Fixed sidebar rows flashing in the wrong position after a drag on iOS and Android ([#9681](https://github.com/getpaseo/paseo/pull/9681))
|
||||
- Fixed desktop startup reporting failure while its daemon was still starting ([#9043](https://github.com/getpaseo/paseo/pull/9043) by [@magiclaw](https://github.com/magiclaw))
|
||||
- Fixed typed characters being lost while web and desktop terminals restored their screen ([#9533](https://github.com/getpaseo/paseo/pull/9533))
|
||||
- Fixed physical arrow keys failing in Android terminals and dropping the next typed character ([#9407](https://github.com/getpaseo/paseo/pull/9407) by [@moevis](https://github.com/moevis))
|
||||
- Fixed non-Git workspaces missing Archive workspace in the command center ([#9777](https://github.com/getpaseo/paseo/pull/9777) by [@andheiberg](https://github.com/andheiberg))
|
||||
- Fixed workspace scripts disappearing when a later configuration read timed out ([#9477](https://github.com/getpaseo/paseo/pull/9477) by [@dinhphieu](https://github.com/dinhphieu))
|
||||
- Fixed sidebar Usage hiding an account after its usage refresh failed ([#9594](https://github.com/getpaseo/paseo/pull/9594))
|
||||
- Fixed closed agents staying unread when their provider session no longer existed ([#9737](https://github.com/getpaseo/paseo/pull/9737) by [@luoph](https://github.com/luoph))
|
||||
- Fixed completion notifications showing an older reply after an autonomous agent turn ([#9793](https://github.com/getpaseo/paseo/pull/9793))
|
||||
- Fixed interrupting messages failing with "already has an active run" ([#9537](https://github.com/getpaseo/paseo/pull/9537) by [@michaelmwu](https://github.com/michaelmwu))
|
||||
- Fixed message retries being refused after a failure before delivery to the provider ([#9580](https://github.com/getpaseo/paseo/pull/9580) by [@tmad4000](https://github.com/tmad4000))
|
||||
- Fixed newly reopened agents losing their provider process on the next idle-cleanup sweep ([#8857](https://github.com/getpaseo/paseo/pull/8857) by [@fdkevin0](https://github.com/fdkevin0))
|
||||
- Fixed Claude session crons and /loop wakeups being lost to idle runtime cleanup ([#9744](https://github.com/getpaseo/paseo/pull/9744) by [@KronixDev](https://github.com/KronixDev))
|
||||
- Fixed forking from a reply when a tool started before it and finished afterward ([#9627](https://github.com/getpaseo/paseo/pull/9627) by [@ragokan](https://github.com/ragokan))
|
||||
- Fixed large Codex history pages stopping history loading when their individual items still fit ([#9432](https://github.com/getpaseo/paseo/pull/9432) by [@RockStone](https://github.com/RockStone))
|
||||
- Fixed OpenCode sessions failing to reconnect after a daemon restart when OpenCode used Bun ([#9653](https://github.com/getpaseo/paseo/pull/9653) by [@quickwind](https://github.com/quickwind))
|
||||
- Fixed provider refresh retaining OpenCode v1 after an upgrade to v2 ([#9593](https://github.com/getpaseo/paseo/pull/9593) by [@tkfka1](https://github.com/tkfka1))
|
||||
- Fixed OpenCode v2 failing to discover plugin tools available only to its session ([#9426](https://github.com/getpaseo/paseo/pull/9426) by [@dptsolutions](https://github.com/dptsolutions))
|
||||
- Fixed ACP models sharing the wrong thinking levels when the provider supplied levels per model ([#9717](https://github.com/getpaseo/paseo/pull/9717) by [@AlfredRR](https://github.com/AlfredRR), [@doskoi](https://github.com/doskoi))
|
||||
- Fixed failed ACP tools without output preventing conversation history from loading ([#9467](https://github.com/getpaseo/paseo/pull/9467) by [@Myasuka](https://github.com/Myasuka))
|
||||
- Fixed Pi and OMP tool calls with null optional arguments appearing as unknown tools ([#9506](https://github.com/getpaseo/paseo/pull/9506) by [@papag00se](https://github.com/papag00se))
|
||||
- Fixed imported OMP sessions saving a file path instead of their session ID ([#8854](https://github.com/getpaseo/paseo/pull/8854) by [@LiebeLee](https://github.com/LiebeLee))
|
||||
- Fixed cross-host child agents losing their caller's mode when both used the same provider ([#9512](https://github.com/getpaseo/paseo/pull/9512) by [@ortschun](https://github.com/ortschun))
|
||||
- Fixed plugin child agents changing from failed or canceled to completed when their session closed ([#8563](https://github.com/getpaseo/paseo/pull/8563) by [@hadan8977](https://github.com/hadan8977))
|
||||
- Fixed CLI commands acting on a different agent whose title matched a missing full agent ID ([#9680](https://github.com/getpaseo/paseo/pull/9680), [#9731](https://github.com/getpaseo/paseo/pull/9731) by [@ese111](https://github.com/ese111))
|
||||
- Fixed archive, detach and reload failing for agents omitted from the CLI listing ([#9726](https://github.com/getpaseo/paseo/pull/9726) by [@xunWhale](https://github.com/xunWhale))
|
||||
- Fixed `paseo agent wait` exiting successfully when no agent matched the ID ([#9782](https://github.com/getpaseo/paseo/pull/9782) by [@Eapp1e](https://github.com/Eapp1e))
|
||||
- Fixed voice mode failing to start when speech input and output both used OpenAI ([#9779](https://github.com/getpaseo/paseo/pull/9779) by [@Huyvux12](https://github.com/Huyvux12))
|
||||
- Fixed dictation hiding a stream error behind a 30-second delivery timeout ([#9784](https://github.com/getpaseo/paseo/pull/9784) by [@tieo](https://github.com/tieo))
|
||||
- Fixed plugin providers rejecting Review attachments in All mode ([#9590](https://github.com/getpaseo/paseo/pull/9590) by [@ese111](https://github.com/ese111))
|
||||
- Fixed plugin timeline writes accepting kinds that the app could not show ([#7677](https://github.com/getpaseo/paseo/pull/7677) by [@ragokan](https://github.com/ragokan))
|
||||
- Fixed the chat moving when a turn ended ([#8944](https://github.com/getpaseo/paseo/pull/8944), [#9175](https://github.com/getpaseo/paseo/pull/9175))
|
||||
- Fixed Claude and OpenCode tool rows changing their title and icon as arguments arrived ([#9248](https://github.com/getpaseo/paseo/pull/9248))
|
||||
- Fixed the context window popover opening before usage was loaded ([#9212](https://github.com/getpaseo/paseo/pull/9212))
|
||||
- Fixed sidebar hover cards opening together ([#9071](https://github.com/getpaseo/paseo/pull/9071))
|
||||
|
||||
- Fixed the working indicator disappearing when returning to a chat whose agent finished while you were away ([#9170](https://github.com/getpaseo/paseo/pull/9170))
|
||||
- Fixed chats with short collapsed turns opening with empty space until you scrolled ([#8358](https://github.com/getpaseo/paseo/pull/8358), [#9083](https://github.com/getpaseo/paseo/pull/9083))
|
||||
- Fixed Collapse turns hiding an earlier reply inside a later turn's summary line after an idle Claude, Codex or OpenCode agent was resumed ([#9098](https://github.com/getpaseo/paseo/pull/9098))
|
||||
- Fixed the missing space between a prompt and the reply or collapsed-turn summary line below it ([#9009](https://github.com/getpaseo/paseo/pull/9009))
|
||||
- Fixed a long user message showing without its fade and Show more for one frame when a chat opened ([#9302](https://github.com/getpaseo/paseo/pull/9302))
|
||||
- Fixed Markdown tables showing as literal pipes when written directly below a paragraph with no blank line ([#8485](https://github.com/getpaseo/paseo/pull/8485) by [@ragokan](https://github.com/ragokan), [@suk-6](https://github.com/suk-6), [@thsrite](https://github.com/thsrite))
|
||||
- Fixed linked badge images that share a line with text rendering as full-width blocks on web and desktop ([#8530](https://github.com/getpaseo/paseo/pull/8530))
|
||||
- Fixed View diagram opening fullscreen instead of returning to the inline Mermaid diagram after View source ([#8932](https://github.com/getpaseo/paseo/pull/8932) by [@luoph](https://github.com/luoph))
|
||||
@@ -47,21 +140,16 @@
|
||||
- Fixed unsent composer text and attachments being deleted when an agent tab was closed ([#9079](https://github.com/getpaseo/paseo/pull/9079))
|
||||
- Fixed pasting text with hyperlinks into the composer dropping the link URLs; links now paste as Markdown ([#8972](https://github.com/getpaseo/paseo/pull/8972))
|
||||
- Fixed the composer losing focus after clicking Send with a mouse ([#9015](https://github.com/getpaseo/paseo/pull/9015))
|
||||
- Fixed the composer resting 50pt above the bottom edge on iPhone ([#8823](https://github.com/getpaseo/paseo/pull/8823) by [@zeyugao](https://github.com/zeyugao))
|
||||
- Fixed Add host sending you to Settings from the sidebar and New workspace ([#8512](https://github.com/getpaseo/paseo/pull/8512))
|
||||
- Fixed a failed agent's red dot and Failed grouping staying in the sidebar after opening the agent or choosing Mark as read ([#8831](https://github.com/getpaseo/paseo/pull/8831))
|
||||
- Fixed a workspace's unread indicator staying on after it was cleared while the agent's runtime was closed ([#9087](https://github.com/getpaseo/paseo/pull/9087))
|
||||
- Fixed unarchiving a workspace not restoring the agents that were archived with it ([#9210](https://github.com/getpaseo/paseo/pull/9210))
|
||||
- Fixed the context window popover closing by itself whenever the chat scrolled during a streaming reply ([#8742](https://github.com/getpaseo/paseo/pull/8742) by [@3ae3ae](https://github.com/3ae3ae))
|
||||
- Fixed the sidebar usage summary updating only when Usage was opened ([#7806](https://github.com/getpaseo/paseo/pull/7806) by [@ragokan](https://github.com/ragokan))
|
||||
- Fixed tooltips and menus above their trigger briefly covering it on Android when their content grew after opening ([#9247](https://github.com/getpaseo/paseo/pull/9247))
|
||||
- Fixed History showing "Could not load history" after reloading the web app on the History screen ([#9029](https://github.com/getpaseo/paseo/pull/9029))
|
||||
- Fixed section links in an HTML file preview replacing the preview with the Paseo app instead of scrolling within the file ([#8559](https://github.com/getpaseo/paseo/pull/8559) by [@3ae3ae](https://github.com/3ae3ae))
|
||||
- Fixed Files Refresh leaving a newly created file hidden when its folder was collapsed during the refresh ([#8582](https://github.com/getpaseo/paseo/pull/8582) by [@hadan8977](https://github.com/hadan8977))
|
||||
- Fixed the branch switcher showing "No branches found" while branches are still loading or after the request fails ([#8938](https://github.com/getpaseo/paseo/pull/8938))
|
||||
- Fixed commit history showing a doubled slash, no rename status and no diff for a file moved up a directory ([#8509](https://github.com/getpaseo/paseo/pull/8509) by [@hadan8977](https://github.com/hadan8977))
|
||||
- Fixed a merged pull request disappearing from its workspace when the checkout was behind the pull request's head
|
||||
- Fixed workspace Git watchers staying in fallback polling after a watcher setup timeout
|
||||
- Fixed abandoned connections staying open for up to 45 seconds after the web or desktop app reconnected ([#9067](https://github.com/getpaseo/paseo/pull/9067))
|
||||
- Fixed a connection routed through another host closing with "The receiving client cannot keep up with host output" while fetching a very large timeline ([#9109](https://github.com/getpaseo/paseo/pull/9109))
|
||||
- Fixed a connected host staying in error after it was updated to a supported version ([#8423](https://github.com/getpaseo/paseo/pull/8423) by [@DAnaeto](https://github.com/DAnaeto))
|
||||
@@ -123,16 +211,21 @@
|
||||
- Fixed a plugin the daemon terminated for an invalid message staying listed with no exit reported ([#9285](https://github.com/getpaseo/paseo/pull/9285) by [@Brandon168](https://github.com/Brandon168))
|
||||
- Fixed ACP provider plugins dropping the token usage an agent reports in its prompt response ([#9396](https://github.com/getpaseo/paseo/pull/9396) by [@Myasuka](https://github.com/Myasuka))
|
||||
- Fixed the published `@getpaseo/*` npm packages declaring no license; they now declare Apache-2.0 ([#7816](https://github.com/getpaseo/paseo/pull/7816) by [@mdlawson](https://github.com/mdlawson), [@ragokan](https://github.com/ragokan))
|
||||
- Fixed forking from an earlier reply failing with "This checkpoint changed after it was created" after a plugin updated one of its timeline cards ([#8746](https://github.com/getpaseo/paseo/pull/8746) by [@monarchmaisuriya](https://github.com/monarchmaisuriya))
|
||||
- Fixed Collapse turns leaving a turn open, or folding to an earlier reply, when a plugin renders the final reply ([#8811](https://github.com/getpaseo/paseo/pull/8811) by [@geoqiao](https://github.com/geoqiao))
|
||||
- Fixed plugin screens showing "This plugin surface is unavailable" while the plugin catalog is still loading after an app reload ([#8123](https://github.com/getpaseo/paseo/pull/8123) by [@vs-tahir](https://github.com/vs-tahir))
|
||||
- Fixed the Workspaces list being pushed out of the mobile sidebar on short screens when plugins add many navigation items ([#8727](https://github.com/getpaseo/paseo/pull/8727) by [@jaredwang](https://github.com/jaredwang))
|
||||
- Fixed timeline plugins not receiving the sender, event and original text on agent-message tool calls ([#8492](https://github.com/getpaseo/paseo/pull/8492) by [@RRD-dev](https://github.com/RRD-dev), [@luoph](https://github.com/luoph))
|
||||
- Fixed plugin RPCs failing when their input or output schema uses a transform ([#8550](https://github.com/getpaseo/paseo/pull/8550))
|
||||
|
||||
### Breaking
|
||||
|
||||
- Removed the deprecated `agent.turn.after.timeline` SDK field, which always returned an empty list ([#9573](https://github.com/getpaseo/paseo/pull/9573) by [@jtomaszewski](https://github.com/jtomaszewski))
|
||||
|
||||
### Notes
|
||||
|
||||
- Background tasks, the Change base picker, archive undo, background agents, plugin subscriptions and fx need both the host and the app on this version
|
||||
- Update both the host and app to use the plugin gallery, background tasks, Change base, archive undo, background agents, plugin subscriptions and fx
|
||||
- Plugin authors reading `agent.turn.after.timeline` must use `timeline.refetch({ direction: "tail", limit: 1, wholeTurns: true })` and filter entries by `event.turnId`
|
||||
- Archive undo restores the workspace, not uncommitted files removed with its worktree
|
||||
|
||||
## 0.15.4 - 2026-11-10
|
||||
|
||||
|
||||
+122
-29
@@ -1,45 +1,138 @@
|
||||
# Changelog
|
||||
|
||||
## 0.16.0-beta.2 - 2026-11-11
|
||||
## 0.16.2 - 2026-11-18
|
||||
|
||||
- **后台任务**:Paseo 现在会在 Composer 上方显示 Agent 正在运行的后台任务,例如 shell 和监视器,每项都带“停止”按钮。支持 Claude Code、Codex 和 OpenCode v2。 ([#6220](https://github.com/getpaseo/paseo/pull/6220), [#9162](https://github.com/getpaseo/paseo/pull/9162),贡献者:[@fxlelouarn](https://github.com/fxlelouarn))
|
||||
- **插件侧边栏视图**:插件可以用自己的布局替换侧边栏内容,展示所有已连接主机上的工作区、Agent、项目和终端。在“设置 → 侧边栏”中为每台设备选择视图;Paseo 的侧边栏页眉和页脚保持不变。 ([#8906](https://github.com/getpaseo/paseo/pull/8906))
|
||||
- **插件 Composer 控件**:插件可以向 Composer 添加自己的控件,并读取和设置其中的提示词、附件、Provider、模型、模式和思考强度。插件还可以把光标放到任意 Agent 的 Composer 中、向“新建工作区”添加条目,并在 Agent 和工作区上保存自己的元数据。 ([#8744](https://github.com/getpaseo/paseo/pull/8744), [#9209](https://github.com/getpaseo/paseo/pull/9209), [#9207](https://github.com/getpaseo/paseo/pull/9207))
|
||||
- **更快的 diff 加载**:打开“更改”时会立即显示文件树,文件内容随后加载。大型 diff 分批到达,加载期间应用的其他部分照常响应,并且 diff 优先于 daemon 的后台 worktree 扫描。 ([#8907](https://github.com/getpaseo/paseo/pull/8907), [#9241](https://github.com/getpaseo/paseo/pull/9241), [#9243](https://github.com/getpaseo/paseo/pull/9243))
|
||||
- **细节打磨**:一轮对话结束时聊天保持不动,返回没有变化的聊天时直接显示原样,无需刷新。工具行从第一帧起就显示最终标题和图标,上下文窗口浮层打开时用量已加载完成,侧边栏悬停卡片一次只打开一个。 ([#8944](https://github.com/getpaseo/paseo/pull/8944), [#9175](https://github.com/getpaseo/paseo/pull/9175), [#9242](https://github.com/getpaseo/paseo/pull/9242), [#9248](https://github.com/getpaseo/paseo/pull/9248), [#9212](https://github.com/getpaseo/paseo/pull/9212), [#9071](https://github.com/getpaseo/paseo/pull/9071))
|
||||
- **重建移动端聊天时间线**:iOS 和 Android 上的聊天时间线已重建。展开或折叠轮次摘要、待办卡片或工具调用组时,你点按的那一行保持原位;在 Android 上,“显示更多”“收起”和计划卡片也是如此。 ([#8717](https://github.com/getpaseo/paseo/pull/8717), [#9085](https://github.com/getpaseo/paseo/pull/9085))
|
||||
- **移动端键盘快捷键**:连接键盘后,iPad 和 Android 现在可使用与桌面端相同的快捷键,包括你自定义的绑定。检测到键盘时会显示快捷键提示和“设置 → 快捷键”。在较窄的桌面端和浏览器窗口中快捷键同样可用。 ([#8625](https://github.com/getpaseo/paseo/pull/8625),贡献者:[@jeroenfrenken](https://github.com/jeroenfrenken)、[@lstroud](https://github.com/lstroud))
|
||||
- **适合触控的平板控件**:在 iPad 和其他触屏设备上,宽屏布局现在使用适合触控尺寸的按钮、行和栏。Composer 工具栏在空间不足时会把控件收进模型菜单;在工作区上向右滑动,可将已折叠的侧边栏以浮层方式显示。 ([#8748](https://github.com/getpaseo/paseo/pull/8748), [#8885](https://github.com/getpaseo/paseo/pull/8885), [#8891](https://github.com/getpaseo/paseo/pull/8891), [#8909](https://github.com/getpaseo/paseo/pull/8909), [#9151](https://github.com/getpaseo/paseo/pull/9151), [#9238](https://github.com/getpaseo/paseo/pull/9238), [#8739](https://github.com/getpaseo/paseo/pull/8739),贡献者:[@zeyugao](https://github.com/zeyugao))
|
||||
- **撤销工作区归档**:在应用中归档工作区时,现在会显示“Workspace 已归档”提示,持续六秒。点击“撤销”或按 Cmd/Ctrl+Z 可恢复该工作区及其标签页和 Agent。在桌面端,侧边栏的工作区行在悬停时还会显示归档按钮。 ([#8904](https://github.com/getpaseo/paseo/pull/8904), [#9104](https://github.com/getpaseo/paseo/pull/9104))
|
||||
- **返回时更少重连**:返回应用时会保留仍可用的连接,包括正在传输大型响应的连接,只在必要时重连一次。主机保存了多个连接时,Paseo 会留在可用的那个连接上。 ([#8651](https://github.com/getpaseo/paseo/pull/8651), [#9086](https://github.com/getpaseo/paseo/pull/9086), [#8855](https://github.com/getpaseo/paseo/pull/8855), [#9116](https://github.com/getpaseo/paseo/pull/9116))
|
||||
### 修复
|
||||
|
||||
- 修复启用“折叠轮次”时,Claude 回复后续后台任务通知导致上一条已完成的回复被折叠的问题 ([#10092](https://github.com/getpaseo/paseo/pull/10092))
|
||||
- 修复归档工作区时丢失分离 HEAD 的 worktree 提交的问题 ([#10009](https://github.com/getpaseo/paseo/pull/10009),贡献者:[@ragokan](https://github.com/ragokan))
|
||||
- 修复 Desktop 更新后,由上一次 Desktop 会话启动的旧版 daemon 仍在运行的问题 ([#10067](https://github.com/getpaseo/paseo/pull/10067))
|
||||
- 修复更改执行权限后 daemon 与 Hub 断开连接的问题 ([#10113](https://github.com/getpaseo/paseo/pull/10113))
|
||||
- 修复一条已保存的主机记录无法读取时,其他主机也消失的问题 ([#9847](https://github.com/getpaseo/paseo/pull/9847),贡献者:[@ragokan](https://github.com/ragokan))
|
||||
- 修复创建 worktree 时,扫描 `.worktreeinclude` 未指定的大型忽略目录导致超时的问题 ([#10020](https://github.com/getpaseo/paseo/pull/10020),贡献者:[@mgranderath](https://github.com/mgranderath))
|
||||
- 修复发送引导消息时取消 Claude 正在进行的上下文压缩的问题 ([#10028](https://github.com/getpaseo/paseo/pull/10028),贡献者:[@NightMachinery](https://github.com/NightMachinery))
|
||||
- 修复 Provider 重用已取消的轮次 ID 时,再次停止导致 Agent 卡住的问题 ([#9774](https://github.com/getpaseo/paseo/pull/9774),贡献者:[@DAnaeto](https://github.com/DAnaeto))
|
||||
- 修复 Desktop 渲染进程意外退出后窗口一直空白的问题 ([#10035](https://github.com/getpaseo/paseo/pull/10035))
|
||||
- 修复 Web 和 Desktop 上文件下载失败时,错误页面占据应用窗口的问题 ([#9937](https://github.com/getpaseo/paseo/pull/9937),贡献者:[@panta82](https://github.com/panta82))
|
||||
- 修复在“导入会话”中选择“加载更多”时丢失滚动位置的问题 ([#9974](https://github.com/getpaseo/paseo/pull/9974))
|
||||
- 修复主目录所在的文件系统拒绝 Unix 套接字时无法打开终端的问题,例如 AFS ([#9214](https://github.com/getpaseo/paseo/pull/9214),贡献者:[@bendavid](https://github.com/bendavid))
|
||||
- 修复 Git 监视器设置超时后反复扫描大型仓库的问题 ([#9828](https://github.com/getpaseo/paseo/pull/9828),贡献者:[@Spshulem](https://github.com/Spshulem))
|
||||
- 修复 `paseo workspace create --path .` 使用本地 daemon 的目录而非命令所在目录的问题 ([#10010](https://github.com/getpaseo/paseo/pull/10010))
|
||||
- 修复针对空闲 Agent 查询 MCP 状态或列表时漏报后台任务的问题 ([#10022](https://github.com/getpaseo/paseo/pull/10022),贡献者:[@ortschun](https://github.com/ortschun))
|
||||
- 修复 OMP 更改思考级别后,选择器仍显示旧级别的问题 ([#9841](https://github.com/getpaseo/paseo/pull/9841),贡献者:[@dsingal0](https://github.com/dsingal0))
|
||||
|
||||
## 0.16.1 - 2026-11-17
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复 `permissions.ask` 规则或返回 `ask` 的钩子要求确认时,Claude Bypass 不显示权限卡片就批准操作的问题 ([#9927](https://github.com/getpaseo/paseo/pull/9927))
|
||||
- 修复触屏笔记本以触控板或鼠标为主要输入时,控件仍使用触控尺寸的问题 ([#9909](https://github.com/getpaseo/paseo/pull/9909),贡献者:[@michaelhthomas](https://github.com/michaelhthomas))
|
||||
- 修复 Claude Code 正在续期已过期的访问令牌时,Paseo 刷新 Claude 模型列表导致 Claude 会话在执行 `/login` 前一直失败的问题 ([#9855](https://github.com/getpaseo/paseo/pull/9855),贡献者:[@daysun-k](https://github.com/daysun-k))
|
||||
- 修复 Web 端“添加主机”的文本字段没有输入框,导致主机密码字段不可见的问题 ([#9865](https://github.com/getpaseo/paseo/pull/9865),贡献者:[@angusb93](https://github.com/angusb93))
|
||||
- 修复新消息引导当前回合后,OpenCode 提问既无法回答也无法关闭的问题 ([#9891](https://github.com/getpaseo/paseo/pull/9891))
|
||||
- 修复名称包含 `/` 的 Pi 和 OMP 模型被截成最后一个斜杠之后文本的问题 ([#9823](https://github.com/getpaseo/paseo/pull/9823), [#9836](https://github.com/getpaseo/paseo/pull/9836),贡献者:[@rms523](https://github.com/rms523))
|
||||
- 修复文件暂存后在同一秒内以相同大小保存时,“更改”遗漏该修改的问题 ([#9854](https://github.com/getpaseo/paseo/pull/9854))
|
||||
- 修复将对话标记为已读失败后,错误提示一直不关闭的问题 ([#9837](https://github.com/getpaseo/paseo/pull/9837))
|
||||
- 修复 daemon 重启后,等待结果和完成通知把 Agent 自行开始的回复与上一条回复拼接在一起的问题 ([#9846](https://github.com/getpaseo/paseo/pull/9846))
|
||||
- 修复客户端仅为读取历史而打开的 Codex 对话一直加载在 daemon 中直到重启的问题 ([#9859](https://github.com/getpaseo/paseo/pull/9859),贡献者:[@Spshulem](https://github.com/Spshulem))
|
||||
|
||||
## 0.16.0 - 2026-11-16
|
||||
|
||||
- **后台任务**:在 Composer 上方查看并停止 Claude Code、Codex 和 OpenCode v2 的后台任务。 ([#6220](https://github.com/getpaseo/paseo/pull/6220), [#9162](https://github.com/getpaseo/paseo/pull/9162), [#9635](https://github.com/getpaseo/paseo/pull/9635),贡献者:[@fxlelouarn](https://github.com/fxlelouarn))
|
||||
- **内置插件库**:无需离开 Paseo,即可浏览、搜索和安装插件,并在同一页面管理插件设置和更新。 ([#9752](https://github.com/getpaseo/paseo/pull/9752))
|
||||
- **命令中心标签页**:在工作区、文件和操作之间切换,最近使用的工作区优先显示。搜索现在包含已归档工作区,还可匹配工作区内的 Agent 标题。 ([#9689](https://github.com/getpaseo/paseo/pull/9689))
|
||||
- **插件侧边栏视图**:插件可以用自己的布局替换侧边栏,展示已连接主机上的工作区和 Agent。在“设置 → 侧边栏”中为每台设备选择视图。 ([#8906](https://github.com/getpaseo/paseo/pull/8906))
|
||||
- **插件 Composer 控件**:插件可以添加 Composer 控件、编辑草稿和附件,以及更改 Agent 设置。插件还可以添加“新建工作区”条目,并在 Agent 和工作区上保存元数据。 ([#8744](https://github.com/getpaseo/paseo/pull/8744), [#9209](https://github.com/getpaseo/paseo/pull/9209), [#9207](https://github.com/getpaseo/paseo/pull/9207), [#9734](https://github.com/getpaseo/paseo/pull/9734),贡献者:[@michaelmwu](https://github.com/michaelmwu))
|
||||
- **排列用量卡片**:拖动 Provider 卡片来调整顺序,并关闭不想在侧边栏摘要中显示的卡片。在用量设置中选择主机。 ([#9660](https://github.com/getpaseo/paseo/pull/9660), [#9740](https://github.com/getpaseo/paseo/pull/9740), [#9748](https://github.com/getpaseo/paseo/pull/9748), [#9780](https://github.com/getpaseo/paseo/pull/9780))
|
||||
- **返回应用时更少提示**:返回没有变化的聊天时,不再闪现“正在更新消息”。Paseo 会保留可用的连接,并在你返回时恢复断开的连接。重连后,已是最新状态的聊天也不再显示额外的更新提示。 ([#9242](https://github.com/getpaseo/paseo/pull/9242), [#8651](https://github.com/getpaseo/paseo/pull/8651), [#9086](https://github.com/getpaseo/paseo/pull/9086), [#8855](https://github.com/getpaseo/paseo/pull/8855), [#9116](https://github.com/getpaseo/paseo/pull/9116), [#9558](https://github.com/getpaseo/paseo/pull/9558),贡献者:[@adamcstephens](https://github.com/adamcstephens))
|
||||
- **重建移动端聊天**:在 iOS 和 Android 上展开轮次摘要、待办卡片和工具组时,阅读位置保持不变。滚动期间发送消息会移到新提示词处。 ([#8717](https://github.com/getpaseo/paseo/pull/8717), [#9085](https://github.com/getpaseo/paseo/pull/9085), [#9806](https://github.com/getpaseo/paseo/pull/9806), [#9693](https://github.com/getpaseo/paseo/pull/9693))
|
||||
- **更快的 diff 加载**:“更改”在文件内容加载完成前先显示文件树。大型 diff 分批加载,且优先于后台 worktree 扫描。 ([#8907](https://github.com/getpaseo/paseo/pull/8907), [#9241](https://github.com/getpaseo/paseo/pull/9241), [#9243](https://github.com/getpaseo/paseo/pull/9243), [#9584](https://github.com/getpaseo/paseo/pull/9584))
|
||||
- **更快的 Composer 菜单**:大型列表中的命令和文件建议更快打开,并随 Composer 尺寸变化保持贴合。 ([#9657](https://github.com/getpaseo/paseo/pull/9657), [#9647](https://github.com/getpaseo/paseo/pull/9647), [#9642](https://github.com/getpaseo/paseo/pull/9642))
|
||||
- **移动端键盘快捷键**:连接键盘后,iPad 和 Android 可使用与桌面端相同的快捷键,包括自定义绑定。在 iPad Composer 中按 Shift+Tab 会切换模式,不再输入制表符。 ([#8625](https://github.com/getpaseo/paseo/pull/8625), [#9561](https://github.com/getpaseo/paseo/pull/9561),贡献者:[@jeroenfrenken](https://github.com/jeroenfrenken), [@lstroud](https://github.com/lstroud))
|
||||
- **适合触控的平板控件**:触屏设备上的宽屏布局使用更大的按钮和行。空间不足时,Composer 会将控件收进模型菜单。 ([#8748](https://github.com/getpaseo/paseo/pull/8748), [#8885](https://github.com/getpaseo/paseo/pull/8885), [#8891](https://github.com/getpaseo/paseo/pull/8891), [#8909](https://github.com/getpaseo/paseo/pull/8909), [#9151](https://github.com/getpaseo/paseo/pull/9151), [#9238](https://github.com/getpaseo/paseo/pull/9238), [#8739](https://github.com/getpaseo/paseo/pull/8739),贡献者:[@zeyugao](https://github.com/zeyugao))
|
||||
- **撤销工作区归档**:在六秒提示期间,点击“撤销”或按 Cmd/Ctrl+Z 可恢复已归档的工作区。Paseo 在移除 worktree 前会检查未保存的文件和未推送的提交。 ([#8904](https://github.com/getpaseo/paseo/pull/8904), [#9104](https://github.com/getpaseo/paseo/pull/9104), [#9625](https://github.com/getpaseo/paseo/pull/9625), [#9753](https://github.com/getpaseo/paseo/pull/9753),贡献者:[@ragokan](https://github.com/ragokan))
|
||||
|
||||
### 新增
|
||||
|
||||
- 在“更改”中为 worktree 工作区新增基准分支选择器(Change base),diff、提交列表和 Git 操作可改用其他分支 ([#8642](https://github.com/getpaseo/paseo/pull/8642), [#8934](https://github.com/getpaseo/paseo/pull/8934),贡献者:[@Myasuka](https://github.com/Myasuka))
|
||||
- 新增 Issue 和 PR 引用链接:Agent 回复、计划、PR 面板和文件预览中的 `#123`、`owner/repo#123` 等引用会链接到 GitHub、GitLab、Gitea、Forgejo 或 Codeberg ([#8636](https://github.com/getpaseo/paseo/pull/8636))
|
||||
- 新增 iPhone Duo 布局支持:工作区操作位于系统竖向栏中,侧边栏和工作区分列折痕两侧 ([#8741](https://github.com/getpaseo/paseo/pull/8741), [#8901](https://github.com/getpaseo/paseo/pull/8901),贡献者:[@zeyugao](https://github.com/zeyugao))
|
||||
- 为 worktree 的 diff、提交和 Git 操作新增基准分支选择器(Change base) ([#8642](https://github.com/getpaseo/paseo/pull/8642), [#8934](https://github.com/getpaseo/paseo/pull/8934),贡献者:[@Myasuka](https://github.com/Myasuka))
|
||||
- 新增可解析 SSH 别名和 fork 上游仓库的 Issue 和 PR 链接 ([#8636](https://github.com/getpaseo/paseo/pull/8636), [#9576](https://github.com/getpaseo/paseo/pull/9576))
|
||||
- 新增 iPhone Duo 布局,侧边栏和工作区分列折痕两侧 ([#8741](https://github.com/getpaseo/paseo/pull/8741), [#8901](https://github.com/getpaseo/paseo/pull/8901),贡献者:[@zeyugao](https://github.com/zeyugao))
|
||||
- 新增 fx Provider,可在“设置 → Hosts → 提供方”的 Provider 目录中添加 ([#9160](https://github.com/getpaseo/paseo/pull/9160))
|
||||
- 新增后台 Agent:Agent 或插件可通过 `background: true` 创建辅助 Agent,它不打开标签页、不发送通知,也不出现在侧边栏和默认 Agent 列表中 ([#8683](https://github.com/getpaseo/paseo/pull/8683))
|
||||
- 新增后台 Agent,不占用标签页、不发送通知,也不出现在默认 Agent 列表中 ([#8683](https://github.com/getpaseo/paseo/pull/8683))
|
||||
- 新增 Terraform 和 HCL 文件(`.tf`、`.tfvars`、`.hcl`)的语法高亮 ([#9106](https://github.com/getpaseo/paseo/pull/9106))
|
||||
- 在每个 Agent 的环境中新增 `PASEO_WORKSPACE_ID`,Agent 可据此识别、重命名或归档自己的工作区 ([#8939](https://github.com/getpaseo/paseo/pull/8939),贡献者:[@DTTerastar](https://github.com/DTTerastar))
|
||||
- 为侧边栏工作区行新增插件徽章 ([#7645](https://github.com/getpaseo/paseo/pull/7645),贡献者:[@jtomaszewski](https://github.com/jtomaszewski))
|
||||
- 为无法预览的文件新增“下载”按钮 ([#9640](https://github.com/getpaseo/paseo/pull/9640))
|
||||
- 在用量中新增 Copilot 高级请求用量和剩余额度 ([#8489](https://github.com/getpaseo/paseo/pull/8489),贡献者:[@thisisryanswift](https://github.com/thisisryanswift))
|
||||
|
||||
### 变更
|
||||
|
||||
- 打开工作区时恢复你离开时的标签页,不再跳转到需要关注的 Agent ([#8935](https://github.com/getpaseo/paseo/pull/8935))
|
||||
- 问题卡片中选择选项后不再自动前进;请用“下一步”或“提交”继续 ([#8525](https://github.com/getpaseo/paseo/pull/8525))
|
||||
- 斜杠命令菜单现在显示加载和错误状态并提供“重试”,且不再默认选中 `/exit` ([#8905](https://github.com/getpaseo/paseo/pull/8905))
|
||||
- 文件浏览器(Explorer)或分屏使工作区变窄时,工作区页眉和标签页改用紧凑控件 ([#8740](https://github.com/getpaseo/paseo/pull/8740), [#9088](https://github.com/getpaseo/paseo/pull/9088),贡献者:[@zeyugao](https://github.com/zeyugao))
|
||||
- 问题卡片在选择选项后等待点击“下一步”或“提交” ([#8525](https://github.com/getpaseo/paseo/pull/8525))
|
||||
- 斜杠命令菜单不再默认选中 `/exit` ([#8905](https://github.com/getpaseo/paseo/pull/8905))
|
||||
- 调整工作区页眉控件以适应较窄的分屏窗格 ([#8740](https://github.com/getpaseo/paseo/pull/8740), [#9088](https://github.com/getpaseo/paseo/pull/9088),贡献者:[@zeyugao](https://github.com/zeyugao))
|
||||
- 向进程已退出的 Pi Agent 发送消息时立即失败,并提示重新加载该 Agent ([#8718](https://github.com/getpaseo/paseo/pull/8718))
|
||||
- 在桌面端和宽屏网页布局中,侧边栏的“重命名 workspace”改为在原处编辑标题,不再打开对话框 ([#9280](https://github.com/getpaseo/paseo/pull/9280))
|
||||
- “更新内容”和网站更新日志改为先显示每个版本的亮点,完整列表收在“显示全部变更”之后 ([#9281](https://github.com/getpaseo/paseo/pull/9281))
|
||||
- “更新内容”先显示亮点,完整列表收在“显示全部变更”之后 ([#9281](https://github.com/getpaseo/paseo/pull/9281))
|
||||
- Claude Bypass 现在批准来自 ask 规则和钩子的执行请求,提问和计划审核仍保留交互 ([#9760](https://github.com/getpaseo/paseo/pull/9760))
|
||||
- Claude 权限卡片现在显示 Provider 提供的原因 ([#3950](https://github.com/getpaseo/paseo/pull/3950),贡献者:[@codebutler](https://github.com/codebutler))
|
||||
- PR 窗格中的“活动”可调整大小或折叠,为检查结果留出更多空间 ([#9656](https://github.com/getpaseo/paseo/pull/9656))
|
||||
- macOS 桌面端的标签页切换快捷键改为 Cmd+Shift+[ 和 Cmd+Shift+] ([#7692](https://github.com/getpaseo/paseo/pull/7692),贡献者:[@jtomaszewski](https://github.com/jtomaszewski))
|
||||
- 在“新建工作区”按 Cmd/Ctrl+N 会打开项目选择器,同时保留草稿 ([#9741](https://github.com/getpaseo/paseo/pull/9741))
|
||||
- 移动端设置导航现在恢复侧边栏之前的位置 ([#9641](https://github.com/getpaseo/paseo/pull/9641))
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复较长的工具详情隐藏折叠标题或无法滚动查看输出的问题 ([#9770](https://github.com/getpaseo/paseo/pull/9770))
|
||||
- 修复图片预览加载时短暂显示错误或拉伸图片的问题 ([#9698](https://github.com/getpaseo/paseo/pull/9698))
|
||||
- 修复网页端和桌面端聊天在较早历史记录进入虚拟化后跳到开头的问题 ([#9664](https://github.com/getpaseo/paseo/pull/9664),贡献者:[@luoph](https://github.com/luoph))
|
||||
- 修复滚动到顶部后仍需再次滚动鼠标滚轮才能加载更早聊天记录的问题 ([#9570](https://github.com/getpaseo/paseo/pull/9570))
|
||||
- 修复跨越部分代码块复制选区时丢失缩进和换行的问题 ([#9515](https://github.com/getpaseo/paseo/pull/9515),贡献者:[@michaelmwu](https://github.com/michaelmwu))
|
||||
- 修复 Mermaid XY 图表的轴标题重叠和标签被裁切的问题 ([#9483](https://github.com/getpaseo/paseo/pull/9483),贡献者:[@FluidXin](https://github.com/FluidXin))
|
||||
- 修复 iOS 上点击命令后命令菜单仍保持打开的问题 ([#9755](https://github.com/getpaseo/paseo/pull/9755))
|
||||
- 修复 Agent 启动失败后无法重试已编辑草稿的问题 ([#9534](https://github.com/getpaseo/paseo/pull/9534),贡献者:[@michaelmwu](https://github.com/michaelmwu))
|
||||
- 修复 Android 平板上模型配置按钮不响应点按的问题 ([#9526](https://github.com/getpaseo/paseo/pull/9526),贡献者:[@moevis](https://github.com/moevis))
|
||||
- 修复更改外观后设置页面丢失滚动位置和编辑内容的问题 ([#9605](https://github.com/getpaseo/paseo/pull/9605))
|
||||
- 修复浅色插件主题中选中行难以阅读、Pure Black 中高亮几乎不可见的问题 ([#9579](https://github.com/getpaseo/paseo/pull/9579),贡献者:[@nathansgreen](https://github.com/nathansgreen))
|
||||
- 修复网页端和桌面端页眉及工具栏图标按钮缺少键盘焦点框的问题 ([#9745](https://github.com/getpaseo/paseo/pull/9745),贡献者:[@junjzhang](https://github.com/junjzhang))
|
||||
- 修复 iOS 和 Android 上拖动后侧边栏行短暂出现在错误位置的问题 ([#9681](https://github.com/getpaseo/paseo/pull/9681))
|
||||
- 修复桌面端在 daemon 仍启动时报告启动失败的问题 ([#9043](https://github.com/getpaseo/paseo/pull/9043),贡献者:[@magiclaw](https://github.com/magiclaw))
|
||||
- 修复网页端和桌面端终端恢复画面时丢失输入字符的问题 ([#9533](https://github.com/getpaseo/paseo/pull/9533))
|
||||
- 修复 Android 终端中实体方向键失效并丢失下一个输入字符的问题 ([#9407](https://github.com/getpaseo/paseo/pull/9407),贡献者:[@moevis](https://github.com/moevis))
|
||||
- 修复非 Git 工作区在命令中心缺少“归档工作区”的问题 ([#9777](https://github.com/getpaseo/paseo/pull/9777),贡献者:[@andheiberg](https://github.com/andheiberg))
|
||||
- 修复后续配置读取超时后工作区脚本消失的问题 ([#9477](https://github.com/getpaseo/paseo/pull/9477),贡献者:[@dinhphieu](https://github.com/dinhphieu))
|
||||
- 修复账号用量刷新失败后侧边栏用量隐藏该账号的问题 ([#9594](https://github.com/getpaseo/paseo/pull/9594))
|
||||
- 修复 Provider 会话已不存在时,已关闭 Agent 仍保持未读的问题 ([#9737](https://github.com/getpaseo/paseo/pull/9737),贡献者:[@luoph](https://github.com/luoph))
|
||||
- 修复 Agent 自主运行一轮后完成通知显示旧回复的问题 ([#9793](https://github.com/getpaseo/paseo/pull/9793))
|
||||
- 修复中断消息因“already has an active run”而失败的问题 ([#9537](https://github.com/getpaseo/paseo/pull/9537),贡献者:[@michaelmwu](https://github.com/michaelmwu))
|
||||
- 修复消息在交给 Provider 前失败后无法重试的问题 ([#9580](https://github.com/getpaseo/paseo/pull/9580),贡献者:[@tmad4000](https://github.com/tmad4000))
|
||||
- 修复刚重新打开的 Agent 在下一次空闲清理时失去 Provider 进程的问题 ([#8857](https://github.com/getpaseo/paseo/pull/8857),贡献者:[@fdkevin0](https://github.com/fdkevin0))
|
||||
- 修复空闲运行时清理导致 Claude 会话 cron 和 /loop 唤醒丢失的问题 ([#9744](https://github.com/getpaseo/paseo/pull/9744),贡献者:[@KronixDev](https://github.com/KronixDev))
|
||||
- 修复工具在回复之前开始、之后结束时无法从该回复分叉的问题 ([#9627](https://github.com/getpaseo/paseo/pull/9627),贡献者:[@ragokan](https://github.com/ragokan))
|
||||
- 修复大型 Codex 历史页面在单个条目仍符合大小限制时阻断历史加载的问题 ([#9432](https://github.com/getpaseo/paseo/pull/9432),贡献者:[@RockStone](https://github.com/RockStone))
|
||||
- 修复 OpenCode 使用 Bun 时,daemon 重启后会话无法重新连接的问题 ([#9653](https://github.com/getpaseo/paseo/pull/9653),贡献者:[@quickwind](https://github.com/quickwind))
|
||||
- 修复 OpenCode 升级到 v2 后刷新 Provider 仍保留 v1 的问题 ([#9593](https://github.com/getpaseo/paseo/pull/9593),贡献者:[@tkfka1](https://github.com/tkfka1))
|
||||
- 修复 OpenCode v2 无法发现仅对其会话可用的插件工具的问题 ([#9426](https://github.com/getpaseo/paseo/pull/9426),贡献者:[@dptsolutions](https://github.com/dptsolutions))
|
||||
- 修复 ACP Provider 按模型提供思考等级时,模型共用错误等级的问题 ([#9717](https://github.com/getpaseo/paseo/pull/9717),贡献者:[@AlfredRR](https://github.com/AlfredRR), [@doskoi](https://github.com/doskoi))
|
||||
- 修复没有输出的失败 ACP 工具阻止对话历史加载的问题 ([#9467](https://github.com/getpaseo/paseo/pull/9467),贡献者:[@Myasuka](https://github.com/Myasuka))
|
||||
- 修复带有 null 可选参数的 Pi 和 OMP 工具调用显示为未知工具的问题 ([#9506](https://github.com/getpaseo/paseo/pull/9506),贡献者:[@papag00se](https://github.com/papag00se))
|
||||
- 修复导入 OMP 会话时保存文件路径而非会话 ID 的问题 ([#8854](https://github.com/getpaseo/paseo/pull/8854),贡献者:[@LiebeLee](https://github.com/LiebeLee))
|
||||
- 修复跨主机子 Agent 与调用者使用相同 Provider 时丢失调用者模式的问题 ([#9512](https://github.com/getpaseo/paseo/pull/9512),贡献者:[@ortschun](https://github.com/ortschun))
|
||||
- 修复插件子 Agent 在会话关闭时从失败或已取消变为已完成的问题 ([#8563](https://github.com/getpaseo/paseo/pull/8563),贡献者:[@hadan8977](https://github.com/hadan8977))
|
||||
- 修复完整 Agent ID 不存在时,CLI 命令误操作标题与该 ID 相同的其他 Agent 的问题 ([#9680](https://github.com/getpaseo/paseo/pull/9680), [#9731](https://github.com/getpaseo/paseo/pull/9731),贡献者:[@ese111](https://github.com/ese111))
|
||||
- 修复无法归档、分离或重新加载未出现在 CLI 列表中的 Agent 的问题 ([#9726](https://github.com/getpaseo/paseo/pull/9726),贡献者:[@xunWhale](https://github.com/xunWhale))
|
||||
- 修复 `paseo agent wait` 在没有 Agent 匹配 ID 时仍成功退出的问题 ([#9782](https://github.com/getpaseo/paseo/pull/9782),贡献者:[@Eapp1e](https://github.com/Eapp1e))
|
||||
- 修复语音输入和输出都使用 OpenAI 时无法启动语音模式的问题 ([#9779](https://github.com/getpaseo/paseo/pull/9779),贡献者:[@Huyvux12](https://github.com/Huyvux12))
|
||||
- 修复听写流错误被 30 秒交付超时掩盖的问题 ([#9784](https://github.com/getpaseo/paseo/pull/9784),贡献者:[@tieo](https://github.com/tieo))
|
||||
- 修复插件 Provider 在 All 模式下拒绝 Review 附件的问题 ([#9590](https://github.com/getpaseo/paseo/pull/9590),贡献者:[@ese111](https://github.com/ese111))
|
||||
- 修复插件时间线写入接受应用无法显示的类型的问题 ([#7677](https://github.com/getpaseo/paseo/pull/7677),贡献者:[@ragokan](https://github.com/ragokan))
|
||||
- 修复一轮结束时聊天位置移动的问题 ([#8944](https://github.com/getpaseo/paseo/pull/8944), [#9175](https://github.com/getpaseo/paseo/pull/9175))
|
||||
- 修复 Claude 和 OpenCode 工具行随参数到达而更改标题和图标的问题 ([#9248](https://github.com/getpaseo/paseo/pull/9248))
|
||||
- 修复用量加载前上下文窗口浮层提前打开的问题 ([#9212](https://github.com/getpaseo/paseo/pull/9212))
|
||||
- 修复多个侧边栏悬停卡片同时打开的问题 ([#9071](https://github.com/getpaseo/paseo/pull/9071))
|
||||
|
||||
- 修复 Agent 在你离开期间完成后,返回聊天时工作指示器消失的问题 ([#9170](https://github.com/getpaseo/paseo/pull/9170))
|
||||
- 修复包含较短折叠轮次的聊天打开时留有空白、需滚动后才填满的问题 ([#8358](https://github.com/getpaseo/paseo/pull/8358), [#9083](https://github.com/getpaseo/paseo/pull/9083))
|
||||
- 修复空闲的 Claude、Codex 或 OpenCode Agent 恢复后,“折叠轮次”把较早的回复藏进后一轮摘要行的问题 ([#9098](https://github.com/getpaseo/paseo/pull/9098))
|
||||
- 修复提示词与其下方的回复或折叠轮次摘要行之间缺少间距的问题 ([#9009](https://github.com/getpaseo/paseo/pull/9009))
|
||||
- 修复聊天打开时,较长的用户消息有一帧不显示渐隐效果和“展开”的问题 ([#9302](https://github.com/getpaseo/paseo/pull/9302))
|
||||
- 修复紧跟在段落之后、中间没有空行的 Markdown 表格显示为原始竖线的问题 ([#8485](https://github.com/getpaseo/paseo/pull/8485),贡献者:[@ragokan](https://github.com/ragokan)、[@suk-6](https://github.com/suk-6)、[@thsrite](https://github.com/thsrite))
|
||||
- 修复网页版和桌面端中与文字同行的带链接徽章图片被渲染成整行宽度的问题 ([#8530](https://github.com/getpaseo/paseo/pull/8530))
|
||||
- 修复“查看源码”后点击“查看图表”会打开全屏、而不是回到内联 Mermaid 图表的问题 ([#8932](https://github.com/getpaseo/paseo/pull/8932),贡献者:[@luoph](https://github.com/luoph))
|
||||
@@ -47,21 +140,16 @@
|
||||
- 修复关闭 Agent 标签页时未发送的 Composer 文本和附件被删除的问题 ([#9079](https://github.com/getpaseo/paseo/pull/9079))
|
||||
- 修复向 Composer 粘贴带超链接的文本时丢失链接地址的问题;链接现在以 Markdown 形式粘贴 ([#8972](https://github.com/getpaseo/paseo/pull/8972))
|
||||
- 修复用鼠标点击“发送”后 Composer 失去焦点的问题 ([#9015](https://github.com/getpaseo/paseo/pull/9015))
|
||||
- 修复 iPhone 上 Composer 停在距底部边缘 50pt 处的问题 ([#8823](https://github.com/getpaseo/paseo/pull/8823),贡献者:[@zeyugao](https://github.com/zeyugao))
|
||||
- 修复从侧边栏和“新建工作区”点击“添加主机”会跳转到“设置”的问题 ([#8512](https://github.com/getpaseo/paseo/pull/8512))
|
||||
- 修复打开失败的 Agent 或选择 Mark as read 后,其红点和“失败”分组仍留在侧边栏的问题 ([#8831](https://github.com/getpaseo/paseo/pull/8831))
|
||||
- 修复在 Agent 运行时已关闭的情况下清除未读后,工作区的未读指示仍然亮着的问题 ([#9087](https://github.com/getpaseo/paseo/pull/9087))
|
||||
- 修复取消归档工作区时未恢复随之归档的 Agent 的问题 ([#9210](https://github.com/getpaseo/paseo/pull/9210))
|
||||
- 修复流式回复期间聊天一滚动上下文窗口浮层就自行关闭的问题 ([#8742](https://github.com/getpaseo/paseo/pull/8742),贡献者:[@3ae3ae](https://github.com/3ae3ae))
|
||||
- 修复侧边栏用量摘要只在打开“使用情况”时才更新的问题 ([#7806](https://github.com/getpaseo/paseo/pull/7806),贡献者:[@ragokan](https://github.com/ragokan))
|
||||
- 修复 Android 上位于触发元素上方的提示和菜单在打开后内容变多时短暂盖住触发元素的问题 ([#9247](https://github.com/getpaseo/paseo/pull/9247))
|
||||
- 修复在“历史”页面刷新网页版后显示“无法加载历史”的问题 ([#9029](https://github.com/getpaseo/paseo/pull/9029))
|
||||
- 修复 HTML 文件预览中的章节链接把预览替换成 Paseo 应用、而不是在文件内滚动的问题 ([#8559](https://github.com/getpaseo/paseo/pull/8559),贡献者:[@3ae3ae](https://github.com/3ae3ae))
|
||||
- 修复“文件”刷新期间文件夹处于折叠状态时,新建的文件一直不显示的问题 ([#8582](https://github.com/getpaseo/paseo/pull/8582),贡献者:[@hadan8977](https://github.com/hadan8977))
|
||||
- 修复分支仍在加载或请求失败时,分支切换器显示“没有找到分支。”的问题 ([#8938](https://github.com/getpaseo/paseo/pull/8938))
|
||||
- 修复文件被移到上一级目录时,提交历史显示双斜杠、没有重命名状态也没有 diff 的问题 ([#8509](https://github.com/getpaseo/paseo/pull/8509),贡献者:[@hadan8977](https://github.com/hadan8977))
|
||||
- 修复检出落后于 PR 头部时,已合并的 PR 从其工作区中消失的问题
|
||||
- 修复工作区 Git 监视器在设置超时后一直停留在回退轮询的问题
|
||||
- 修复网页版或桌面端重连后,被放弃的连接最多保持打开 45 秒的问题 ([#9067](https://github.com/getpaseo/paseo/pull/9067))
|
||||
- 修复通过另一台主机路由的连接在获取超大时间线时以“The receiving client cannot keep up with host output”关闭的问题 ([#9109](https://github.com/getpaseo/paseo/pull/9109))
|
||||
- 修复已连接的主机在更新到受支持的版本后仍停留在错误状态的问题 ([#8423](https://github.com/getpaseo/paseo/pull/8423),贡献者:[@DAnaeto](https://github.com/DAnaeto))
|
||||
@@ -123,16 +211,21 @@
|
||||
- 修复 daemon 因无效消息终止插件后,该插件仍留在列表中且未报告退出的问题 ([#9285](https://github.com/getpaseo/paseo/pull/9285),贡献者:[@Brandon168](https://github.com/Brandon168))
|
||||
- 修复 ACP Provider 插件丢弃 Agent 在提示词响应中报告的 token 用量的问题 ([#9396](https://github.com/getpaseo/paseo/pull/9396),贡献者:[@Myasuka](https://github.com/Myasuka))
|
||||
- 修复已发布的 `@getpaseo/*` npm 包未声明许可证的问题;现在声明为 Apache-2.0 ([#7816](https://github.com/getpaseo/paseo/pull/7816),贡献者:[@mdlawson](https://github.com/mdlawson)、[@ragokan](https://github.com/ragokan))
|
||||
- 修复插件更新了自己的某张时间线卡片后,从较早的回复分叉因“This checkpoint changed after it was created”失败的问题 ([#8746](https://github.com/getpaseo/paseo/pull/8746),贡献者:[@monarchmaisuriya](https://github.com/monarchmaisuriya))
|
||||
- 修复由插件渲染最终回复时,“折叠轮次”让轮次保持展开或折叠到较早回复的问题 ([#8811](https://github.com/getpaseo/paseo/pull/8811),贡献者:[@geoqiao](https://github.com/geoqiao))
|
||||
- 修复应用刷新后插件目录仍在加载时,插件页面显示“This plugin surface is unavailable”的问题 ([#8123](https://github.com/getpaseo/paseo/pull/8123),贡献者:[@vs-tahir](https://github.com/vs-tahir))
|
||||
- 修复插件添加了许多导航项时,矮屏上的工作区列表被挤出移动端侧边栏的问题 ([#8727](https://github.com/getpaseo/paseo/pull/8727),贡献者:[@jaredwang](https://github.com/jaredwang))
|
||||
- 修复时间线插件在 Agent 消息工具调用上收不到发送方、事件和原始文本的问题 ([#8492](https://github.com/getpaseo/paseo/pull/8492),贡献者:[@RRD-dev](https://github.com/RRD-dev)、[@luoph](https://github.com/luoph))
|
||||
- 修复输入或输出 schema 使用 transform 时插件 RPC 失败的问题 ([#8550](https://github.com/getpaseo/paseo/pull/8550))
|
||||
|
||||
### 破坏性变更
|
||||
|
||||
- 移除已弃用且始终返回空列表的 `agent.turn.after.timeline` SDK 字段 ([#9573](https://github.com/getpaseo/paseo/pull/9573),贡献者:[@jtomaszewski](https://github.com/jtomaszewski))
|
||||
|
||||
### 说明
|
||||
|
||||
- 后台任务、基准分支选择器、归档撤销、后台 Agent、插件订阅和 fx 需要主机和应用都更新到此版本
|
||||
- 使用插件库、后台任务、Change base、归档撤销、后台 Agent、插件订阅和 fx 时,请同时更新主机和应用
|
||||
- 读取 `agent.turn.after.timeline` 的插件作者必须改用 `timeline.refetch({ direction: "tail", limit: 1, wholeTurns: true })`,并按 `event.turnId` 筛选条目
|
||||
- 归档撤销会恢复工作区,但不会恢复随 worktree 一起移除的未提交文件
|
||||
|
||||
## 0.15.4 - 2026-11-10
|
||||
|
||||
|
||||
@@ -506,5 +506,5 @@ Agent and terminal environments are unchanged. System proxy settings and SOCKS-o
|
||||
## Deployment models
|
||||
|
||||
1. **Local daemon** (default): `paseo daemon start` on `127.0.0.1:6767`
|
||||
2. **Managed desktop**: Electron uses the server package’s local-instance lifecycle capability for sanitized launch, published readiness, and captured-PID stop. Only a matching `{pid, startedAt}` from a spawn in the current Desktop session authorizes automatic stop or binary replacement. Preexisting instances, including legacy `desktopManaged` records, are attach-only. Keep-running survivors attach in the next session. Explicit attached Stop requires a confirmation naming the captured home/PID. Ordinary Restart uses the worker RPC on every app platform.
|
||||
2. **Managed desktop**: Electron uses the server package’s local-instance lifecycle capability for sanitized launch, published readiness, and captured-PID stop. Only Desktop's own launch writes `desktopManaged: true` to `paseo.pid`. The CLI launch path removes the flag. While Desktop manages the built-in daemon, an app update or a version mismatch replaces any `desktopManaged` daemon, including one that an earlier Desktop session left running. Bundled CLIs before v0.9.0 exported the flag, so a daemon that one of them started also carries it and is replaced. Quit, Settings, and host removal stop only a daemon that the current session launched, matched by `{pid, startedAt}`. A daemon that the user started through the CLI is attach-only. Explicit attached Stop requires a confirmation naming the captured home/PID. Ordinary Restart uses the worker RPC on every app platform.
|
||||
3. **Remote + relay**: Daemon behind firewall, relay bridges with E2E encryption
|
||||
|
||||
@@ -590,6 +590,16 @@ bookkeeping may scan opaque row sizes during a deferred write, never during host
|
||||
before a requested cache row can paint. The row store is not encrypted. A cached timeline can contain
|
||||
source code, prompts, and tool output; encrypted-at-rest storage is a separate security decision.
|
||||
|
||||
### Saved hosts
|
||||
|
||||
**AsyncStorage key:** `@paseo:daemon-registry`, an array of host profiles.
|
||||
|
||||
Every app build on a device shares this key, including an older build after a downgrade and a newer
|
||||
one that saves a connection kind this build doesn't know. The key holds every saved host and its
|
||||
password, so never remove it. Read each host and connection on its own, skip the ones this build
|
||||
can't read, and write them back on every save. A value that isn't a JSON array is copied to
|
||||
`@paseo:daemon-registry:unreadable` before the next save overwrites it.
|
||||
|
||||
### Draft Store
|
||||
|
||||
**AsyncStorage key:** `paseo-drafts` (version 2)
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ Dense toolbar rows, such as the composer's, are the exception to the 44pt contro
|
||||
|
||||
In the composer, the first glyph's ink starts on the text column's edge, and the trailing control is always a disc, so the row does not shift as it changes between voice mode, send and stop. The disc nests into the corner, as far from the right edge as from the bottom, and touch-sized the composer's corner radius is concentric with it (`packages/app/src/composer/input/toolbar-rails.ts`). Touch-sized the disc keeps a 6pt clearance from its neighbour, because it is always painted and a pressed neighbour would merge with it. The attach button sits 2pt closer to the picker than its highlight would put it: the plus is all thin arms, so the full gap reads wide. That offset is set by eye.
|
||||
|
||||
One gate, `resolveControlSizing`, picks touch or pointer sizing: touch when the layout is compact or the device has a touch screen. An iPad with the sidebar docked is wide and touch-sized; a desktop is pointer-sized; a phone is both compact and touch. The touch-screen fact is read once at startup (`hasTouchScreen` in `hooks/use-fine-pointer.ts`), so attaching a mouse or keyboard to a tablet never shrinks its controls. Stylesheets take sizes from `bySizing({ touch, pointer })`, which resolves to a breakpoint value, so a caller never sees which sizing it got. Rows, icon buttons and icon slots take theirs from `styles/density.ts`, which uses the same gate. An `{ xs, md }` literal for a hit target or glyph is wrong: on an iPad it yields the pointer size.
|
||||
One gate, `resolveControlSizing`, picks touch or pointer sizing: touch when the layout is compact or touch is the primary input. An iPad with the sidebar docked is wide and touch-sized; a desktop is pointer-sized; a phone is both compact and touch. The primary input comes from `(pointer: coarse)` (`hasTouchPrimaryPointer` in `hooks/pointer-capabilities.ts`), not from whether a touch screen exists: WebKit keeps touch primary on an iPad with a trackpad attached, and Chromium reports a fine primary pointer for a laptop with a touch screen that its trackpad drives. The fact is read once at startup: attaching a pointer to a tablet does not shrink its controls, and a 2-in-1 launched with a pointer keeps pointer sizes after it switches to tablet mode until the app reloads. Stylesheets take sizes from `bySizing({ touch, pointer })`, which resolves to a breakpoint value, so a caller never sees which sizing it got. Rows, icon buttons and icon slots take theirs from `styles/density.ts`, which uses the same gate. An `{ xs, md }` literal for a hit target or glyph is wrong: on an iPad it yields the pointer size.
|
||||
|
||||
Buttons are pills (`borderRadius.full`) with medium-weight labels; an icon-only button is a circle. `<Switch>` follows the same two sizes: a 34×20 track by default and in `sm`, 44×26 where controls are touch-sized, and it reserves its size's control height so a row holding one lines up with a row holding a button. Buttons, text fields, dropdown triggers, and `<SegmentedControl>` (`packages/app/src/components/ui/segmented-control.tsx`) share the size contract — the same size name means the same height and label size on every control kind, so controls in one row line up. Segments run tighter than a button, because the gap between segments already reads as padding. The selected segment is a `surface3` fill with `foreground` text, not an inverted one — inverting it inside thin chrome puts a white slab in the toolbar. A settings row sizes the controls in its trailing slot itself, default in a card and `sm` when nested (`packages/app/src/components/ui/control-size.tsx`), so don't pass a size to a button, dropdown or field placed in a row. Code that computes with a control's height outside a stylesheet uses `controlHeightForLayout`. Never shrink a control's font or padding locally to fit a context — if the context needs a smaller control, the size tier is missing or the wrong one is in use.
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ Do not replace the Linux implementation with `fs.watch({ recursive: true })`. No
|
||||
|
||||
Closing an observation must remain safe after its root is renamed or removed. Workspace archive removes owned worktrees while releasing observation references, so teardown cannot assume the watched path still exists.
|
||||
|
||||
`unsubscribe()` is an awaited barrier. Once it resolves, no scan, reconciliation, queued event, native handle, or callback may remain. `updateIgnore()` is the equivalent barrier for excluded paths: events queued below a newly excluded root cannot be delivered after it resolves. Treat path disappearance while scanning, attaching, or receiving a watcher error as rename/archive churn. Surface permission and resource errors so WorkspaceGit can enter bounded polling.
|
||||
`unsubscribe()` is an awaited barrier. Once it resolves, no scan, reconciliation, queued event, native handle, or callback may remain. `updateIgnore()` is the equivalent barrier for excluded paths: events queued below a newly excluded root cannot be delivered after it resolves. Treat path disappearance while scanning, attaching, or receiving a watcher error as rename/archive churn. Surface permission and resource errors so WorkspaceGit can enter bounded polling. `subscribe()` accepts an abort signal; aborting it before it resolves stops the startup scan and rejects. WorkspaceGit aborts every subscription that misses its setup deadline, because an abandoned scan otherwise keeps walking the tree. A timed-out directory retries on the recovery ladder (30 seconds doubling to five minutes), and each consecutive timeout keeps doubling the delay up to one hour. Under sustained CPU load the next scan misses the deadline too, and each attempt repeats the full scan. An accepted subscription resets the timeout streak. Degraded polling keeps its own cadence throughout.
|
||||
|
||||
Linux topology repair is trailing-debounced and scoped to the renamed path. A file rename needs one classification stat; a new or moved directory scans only its subtree. Full-tree scans are reserved for startup and ignore-set replacement. A subscription reports changes after `subscribe()` resolves, not the files that already existed. macOS FSEvents can still replay writes made moments before the stream started. Consumers read their initial state after `subscribe()` resolves; WorkspaceGit re-reads its checkout once observation setup completes, because its first refresh runs in parallel with setup. The Linux startup scan therefore emits nothing; only a scoped reconciliation of new topology reports files found before their directory's watcher was installed. Startup creates made every cold diff compute and discard a first revision. Benchmark startup cost with pre-populated trees.
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ The worker writes `$PASEO_HOME/terminal-worker/<pid>.json` (owner-only) with its
|
||||
- Workers never query their own birth time or command line. Readers accept legacy identity fields but ignore them. Daemons through 0.15.1 report new records unreadable and cannot adopt them.
|
||||
- Windows terminal programs have no recorded birth time and terminal lifecycle operations never launch PowerShell. Linux and macOS retain program birth-time checks through `ps` with `LC_ALL=C`; Linux also walks sessions to find surviving jobs.
|
||||
- Unix socket paths have a byte budget (103 on macOS, 107 on Linux). Long dev homes use an owner-only fallback under `$TMPDIR/paseo-<uid>/` or `/tmp/paseo-<uid>/`. An existing directory must be a real `0700` directory owned by you; a shared root is never chmodded.
|
||||
- A home on a filesystem that refuses Unix sockets (AFS, some network mounts) passes those checks and then fails the bind with `EPERM`, `EACCES`, `EOPNOTSUPP` or `ENOTSUP`. The worker moves on to the next directory on those codes only; any other listen error fails the start. The record carries the path the worker bound, so nothing else recomputes it.
|
||||
- A kill cleanup that cannot confirm every process gone writes `closing-<recordId>.json` beside the worker record. The worker rewrites its own record whenever a terminal starts or exits, so the kill intent has to live in a file it never writes. A closing record is never adopted; the next stop or start retries it.
|
||||
- An unreadable record of either kind makes `daemon status` and a kill restart fail with its path: a kill cleanup that met it could not check what it names, and leaves nothing else behind. A read that fails with `EPERM`, `EBUSY` or `EACCES` is retried for 250ms first: on Windows, opening a record while the worker renames its new copy over it fails that way for a moment.
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
- Background tasks: See and stop background tasks above the composer for Claude Code, Codex and OpenCode v2.
|
||||
- Built-in plugin gallery: Browse, search and install plugins without leaving Paseo. Manage their settings and updates from the same page.
|
||||
- Command center tabs: Switch between Workspaces, Files and Actions, with recent workspaces shown first. Search now includes archived workspaces and matches agent titles within their workspace.
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,5 @@
|
||||
- Background tasks: See and stop background tasks above the composer for Claude Code, Codex and OpenCode v2.
|
||||
- Built-in plugin gallery: Browse, search and install plugins without leaving Paseo. Manage their settings and updates from the same page.
|
||||
- Command center tabs: Switch between Workspaces, Files and Actions, with recent workspaces shown first. Search now includes archived workspaces and matches agent titles within their workspace.
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,5 @@
|
||||
- Background tasks: See and stop background tasks above the composer for Claude Code, Codex and OpenCode v2.
|
||||
- Built-in plugin gallery: Browse, search and install plugins without leaving Paseo. Manage their settings and updates from the same page.
|
||||
- Command center tabs: Switch between Workspaces, Files and Actions, with recent workspaces shown first. Search now includes archived workspaces and matches agent titles within their workspace.
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,5 @@
|
||||
- Background tasks: See and stop background tasks above the composer for Claude Code, Codex and OpenCode v2.
|
||||
- Built-in plugin gallery: Browse, search and install plugins without leaving Paseo. Manage their settings and updates from the same page.
|
||||
- Command center tabs: Switch between Workspaces, Files and Actions, with recent workspaces shown first. Search now includes archived workspaces and matches agent titles within their workspace.
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,6 @@
|
||||
Fixed
|
||||
- Fixed Claude Bypass approving actions without a permission card when a permissions.ask rule or a hook that returns ask required one
|
||||
- Fixed controls being touch-sized on a touch-screen laptop when a trackpad or mouse is its primary input
|
||||
- Fixed Claude sessions failing until /login when Paseo refreshed the Claude model list while Claude Code was renewing an expired access token
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,6 @@
|
||||
Fixed
|
||||
- Fixed Claude Bypass approving actions without a permission card when a permissions.ask rule or a hook that returns ask required one
|
||||
- Fixed controls being touch-sized on a touch-screen laptop when a trackpad or mouse is its primary input
|
||||
- Fixed Claude sessions failing until /login when Paseo refreshed the Claude model list while Claude Code was renewing an expired access token
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,6 @@
|
||||
Fixed
|
||||
- Fixed Claude Bypass approving actions without a permission card when a permissions.ask rule or a hook that returns ask required one
|
||||
- Fixed controls being touch-sized on a touch-screen laptop when a trackpad or mouse is its primary input
|
||||
- Fixed Claude sessions failing until /login when Paseo refreshed the Claude model list while Claude Code was renewing an expired access token
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,6 @@
|
||||
Fixed
|
||||
- Fixed Claude Bypass approving actions without a permission card when a permissions.ask rule or a hook that returns ask required one
|
||||
- Fixed controls being touch-sized on a touch-screen laptop when a trackpad or mouse is its primary input
|
||||
- Fixed Claude sessions failing until /login when Paseo refreshed the Claude model list while Claude Code was renewing an expired access token
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,8 @@
|
||||
Fixed
|
||||
- Fixed Collapse turns hiding a finished reply when Claude answers a later background task notification
|
||||
- Fixed detached worktree commits getting lost when archiving a workspace
|
||||
- Fixed Desktop updates leaving an older daemon running when an earlier Desktop session started it
|
||||
- Fixed daemons losing their Hub connection after execution permissions changed
|
||||
- Fixed saved hosts disappearing when one stored entry could not be read
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,8 @@
|
||||
Fixed
|
||||
- Fixed Collapse turns hiding a finished reply when Claude answers a later background task notification
|
||||
- Fixed detached worktree commits getting lost when archiving a workspace
|
||||
- Fixed Desktop updates leaving an older daemon running when an earlier Desktop session started it
|
||||
- Fixed daemons losing their Hub connection after execution permissions changed
|
||||
- Fixed saved hosts disappearing when one stored entry could not be read
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,8 @@
|
||||
Fixed
|
||||
- Fixed Collapse turns hiding a finished reply when Claude answers a later background task notification
|
||||
- Fixed detached worktree commits getting lost when archiving a workspace
|
||||
- Fixed Desktop updates leaving an older daemon running when an earlier Desktop session started it
|
||||
- Fixed daemons losing their Hub connection after execution permissions changed
|
||||
- Fixed saved hosts disappearing when one stored entry could not be read
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,8 @@
|
||||
Fixed
|
||||
- Fixed Collapse turns hiding a finished reply when Claude answers a later background task notification
|
||||
- Fixed detached worktree commits getting lost when archiving a workspace
|
||||
- Fixed Desktop updates leaving an older daemon running when an earlier Desktop session started it
|
||||
- Fixed daemons losing their Hub connection after execution permissions changed
|
||||
- Fixed saved hosts disappearing when one stored entry could not be read
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
+1
-1
@@ -1 +1 @@
|
||||
sha256-e6BNeOJvy1uyDe/XW9hdr7NBgJ+t9tlNum5oLNefREI=
|
||||
sha256-hN+Klz3jXugHs5MsVzIQIwIa/HGbpdJ04qolKvbsOuk=
|
||||
|
||||
Generated
+65
-65
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "paseo",
|
||||
"version": "0.16.0-beta.2",
|
||||
"version": "0.16.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "paseo",
|
||||
"version": "0.16.0-beta.2",
|
||||
"version": "0.16.2",
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
"workspaces": [
|
||||
@@ -130,22 +130,22 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk": {
|
||||
"version": "0.3.246",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk/-/claude-agent-sdk-0.3.246.tgz",
|
||||
"integrity": "sha512-FtR0HoHHNqeqJWjZN8qLUAzZVFUI9ztXYNPPwv98Ecmv9qq2QTauI8IzkY26CC0mleWAqb9RQEW2C0OtiUliug==",
|
||||
"version": "0.3.326",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk/-/claude-agent-sdk-0.3.326.tgz",
|
||||
"integrity": "sha512-BUTSky/4YWfL/MxC+4kV0NDbJFjbJPoQMFEk/s9G6hV9LUfYPMbsWz94bFQ7ZIo2ubj2xwJ2c2NVxkNlQhVw+Q==",
|
||||
"license": "SEE LICENSE IN README.md",
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
"node": ">=18.14.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.246",
|
||||
"@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.246",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.246",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.246",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.246",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.246",
|
||||
"@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.246",
|
||||
"@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.246"
|
||||
"@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.326",
|
||||
"@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.326",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.326",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.326",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.326",
|
||||
"@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.326",
|
||||
"@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.326",
|
||||
"@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.326"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@anthropic-ai/sdk": ">=0.93.0",
|
||||
@@ -154,9 +154,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-darwin-arm64": {
|
||||
"version": "0.3.246",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-arm64/-/claude-agent-sdk-darwin-arm64-0.3.246.tgz",
|
||||
"integrity": "sha512-pYDv2RT+UVOvEapMEWKf7Gm5a87Si1Zf+XR23IMGYbG5mESatNJ8Gz2PmkrwfTezZknb0ljWZe8zgcTFITM3dA==",
|
||||
"version": "0.3.326",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-arm64/-/claude-agent-sdk-darwin-arm64-0.3.326.tgz",
|
||||
"integrity": "sha512-D3ZbowCMdKNet0YPZlsJxdJUW1t1Q8KLy1BwNd+5eilf18TlCRtWZlm8DrewFLmu/gxBK7gcsq6uysrIVbPyQg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -167,9 +167,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-darwin-x64": {
|
||||
"version": "0.3.246",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-x64/-/claude-agent-sdk-darwin-x64-0.3.246.tgz",
|
||||
"integrity": "sha512-yl+gMMFUQ8++SBaxUe2JxBqU0LOJO4HZTsWWTOrH5kRlTRhdQDF/lESsoNXCHgfF/+77YNKgef0h+rl/D12Jfg==",
|
||||
"version": "0.3.326",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-x64/-/claude-agent-sdk-darwin-x64-0.3.326.tgz",
|
||||
"integrity": "sha512-m8K3Im2S8STdAVBrriuDZyJcnjsu/Vc3476wIOqTAefnCCdtdZ4AHcOcWxt+4KIHE5Vx1qT2qacTRrQBaVVweA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -180,9 +180,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-linux-arm64": {
|
||||
"version": "0.3.246",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64/-/claude-agent-sdk-linux-arm64-0.3.246.tgz",
|
||||
"integrity": "sha512-t7AEewD7bcjZYMmrfFLjsUSxPo4z+5J5O5cC9V2zOvAhNkefdMeGWI2/1cdqZxuaOiFVt46byjlZuiNNunF+bQ==",
|
||||
"version": "0.3.326",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64/-/claude-agent-sdk-linux-arm64-0.3.326.tgz",
|
||||
"integrity": "sha512-nYVN8jCcH490DCXIvby7rllzQFxLzKeKClfo2u/yv7mx3ipZQv344caULL/amwZ8w8GUzYyZ8hnS6pI9goSq+A==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -193,9 +193,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-linux-arm64-musl": {
|
||||
"version": "0.3.246",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64-musl/-/claude-agent-sdk-linux-arm64-musl-0.3.246.tgz",
|
||||
"integrity": "sha512-AeiDXveuA9dVRDouSRiQzL40P3dOuJPfZOlwwsFNbVUN0D+06WtwgmeWYnyRG4dxsM67Pf4lYcRZ0x9pfEZUwQ==",
|
||||
"version": "0.3.326",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64-musl/-/claude-agent-sdk-linux-arm64-musl-0.3.326.tgz",
|
||||
"integrity": "sha512-baSsuP2/wuWujRpHjKT4WkJB5lhttqKq9jcTfY2KRtQpylbk8E5PWcct/pmwJfNCKIUoE8CD+JpmoWzsdd5Ajw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -206,9 +206,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-linux-x64": {
|
||||
"version": "0.3.246",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64/-/claude-agent-sdk-linux-x64-0.3.246.tgz",
|
||||
"integrity": "sha512-BIbBlJ6x7Cys6UFvahUfce26H+U+Q4tLWjKRD39AaV7JvRav8/vfdFytzWq6E+h9hT1OOWYuPYx2gMn5vDhZhQ==",
|
||||
"version": "0.3.326",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64/-/claude-agent-sdk-linux-x64-0.3.326.tgz",
|
||||
"integrity": "sha512-WMhDY07gk2O0E8FXTbrVYmPjSLFaYPDCPwsNueVxm6vZ7ek+lPaKuOMAxTb1K07TzSmTOexoWeX2Y9VrbVDMpw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -219,9 +219,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-linux-x64-musl": {
|
||||
"version": "0.3.246",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64-musl/-/claude-agent-sdk-linux-x64-musl-0.3.246.tgz",
|
||||
"integrity": "sha512-+3PrWX3qXgakO3tZImr7keKFry5XIkbHBEaUxgi3/RtPmxGwS+JdVAr0xxzOoC2F6Y66Kn0lUnztRnZHORBc+Q==",
|
||||
"version": "0.3.326",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64-musl/-/claude-agent-sdk-linux-x64-musl-0.3.326.tgz",
|
||||
"integrity": "sha512-kK9VO3uFqNd4wgeU0Cefluam5AdPu6mvF1nn6aboGy8TA5NoxlWTmA4/AwMhK39zK1S9Q2OjeX0JtAahYlIchw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -232,9 +232,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-win32-arm64": {
|
||||
"version": "0.3.246",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-arm64/-/claude-agent-sdk-win32-arm64-0.3.246.tgz",
|
||||
"integrity": "sha512-JV8b28OJ8d+EMVEVIWlN3aEkT8uSehO3ZN/PJzXFG7Jgn56oVYUew4aY9vK4jao/4E4mdfzvs358w4HcTBUzVw==",
|
||||
"version": "0.3.326",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-arm64/-/claude-agent-sdk-win32-arm64-0.3.326.tgz",
|
||||
"integrity": "sha512-S+Ai+HhGRVFfTDmYWRfTrdWF3b4KMsfLSThZCqRJ0WCOKOXrRShMKV1hqqHBljx/wkMDPCpY0V/9S/e6w57eGQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -245,9 +245,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/@anthropic-ai/claude-agent-sdk-win32-x64": {
|
||||
"version": "0.3.246",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-x64/-/claude-agent-sdk-win32-x64-0.3.246.tgz",
|
||||
"integrity": "sha512-omI65bYGynLpE1Ybijk56K1wBnt0H6WujNwlg1LzIdeHrYmpUxoqncK92xKH5kb9XWUz3byHqArbv7wsT+M/2A==",
|
||||
"version": "0.3.326",
|
||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-x64/-/claude-agent-sdk-win32-x64-0.3.326.tgz",
|
||||
"integrity": "sha512-Yn1gZXYFuHmjHz7SpHx4TqDcRDsC8TfwWcntJdYjFzMWm+caPAp6QRqr/aTvirjqVA1D+D8Rd29xhuytpE3xTQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -37468,7 +37468,7 @@
|
||||
},
|
||||
"packages/app": {
|
||||
"name": "@getpaseo/app",
|
||||
"version": "0.16.0-beta.2",
|
||||
"version": "0.16.2",
|
||||
"dependencies": {
|
||||
"@codemirror/commands": "6.10.4",
|
||||
"@codemirror/language": "6.12.4",
|
||||
@@ -39637,13 +39637,13 @@
|
||||
},
|
||||
"packages/cli": {
|
||||
"name": "@getpaseo/cli",
|
||||
"version": "0.16.0-beta.2",
|
||||
"version": "0.16.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@clack/prompts": "^1.0.0",
|
||||
"@getpaseo/client": "0.16.0-beta.2",
|
||||
"@getpaseo/protocol": "0.16.0-beta.2",
|
||||
"@getpaseo/server": "0.16.0-beta.2",
|
||||
"@getpaseo/client": "0.16.2",
|
||||
"@getpaseo/protocol": "0.16.2",
|
||||
"@getpaseo/server": "0.16.2",
|
||||
"chalk": "^5.3.0",
|
||||
"commander": "^12.0.0",
|
||||
"mime-types": "^2.1.35",
|
||||
@@ -39890,11 +39890,11 @@
|
||||
},
|
||||
"packages/client": {
|
||||
"name": "@getpaseo/client",
|
||||
"version": "0.16.0-beta.2",
|
||||
"version": "0.16.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@getpaseo/protocol": "0.16.0-beta.2",
|
||||
"@getpaseo/relay": "0.16.0-beta.2",
|
||||
"@getpaseo/protocol": "0.16.2",
|
||||
"@getpaseo/relay": "0.16.2",
|
||||
"ws": "^8.20.0",
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
@@ -39906,7 +39906,7 @@
|
||||
},
|
||||
"packages/desktop": {
|
||||
"name": "@getpaseo/desktop",
|
||||
"version": "0.16.0-beta.2",
|
||||
"version": "0.16.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@getpaseo/cli": "*",
|
||||
@@ -40149,7 +40149,7 @@
|
||||
},
|
||||
"packages/expo-two-way-audio": {
|
||||
"name": "@getpaseo/expo-two-way-audio",
|
||||
"version": "0.16.0-beta.2",
|
||||
"version": "0.16.2",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.14",
|
||||
@@ -40195,7 +40195,7 @@
|
||||
},
|
||||
"packages/highlight": {
|
||||
"name": "@getpaseo/highlight",
|
||||
"version": "0.16.0-beta.2",
|
||||
"version": "0.16.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@codemirror/language": "6.12.4",
|
||||
@@ -40225,7 +40225,7 @@
|
||||
},
|
||||
"packages/plugin": {
|
||||
"name": "@getpaseo/plugin",
|
||||
"version": "0.16.0-beta.2",
|
||||
"version": "0.16.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "^1.4.0",
|
||||
@@ -40233,8 +40233,8 @@
|
||||
"use-sync-external-store": "^1.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@getpaseo/client": "0.16.0-beta.2",
|
||||
"@getpaseo/protocol": "0.16.0-beta.2",
|
||||
"@getpaseo/client": "0.16.2",
|
||||
"@getpaseo/protocol": "0.16.2",
|
||||
"@types/node": "^20.9.0",
|
||||
"@types/react": "~19.2.0",
|
||||
"react": "19.2.3",
|
||||
@@ -40244,8 +40244,8 @@
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@getpaseo/client": "0.16.0-beta.2",
|
||||
"@getpaseo/protocol": "0.16.0-beta.2",
|
||||
"@getpaseo/client": "0.16.2",
|
||||
"@getpaseo/protocol": "0.16.2",
|
||||
"react": ">=19.1.0 <20",
|
||||
"react-native": ">=0.81.5",
|
||||
"zod": "^4.4.3"
|
||||
@@ -40267,7 +40267,7 @@
|
||||
},
|
||||
"packages/protocol": {
|
||||
"name": "@getpaseo/protocol",
|
||||
"version": "0.16.0-beta.2",
|
||||
"version": "0.16.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"semver": "^7.8.5",
|
||||
@@ -40295,7 +40295,7 @@
|
||||
},
|
||||
"packages/relay": {
|
||||
"name": "@getpaseo/relay",
|
||||
"version": "0.16.0-beta.2",
|
||||
"version": "0.16.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@noble/ciphers": "^2.4.0",
|
||||
@@ -40517,17 +40517,17 @@
|
||||
},
|
||||
"packages/server": {
|
||||
"name": "@getpaseo/server",
|
||||
"version": "0.16.0-beta.2",
|
||||
"version": "0.16.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "^0.17.1",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.246",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.326",
|
||||
"@anthropic-ai/sdk": "^0.104.2",
|
||||
"@getpaseo/client": "0.16.0-beta.2",
|
||||
"@getpaseo/highlight": "0.16.0-beta.2",
|
||||
"@getpaseo/plugin": "0.16.0-beta.2",
|
||||
"@getpaseo/protocol": "0.16.0-beta.2",
|
||||
"@getpaseo/relay": "0.16.0-beta.2",
|
||||
"@getpaseo/client": "0.16.2",
|
||||
"@getpaseo/highlight": "0.16.2",
|
||||
"@getpaseo/plugin": "0.16.2",
|
||||
"@getpaseo/protocol": "0.16.2",
|
||||
"@getpaseo/relay": "0.16.2",
|
||||
"@isaacs/ttlcache": "^2.1.4",
|
||||
"@modelcontextprotocol/sdk": "1.29.0",
|
||||
"@opencode-ai/sdk": "1.14.46",
|
||||
@@ -41474,7 +41474,7 @@
|
||||
},
|
||||
"packages/website": {
|
||||
"name": "@getpaseo/website",
|
||||
"version": "0.16.0-beta.2",
|
||||
"version": "0.16.2",
|
||||
"dependencies": {
|
||||
"@cloudflare/vite-plugin": "^1.29.1",
|
||||
"@cloudflare/workers-types": "^4.20260317.1",
|
||||
@@ -43084,7 +43084,7 @@
|
||||
},
|
||||
"plugins": {
|
||||
"name": "@getpaseo/builtin-plugins",
|
||||
"version": "0.16.0-beta.2",
|
||||
"version": "0.16.2",
|
||||
"dependencies": {
|
||||
"@getpaseo/plugin": "*",
|
||||
"zod": "^4.4.3"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "paseo",
|
||||
"version": "0.16.0-beta.2",
|
||||
"version": "0.16.2",
|
||||
"private": true,
|
||||
"description": "Paseo: voice-controlled development environment for local AI coding agents",
|
||||
"keywords": [
|
||||
|
||||
@@ -466,12 +466,12 @@ test("downloads a file over direct TCP with its original filename and bytes", as
|
||||
await gotoWorkspace(page, workspace.workspaceId);
|
||||
await openFileExplorer(page);
|
||||
|
||||
const daemonRequest = page.waitForRequest("**/api/files/download?*");
|
||||
const downloaded = await downloadFileFromExplorer(page, fileName);
|
||||
const url = new URL(downloaded.url());
|
||||
expect(url.protocol).toBe("http:");
|
||||
expect(url.port).toBe(getE2EDaemonPort());
|
||||
expect(url.pathname).toBe("/api/files/download");
|
||||
expect(url.searchParams.get("token")).toBeTruthy();
|
||||
const requestUrl = new URL((await daemonRequest).url());
|
||||
expect(requestUrl.port).toBe(getE2EDaemonPort());
|
||||
expect(requestUrl.searchParams.get("token")).toBeTruthy();
|
||||
expect(new URL(downloaded.url()).protocol).toBe("blob:");
|
||||
expect(downloaded.suggestedFilename()).toBe(fileName);
|
||||
const savedFile = testInfo.outputPath(fileName);
|
||||
await downloaded.saveAs(savedFile);
|
||||
@@ -479,6 +479,45 @@ test("downloads a file over direct TCP with its original filename and bytes", as
|
||||
expect(await readFile(savedFile)).toEqual(source);
|
||||
});
|
||||
|
||||
test("keeps the app open and shows the error when the host rejects a download", async ({
|
||||
page,
|
||||
}, testInfo) => {
|
||||
const fileName = "removed-during-download.bin";
|
||||
const filePath = path.join(workspace.workspaceDirectory, fileName);
|
||||
const source = Buffer.from([0, 1, 2, 255]);
|
||||
await writeFile(filePath, source);
|
||||
await gotoWorkspace(page, workspace.workspaceId);
|
||||
await openFileExplorer(page);
|
||||
const workspaceUrl = page.url();
|
||||
|
||||
// The file disappears after the token is issued, so the real daemon answers 404.
|
||||
await page.route(
|
||||
"**/api/files/download?*",
|
||||
async (route) => {
|
||||
await rm(filePath);
|
||||
await route.continue();
|
||||
},
|
||||
{ times: 1 },
|
||||
);
|
||||
await page
|
||||
.getByTestId("file-explorer-tree-scroll")
|
||||
.getByText(fileName, { exact: true })
|
||||
.click({ button: "right" });
|
||||
await page.getByRole("menuitem", { name: "Download", exact: true }).click();
|
||||
|
||||
await expect(
|
||||
page.getByText("Failed to download file (HTTP 404).", { exact: true }),
|
||||
).toBeVisible();
|
||||
expect(page.url()).toBe(workspaceUrl);
|
||||
|
||||
await writeFile(filePath, source);
|
||||
const downloaded = await downloadFileFromExplorer(page, fileName);
|
||||
const savedFile = testInfo.outputPath(fileName);
|
||||
await downloaded.saveAs(savedFile);
|
||||
expect(await readFile(savedFile)).toEqual(source);
|
||||
expect(page.url()).toBe(workspaceUrl);
|
||||
});
|
||||
|
||||
test("downloads an unsupported binary from its preview with original filename and bytes", async ({
|
||||
page,
|
||||
}, testInfo) => {
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
import { expect, type Page } from "@playwright/test";
|
||||
import { test } from "../support/fixtures";
|
||||
import { gotoAppShell, openSettings } from "../support/helpers/app";
|
||||
import { renameHostFromSettings } from "../support/helpers/hosts";
|
||||
import { getServerId } from "../support/helpers/server-id";
|
||||
import { openHostSection, selectSettingsHost } from "../support/helpers/settings";
|
||||
|
||||
const REGISTRY_KEY = "@paseo:daemon-registry";
|
||||
const SEED_NONCE_KEY = "@paseo:e2e-seed-nonce";
|
||||
const DISABLE_DEFAULT_SEED_ONCE_KEY = "@paseo:e2e-disable-default-seed-once";
|
||||
|
||||
// What a build with a connection kind this one doesn't know leaves in the registry: an extra
|
||||
// connection on a host this build can reach, and a host reached only through it.
|
||||
const UNKNOWN_CONNECTION = { id: "future:garage", type: "futureKind", address: "garage" };
|
||||
const UNKNOWN_HOST = {
|
||||
serverId: "srv_e2e_unknown_connection_host",
|
||||
label: "Unknown connection host",
|
||||
connections: [{ id: "future:roof", type: "futureKind", address: "roof" }],
|
||||
preferredConnectionId: "future:roof",
|
||||
};
|
||||
const OFFLINE_HOST = {
|
||||
serverId: "srv_e2e_saved_offline_host",
|
||||
label: "Saved offline host",
|
||||
password: "e2e-fake-password",
|
||||
connections: [{ id: "direct:127.0.0.1:59999", type: "directTcp", endpoint: "127.0.0.1:59999" }],
|
||||
preferredConnectionId: "direct:127.0.0.1:59999",
|
||||
};
|
||||
|
||||
interface StoredHost {
|
||||
serverId: string;
|
||||
label?: string;
|
||||
password?: string;
|
||||
connections: unknown[];
|
||||
}
|
||||
|
||||
async function addUnreadableEntriesAndReload(page: Page): Promise<void> {
|
||||
await page.evaluate(
|
||||
({ keys, primaryServerId, unknownConnection, offlineHost, unknownHost }) => {
|
||||
const nonce = localStorage.getItem(keys.nonce);
|
||||
if (!nonce) {
|
||||
throw new Error("Expected the e2e seed nonce before overriding the host registry.");
|
||||
}
|
||||
const registry: StoredHost[] = JSON.parse(localStorage.getItem(keys.registry) ?? "[]");
|
||||
registry
|
||||
.find((host) => host.serverId === primaryServerId)
|
||||
?.connections.push(unknownConnection);
|
||||
registry.push(offlineHost, unknownHost);
|
||||
localStorage.setItem(keys.registry, JSON.stringify(registry));
|
||||
localStorage.setItem(keys.disableSeedOnce, nonce);
|
||||
},
|
||||
{
|
||||
keys: {
|
||||
registry: REGISTRY_KEY,
|
||||
nonce: SEED_NONCE_KEY,
|
||||
disableSeedOnce: DISABLE_DEFAULT_SEED_ONCE_KEY,
|
||||
},
|
||||
primaryServerId: getServerId(),
|
||||
unknownConnection: UNKNOWN_CONNECTION,
|
||||
offlineHost: OFFLINE_HOST,
|
||||
unknownHost: UNKNOWN_HOST,
|
||||
},
|
||||
);
|
||||
await page.reload();
|
||||
}
|
||||
|
||||
async function readStoredRegistry(page: Page): Promise<StoredHost[] | null> {
|
||||
return page.evaluate((key) => JSON.parse(localStorage.getItem(key) ?? "null"), REGISTRY_KEY);
|
||||
}
|
||||
|
||||
async function readStoredHost(page: Page, serverId: string): Promise<StoredHost | undefined> {
|
||||
return (await readStoredRegistry(page))?.find((host) => host.serverId === serverId);
|
||||
}
|
||||
|
||||
test("saved hosts survive a registry entry this build can't read, and saving keeps it", async ({
|
||||
page,
|
||||
}) => {
|
||||
await gotoAppShell(page);
|
||||
await addUnreadableEntriesAndReload(page);
|
||||
|
||||
await test.step("both readable hosts are listed", async () => {
|
||||
await page.getByTestId("sidebar-hosts-trigger").click();
|
||||
await expect(page.getByTestId(`sidebar-host-row-${getServerId()}`)).toBeVisible();
|
||||
await expect(page.getByTestId(`sidebar-host-row-${OFFLINE_HOST.serverId}`)).toBeVisible();
|
||||
await expect(page.getByTestId(`sidebar-host-row-${UNKNOWN_HOST.serverId}`)).toHaveCount(0);
|
||||
await page.keyboard.press("Escape");
|
||||
});
|
||||
|
||||
await test.step("renaming a host keeps its password and the entries it can't read", async () => {
|
||||
await openSettings(page);
|
||||
await selectSettingsHost(page, OFFLINE_HOST.serverId);
|
||||
await openHostSection(page, OFFLINE_HOST.serverId, "host");
|
||||
await renameHostFromSettings(page, "Renamed offline host");
|
||||
|
||||
await expect
|
||||
.poll(() => readStoredHost(page, OFFLINE_HOST.serverId))
|
||||
.toMatchObject({ label: "Renamed offline host", password: OFFLINE_HOST.password });
|
||||
const stored = await readStoredRegistry(page);
|
||||
expect(stored?.map((host) => host.serverId)).toEqual([
|
||||
getServerId(),
|
||||
OFFLINE_HOST.serverId,
|
||||
UNKNOWN_HOST.serverId,
|
||||
]);
|
||||
expect(stored?.[0]?.connections).toContainEqual(UNKNOWN_CONNECTION);
|
||||
expect(stored?.[2]).toEqual(UNKNOWN_HOST);
|
||||
});
|
||||
});
|
||||
@@ -33,6 +33,8 @@ import {
|
||||
expectNoHostPasswordControls,
|
||||
removeHostFromHostPage,
|
||||
addDirectHostFromSettings,
|
||||
expectAddHostFieldDrawnAsInput,
|
||||
selectHostConnectionType,
|
||||
expectHostOnlineWithoutError,
|
||||
expectIdleAgentRelease,
|
||||
editRestartRecoveryPrompt,
|
||||
@@ -307,6 +309,24 @@ async function closeAddHostAndChangeTheme(page: import("@playwright/test").Page)
|
||||
await page.keyboard.press("Control+Alt+t");
|
||||
}
|
||||
|
||||
test("Add host draws its text fields as bordered inputs", async ({ page }) => {
|
||||
await gotoAppShell(page);
|
||||
|
||||
await test.step("the pairing link field", async () => {
|
||||
await openSidebarAddHost(page);
|
||||
await selectHostConnectionType(page, "relay");
|
||||
await expectAddHostFieldDrawnAsInput(page, "pair-link-input");
|
||||
await page.getByTestId("pair-link-cancel").click();
|
||||
});
|
||||
|
||||
await test.step("the direct connection fields", async () => {
|
||||
await selectHostConnectionType(page, "direct");
|
||||
await expectAddHostFieldDrawnAsInput(page, "direct-host-input");
|
||||
await expectAddHostFieldDrawnAsInput(page, "direct-port-input");
|
||||
await expectAddHostFieldDrawnAsInput(page, "direct-password-input");
|
||||
});
|
||||
});
|
||||
|
||||
test("sidebar Add host completes without navigating", async ({ page }) => {
|
||||
await gotoAppShell(page);
|
||||
await expect(page).toHaveURL(/\/open-project$/);
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
import { expect, test } from "../support/fixtures";
|
||||
import { gotoAppShell } from "../support/helpers/app";
|
||||
import {
|
||||
expectFooterActionsInline,
|
||||
seedDockedSidebarWidth,
|
||||
} from "../support/helpers/sidebar-footer-overflow";
|
||||
|
||||
// Chromium's pointer bitmasks expose both inputs while the mouse is primary.
|
||||
test.use({
|
||||
viewport: { width: 1280, height: 800 },
|
||||
launchOptions: {
|
||||
args: [
|
||||
"--blink-settings=primaryPointerType=4,availablePointerTypes=6,primaryHoverType=2,availableHoverTypes=3",
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
test("a touchscreen laptop keeps sidebar actions visible with a fine primary pointer", async ({
|
||||
page,
|
||||
}) => {
|
||||
await seedDockedSidebarWidth(page, 200);
|
||||
await gotoAppShell(page);
|
||||
expect(
|
||||
await page.evaluate(() => ({
|
||||
finePrimary: matchMedia("(pointer: fine)").matches,
|
||||
touchScreen: matchMedia("(any-pointer: coarse)").matches,
|
||||
})),
|
||||
).toEqual({ finePrimary: true, touchScreen: true });
|
||||
await expectFooterActionsInline(page, [
|
||||
"sidebar-add-project",
|
||||
"sidebar-usage-icon",
|
||||
"sidebar-hosts-trigger",
|
||||
"sidebar-help",
|
||||
"sidebar-settings",
|
||||
]);
|
||||
});
|
||||
@@ -361,6 +361,10 @@ test.describe("Worktree restore", () => {
|
||||
cwd: backingWorktree.workspaceDirectory,
|
||||
stdio: "pipe",
|
||||
});
|
||||
const originalHead = execFileSync("git", ["rev-parse", "HEAD"], {
|
||||
cwd: backingWorktree.workspaceDirectory,
|
||||
encoding: "utf8",
|
||||
}).trim();
|
||||
const created = await worktreeClient.createWorkspace({
|
||||
source: { kind: "directory", path: backingWorktree.workspaceDirectory },
|
||||
title: "Sample workspace",
|
||||
@@ -389,10 +393,7 @@ test.describe("Worktree restore", () => {
|
||||
await page.getByTestId(`agent-row-${getServerId()}-${agent.id}`).click();
|
||||
await expect(page.getByText("Workspace archived", { exact: true })).toBeVisible();
|
||||
await expect(
|
||||
page.getByText(
|
||||
"Restore Sample workspace to return to its agents. A new branch will start from the saved base or the repository default.",
|
||||
{ exact: true },
|
||||
),
|
||||
page.getByText("Restore Sample workspace to return to its agents.", { exact: true }),
|
||||
).toBeVisible();
|
||||
await captureBranchlessRestoreStep(page, "01-restore-workspace.png");
|
||||
|
||||
@@ -409,17 +410,13 @@ test.describe("Worktree restore", () => {
|
||||
cwd: backingWorktree.workspaceDirectory,
|
||||
encoding: "utf8",
|
||||
}).trim();
|
||||
const defaultHead = execFileSync("git", ["rev-parse", "main"], {
|
||||
cwd: tempRepo.path,
|
||||
encoding: "utf8",
|
||||
}).trim();
|
||||
expect(restoredHead).toBe(defaultHead);
|
||||
expect(restoredHead).toBe(originalHead);
|
||||
expect(
|
||||
execFileSync("git", ["branch", "--show-current"], {
|
||||
cwd: backingWorktree.workspaceDirectory,
|
||||
encoding: "utf8",
|
||||
}).trim(),
|
||||
).toMatch(/^restored\//);
|
||||
).toBe("");
|
||||
});
|
||||
|
||||
test("restore failure stays visible and permits a successful retry", async ({ page }) => {
|
||||
|
||||
@@ -97,18 +97,15 @@ export class ImportSessionFlow {
|
||||
await target.scrollIntoViewIfNeeded();
|
||||
await expect(target).toBeInViewport();
|
||||
}
|
||||
/**
|
||||
* Scrolls the virtualized list, the only one that leaves rows unmounted. A row handle is no way
|
||||
* in: the list unmounts rows as it scrolls, and a detached row has no scroller above it.
|
||||
*/
|
||||
private async scrollList(forward: boolean) {
|
||||
await this.page
|
||||
.locator('[data-testid^="import-session-session-"]')
|
||||
.first()
|
||||
.evaluate((row, advance) => {
|
||||
let element = row.parentElement;
|
||||
while (element && !["auto", "scroll"].includes(getComputedStyle(element).overflowY))
|
||||
element = element.parentElement;
|
||||
if (!element) throw new Error("Import list has no scroll owner");
|
||||
element.scrollTop = advance ? element.scrollTop + element.clientHeight * 0.8 : 0;
|
||||
element.dispatchEvent(new Event("scroll"));
|
||||
}, forward);
|
||||
await this.page.getByTestId("import-session-list").evaluate((list, advance) => {
|
||||
list.scrollTop = advance ? list.scrollTop + list.clientHeight * 0.8 : 0;
|
||||
list.dispatchEvent(new Event("scroll"));
|
||||
}, forward);
|
||||
}
|
||||
async search(query: string) {
|
||||
await this.page.getByTestId("import-session-search").fill(query);
|
||||
@@ -120,11 +117,18 @@ export class ImportSessionFlow {
|
||||
await this.page.getByTestId("import-session-search").fill("");
|
||||
await expect(this.page.getByTestId("import-session-load-more")).toBeVisible();
|
||||
}
|
||||
/** Load more keeps the reader down the list instead of sending them back to the top. */
|
||||
async loadMore() {
|
||||
await this.page.getByTestId("import-session-load-more").click();
|
||||
const loadMore = this.page.getByTestId("import-session-load-more");
|
||||
const topRow = this.page.getByTestId((await this.rowIds())[0]!);
|
||||
await expect(topRow).toBeInViewport();
|
||||
await loadMore.click();
|
||||
// The next page is the last and short, so the button leaves once it lands.
|
||||
await expect(loadMore).toHaveCount(0);
|
||||
await expect(this.page.getByText("Loading sessions...", { exact: true })).toHaveCount(0);
|
||||
await expect(topRow).not.toBeInViewport();
|
||||
await this.revealSession("fixture-root-20");
|
||||
await expect(this.page.getByText("Root session 20", { exact: true })).toBeInViewport();
|
||||
await expect(this.page.getByTestId("import-session-load-more")).toHaveCount(0);
|
||||
}
|
||||
async retryProvider(provider: string, label: string) {
|
||||
await this.expectProviderError(label);
|
||||
|
||||
@@ -223,6 +223,14 @@ export async function addDirectHostFromSettings(
|
||||
await expect(page.getByTestId("add-host-modal")).toHaveCount(0, { timeout: 30_000 });
|
||||
}
|
||||
|
||||
export async function expectAddHostFieldDrawnAsInput(page: Page, testId: string): Promise<void> {
|
||||
const field = page.getByTestId(testId);
|
||||
await expect(field).toBeVisible();
|
||||
await expect(field).toHaveCSS("border-top-width", "1px");
|
||||
await expect(field).not.toHaveCSS("padding-left", "0px");
|
||||
await expect(field).not.toHaveCSS("background-color", "rgba(0, 0, 0, 0)");
|
||||
}
|
||||
|
||||
export async function toggleHostAdvanced(page: Page): Promise<void> {
|
||||
await page.getByTestId("direct-host-advanced-toggle").click();
|
||||
}
|
||||
|
||||
@@ -60,14 +60,8 @@ export function footerOverflowMenu(page: Page): Locator {
|
||||
return page.getByTestId("sidebar-footer-overflow-menu");
|
||||
}
|
||||
|
||||
/**
|
||||
* The icon line shows exactly `testIDs`, in order, each `controlSize` square and wholly inside the
|
||||
* line's box, so no button is cut off by the sidebar's edge.
|
||||
*/
|
||||
export async function expectFooterLine(
|
||||
page: Page,
|
||||
input: { testIDs: string[]; controlSize: number },
|
||||
): Promise<void> {
|
||||
/** The icon line shows exactly `testIDs`, in order. */
|
||||
export async function expectFooterActionsInline(page: Page, testIDs: string[]): Promise<void> {
|
||||
const line = footerLine(page);
|
||||
await expect(line).toHaveCount(1);
|
||||
await expect
|
||||
@@ -76,7 +70,16 @@ export async function expectFooterLine(
|
||||
.locator(FOOTER_LINE_TEST_IDS.map((testID) => `[data-testid="${testID}"]`).join(","))
|
||||
.evaluateAll((elements) => elements.map((element) => element.getAttribute("data-testid"))),
|
||||
)
|
||||
.toEqual(input.testIDs);
|
||||
.toEqual(testIDs);
|
||||
}
|
||||
|
||||
/** The actions are square and fit inside the line. */
|
||||
export async function expectFooterLine(
|
||||
page: Page,
|
||||
input: { testIDs: string[]; controlSize: number },
|
||||
): Promise<void> {
|
||||
await expectFooterActionsInline(page, input.testIDs);
|
||||
const line = footerLine(page);
|
||||
const { row, buttons } = await line.evaluate((element, testIDs) => {
|
||||
const rect = (node: Element) => {
|
||||
const { x, width, height } = node.getBoundingClientRect();
|
||||
|
||||
@@ -15,6 +15,5 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.facebook.react:react-android'
|
||||
testImplementation "junit:junit:4.13.2"
|
||||
}
|
||||
|
||||
+3
-25
@@ -1,48 +1,26 @@
|
||||
package sh.paseo.trace
|
||||
|
||||
import android.os.Trace
|
||||
import com.facebook.react.bridge.UiThreadUtil
|
||||
import com.facebook.react.bridge.ReactContext
|
||||
import expo.modules.kotlin.modules.Module
|
||||
import expo.modules.kotlin.modules.ModuleDefinition
|
||||
|
||||
class PaseoNativeTraceModule : Module() {
|
||||
private var recorder: DiagnosticRecorder? = null
|
||||
private var touches: TouchDiagnostics? = null
|
||||
|
||||
override fun definition() = ModuleDefinition {
|
||||
Name("PaseoNativeTrace")
|
||||
|
||||
Function("startRecorder") { metadata: Map<String, String> ->
|
||||
if (recorder == null) {
|
||||
(appContext.reactContext as? ReactContext)?.let { context ->
|
||||
val sink = DiagnosticRecorder(context.applicationContext, metadata)
|
||||
recorder = sink
|
||||
UiThreadUtil.runOnUiThread {
|
||||
if (recorder === sink) {
|
||||
touches = TouchDiagnostics(context, sink::record).also { it.start(appContext.currentActivity?.window) }
|
||||
}
|
||||
}
|
||||
}
|
||||
appContext.reactContext?.applicationContext?.let { recorder = DiagnosticRecorder(it, metadata) }
|
||||
}
|
||||
HeartbeatTiming.intervalMs
|
||||
}
|
||||
Function("record") { name: String, data: Map<String, String> -> recorder?.record(name, data) }
|
||||
Function("heartbeat") { recorder?.heartbeat() }
|
||||
OnActivityEntersForeground {
|
||||
recorder?.active(true)
|
||||
UiThreadUtil.runOnUiThread { touches?.activity(appContext.currentActivity?.window) }
|
||||
}
|
||||
OnActivityEntersForeground { recorder?.active(true) }
|
||||
OnActivityEntersBackground { recorder?.active(false) }
|
||||
OnDestroy {
|
||||
val sink = recorder
|
||||
recorder = null
|
||||
UiThreadUtil.runOnUiThread {
|
||||
touches?.close()
|
||||
touches = null
|
||||
sink?.close()
|
||||
}
|
||||
}
|
||||
OnDestroy { recorder?.close(); recorder = null }
|
||||
|
||||
Function("beginSection") { name: String ->
|
||||
Trace.beginSection(name.take(127))
|
||||
|
||||
-141
@@ -1,141 +0,0 @@
|
||||
package sh.paseo.trace
|
||||
|
||||
import android.graphics.Rect
|
||||
import android.os.Build
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.Window
|
||||
import android.view.WindowInsets
|
||||
import com.facebook.react.R
|
||||
import com.facebook.react.bridge.ReactContext
|
||||
import com.facebook.react.bridge.UiThreadUtil
|
||||
import com.facebook.react.interfaces.ExtraWindowEventListener
|
||||
import com.facebook.react.uimanager.ReactPointerEventsView
|
||||
import com.facebook.react.uimanager.TouchTargetHelper
|
||||
import com.facebook.react.uimanager.RootView
|
||||
|
||||
/** Temporary touch evidence. Only attached while the diagnostic recorder is running. */
|
||||
internal class TouchDiagnostics(
|
||||
private val context: ReactContext,
|
||||
private val write: (String, Map<String, String>) -> Unit,
|
||||
) : ExtraWindowEventListener {
|
||||
private val windows = mutableMapOf<Window, TouchCallback>()
|
||||
private var nextWindow = 0
|
||||
private var activityWindow: Window? = null
|
||||
|
||||
fun start(window: Window?) {
|
||||
UiThreadUtil.assertOnUiThread()
|
||||
context.addExtraWindowEventListener(this)
|
||||
activity(window)
|
||||
}
|
||||
|
||||
fun activity(window: Window?) {
|
||||
if (activityWindow === window) return
|
||||
activityWindow?.let { release(it) }
|
||||
activityWindow = window
|
||||
window?.let { observe(it) }
|
||||
}
|
||||
|
||||
override fun onExtraWindowCreate(window: Window) = observe(window)
|
||||
override fun onExtraWindowDestroy(window: Window) = release(window)
|
||||
|
||||
private fun observe(window: Window) {
|
||||
if (windows.containsKey(window)) return
|
||||
val callback = TouchCallback(window, window.callback, ++nextWindow, write)
|
||||
windows[window] = callback
|
||||
window.callback = callback
|
||||
write("touch.window.open", mapOf("window" to "$nextWindow"))
|
||||
}
|
||||
|
||||
private fun release(window: Window) {
|
||||
val callback = windows.remove(window) ?: return
|
||||
// Another observer may wrap ours. Disable it even when we cannot unwrap its owner.
|
||||
callback.active = false
|
||||
if (window.callback === callback) window.callback = callback.previous
|
||||
write("touch.window.close", mapOf("window" to "${callback.id}"))
|
||||
}
|
||||
|
||||
fun close() {
|
||||
context.removeExtraWindowEventListener(this)
|
||||
windows.keys.toList().forEach { release(it) }
|
||||
activityWindow = null
|
||||
}
|
||||
}
|
||||
|
||||
private class TouchCallback(
|
||||
private val window: Window,
|
||||
val previous: Window.Callback,
|
||||
val id: Int,
|
||||
private val write: (String, Map<String, String>) -> Unit,
|
||||
) : Window.Callback by previous {
|
||||
var active = true
|
||||
override fun dispatchTouchEvent(event: MotionEvent): Boolean {
|
||||
val boundary = event.actionMasked == MotionEvent.ACTION_DOWN ||
|
||||
event.actionMasked == MotionEvent.ACTION_UP || event.actionMasked == MotionEvent.ACTION_CANCEL
|
||||
if (!active || !boundary) return previous.dispatchTouchEvent(event)
|
||||
val fields = mutableMapOf(
|
||||
"window" to "$id", "gesture" to "${event.downTime}",
|
||||
"action" to "${event.actionMasked}", "eventMs" to "${event.eventTime}",
|
||||
"x" to "${event.x}", "y" to "${event.y}",
|
||||
"imeVisible" to if (Build.VERSION.SDK_INT >= 30) "${window.decorView.rootWindowInsets?.isVisible(WindowInsets.Type.ime())}" else "unsupported",
|
||||
"imeBottom" to if (Build.VERSION.SDK_INT >= 30) "${window.decorView.rootWindowInsets?.getInsets(WindowInsets.Type.ime())?.bottom}" else "unsupported",
|
||||
"focus" to describe(window.currentFocus),
|
||||
)
|
||||
// This is a hit-test prediction, not proof that the eventual responder accepted the press.
|
||||
// Use RN's own pointer-events and transformed-coordinate rules, rather than approximating them.
|
||||
val root = reactRootAt(window.decorView, event.x.toInt(), event.y.toInt())
|
||||
if (root != null) {
|
||||
try {
|
||||
val origin = IntArray(2)
|
||||
root.getLocationOnScreen(origin)
|
||||
val path = TouchTargetHelper.findTargetPathAndCoordinatesForTouch(event.rawX - origin[0], event.rawY - origin[1], root, FloatArray(2))
|
||||
path.take(10).forEachIndexed { index, target ->
|
||||
fields["hit$index"] = "${target.getViewId()}:${describe(target.getView())}"
|
||||
}
|
||||
} catch (error: RuntimeException) {
|
||||
fields["hitError"] = error.javaClass.simpleName
|
||||
}
|
||||
}
|
||||
write("touch.window.before", fields)
|
||||
val handled = previous.dispatchTouchEvent(event)
|
||||
write("touch.window.after", mapOf(
|
||||
"window" to "$id", "gesture" to "${event.downTime}",
|
||||
"action" to "${event.actionMasked}", "handled" to "$handled",
|
||||
"focus" to describe(window.currentFocus),
|
||||
))
|
||||
return handled
|
||||
}
|
||||
}
|
||||
|
||||
private fun describe(view: View?): String {
|
||||
if (view == null) return "none"
|
||||
// Deliberately omit text, accessibility labels, nativeID, and content descriptions.
|
||||
val pointer = (view as? ReactPointerEventsView)?.pointerEvents
|
||||
val testId = (view.getTag(R.id.react_test_id) as? String)?.takeIf { it in diagnosticTestIds } ?: ""
|
||||
return "${view.javaClass.simpleName}#$testId/${view.id};p=$pointer;a=${view.alpha};enabled=${view.isEnabled};frame=${view.left},${view.top},${view.width},${view.height};translation=${view.translationX},${view.translationY}"
|
||||
}
|
||||
|
||||
// Other test IDs include user-controlled entity IDs. Keep only fixed surface names.
|
||||
private val diagnosticTestIds = setOf(
|
||||
"message-input-root", "composer-fullscreen", "composer-viewport", "composer-viewport-content",
|
||||
"composer-dock-content", "composer-track-scroll", "agent-list-backdrop", "file-explorer-backdrop",
|
||||
"workspace-create-submit", "new-workspace-launch-submit", "compact-provider-list",
|
||||
)
|
||||
|
||||
// Expo's developer menu adds a full-window Compose host above the React root. It passes ordinary
|
||||
// touches through, but RN's helper cannot traverse that host. Start at the actual React surface;
|
||||
// native modal windows expose a separate RootView and receive their own observation.
|
||||
private fun reactRootAt(view: View, x: Int, y: Int): ViewGroup? {
|
||||
if (view.visibility != View.VISIBLE || view.alpha == 0f) return null
|
||||
// getGlobalVisibleRect is relative to the window root, including for offset/freeform windows.
|
||||
val bounds = Rect()
|
||||
if (!view.getGlobalVisibleRect(bounds) || !bounds.contains(x, y)) return null
|
||||
if (view is RootView && view is ViewGroup) return view
|
||||
if (view is ViewGroup) {
|
||||
for (index in view.childCount - 1 downTo 0) {
|
||||
reactRootAt(view.getChildAt(index), x, y)?.let { return it }
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/app",
|
||||
"version": "0.16.0-beta.2",
|
||||
"version": "0.16.2",
|
||||
"private": true,
|
||||
"main": "index.ts",
|
||||
"scripts": {
|
||||
|
||||
@@ -17,6 +17,11 @@ export function nextPageLimit(limit: number): number {
|
||||
return PAGE_LIMITS.find((candidate) => candidate > limit) ?? limit;
|
||||
}
|
||||
|
||||
/** The page Load more grew this limit from, or null for the first page. */
|
||||
export function previousPageLimit(limit: number): number | null {
|
||||
return PAGE_LIMITS.findLast((candidate) => candidate < limit) ?? null;
|
||||
}
|
||||
|
||||
export function requiresImportSessionsHostUpgrade(input: {
|
||||
supportsSnapshot: boolean;
|
||||
workspaceId?: string | null;
|
||||
|
||||
@@ -1172,6 +1172,44 @@ describe("ImportSessionSheet", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("keeps the loaded list in place while Load more fetches the next page", async () => {
|
||||
let releaseNextPage: () => void = () => undefined;
|
||||
const nextPage = new Promise<void>((resolve) => {
|
||||
releaseNextPage = resolve;
|
||||
});
|
||||
const fetchRecentProviderSessions = vi.fn(async (options: { limit?: number } | undefined) => {
|
||||
if (options?.limit !== 15) await nextPage;
|
||||
return {
|
||||
requestId: "recent-provider-sessions",
|
||||
entries: createPageOfEntries(options?.limit === 15 ? 15 : 20),
|
||||
};
|
||||
});
|
||||
|
||||
renderSheet(createRecentSessionsClient(fetchRecentProviderSessions, vi.fn()), {
|
||||
cwd: null,
|
||||
snapshot: { supportsSnapshot: true, entries: [createSnapshotEntry("claude")] },
|
||||
});
|
||||
|
||||
fireEvent.click(await screen.findByTestId("import-session-load-more"));
|
||||
// The list the user scrolled to Load more is the one they keep: replacing it would drop
|
||||
// them back at the top, behind a loading state, until the larger page lands.
|
||||
const list = screen.getByTestId("import-session-list");
|
||||
await waitFor(() => {
|
||||
expect(fetchRecentProviderSessions).toHaveBeenCalledWith({
|
||||
providers: ["claude"],
|
||||
limit: 45,
|
||||
});
|
||||
});
|
||||
expect(screen.getByTestId("import-session-list")).toBe(list);
|
||||
expect(screen.queryByText("Loading sessions...")).toBeNull();
|
||||
|
||||
releaseNextPage();
|
||||
await waitFor(() => {
|
||||
expect(screen.queryByTestId("import-session-load-more")).toBeNull();
|
||||
});
|
||||
expect(screen.getByTestId("import-session-list")).toBe(list);
|
||||
});
|
||||
|
||||
it("stops the refresh spinner and retries only the failed provider", async () => {
|
||||
const fetchRecentProviderSessions = vi.fn(
|
||||
async (options: { providers?: string[] } | undefined) => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { type ReactNode, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { Pressable, type PressableStateCallbackType, Text, View } from "react-native";
|
||||
import { keepPreviousData, useMutation, useQueries, useQueryClient } from "@tanstack/react-query";
|
||||
import { useMutation, useQueries, useQueryClient, type QueryClient } from "@tanstack/react-query";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import type {
|
||||
DaemonClient,
|
||||
@@ -40,6 +40,7 @@ import {
|
||||
resolveDirectoryLabel,
|
||||
nextPageLimit,
|
||||
PER_PROVIDER_LIMIT,
|
||||
previousPageLimit,
|
||||
type ProviderErrorRow,
|
||||
resolveImportTarget,
|
||||
resolveProvidersToFetch,
|
||||
@@ -100,11 +101,12 @@ interface SessionsQueryConfig {
|
||||
// Query's default retry would keep the header spinner turning and pile up
|
||||
// in-flight daemon requests behind a dead provider (#2512).
|
||||
retry: false;
|
||||
placeholderData: typeof keepPreviousData;
|
||||
placeholderData: () => RecentSessionsResponse | undefined;
|
||||
queryFn: () => Promise<RecentSessionsResponse>;
|
||||
}
|
||||
|
||||
function buildSessionsQueriesConfig(args: {
|
||||
queryClient: QueryClient;
|
||||
providersToFetch: AgentProvider[] | null;
|
||||
visible: boolean;
|
||||
client: RecentProviderSessionsClient | null;
|
||||
@@ -113,14 +115,24 @@ function buildSessionsQueriesConfig(args: {
|
||||
limit: number;
|
||||
hostDisconnectedMessage?: string;
|
||||
}): SessionsQueryConfig[] {
|
||||
const { providersToFetch, visible, client, cwd, query, limit, hostDisconnectedMessage } = args;
|
||||
const { queryClient, providersToFetch, visible, client, cwd, query, limit } = args;
|
||||
const { hostDisconnectedMessage } = args;
|
||||
if (providersToFetch === null) return [];
|
||||
const enabled = visible && Boolean(client);
|
||||
const previousLimit = previousPageLimit(limit);
|
||||
return providersToFetch.map((provider) => ({
|
||||
queryKey: buildSessionsQueryKey({ cwd, query, limit, provider }),
|
||||
enabled,
|
||||
retry: false as const,
|
||||
placeholderData: keepPreviousData,
|
||||
// While Load more fetches the next page, keep showing the page it grew from. React Query's
|
||||
// keepPreviousData cannot do this here: useQueries gives a changed key a new observer, which
|
||||
// has no previous data, so the rows would vanish and the list would remount at the top.
|
||||
placeholderData: () =>
|
||||
previousLimit === null
|
||||
? undefined
|
||||
: queryClient.getQueryData<RecentSessionsResponse>(
|
||||
buildSessionsQueryKey({ cwd, query, limit: previousLimit, provider }),
|
||||
),
|
||||
queryFn: async () => {
|
||||
if (!client) {
|
||||
throw new Error(hostDisconnectedMessage ?? i18n.t("workspace.terminal.hostDisconnected"));
|
||||
@@ -522,6 +534,7 @@ export function ImportSessionSheet({
|
||||
const queriesConfig = useMemo(
|
||||
() =>
|
||||
buildSessionsQueriesConfig({
|
||||
queryClient,
|
||||
providersToFetch,
|
||||
visible,
|
||||
client,
|
||||
@@ -530,7 +543,7 @@ export function ImportSessionSheet({
|
||||
limit: pageLimit,
|
||||
hostDisconnectedMessage: t("workspace.terminal.hostDisconnected"),
|
||||
}),
|
||||
[providersToFetch, visible, client, scopeCwd, query, pageLimit, t],
|
||||
[queryClient, providersToFetch, visible, client, scopeCwd, query, pageLimit, t],
|
||||
);
|
||||
|
||||
const queries = useQueries({ queries: queriesConfig });
|
||||
|
||||
@@ -68,24 +68,27 @@ const theme = {
|
||||
} as unknown as Theme;
|
||||
|
||||
describe("control sizing gate", () => {
|
||||
it("is touch-sized in the compact layout or on a touch screen, and pointer-sized otherwise", () => {
|
||||
expect(resolveControlSizing({ compactLayout: true, touchScreen: true })).toBe("touch");
|
||||
expect(resolveControlSizing({ compactLayout: true, touchScreen: false })).toBe("touch");
|
||||
expect(resolveControlSizing({ compactLayout: false, touchScreen: true })).toBe("touch");
|
||||
expect(resolveControlSizing({ compactLayout: false, touchScreen: false })).toBe("pointer");
|
||||
it("is touch-sized in the compact layout or where touch is the primary input, and pointer-sized otherwise", () => {
|
||||
expect(resolveControlSizing({ compactLayout: true, touchPrimaryPointer: true })).toBe("touch");
|
||||
expect(resolveControlSizing({ compactLayout: true, touchPrimaryPointer: false })).toBe("touch");
|
||||
expect(resolveControlSizing({ compactLayout: false, touchPrimaryPointer: true })).toBe("touch");
|
||||
expect(resolveControlSizing({ compactLayout: false, touchPrimaryPointer: false })).toBe(
|
||||
"pointer",
|
||||
);
|
||||
});
|
||||
|
||||
it("gives a touch screen its touch sizes at every width", () => {
|
||||
it("gives a touch primary pointer its touch sizes at every width", () => {
|
||||
const sizes = { touch: 44, pointer: 32 };
|
||||
|
||||
// An iPad: touch-sized in the docked desktop layout too.
|
||||
expect(bySizing(sizes, true)).toEqual({ xs: 44, md: 44 });
|
||||
// A mouse-driven window: touch-sized only once it narrows into the compact layout.
|
||||
// A mouse- or trackpad-driven window, touch screen or not: touch-sized only once it narrows
|
||||
// into the compact layout.
|
||||
expect(bySizing(sizes, false)).toEqual({ xs: 44, md: 32 });
|
||||
});
|
||||
|
||||
it("keeps a device without a touch screen on pointer sizes from md up", () => {
|
||||
// The unit runtime has no touch screen, which is the desktop that must not change.
|
||||
it("keeps a device without a touch primary pointer on pointer sizes from md up", () => {
|
||||
// The unit runtime has no touch primary pointer, which is the desktop that must not change.
|
||||
expect(controlSizingForLayout(false)).toBe("pointer");
|
||||
expect(controlSizingForLayout(true)).toBe("touch");
|
||||
expect(CONTROL_HEIGHTS.md).toEqual({ xs: 44, md: 32 });
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { hasTouchScreen } from "@/hooks/pointer-capabilities";
|
||||
import { hasTouchPrimaryPointer } from "@/hooks/pointer-capabilities";
|
||||
|
||||
// The sizing gate, apart from the control sizes so that low-level modules such as
|
||||
// `constants/layout` can size by it without loading the theme. Import it through
|
||||
@@ -14,28 +14,32 @@ export type ControlSizing = "touch" | "pointer";
|
||||
export interface ControlSizingFacts {
|
||||
/** The layout is below the `md` breakpoint. */
|
||||
compactLayout: boolean;
|
||||
/** The device has a touch screen; see `hasTouchScreen`. */
|
||||
touchScreen: boolean;
|
||||
/** Touch is the device's primary input; see `hasTouchPrimaryPointer`. */
|
||||
touchPrimaryPointer: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* The one sizing gate: touch-sized in the compact layout or on any device with a touch screen,
|
||||
* pointer-sized otherwise. A touch screen keeps touch sizing when a mouse or keyboard is attached.
|
||||
* The one sizing gate: touch-sized in the compact layout or where touch is the primary input,
|
||||
* pointer-sized otherwise. An iPad keeps touch sizing with a trackpad attached; a laptop with a
|
||||
* touch screen that its trackpad drives is pointer-sized.
|
||||
*/
|
||||
export function resolveControlSizing({
|
||||
compactLayout,
|
||||
touchScreen,
|
||||
touchPrimaryPointer,
|
||||
}: ControlSizingFacts): ControlSizing {
|
||||
if (compactLayout || touchScreen) return "touch";
|
||||
if (compactLayout || touchPrimaryPointer) return "touch";
|
||||
return "pointer";
|
||||
}
|
||||
|
||||
// Read once, so attaching a mouse or keyboard later never flips the sizing.
|
||||
const DEVICE_HAS_TOUCH_SCREEN = hasTouchScreen();
|
||||
const DEVICE_HAS_TOUCH_PRIMARY_POINTER = hasTouchPrimaryPointer();
|
||||
|
||||
/** The sizing on this device for a layout, for code that sizes outside a stylesheet. */
|
||||
export function controlSizingForLayout(compactLayout: boolean): ControlSizing {
|
||||
return resolveControlSizing({ compactLayout, touchScreen: DEVICE_HAS_TOUCH_SCREEN });
|
||||
return resolveControlSizing({
|
||||
compactLayout,
|
||||
touchPrimaryPointer: DEVICE_HAS_TOUCH_PRIMARY_POINTER,
|
||||
});
|
||||
}
|
||||
|
||||
/** A Unistyles breakpoint value: one number in the compact layout, another from `md` up. */
|
||||
@@ -51,11 +55,11 @@ export type SizingValue = Record<ControlSizing, number>;
|
||||
*/
|
||||
export function bySizing(
|
||||
sizes: SizingValue,
|
||||
touchScreen: boolean = DEVICE_HAS_TOUCH_SCREEN,
|
||||
touchPrimaryPointer: boolean = DEVICE_HAS_TOUCH_PRIMARY_POINTER,
|
||||
): LayoutValue {
|
||||
return {
|
||||
xs: sizes[resolveControlSizing({ compactLayout: true, touchScreen })],
|
||||
md: sizes[resolveControlSizing({ compactLayout: false, touchScreen })],
|
||||
xs: sizes[resolveControlSizing({ compactLayout: true, touchPrimaryPointer })],
|
||||
md: sizes[resolveControlSizing({ compactLayout: false, touchPrimaryPointer })],
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { recordComposerCommand } from "@/composer/touch-diagnostics";
|
||||
import { forwardRef, useCallback, type ComponentProps } from "react";
|
||||
import { Text, View, type PressableStateCallbackType } from "react-native";
|
||||
import { StyleSheet } from "react-native-unistyles";
|
||||
@@ -62,18 +61,13 @@ export const AgentControlTrigger = forwardRef<View, AgentControlTriggerProps>(
|
||||
[disabled, isSheet, open, showToolbarLabel],
|
||||
);
|
||||
|
||||
const activate = useCallback(() => {
|
||||
recordComposerCommand("control");
|
||||
onPress();
|
||||
}, [onPress]);
|
||||
|
||||
return (
|
||||
<ComboboxTrigger
|
||||
{...triggerProps}
|
||||
ref={ref}
|
||||
collapsable={false}
|
||||
disabled={disabled}
|
||||
onPress={activate}
|
||||
onPress={onPress}
|
||||
style={triggerStyle}
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel={accessibilityLabel}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { recordComposerCommand } from "@/composer/touch-diagnostics";
|
||||
import { useCallback, useMemo, useState, type ReactNode } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {
|
||||
@@ -32,6 +31,7 @@ import {
|
||||
toolbarSlot,
|
||||
type ToolbarGlyphs,
|
||||
} from "@/components/ui/control-geometry";
|
||||
import { shortModelLabel } from "./utils";
|
||||
|
||||
const SNAP_POINTS = ["80%", "90%"];
|
||||
const MODEL_LIST_TOP_INSET = 4;
|
||||
@@ -67,11 +67,6 @@ interface CompactModelSheetProps {
|
||||
children: ReactNode;
|
||||
}
|
||||
|
||||
function shortModelLabel(label: string): string {
|
||||
const separatorIndex = label.lastIndexOf("/");
|
||||
return separatorIndex === -1 ? label : label.slice(separatorIndex + 1);
|
||||
}
|
||||
|
||||
function resolveModelSheetProfileActions(
|
||||
onCreateProfile: ((seed: AgentProfileSeed) => void) | undefined,
|
||||
onEditProfile: ((profileId: string) => void) | undefined,
|
||||
@@ -207,7 +202,6 @@ export function CompactModelSheet({
|
||||
);
|
||||
|
||||
const open = useCallback(() => {
|
||||
recordComposerCommand("model");
|
||||
Keyboard.dismiss();
|
||||
rootBrowser.showAll();
|
||||
setIsOpen(true);
|
||||
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
getAgentControlHintKey,
|
||||
normalizeModelId,
|
||||
resolveAgentModelSelection,
|
||||
shortModelLabel,
|
||||
} from "./utils";
|
||||
|
||||
describe("getAgentControlHintKey", () => {
|
||||
@@ -251,3 +252,19 @@ describe("resolveAgentModelSelection", () => {
|
||||
expect(selection.displayThinking).toBe("Max");
|
||||
});
|
||||
});
|
||||
|
||||
describe("shortModelLabel", () => {
|
||||
it("drops a provider namespace", () => {
|
||||
expect(shortModelLabel("openrouter/gpt-5.5")).toBe("gpt-5.5");
|
||||
expect(shortModelLabel("openrouter/google/gemini-2.5-flash")).toBe("gemini-2.5-flash");
|
||||
});
|
||||
|
||||
it("keeps slashes inside a display name", () => {
|
||||
expect(shortModelLabel("DeepSeek V4.1 Flash (~6-7 tok/s, 56/56)")).toBe(
|
||||
"DeepSeek V4.1 Flash (~6-7 tok/s, 56/56)",
|
||||
);
|
||||
expect(shortModelLabel("llama-swap/DeepSeek V4.1 Flash (56/56)")).toBe(
|
||||
"DeepSeek V4.1 Flash (56/56)",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -35,6 +35,12 @@ export function normalizeModelId(modelId: string | null | undefined): string | n
|
||||
return normalized;
|
||||
}
|
||||
|
||||
// Drops a provider namespace ("openrouter/gpt-5.5" -> "gpt-5.5") for the compact trigger.
|
||||
// A namespace segment has no spaces, so slashes inside a display name ("52/56") survive.
|
||||
export function shortModelLabel(label: string): string {
|
||||
return label.replace(/^(?:[^\s/]+\/)+(?=\S)/, "");
|
||||
}
|
||||
|
||||
export function getFeatureHighlightColor(featureId: string): FeatureHighlightColor {
|
||||
switch (featureId) {
|
||||
case FAST_MODE_FEATURE_ID:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { useComposerTouchDiagnostics, recordComposerCommand } from "@/composer/touch-diagnostics";
|
||||
import { useKeyboardFocusSurface } from "@/keyboard";
|
||||
import type { SendShortcut } from "@/hooks/use-settings";
|
||||
import {
|
||||
@@ -1762,7 +1761,6 @@ export const MessageInput = forwardRef<MessageInputRef, MessageInputProps>(
|
||||
}, [resetComposerHeight]);
|
||||
|
||||
const handleSendMessage = useCallback(() => {
|
||||
recordComposerCommand("send");
|
||||
const liveValue = textInputRef.current?.getText() ?? valueRef.current;
|
||||
if (!preserveHeightOnSubmit) {
|
||||
updateLiveTextPresence("");
|
||||
@@ -1792,18 +1790,19 @@ export const MessageInput = forwardRef<MessageInputRef, MessageInputProps>(
|
||||
exitFullscreen,
|
||||
]);
|
||||
|
||||
const handleQueueMessage = useCallback(() => {
|
||||
recordComposerCommand("queue");
|
||||
return queueMessageImpl({
|
||||
value: textInputRef.current?.getText() ?? valueRef.current,
|
||||
attachments,
|
||||
cwd,
|
||||
onQueue,
|
||||
replaceText,
|
||||
onMinimizeHeight: minimizeInputHeight,
|
||||
exitFullscreen,
|
||||
});
|
||||
}, [attachments, cwd, onQueue, replaceText, minimizeInputHeight, exitFullscreen]);
|
||||
const handleQueueMessage = useCallback(
|
||||
() =>
|
||||
queueMessageImpl({
|
||||
value: textInputRef.current?.getText() ?? valueRef.current,
|
||||
attachments,
|
||||
cwd,
|
||||
onQueue,
|
||||
replaceText,
|
||||
onMinimizeHeight: minimizeInputHeight,
|
||||
exitFullscreen,
|
||||
}),
|
||||
[attachments, cwd, onQueue, replaceText, minimizeInputHeight, exitFullscreen],
|
||||
);
|
||||
|
||||
const handleDefaultSendAction = useCallback(() => {
|
||||
runDefaultSendAction({
|
||||
@@ -2328,17 +2327,8 @@ export const MessageInput = forwardRef<MessageInputRef, MessageInputProps>(
|
||||
handleRealtimeVoiceStop,
|
||||
],
|
||||
);
|
||||
const touchDiagnostics = useComposerTouchDiagnostics({
|
||||
active: isPaneFocused,
|
||||
disabled,
|
||||
sendDisabled: isSendButtonDisabled,
|
||||
focused: isInputFocused,
|
||||
fullscreen: isFullscreen,
|
||||
voiceOverlay: showOverlay,
|
||||
});
|
||||
return (
|
||||
<View
|
||||
{...touchDiagnostics}
|
||||
ref={rootRef}
|
||||
style={
|
||||
isFullscreen
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
import { useEffect } from "react";
|
||||
import type { ComposerTouchState } from "./index";
|
||||
import { Keyboard, type GestureResponderEvent } from "react-native";
|
||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||
import { watchdog } from "@/watchdog";
|
||||
|
||||
/** Temporary companion to Android TouchDiagnostics. No draft text or identifiers are recorded. */
|
||||
export function recordComposerCommand(command: "send" | "queue" | "control" | "model"): void {
|
||||
watchdog?.record("touch.composer.command", { command });
|
||||
}
|
||||
|
||||
function useRecordedComposerTouches(state: ComposerTouchState) {
|
||||
const insets = useSafeAreaInsets();
|
||||
const { active, disabled, sendDisabled, focused, fullscreen, voiceOverlay } = state;
|
||||
useEffect(() => {
|
||||
if (!active) return;
|
||||
watchdog?.record("touch.composer.state", {
|
||||
disabled: String(disabled),
|
||||
sendDisabled: String(sendDisabled),
|
||||
focused: String(focused),
|
||||
fullscreen: String(fullscreen),
|
||||
voiceOverlay: String(voiceOverlay),
|
||||
});
|
||||
}, [active, disabled, sendDisabled, focused, fullscreen, voiceOverlay]);
|
||||
const record = (phase: string, event: GestureResponderEvent) => {
|
||||
if (!watchdog) return;
|
||||
const touch = event.nativeEvent;
|
||||
watchdog.record("touch.composer", {
|
||||
phase,
|
||||
target: String(touch.target),
|
||||
timestamp: String(touch.timestamp),
|
||||
x: String(touch.pageX),
|
||||
y: String(touch.pageY),
|
||||
disabled: String(state.disabled),
|
||||
sendDisabled: String(state.sendDisabled),
|
||||
focused: String(state.focused),
|
||||
fullscreen: String(state.fullscreen),
|
||||
voiceOverlay: String(state.voiceOverlay),
|
||||
keyboardVisible: String(Keyboard.isVisible()),
|
||||
keyboardHeight: String(Keyboard.metrics()?.height),
|
||||
safeBottom: String(insets.bottom),
|
||||
});
|
||||
};
|
||||
return watchdog
|
||||
? {
|
||||
onStartShouldSetResponderCapture(event: GestureResponderEvent) {
|
||||
record("capture", event);
|
||||
return false;
|
||||
},
|
||||
onTouchEnd: (event: GestureResponderEvent) => record("end", event),
|
||||
onTouchCancel: (event: GestureResponderEvent) => record("cancel", event),
|
||||
}
|
||||
: {};
|
||||
}
|
||||
|
||||
function useNoComposerTouches(_state: ComposerTouchState) {
|
||||
return {};
|
||||
}
|
||||
|
||||
// Build configuration is fixed for the module lifetime. Ordinary builds subscribe to nothing.
|
||||
export const useComposerTouchDiagnostics = watchdog
|
||||
? useRecordedComposerTouches
|
||||
: useNoComposerTouches;
|
||||
@@ -1,14 +0,0 @@
|
||||
/** Temporary diagnostics are Android-only. Metro selects index.android.ts on Android. */
|
||||
export interface ComposerTouchState {
|
||||
active: boolean;
|
||||
disabled: boolean;
|
||||
sendDisabled: boolean;
|
||||
focused: boolean;
|
||||
fullscreen: boolean;
|
||||
voiceOverlay: boolean;
|
||||
}
|
||||
|
||||
export function recordComposerCommand(_command: "send" | "queue" | "control" | "model"): void {}
|
||||
export function useComposerTouchDiagnostics(_state: ComposerTouchState) {
|
||||
return {};
|
||||
}
|
||||
@@ -23,10 +23,18 @@ class FakeMediaQueryList {
|
||||
}
|
||||
}
|
||||
|
||||
function createFakeDisplay(initial: { finePointer: boolean; touchScreen: boolean }) {
|
||||
function createFakeDisplay(initial: {
|
||||
finePointer: boolean;
|
||||
touchScreen: boolean;
|
||||
touchPrimaryPointer?: boolean;
|
||||
}) {
|
||||
const queries = {
|
||||
finePointer: new FakeMediaQueryList("(hover: hover) and (pointer: fine)", initial.finePointer),
|
||||
touchScreen: new FakeMediaQueryList("(any-pointer: coarse)", initial.touchScreen),
|
||||
touchPrimaryPointer: new FakeMediaQueryList(
|
||||
"(pointer: coarse)",
|
||||
initial.touchPrimaryPointer ?? false,
|
||||
),
|
||||
};
|
||||
const matchMedia = (query: string) => {
|
||||
const match = Object.values(queries).find((list) => list.media === query);
|
||||
@@ -75,3 +83,25 @@ describe("pointer capabilities", () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("hasTouchPrimaryPointer", () => {
|
||||
it("is false on a touch-screen laptop driven by its trackpad", () => {
|
||||
const display = createFakeDisplay({ finePointer: true, touchScreen: true });
|
||||
expect(createPointerCapabilitiesSource(display.matchMedia).hasTouchPrimaryPointer()).toBe(
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
it("is true when the primary pointer is coarse", () => {
|
||||
const display = createFakeDisplay({
|
||||
finePointer: false,
|
||||
touchScreen: true,
|
||||
touchPrimaryPointer: true,
|
||||
});
|
||||
expect(createPointerCapabilitiesSource(display.matchMedia).hasTouchPrimaryPointer()).toBe(true);
|
||||
});
|
||||
|
||||
it("is false without media queries", () => {
|
||||
expect(createPointerCapabilitiesSource(null).hasTouchPrimaryPointer()).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -8,6 +8,7 @@ import { isWeb } from "@/constants/platform";
|
||||
// (detachable keyboards, tablet mode, devtools touch emulation).
|
||||
const FINE_POINTER_QUERY = "(hover: hover) and (pointer: fine)";
|
||||
const TOUCH_SCREEN_QUERY = "(any-pointer: coarse)";
|
||||
const TOUCH_PRIMARY_POINTER_QUERY = "(pointer: coarse)";
|
||||
|
||||
export interface PointerCapabilities {
|
||||
/** A mouse-like pointer drives the UI. */
|
||||
@@ -21,6 +22,7 @@ type MatchMedia = (query: string) => MediaQueryList;
|
||||
export interface PointerCapabilitiesSource {
|
||||
getSnapshot: () => PointerCapabilities;
|
||||
subscribe: (onChange: () => void) => () => void;
|
||||
hasTouchPrimaryPointer: () => boolean;
|
||||
}
|
||||
|
||||
export function createPointerCapabilitiesSource(
|
||||
@@ -28,9 +30,11 @@ export function createPointerCapabilitiesSource(
|
||||
): PointerCapabilitiesSource {
|
||||
const finePointerQuery = matchMedia?.(FINE_POINTER_QUERY) ?? null;
|
||||
const touchScreenQuery = matchMedia?.(TOUCH_SCREEN_QUERY) ?? null;
|
||||
const touchPrimaryPointerQuery = matchMedia?.(TOUCH_PRIMARY_POINTER_QUERY) ?? null;
|
||||
let snapshot: PointerCapabilities = { finePointer: false, touchScreen: false };
|
||||
|
||||
return {
|
||||
hasTouchPrimaryPointer: () => touchPrimaryPointerQuery?.matches ?? false,
|
||||
getSnapshot() {
|
||||
const finePointer = finePointerQuery?.matches ?? false;
|
||||
const touchScreen = touchScreenQuery?.matches ?? false;
|
||||
@@ -61,6 +65,7 @@ const NATIVE_POINTER_CAPABILITIES: PointerCapabilities = { finePointer: false, t
|
||||
const nativeSource: PointerCapabilitiesSource = {
|
||||
getSnapshot: () => NATIVE_POINTER_CAPABILITIES,
|
||||
subscribe: () => () => {},
|
||||
hasTouchPrimaryPointer: () => true,
|
||||
};
|
||||
|
||||
const source = isWeb ? createPointerCapabilitiesSource(browserMatchMedia()) : nativeSource;
|
||||
@@ -79,10 +84,11 @@ export function hasFinePointer(): boolean {
|
||||
return source.getSnapshot().finePointer;
|
||||
}
|
||||
|
||||
/** Touch sizing remains enabled on hybrid browsers that report touch points. */
|
||||
export function hasTouchScreen(): boolean {
|
||||
return (
|
||||
source.getSnapshot().touchScreen ||
|
||||
(isWeb && typeof window !== "undefined" && window.navigator.maxTouchPoints > 0)
|
||||
);
|
||||
/**
|
||||
* True when touch is the primary input, read at call time. iPadOS keeps touch primary with a
|
||||
* trackpad attached; a laptop with a touch screen that its trackpad drives reports a fine primary
|
||||
* pointer.
|
||||
*/
|
||||
export function hasTouchPrimaryPointer(): boolean {
|
||||
return source.hasTouchPrimaryPointer();
|
||||
}
|
||||
|
||||
@@ -431,7 +431,7 @@ function AddHostModalContent({ visible, onClose, onCancel, onSaved }: AddHostMod
|
||||
<View style={styles.portRow}>
|
||||
<View style={hostFieldStyle}>
|
||||
<Text style={styles.label}>{t("pairing.direct.fields.host")}</Text>
|
||||
<ThemedAdaptiveTextInput
|
||||
<AdaptiveTextInput
|
||||
testID="direct-host-input"
|
||||
nativeID="direct-host-input"
|
||||
accessibilityLabel={t("pairing.direct.fields.host")}
|
||||
@@ -449,7 +449,7 @@ function AddHostModalContent({ visible, onClose, onCancel, onSaved }: AddHostMod
|
||||
</View>
|
||||
<View style={portFieldStyle}>
|
||||
<Text style={styles.label}>{t("pairing.direct.fields.port")}</Text>
|
||||
<ThemedAdaptiveTextInput
|
||||
<AdaptiveTextInput
|
||||
testID="direct-port-input"
|
||||
nativeID="direct-port-input"
|
||||
accessibilityLabel={t("pairing.direct.fields.port")}
|
||||
@@ -491,7 +491,7 @@ function AddHostModalContent({ visible, onClose, onCancel, onSaved }: AddHostMod
|
||||
<View style={styles.field}>
|
||||
<Text style={styles.label}>{t("pairing.direct.fields.password")}</Text>
|
||||
<View style={styles.passwordRow}>
|
||||
<ThemedAdaptiveTextInput
|
||||
<AdaptiveTextInput
|
||||
testID="direct-password-input"
|
||||
nativeID="direct-password-input"
|
||||
accessibilityLabel={t("pairing.direct.fields.password")}
|
||||
@@ -539,7 +539,7 @@ function AddHostModalContent({ visible, onClose, onCancel, onSaved }: AddHostMod
|
||||
<Text style={styles.advancedText}>{t("pairing.direct.advanced.label")}</Text>
|
||||
</PressHighlight>
|
||||
{isAdvancedOpen ? (
|
||||
<ThemedAdaptiveTextInput
|
||||
<AdaptiveTextInput
|
||||
testID="direct-host-uri-input"
|
||||
nativeID="direct-host-uri-input"
|
||||
accessibilityLabel={t("pairing.direct.fields.connectionUri")}
|
||||
@@ -598,7 +598,3 @@ const ThemedChevronRight = withUnistyles(ChevronRight, (theme) => ({
|
||||
const ThemedEye = withUnistyles(Eye, (theme) => ({ color: theme.colors.foregroundMuted }));
|
||||
|
||||
const ThemedEyeOff = withUnistyles(EyeOff, (theme) => ({ color: theme.colors.foregroundMuted }));
|
||||
|
||||
const ThemedAdaptiveTextInput = withUnistyles(AdaptiveTextInput, (theme) => ({
|
||||
placeholderTextColor: theme.colors.foregroundMuted,
|
||||
}));
|
||||
|
||||
@@ -212,7 +212,7 @@ function PairLinkModalContent({
|
||||
|
||||
<View style={styles.field}>
|
||||
<Text style={styles.label}>{t("pairing.link.label")}</Text>
|
||||
<ThemedAdaptiveTextInput
|
||||
<AdaptiveTextInput
|
||||
ref={inputRef}
|
||||
initialValue={initialUrl}
|
||||
testID="pair-link-input"
|
||||
@@ -234,11 +234,13 @@ function PairLinkModalContent({
|
||||
<Text style={styles.label}>
|
||||
{t("pairing.hostPassword.title", { host: parsedHostLabel(offerUrlRef.current) })}
|
||||
</Text>
|
||||
<ThemedAdaptiveTextInput
|
||||
<AdaptiveTextInput
|
||||
testID="pair-link-password-input"
|
||||
resetKey={`pair-link-password-${passwordResetKey}`}
|
||||
accessibilityLabel={t("pairing.hostPassword.label")}
|
||||
placeholder={t("pairing.hostPassword.label")}
|
||||
onChangeText={setPassword}
|
||||
autoFocus
|
||||
secureTextEntry
|
||||
style={styles.input}
|
||||
/>
|
||||
@@ -275,7 +277,3 @@ function PairLinkModalContent({
|
||||
}
|
||||
|
||||
const ThemedLink = withUnistyles(Link, (theme) => ({ color: theme.colors.accentForeground }));
|
||||
|
||||
const ThemedAdaptiveTextInput = withUnistyles(AdaptiveTextInput, (theme) => ({
|
||||
placeholderTextColor: theme.colors.foregroundMuted,
|
||||
}));
|
||||
|
||||
@@ -484,8 +484,7 @@ export const ar: TranslationResources = {
|
||||
archivedTitle: "مساحة العمل مؤرشفة",
|
||||
restoreDescription:
|
||||
"استعد {{workspaceName}} للعودة إلى وكلائها. ستستخدم شجرة العمل الفرع {{branch}}.",
|
||||
restoreWithoutBranchDescription:
|
||||
"استعد {{workspaceName}} للعودة إلى وكلائها. سيبدأ فرع جديد من الفرع الأساسي المحفوظ أو الفرع الافتراضي للمستودع.",
|
||||
restoreWithoutBranchDescription: "استعد {{workspaceName}} للعودة إلى وكلائها.",
|
||||
unarchiveDescription: "{{workspaceName}} مؤرشفة. ألغِ أرشفتها لفتحها مجددًا.",
|
||||
restoreAction: "استعادة",
|
||||
unarchiveAction: "إلغاء الأرشفة",
|
||||
@@ -2017,6 +2016,7 @@ export const ar: TranslationResources = {
|
||||
hostUnavailable: "مضيف التنزيل غير متاح.",
|
||||
cancelled: "تم إلغاء التنزيل.",
|
||||
failed: "فشل تنزيل الملف.",
|
||||
httpFailed: "فشل تنزيل الملف (HTTP {{status}}).",
|
||||
shareFile: "مشاركة الملف",
|
||||
shareFileNamed: "مشاركة{{fileName}}",
|
||||
},
|
||||
|
||||
@@ -483,8 +483,7 @@ export const en = {
|
||||
archivedTitle: "Workspace archived",
|
||||
restoreDescription:
|
||||
"Restore {{workspaceName}} to return to its agents. Its worktree will use branch {{branch}}.",
|
||||
restoreWithoutBranchDescription:
|
||||
"Restore {{workspaceName}} to return to its agents. A new branch will start from the saved base or the repository default.",
|
||||
restoreWithoutBranchDescription: "Restore {{workspaceName}} to return to its agents.",
|
||||
unarchiveDescription: "{{workspaceName}} is archived. Unarchive it to open it again.",
|
||||
restoreAction: "Restore",
|
||||
unarchiveAction: "Unarchive",
|
||||
@@ -2045,6 +2044,7 @@ export const en = {
|
||||
hostUnavailable: "Download host is unavailable.",
|
||||
cancelled: "Download was cancelled.",
|
||||
failed: "Failed to download file.",
|
||||
httpFailed: "Failed to download file (HTTP {{status}}).",
|
||||
shareFile: "Share file",
|
||||
shareFileNamed: "Share {{fileName}}",
|
||||
},
|
||||
|
||||
@@ -489,8 +489,7 @@ export const es: TranslationResources = {
|
||||
archivedTitle: "Espacio de trabajo archivado",
|
||||
restoreDescription:
|
||||
"Restaura {{workspaceName}} para volver a sus agentes. Su worktree usará la rama {{branch}}.",
|
||||
restoreWithoutBranchDescription:
|
||||
"Restaura {{workspaceName}} para volver a sus agentes. Se creará una rama nueva desde la base guardada o la rama predeterminada del repositorio.",
|
||||
restoreWithoutBranchDescription: "Restaura {{workspaceName}} para volver a sus agentes.",
|
||||
unarchiveDescription:
|
||||
"{{workspaceName}} está archivado. Desarchívalo para volver a abrirlo.",
|
||||
restoreAction: "Restaurar",
|
||||
@@ -2066,6 +2065,7 @@ export const es: TranslationResources = {
|
||||
hostUnavailable: "El host de descarga no está disponible.",
|
||||
cancelled: "La descarga fue cancelada.",
|
||||
failed: "No se pudo descargar el archivo.",
|
||||
httpFailed: "No se pudo descargar el archivo (HTTP {{status}}).",
|
||||
shareFile: "compartir archivo",
|
||||
shareFileNamed: "Compartir{{fileName}}",
|
||||
},
|
||||
|
||||
@@ -489,8 +489,7 @@ export const fr: TranslationResources = {
|
||||
archivedTitle: "Espace de travail archivé",
|
||||
restoreDescription:
|
||||
"Restaurez {{workspaceName}} pour retrouver ses agents. Son worktree utilisera la branche {{branch}}.",
|
||||
restoreWithoutBranchDescription:
|
||||
"Restaurez {{workspaceName}} pour retrouver ses agents. Une nouvelle branche partira de la base enregistrée ou de la branche par défaut du dépôt.",
|
||||
restoreWithoutBranchDescription: "Restaurez {{workspaceName}} pour retrouver ses agents.",
|
||||
unarchiveDescription: "{{workspaceName}} est archivé. Désarchivez-le pour le rouvrir.",
|
||||
restoreAction: "Restaurer",
|
||||
unarchiveAction: "Désarchiver",
|
||||
@@ -2065,6 +2064,7 @@ export const fr: TranslationResources = {
|
||||
hostUnavailable: "L’hôte de téléchargement est indisponible.",
|
||||
cancelled: "Téléchargement annulé.",
|
||||
failed: "Impossible de télécharger le fichier.",
|
||||
httpFailed: "Impossible de télécharger le fichier (HTTP {{status}}).",
|
||||
shareFile: "Partager le fichier",
|
||||
shareFileNamed: "Partager {{fileName}}",
|
||||
},
|
||||
|
||||
@@ -489,8 +489,7 @@ export const ja: TranslationResources = {
|
||||
archivedTitle: "ワークスペースはアーカイブ済みです",
|
||||
restoreDescription:
|
||||
"{{workspaceName}} を復元してエージェントに戻ります。worktree ではブランチ {{branch}} を使用します。",
|
||||
restoreWithoutBranchDescription:
|
||||
"{{workspaceName}} を復元してエージェントに戻ります。保存されたベース、またはリポジトリのデフォルトブランチから新しいブランチを作成します。",
|
||||
restoreWithoutBranchDescription: "{{workspaceName}} を復元してエージェントに戻ります。",
|
||||
unarchiveDescription:
|
||||
"{{workspaceName}} はアーカイブされています。再度開くにはアーカイブを解除してください。",
|
||||
restoreAction: "復元",
|
||||
@@ -2038,6 +2037,7 @@ export const ja: TranslationResources = {
|
||||
hostUnavailable: "ダウンロードホストが利用できません。",
|
||||
cancelled: "ダウンロードがキャンセルされました。",
|
||||
failed: "ファイルのダウンロードに失敗しました。",
|
||||
httpFailed: "ファイルのダウンロードに失敗しました (HTTP {{status}}).",
|
||||
shareFile: "ファイルを共有",
|
||||
shareFileNamed: "{{fileName}}を共有",
|
||||
},
|
||||
|
||||
@@ -485,8 +485,7 @@ export const ko: TranslationResources = {
|
||||
archivedTitle: "워크스페이스가 보관되었습니다",
|
||||
restoreDescription:
|
||||
"{{workspaceName}}를 복원하여 에이전트로 돌아갑니다. 워크트리는 {{branch}} 브랜치를 사용합니다.",
|
||||
restoreWithoutBranchDescription:
|
||||
"{{workspaceName}}를 복원하여 에이전트로 돌아갑니다. 저장된 기반 브랜치 또는 저장소 기본 브랜치에서 새 브랜치를 만듭니다.",
|
||||
restoreWithoutBranchDescription: "{{workspaceName}}를 복원하여 에이전트로 돌아갑니다.",
|
||||
unarchiveDescription: "{{workspaceName}}가 보관되었습니다. 다시 열려면 보관을 취소하세요.",
|
||||
restoreAction: "복원",
|
||||
unarchiveAction: "보관 취소",
|
||||
@@ -2028,6 +2027,7 @@ export const ko: TranslationResources = {
|
||||
hostUnavailable: "다운로드 호스트를 사용할 수 없습니다.",
|
||||
cancelled: "다운로드가 취소되었습니다.",
|
||||
failed: "파일을 다운로드하지 못했습니다.",
|
||||
httpFailed: "파일을 다운로드하지 못했습니다 (HTTP {{status}}).",
|
||||
shareFile: "파일 공유",
|
||||
shareFileNamed: "{{fileName}} 공유",
|
||||
},
|
||||
|
||||
@@ -488,8 +488,7 @@ export const ptBR: TranslationResources = {
|
||||
archivedTitle: "Workspace arquivado",
|
||||
restoreDescription:
|
||||
"Restaure {{workspaceName}} para voltar aos seus agentes. A worktree usará a branch {{branch}}.",
|
||||
restoreWithoutBranchDescription:
|
||||
"Restaure {{workspaceName}} para voltar aos seus agentes. Uma nova branch partirá da base salva ou da branch padrão do repositório.",
|
||||
restoreWithoutBranchDescription: "Restaure {{workspaceName}} para voltar aos seus agentes.",
|
||||
unarchiveDescription:
|
||||
"{{workspaceName}} está arquivado. Desarquive-o para abri-lo novamente.",
|
||||
restoreAction: "Restaurar",
|
||||
@@ -2051,6 +2050,7 @@ export const ptBR: TranslationResources = {
|
||||
hostUnavailable: "Host de download indisponível.",
|
||||
cancelled: "Download cancelado.",
|
||||
failed: "Falha ao baixar arquivo.",
|
||||
httpFailed: "Falha ao baixar arquivo (HTTP {{status}}).",
|
||||
shareFile: "Compartilhar arquivo",
|
||||
shareFileNamed: "Compartilhar {{fileName}}",
|
||||
},
|
||||
|
||||
@@ -489,7 +489,7 @@ export const ru: TranslationResources = {
|
||||
restoreDescription:
|
||||
"Восстановите «{{workspaceName}}», чтобы вернуться к его агентам. Worktree будет использовать ветку {{branch}}.",
|
||||
restoreWithoutBranchDescription:
|
||||
"Восстановите «{{workspaceName}}», чтобы вернуться к его агентам. Новая ветка будет создана от сохранённой базовой или ветки репозитория по умолчанию.",
|
||||
"Восстановите «{{workspaceName}}», чтобы вернуться к его агентам.",
|
||||
unarchiveDescription:
|
||||
"Рабочее пространство «{{workspaceName}}» находится в архиве. Разархивируйте его, чтобы снова открыть.",
|
||||
restoreAction: "Восстановить",
|
||||
@@ -2051,6 +2051,7 @@ export const ru: TranslationResources = {
|
||||
hostUnavailable: "Хост загрузки недоступен.",
|
||||
cancelled: "Загрузка отменена.",
|
||||
failed: "Не удалось загрузить файл.",
|
||||
httpFailed: "Не удалось загрузить файл (HTTP {{status}}).",
|
||||
shareFile: "Поделиться файлом",
|
||||
shareFileNamed: "Поделиться {{fileName}}",
|
||||
},
|
||||
|
||||
@@ -484,8 +484,7 @@ export const zhCN: TranslationResources = {
|
||||
archivedTitle: "Workspace 已归档",
|
||||
restoreDescription:
|
||||
"恢复 {{workspaceName}} 以返回其中的代理。worktree 将使用分支 {{branch}}。",
|
||||
restoreWithoutBranchDescription:
|
||||
"恢复 {{workspaceName}} 以返回其中的代理。新分支将从保存的基准分支或仓库默认分支创建。",
|
||||
restoreWithoutBranchDescription: "恢复 {{workspaceName}} 以返回其中的代理。",
|
||||
unarchiveDescription: "{{workspaceName}} 已归档。取消归档以重新打开。",
|
||||
restoreAction: "恢复",
|
||||
unarchiveAction: "取消归档",
|
||||
@@ -1994,6 +1993,7 @@ export const zhCN: TranslationResources = {
|
||||
hostUnavailable: "下载 Host 不可用。",
|
||||
cancelled: "下载已取消。",
|
||||
failed: "下载文件失败。",
|
||||
httpFailed: "下载文件失败 (HTTP {{status}}).",
|
||||
shareFile: "共享文件",
|
||||
shareFileNamed: "共享 {{fileName}}",
|
||||
},
|
||||
|
||||
@@ -762,7 +762,7 @@ function ChatAgentContent({
|
||||
});
|
||||
const reportAttentionError = useCallback(
|
||||
(error: unknown) => {
|
||||
toastApi.show(String(error), { variant: "error", durationMs: null });
|
||||
toastApi.error(toErrorMessage(error));
|
||||
},
|
||||
[toastApi],
|
||||
);
|
||||
|
||||
@@ -2256,6 +2256,59 @@ describe("HostRuntimeController", () => {
|
||||
});
|
||||
});
|
||||
|
||||
const REGISTRY_KEY = "@paseo:daemon-registry";
|
||||
const futureConnection = { id: "future:1", type: "futureKind", address: "future.example.com" };
|
||||
const directA: HostConnection = {
|
||||
id: "direct:lan-a:6767",
|
||||
type: "directTcp",
|
||||
endpoint: "lan-a:6767",
|
||||
};
|
||||
const directB: HostConnection = {
|
||||
id: "direct:lan-b:6767",
|
||||
type: "directTcp",
|
||||
endpoint: "lan-b:6767",
|
||||
};
|
||||
// What a build with a connection kind this one doesn't know leaves behind: an extra connection
|
||||
// on a host this build can reach, and a host reached only through it.
|
||||
const storedWithUnreadableEntries = [
|
||||
{
|
||||
...makeHost({ serverId: "srv_a", password: "secret-a" }),
|
||||
connections: [futureConnection, directA],
|
||||
},
|
||||
makeHost({ serverId: "srv_b", password: "secret-b", connections: [directB] }),
|
||||
{ serverId: "srv_future", label: "future host", connections: [futureConnection] },
|
||||
];
|
||||
|
||||
async function bootWithRegistry(registry: string): Promise<{
|
||||
store: HostRuntimeStore;
|
||||
storage: HostRuntimeStorage;
|
||||
}> {
|
||||
const storage = createMemoryHostRuntimeStorage({
|
||||
[REGISTRY_KEY]: registry,
|
||||
"@paseo:e2e": "1",
|
||||
});
|
||||
const store = new HostRuntimeStore({
|
||||
storage,
|
||||
deps: {
|
||||
createClient: () => new FakeDaemonClient() as unknown as DaemonClient,
|
||||
connectToDaemon: async ({ host }) => ({
|
||||
client: makeConnectedProbeClient(5) as unknown as DaemonClient,
|
||||
serverId: host.serverId,
|
||||
hostname: host.label ?? null,
|
||||
}),
|
||||
getClientId: async () => "cid_test_runtime",
|
||||
},
|
||||
revokePushNotifications: async () => undefined,
|
||||
});
|
||||
await store.boot();
|
||||
return { store, storage };
|
||||
}
|
||||
|
||||
async function readRegistry(storage: HostRuntimeStorage): Promise<unknown> {
|
||||
const raw = await storage.getItem(REGISTRY_KEY);
|
||||
return raw === null ? null : JSON.parse(raw);
|
||||
}
|
||||
|
||||
describe("HostRuntimeStore", () => {
|
||||
function gatewayRecoveryFixture() {
|
||||
const parent = new FakeDaemonClient();
|
||||
@@ -2686,6 +2739,98 @@ describe("HostRuntimeStore", () => {
|
||||
session.clearSession(host.serverId);
|
||||
});
|
||||
|
||||
it("keeps readable hosts when the registry holds entries this build can't read", async () => {
|
||||
const { store, storage } = await bootWithRegistry(JSON.stringify(storedWithUnreadableEntries));
|
||||
|
||||
expect(store.getHosts().map((host) => [host.serverId, host.password])).toEqual([
|
||||
["srv_a", "secret-a"],
|
||||
["srv_b", "secret-b"],
|
||||
]);
|
||||
expect(store.getHosts()[0]?.connections.map((connection) => connection.id)).toEqual([
|
||||
directA.id,
|
||||
]);
|
||||
expect(await readRegistry(storage)).toEqual(storedWithUnreadableEntries);
|
||||
|
||||
store.syncHosts([]);
|
||||
});
|
||||
|
||||
it("keeps the entries it can't read when it saves the registry", async () => {
|
||||
const { store, storage } = await bootWithRegistry(JSON.stringify(storedWithUnreadableEntries));
|
||||
|
||||
await store.renameHost("srv_b", "renamed");
|
||||
|
||||
expect(await readRegistry(storage)).toMatchObject([
|
||||
{
|
||||
serverId: "srv_a",
|
||||
password: "secret-a",
|
||||
connections: [{ id: directA.id }, futureConnection],
|
||||
},
|
||||
{ serverId: "srv_b", password: "secret-b", label: "renamed" },
|
||||
storedWithUnreadableEntries[2],
|
||||
]);
|
||||
|
||||
store.syncHosts([]);
|
||||
});
|
||||
|
||||
it("moves a stored connection password to its host and keeps the connection it can't read", async () => {
|
||||
const { store, storage } = await bootWithRegistry(
|
||||
JSON.stringify([
|
||||
{
|
||||
serverId: "srv_legacy",
|
||||
connections: [
|
||||
{ type: "directTcp", endpoint: "lan-a:6767", password: "old-secret" },
|
||||
futureConnection,
|
||||
],
|
||||
},
|
||||
]),
|
||||
);
|
||||
|
||||
expect(store.getHosts().map((host) => [host.serverId, host.password])).toEqual([
|
||||
["srv_legacy", "old-secret"],
|
||||
]);
|
||||
await vi.waitFor(async () =>
|
||||
expect(await readRegistry(storage)).toMatchObject([
|
||||
{ serverId: "srv_legacy", password: "old-secret" },
|
||||
]),
|
||||
);
|
||||
expect(await readRegistry(storage)).toMatchObject([
|
||||
{ connections: [{ ...directA, useTls: false }, futureConnection] },
|
||||
]);
|
||||
const [written] = (await readRegistry(storage)) as Array<{ connections: unknown[] }>;
|
||||
expect(written?.connections[0]).not.toHaveProperty("password");
|
||||
|
||||
store.syncHosts([]);
|
||||
});
|
||||
|
||||
it("forgets an entry it can't read once that host is paired again and removed", async () => {
|
||||
const { store, storage } = await bootWithRegistry(
|
||||
JSON.stringify([{ serverId: "srv_future", connections: [futureConnection] }]),
|
||||
);
|
||||
expect(store.getHosts()).toEqual([]);
|
||||
|
||||
await store.upsertDirectConnection({ serverId: "srv_future", endpoint: directA.endpoint });
|
||||
await vi.waitFor(async () =>
|
||||
expect(await readRegistry(storage)).toMatchObject([
|
||||
{ serverId: "srv_future", connections: [{ id: directA.id }] },
|
||||
]),
|
||||
);
|
||||
|
||||
await store.removeHost("srv_future");
|
||||
expect(await readRegistry(storage)).toEqual([]);
|
||||
|
||||
store.syncHosts([]);
|
||||
});
|
||||
|
||||
it("copies a registry that isn't JSON aside instead of deleting it", async () => {
|
||||
const { store, storage } = await bootWithRegistry("{not json");
|
||||
|
||||
expect(store.getHosts()).toEqual([]);
|
||||
expect(await storage.getItem(`${REGISTRY_KEY}:unreadable`)).toBe("{not json");
|
||||
expect(await storage.getItem(REGISTRY_KEY)).toBe("{not json");
|
||||
|
||||
store.syncHosts([]);
|
||||
});
|
||||
|
||||
it("marks the host registry loaded after boot reads storage", async () => {
|
||||
const previousOverride = process.env.EXPO_PUBLIC_LOCAL_DAEMON;
|
||||
process.env.EXPO_PUBLIC_LOCAL_DAEMON = "not-an-endpoint";
|
||||
|
||||
@@ -17,14 +17,16 @@ import {
|
||||
import {
|
||||
connectionFromListen,
|
||||
createRemoteSshHostConnection,
|
||||
normalizeStoredHostProfile,
|
||||
forgetUnreadableHost,
|
||||
pinRelayProtectedSecurityInProfiles,
|
||||
readHostRegistry,
|
||||
upsertHostConnectionInProfiles,
|
||||
registryHasConnection,
|
||||
relayConnectionFromOffer,
|
||||
StoredHostRegistrySchema,
|
||||
writeHostRegistry,
|
||||
type HostConnection,
|
||||
type HostProfile,
|
||||
type UnreadableHostEntries,
|
||||
} from "@/types/host-connection";
|
||||
import { defaultHostAppearance, type HostBadgeDisplay, type HostColor } from "@/hosts/appearance";
|
||||
import {
|
||||
@@ -43,7 +45,7 @@ import { isWeb } from "@/constants/platform";
|
||||
import { connectToDaemon, getConnectionAuthFailureReason } from "@/utils/test-daemon-connection";
|
||||
import { getOrCreateClientId } from "@/utils/client-id";
|
||||
import { z } from "zod";
|
||||
import { readValidatedJson, readValidatedString } from "@/storage/validated-storage";
|
||||
import { readValidatedString } from "@/storage/validated-storage";
|
||||
import {
|
||||
selectBestConnection,
|
||||
type ConnectionCandidate,
|
||||
@@ -1692,6 +1694,7 @@ export class HostRuntimeStore {
|
||||
private hostListVersion = 0;
|
||||
private hostRegistryLoaded = false;
|
||||
private hosts: HostProfile[] = [];
|
||||
private unreadableHosts: UnreadableHostEntries = { hosts: [], connectionsByServerId: new Map() };
|
||||
private hostAppearanceMutationTail: Promise<void> = Promise.resolve();
|
||||
private hostRegistryStatus: HostRegistryStatus = "loading";
|
||||
private deps: HostRuntimeControllerDeps;
|
||||
@@ -1799,32 +1802,17 @@ export class HostRuntimeStore {
|
||||
let shouldPersistHosts = false;
|
||||
let profiles: HostProfile[] = [];
|
||||
try {
|
||||
const stored = await readValidatedJson(
|
||||
this.storage,
|
||||
REGISTRY_STORAGE_KEY,
|
||||
StoredHostRegistrySchema,
|
||||
);
|
||||
const stored = await this.readStoredRegistry();
|
||||
if (stored) {
|
||||
const normalizedProfiles: HostProfile[] = [];
|
||||
for (const entry of stored) {
|
||||
const profile = normalizeStoredHostProfile(entry);
|
||||
if (!profile) {
|
||||
await this.storage.removeItem(REGISTRY_STORAGE_KEY);
|
||||
normalizedProfiles.length = 0;
|
||||
break;
|
||||
}
|
||||
// COMPAT(connectionPassword): added in v0.9.1, remove after 2027-03-24 with stored-password migration.
|
||||
if (
|
||||
entry.connections.some(
|
||||
(connection) => connection.type === "directTcp" && connection.password,
|
||||
)
|
||||
) {
|
||||
shouldPersistHosts = true;
|
||||
}
|
||||
normalizedProfiles.push(profile);
|
||||
// An entry this build can't read skips only that host or connection, and stays stored.
|
||||
const registry = readHostRegistry(stored);
|
||||
this.unreadableHosts = registry.unreadable;
|
||||
// COMPAT(connectionPassword): added in v0.9.1, remove after 2027-03-24 with stored-password migration.
|
||||
if (registry.movedConnectionPassword) {
|
||||
shouldPersistHosts = true;
|
||||
}
|
||||
profiles = normalizedProfiles.filter((entry) => !isPlaceholderServerId(entry.serverId));
|
||||
if (profiles.length !== normalizedProfiles.length) {
|
||||
profiles = registry.hosts.filter((entry) => !isPlaceholderServerId(entry.serverId));
|
||||
if (profiles.length !== registry.hosts.length) {
|
||||
shouldPersistHosts = true;
|
||||
}
|
||||
}
|
||||
@@ -2320,6 +2308,7 @@ export class HostRuntimeStore {
|
||||
async removeHost(serverId: string): Promise<void> {
|
||||
await this.revokePushNotifications({ client: this.getClient(serverId), serverId });
|
||||
const remaining = this.hosts.filter((daemon) => daemon.serverId !== serverId);
|
||||
this.unreadableHosts = forgetUnreadableHost(this.unreadableHosts, serverId);
|
||||
this.setHostsAndSync(remaining);
|
||||
await this.persistHosts();
|
||||
}
|
||||
@@ -2408,7 +2397,27 @@ export class HostRuntimeStore {
|
||||
}
|
||||
|
||||
private async persistHosts(hosts = this.hosts): Promise<void> {
|
||||
await this.storage.setItem(REGISTRY_STORAGE_KEY, JSON.stringify(hosts));
|
||||
await this.storage.setItem(
|
||||
REGISTRY_STORAGE_KEY,
|
||||
JSON.stringify(writeHostRegistry(hosts, this.unreadableHosts)),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads the stored registry without removing it. A value that isn't a JSON array is copied to
|
||||
* `<key>:unreadable` first, because the next save overwrites the key.
|
||||
*/
|
||||
private async readStoredRegistry(): Promise<unknown[] | null> {
|
||||
const raw = await this.storage.getItem(REGISTRY_STORAGE_KEY);
|
||||
if (raw === null) return null;
|
||||
try {
|
||||
const value: unknown = JSON.parse(raw);
|
||||
if (Array.isArray(value)) return value;
|
||||
} catch {
|
||||
// Not JSON: copied aside below.
|
||||
}
|
||||
await this.storage.setItem(`${REGISTRY_STORAGE_KEY}:unreadable`, raw);
|
||||
return null;
|
||||
}
|
||||
|
||||
private emitHostList(): void {
|
||||
|
||||
@@ -90,6 +90,7 @@ interface StartInput {
|
||||
token?: ReturnType<typeof createTokenRequest>;
|
||||
reader?: ReturnType<typeof createFileReader>;
|
||||
saver?: ReturnType<typeof createFileSaver>;
|
||||
fetchFile?: typeof fetch;
|
||||
}
|
||||
|
||||
async function startDownload(input: StartInput): Promise<Download | undefined> {
|
||||
@@ -108,6 +109,7 @@ async function startDownload(input: StartInput): Promise<Download | undefined> {
|
||||
requestFileDownloadToken: token.request,
|
||||
readFile: reader.read,
|
||||
saveFile: saver.save,
|
||||
fetchFile: input.fetchFile ?? (async () => new Response(FILE_BYTES)),
|
||||
});
|
||||
const { activeDownloadId, downloads } = useDownloadStore.getState();
|
||||
return activeDownloadId ? downloads.get(activeDownloadId) : undefined;
|
||||
@@ -203,6 +205,57 @@ describe("download store transport selection", () => {
|
||||
expect(saver.savedFiles).toEqual([]);
|
||||
});
|
||||
|
||||
it("fails with the HTTP status when a proxy in front of the host rejects the download", async () => {
|
||||
const requests: Array<RequestInit | undefined> = [];
|
||||
const download = await startDownload({
|
||||
profile: profileWith([localTcpConnection]),
|
||||
activeConnectionId: localTcpConnection.id,
|
||||
fetchFile: async (_url, init) => {
|
||||
requests.push(init);
|
||||
return new Response("<h1>401 Authorization Required</h1>", {
|
||||
status: 401,
|
||||
headers: { "WWW-Authenticate": 'Basic realm="Paseo"' },
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
expect(download).toMatchObject({
|
||||
status: "error",
|
||||
message: i18n.t("downloads.httpFailed", { status: 401 }),
|
||||
});
|
||||
expect(requests).toEqual([{ credentials: "include", redirect: "error" }]);
|
||||
});
|
||||
|
||||
it("fails with a readable message when the download request cannot reach the host", async () => {
|
||||
const download = await startDownload({
|
||||
profile: profileWith([localTcpConnection]),
|
||||
activeConnectionId: localTcpConnection.id,
|
||||
fetchFile: async () => {
|
||||
throw new TypeError("Failed to fetch");
|
||||
},
|
||||
});
|
||||
|
||||
expect(download).toMatchObject({ status: "error", message: i18n.t("downloads.failed") });
|
||||
});
|
||||
|
||||
it("fails with a readable message when the connection drops while the file is downloading", async () => {
|
||||
const saver = createFileSaver();
|
||||
const download = await startDownload({
|
||||
profile: profileWith([localTcpConnection]),
|
||||
activeConnectionId: localTcpConnection.id,
|
||||
fetchFile: async () =>
|
||||
new Response(
|
||||
new ReadableStream({
|
||||
start: (controller) => controller.error(new TypeError("network error")),
|
||||
}),
|
||||
),
|
||||
saver,
|
||||
});
|
||||
|
||||
expect(download).toMatchObject({ status: "error", message: i18n.t("downloads.failed") });
|
||||
expect(saver.savedFiles).toEqual([]);
|
||||
});
|
||||
|
||||
it("fails the download and saves nothing when the session read fails", async () => {
|
||||
const reader = createFileReader(async () => {
|
||||
throw new Error("Connection lost");
|
||||
|
||||
@@ -4,7 +4,6 @@ import * as LegacyFileSystem from "expo-file-system/legacy";
|
||||
import * as Sharing from "expo-sharing";
|
||||
import type { HostProfile } from "@/types/host-connection";
|
||||
import { buildDaemonWebSocketUrl } from "@/utils/daemon-endpoints";
|
||||
import { openExternalUrl } from "@/utils/open-external-url";
|
||||
import { isWeb } from "@/constants/platform";
|
||||
import { i18n } from "@/i18n/i18next";
|
||||
|
||||
@@ -59,6 +58,7 @@ interface DownloadState {
|
||||
/** Reads the whole file over the session socket; used when no direct HTTP endpoint is active. */
|
||||
readFile: (path: string, maxBytes: number) => Promise<{ bytes: Uint8Array; size: number }>;
|
||||
saveFile?: typeof saveDownloadedBytes;
|
||||
fetchFile?: typeof fetch;
|
||||
}) => Promise<void>;
|
||||
|
||||
updateProgress: (id: string, progress: DownloadProgress) => void;
|
||||
@@ -86,6 +86,7 @@ export const useDownloadStore = create<DownloadState>()((set, get) => ({
|
||||
requestFileDownloadToken,
|
||||
readFile,
|
||||
saveFile = saveDownloadedBytes,
|
||||
fetchFile = fetch,
|
||||
}) => {
|
||||
const id = generateDownloadId();
|
||||
const download: Download = {
|
||||
@@ -144,14 +145,11 @@ export const useDownloadStore = create<DownloadState>()((set, get) => ({
|
||||
throw new Error(i18n.t("downloads.hostUnavailable"));
|
||||
}
|
||||
|
||||
const downloadUrl = buildDownloadUrl(
|
||||
downloadTarget.baseUrl,
|
||||
tokenResponse.token,
|
||||
isWeb ? downloadTarget.authCredentials : null,
|
||||
);
|
||||
const downloadUrl = buildDownloadUrl(downloadTarget.baseUrl, tokenResponse.token);
|
||||
|
||||
if (isWeb) {
|
||||
triggerBrowserDownload(downloadUrl, resolvedFileName);
|
||||
const file = await fetchDownload(fetchFile, downloadUrl);
|
||||
saveBrowserFile(file, resolvedFileName);
|
||||
get().completeDownload(id);
|
||||
return;
|
||||
}
|
||||
@@ -198,11 +196,6 @@ export const useDownloadStore = create<DownloadState>()((set, get) => ({
|
||||
await shareSavedFile(result.uri, tokenResponse.mimeType, resolvedFileName);
|
||||
} catch (error) {
|
||||
const message = error instanceof Error ? error.message : i18n.t("downloads.failed");
|
||||
if (isWeb) {
|
||||
console.warn("[DownloadStore] Download failed:", message);
|
||||
get().failDownload(id, message);
|
||||
return;
|
||||
}
|
||||
get().failDownload(id, message);
|
||||
}
|
||||
},
|
||||
@@ -283,7 +276,6 @@ function findMostRecentDownloadId(downloads: Map<string, Download>): string | nu
|
||||
interface DownloadTarget {
|
||||
baseUrl: string | null;
|
||||
authHeader: string | null;
|
||||
authCredentials: { username: string; password: string } | null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -306,7 +298,7 @@ function resolveDaemonDownloadTarget(
|
||||
buildDaemonWebSocketUrl(connection.endpoint, { useTls: connection.useTls ?? false }),
|
||||
);
|
||||
} catch {
|
||||
return { baseUrl: null, authHeader: null, authCredentials: null };
|
||||
return { baseUrl: null, authHeader: null };
|
||||
}
|
||||
|
||||
if (parsed.protocol === "ws:") {
|
||||
@@ -332,23 +324,41 @@ function resolveDaemonDownloadTarget(
|
||||
? `Basic ${btoa(`${authCredentials.username}:${authCredentials.password}`)}`
|
||||
: null;
|
||||
|
||||
return { baseUrl, authHeader, authCredentials };
|
||||
return { baseUrl, authHeader };
|
||||
}
|
||||
|
||||
function buildDownloadUrl(
|
||||
baseUrl: string,
|
||||
token: string,
|
||||
authCredentials: { username: string; password: string } | null,
|
||||
): string {
|
||||
function buildDownloadUrl(baseUrl: string, token: string): string {
|
||||
const url = new URL("/api/files/download", baseUrl);
|
||||
url.searchParams.set("token", token);
|
||||
if (authCredentials) {
|
||||
url.username = authCredentials.username;
|
||||
url.password = authCredentials.password;
|
||||
}
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the file instead of navigating to it. The app runs on another origin than the host
|
||||
* (paseo://app on desktop), so a link to the download URL navigates the whole window, and any
|
||||
* response that is not the file (a proxy's 401 page, a 404) replaces the app.
|
||||
*/
|
||||
async function fetchDownload(fetchFile: typeof fetch, url: string): Promise<Blob> {
|
||||
let response: Response;
|
||||
try {
|
||||
// Send the same cookies the host's WebSocket handshake sends, so a proxy in front of the
|
||||
// host lets the download through. Refuse redirects: a proxy that redirects to a login page
|
||||
// would otherwise be saved as the file.
|
||||
response = await fetchFile(url, { credentials: "include", redirect: "error" });
|
||||
} catch {
|
||||
throw new Error(i18n.t("downloads.failed"));
|
||||
}
|
||||
if (!response.ok) {
|
||||
throw new Error(i18n.t("downloads.httpFailed", { status: response.status }));
|
||||
}
|
||||
try {
|
||||
// The body streams after the headers, so the connection can still drop here.
|
||||
return await response.blob();
|
||||
} catch {
|
||||
throw new Error(i18n.t("downloads.failed"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves bytes read over the session. Web and Electron hand them to the browser's download
|
||||
* manager and return `null`; native writes the file and returns its URI for the share sheet.
|
||||
@@ -361,12 +371,7 @@ async function saveDownloadedBytes({
|
||||
if (isWeb) {
|
||||
const buffer = new ArrayBuffer(bytes.byteLength);
|
||||
new Uint8Array(buffer).set(bytes);
|
||||
const url = URL.createObjectURL(
|
||||
new Blob([buffer], { type: mimeType ?? "application/octet-stream" }),
|
||||
);
|
||||
triggerBrowserDownload(url, fileName);
|
||||
// The browser may still be reading the blob while its save prompt is open.
|
||||
setTimeout(() => URL.revokeObjectURL(url), 60_000);
|
||||
saveBrowserFile(new Blob([buffer], { type: mimeType ?? "application/octet-stream" }), fileName);
|
||||
return null;
|
||||
}
|
||||
// Resolve and write in one tick so two downloads of the same name cannot pick the same path.
|
||||
@@ -390,14 +395,12 @@ async function shareSavedFile(
|
||||
}
|
||||
}
|
||||
|
||||
function triggerBrowserDownload(url: string, fileName: string) {
|
||||
function saveBrowserFile(file: Blob, fileName: string) {
|
||||
if (typeof document === "undefined") {
|
||||
if (typeof window !== "undefined") {
|
||||
void openExternalUrl(url);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
const url = URL.createObjectURL(file);
|
||||
const link = document.createElement("a");
|
||||
link.href = url;
|
||||
link.download = fileName;
|
||||
@@ -405,6 +408,8 @@ function triggerBrowserDownload(url: string, fileName: string) {
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
link.remove();
|
||||
// The browser may still be reading the blob while its save prompt is open.
|
||||
setTimeout(() => URL.revokeObjectURL(url), 60_000);
|
||||
}
|
||||
|
||||
function resolveDownloadTargetFile(fileName: string): FSFile {
|
||||
|
||||
@@ -5,9 +5,11 @@ import {
|
||||
normalizeStoredHostProfile,
|
||||
orderHostsLocalFirst,
|
||||
pinRelayProtectedSecurityInProfiles,
|
||||
readHostRegistry,
|
||||
relayConnectionFromOffer,
|
||||
resolveActiveHostServerId,
|
||||
upsertHostConnectionInProfiles,
|
||||
writeHostRegistry,
|
||||
type HostConnection,
|
||||
type HostProfile,
|
||||
} from "./host-connection";
|
||||
@@ -87,6 +89,25 @@ describe("normalizeStoredHostProfile", () => {
|
||||
expect(profile?.connections[0]).not.toHaveProperty("password");
|
||||
});
|
||||
|
||||
it("drops a connection kind this build doesn't know and keeps the host", () => {
|
||||
const profile = normalizeStoredHostProfile({
|
||||
serverId: "srv_mixed",
|
||||
password: "secret",
|
||||
connections: [
|
||||
{ id: "future:1", type: "futureKind", address: "future.example.com" },
|
||||
{ id: "direct:lan:6767", type: "directTcp", endpoint: "lan:6767", futureField: true },
|
||||
{ id: "direct:remote:6767", type: "directTcp", endpoint: "remote:6767" },
|
||||
],
|
||||
preferredConnectionId: "direct:remote:6767",
|
||||
});
|
||||
|
||||
expect(profile?.password).toBe("secret");
|
||||
expect(profile?.connections).toEqual([
|
||||
{ id: "direct:remote:6767", type: "directTcp", endpoint: "remote:6767", useTls: false },
|
||||
]);
|
||||
expect(profile?.preferredConnectionId).toBe("direct:remote:6767");
|
||||
});
|
||||
|
||||
it("preserves legacy relay ids when TLS is absent", () => {
|
||||
const profile = normalizeStoredHostProfile({
|
||||
serverId: "srv_relay",
|
||||
@@ -177,6 +198,59 @@ describe("normalizeStoredHostProfile", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("readHostRegistry and writeHostRegistry", () => {
|
||||
const direct: HostConnection = {
|
||||
id: "direct:lan:6767",
|
||||
type: "directTcp",
|
||||
endpoint: "lan:6767",
|
||||
useTls: false,
|
||||
};
|
||||
const future = { id: "future:1", type: "futureKind", address: "future.example.com" };
|
||||
|
||||
it("writes back every entry it could not read", () => {
|
||||
const unreadableHost = { serverId: "srv_future", connections: [future] };
|
||||
const hostWithFutureField = { serverId: "srv_field", connections: [direct], futureField: 1 };
|
||||
const stored = [
|
||||
{ ...makeHost("srv_a"), connections: [direct, future] },
|
||||
unreadableHost,
|
||||
hostWithFutureField,
|
||||
"not a host",
|
||||
];
|
||||
|
||||
const { hosts, unreadable } = readHostRegistry(stored);
|
||||
expect(hosts.map((host) => host.serverId)).toEqual(["srv_a"]);
|
||||
expect(hosts[0]?.connections).toEqual([direct]);
|
||||
|
||||
expect(writeHostRegistry(hosts, unreadable)).toEqual([
|
||||
{ ...hosts[0], connections: [direct, future] },
|
||||
unreadableHost,
|
||||
hostWithFutureField,
|
||||
"not a host",
|
||||
]);
|
||||
});
|
||||
|
||||
it("writes a host saved again by this build in place of the entry it could not read", () => {
|
||||
const { hosts, unreadable } = readHostRegistry([{ serverId: "srv_a", connections: [future] }]);
|
||||
expect(hosts).toEqual([]);
|
||||
|
||||
const saved = { ...makeHost("srv_a"), connections: [direct] };
|
||||
expect(writeHostRegistry([saved], unreadable)).toEqual([saved]);
|
||||
});
|
||||
|
||||
it("moves a stored direct TCP password to its host next to a connection it can't read", () => {
|
||||
const registry = readHostRegistry([
|
||||
{
|
||||
serverId: "srv_legacy",
|
||||
connections: [future, { type: "directTcp", endpoint: "lan:6767", password: "old-secret" }],
|
||||
},
|
||||
]);
|
||||
|
||||
expect(registry.movedConnectionPassword).toBe(true);
|
||||
expect(registry.hosts[0]?.password).toBe("old-secret");
|
||||
expect(registry.hosts[0]?.connections).toEqual([direct]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("createRemoteSshHostConnection", () => {
|
||||
it("keeps optional SSH settings absent", () => {
|
||||
expect(createRemoteSshHostConnection({ host: "build-box" })).toEqual({
|
||||
|
||||
@@ -522,12 +522,12 @@ const StoredHostProfileSchema = z.strictObject({
|
||||
label: z.string().optional(),
|
||||
appearance: HostAppearanceSchema.optional(),
|
||||
lifecycle: z.strictObject({}).optional(),
|
||||
connections: z.array(StoredHostConnectionSchema).min(1),
|
||||
// Read one by one, so a connection kind another build wrote skips only that connection.
|
||||
connections: z.array(z.unknown()).min(1),
|
||||
preferredConnectionId: z.string().nullable().optional(),
|
||||
createdAt: z.string().datetime({ offset: true }).optional(),
|
||||
updatedAt: z.string().datetime({ offset: true }).optional(),
|
||||
});
|
||||
export const StoredHostRegistrySchema = z.array(StoredHostProfileSchema);
|
||||
type StoredHostConnection = z.infer<typeof StoredHostConnectionSchema>;
|
||||
|
||||
function normalizeStoredConnection(connection: StoredHostConnection): HostConnection | null {
|
||||
@@ -590,20 +590,37 @@ function normalizeStoredConnection(connection: StoredHostConnection): HostConnec
|
||||
}
|
||||
|
||||
export function normalizeStoredHostProfile(entry: unknown): HostProfile | null {
|
||||
return readStoredHost(entry)?.profile ?? null;
|
||||
}
|
||||
|
||||
interface StoredHostRead {
|
||||
profile: HostProfile;
|
||||
unreadableConnections: unknown[];
|
||||
movedConnectionPassword: boolean;
|
||||
}
|
||||
|
||||
function readStoredHost(entry: unknown): StoredHostRead | null {
|
||||
const result = StoredHostProfileSchema.safeParse(entry);
|
||||
if (!result.success) {
|
||||
return null;
|
||||
}
|
||||
const record = result.data;
|
||||
const serverId = record.serverId;
|
||||
const storedConnections: StoredHostConnection[] = [];
|
||||
const unreadableConnections: unknown[] = [];
|
||||
for (const stored of record.connections) {
|
||||
const parsed = StoredHostConnectionSchema.safeParse(stored);
|
||||
if (parsed.success) storedConnections.push(parsed.data);
|
||||
else unreadableConnections.push(stored);
|
||||
}
|
||||
// COMPAT(connectionPassword): added in v0.9.1, remove after 2027-03-24 once stored direct passwords have migrated.
|
||||
const legacyPassword = record.connections.find(
|
||||
const legacyPassword = storedConnections.find(
|
||||
(connection) => connection.type === "directTcp" && connection.password,
|
||||
);
|
||||
const password =
|
||||
record.password ?? (legacyPassword?.type === "directTcp" ? legacyPassword.password : undefined);
|
||||
|
||||
const connections = record.connections
|
||||
const connections = storedConnections
|
||||
.map((connection) => normalizeStoredConnection(connection))
|
||||
.filter((connection): connection is HostConnection => connection !== null);
|
||||
if (connections.length === 0) {
|
||||
@@ -620,18 +637,90 @@ export function normalizeStoredHostProfile(entry: unknown): HostProfile | null {
|
||||
: (connections[0]?.id ?? null);
|
||||
|
||||
return {
|
||||
serverId,
|
||||
...(password ? { password } : {}),
|
||||
label,
|
||||
appearance: record.appearance ?? defaultHostAppearance(),
|
||||
lifecycle: defaultLifecycle(),
|
||||
connections,
|
||||
preferredConnectionId,
|
||||
createdAt: record.createdAt ?? now,
|
||||
updatedAt: record.updatedAt ?? now,
|
||||
profile: {
|
||||
serverId,
|
||||
...(password ? { password } : {}),
|
||||
label,
|
||||
appearance: record.appearance ?? defaultHostAppearance(),
|
||||
lifecycle: defaultLifecycle(),
|
||||
connections,
|
||||
preferredConnectionId,
|
||||
createdAt: record.createdAt ?? now,
|
||||
updatedAt: record.updatedAt ?? now,
|
||||
},
|
||||
unreadableConnections,
|
||||
movedConnectionPassword: legacyPassword !== undefined,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Stored registry entries this build can't read, such as a connection kind added by a newer
|
||||
* build. `writeHostRegistry` writes them back so that build still finds them.
|
||||
*/
|
||||
export interface UnreadableHostEntries {
|
||||
hosts: unknown[];
|
||||
connectionsByServerId: Map<string, unknown[]>;
|
||||
}
|
||||
|
||||
export function readHostRegistry(stored: unknown[]): {
|
||||
hosts: HostProfile[];
|
||||
unreadable: UnreadableHostEntries;
|
||||
// COMPAT(connectionPassword): added in v0.9.1, remove after 2027-03-24 with stored-password migration.
|
||||
movedConnectionPassword: boolean;
|
||||
} {
|
||||
const hosts: HostProfile[] = [];
|
||||
const unreadable: UnreadableHostEntries = { hosts: [], connectionsByServerId: new Map() };
|
||||
let movedConnectionPassword = false;
|
||||
for (const entry of stored) {
|
||||
const read = readStoredHost(entry);
|
||||
if (!read) {
|
||||
unreadable.hosts.push(entry);
|
||||
continue;
|
||||
}
|
||||
hosts.push(read.profile);
|
||||
if (read.unreadableConnections.length > 0) {
|
||||
unreadable.connectionsByServerId.set(read.profile.serverId, read.unreadableConnections);
|
||||
}
|
||||
movedConnectionPassword ||= read.movedConnectionPassword;
|
||||
}
|
||||
return { hosts, unreadable, movedConnectionPassword };
|
||||
}
|
||||
|
||||
export function writeHostRegistry(
|
||||
hosts: HostProfile[],
|
||||
unreadable: UnreadableHostEntries,
|
||||
): unknown[] {
|
||||
const savedServerIds = new Set(hosts.map((host) => host.serverId));
|
||||
const written: unknown[] = hosts.map((host) => {
|
||||
const kept = unreadable.connectionsByServerId.get(host.serverId);
|
||||
return kept ? { ...host, connections: [...host.connections, ...kept] } : host;
|
||||
});
|
||||
for (const entry of unreadable.hosts) {
|
||||
// A host this build saved again replaces the entry it couldn't read.
|
||||
const serverId = readStoredServerId(entry);
|
||||
if (serverId === null || !savedServerIds.has(serverId)) written.push(entry);
|
||||
}
|
||||
return written;
|
||||
}
|
||||
|
||||
/** Drops the entries this build couldn't read for a host you removed. */
|
||||
export function forgetUnreadableHost(
|
||||
unreadable: UnreadableHostEntries,
|
||||
serverId: string,
|
||||
): UnreadableHostEntries {
|
||||
const connectionsByServerId = new Map(unreadable.connectionsByServerId);
|
||||
connectionsByServerId.delete(serverId);
|
||||
return {
|
||||
hosts: unreadable.hosts.filter((entry) => readStoredServerId(entry) !== serverId),
|
||||
connectionsByServerId,
|
||||
};
|
||||
}
|
||||
|
||||
function readStoredServerId(entry: unknown): string | null {
|
||||
if (typeof entry !== "object" || entry === null || !("serverId" in entry)) return null;
|
||||
return typeof entry.serverId === "string" ? entry.serverId.trim() : null;
|
||||
}
|
||||
|
||||
export function hostHasConnection(host: HostProfile, connection: HostConnection): boolean {
|
||||
return host.connections.some((existing) => hostConnectionEquals(existing, connection));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/cli",
|
||||
"version": "0.16.0-beta.2",
|
||||
"version": "0.16.2",
|
||||
"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.16.0-beta.2",
|
||||
"@getpaseo/protocol": "0.16.0-beta.2",
|
||||
"@getpaseo/server": "0.16.0-beta.2",
|
||||
"@getpaseo/client": "0.16.2",
|
||||
"@getpaseo/protocol": "0.16.2",
|
||||
"@getpaseo/server": "0.16.2",
|
||||
"chalk": "^5.3.0",
|
||||
"commander": "^12.0.0",
|
||||
"mime-types": "^2.1.35",
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { buildWorkspaceSource } from "./create.js";
|
||||
|
||||
@@ -8,6 +9,49 @@ describe("workspace create source", () => {
|
||||
).toEqual({ kind: "directory", path: "/tmp/project", projectId: "project-1" });
|
||||
});
|
||||
|
||||
it("resolves a relative path against the directory the command runs in", () => {
|
||||
const daemonTarget = { kind: "instance" as const, home: "/tmp/paseo-home" };
|
||||
expect(buildWorkspaceSource({ daemonTarget, isolation: "local", path: "." })).toEqual({
|
||||
kind: "directory",
|
||||
path: process.cwd(),
|
||||
});
|
||||
expect(
|
||||
buildWorkspaceSource({ daemonTarget, isolation: "worktree", path: "../sibling" }),
|
||||
).toEqual({
|
||||
kind: "worktree",
|
||||
cwd: path.resolve(process.cwd(), "../sibling"),
|
||||
action: "branch-off",
|
||||
});
|
||||
});
|
||||
|
||||
it("sends a relative path to an explicit daemon endpoint as written", () => {
|
||||
const daemonTarget = { kind: "endpoint" as const, host: "other-box:6767" };
|
||||
expect(buildWorkspaceSource({ daemonTarget, isolation: "local", path: "repo" })).toEqual({
|
||||
kind: "directory",
|
||||
path: "repo",
|
||||
});
|
||||
});
|
||||
|
||||
it("passes an absolute path from another operating system through unchanged", () => {
|
||||
expect(buildWorkspaceSource({ isolation: "local", path: "C:\\repos\\project" })).toEqual({
|
||||
kind: "directory",
|
||||
path: "C:\\repos\\project",
|
||||
});
|
||||
});
|
||||
|
||||
it("leaves a home-relative path for the daemon to expand", () => {
|
||||
const daemonTarget = { kind: "instance" as const, home: "/tmp/paseo-home" };
|
||||
expect(buildWorkspaceSource({ daemonTarget, isolation: "local", path: "~/repo" })).toEqual({
|
||||
kind: "directory",
|
||||
path: "~/repo",
|
||||
});
|
||||
expect(buildWorkspaceSource({ daemonTarget, isolation: "worktree", path: "~" })).toEqual({
|
||||
kind: "worktree",
|
||||
cwd: "~",
|
||||
action: "branch-off",
|
||||
});
|
||||
});
|
||||
|
||||
it("keeps branch names separate from managed worktree slugs", () => {
|
||||
expect(
|
||||
buildWorkspaceSource({
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import { isAbsolute as isPosixAbsolute } from "node:path/posix";
|
||||
import { isAbsolute as isWindowsAbsolute } from "node:path/win32";
|
||||
import { resolve } from "node:path";
|
||||
import type { Command } from "commander";
|
||||
import { connectToDaemon, getDaemonHost } from "../../utils/client.js";
|
||||
import { resolveCallerAgentId } from "../../utils/caller-agent.js";
|
||||
import type { DaemonTarget } from "../../utils/daemon-target.js";
|
||||
import type { CommandError, CommandOptions, SingleResult } from "../../output/index.js";
|
||||
import { toWorkspaceRow, workspaceSchema, type WorkspaceRow } from "./shared.js";
|
||||
|
||||
@@ -121,12 +125,26 @@ function buildWorktreeWorkspaceSource(options: WorkspaceCreateOptions, path: str
|
||||
}
|
||||
}
|
||||
|
||||
// A relative --path names a directory relative to where the command runs, so
|
||||
// it is made absolute here for a local daemon, which would otherwise resolve
|
||||
// it against its own working directory. For an explicit endpoint the path is
|
||||
// sent as written, the same rule as resolveRepositoryDirectory. An absolute
|
||||
// path can target a daemon on a different operating system, and the daemon
|
||||
// expands a leading ~ to its own home directory.
|
||||
function resolveCallerPath(input: string, daemonTarget: DaemonTarget): string {
|
||||
const isHomeRelative = input === "~" || input.startsWith("~/");
|
||||
if (isHomeRelative || isPosixAbsolute(input) || isWindowsAbsolute(input)) return input;
|
||||
return daemonTarget.kind === "instance" ? resolve(input) : input;
|
||||
}
|
||||
|
||||
export function buildWorkspaceSource(options: WorkspaceCreateOptions) {
|
||||
const callerPath =
|
||||
options.path === undefined ? undefined : resolveCallerPath(options.path, options.daemonTarget);
|
||||
if (options.isolation === "local") {
|
||||
return buildLocalWorkspaceSource(options, options.path ?? process.cwd());
|
||||
return buildLocalWorkspaceSource(options, callerPath ?? process.cwd());
|
||||
}
|
||||
if (options.isolation === "worktree") {
|
||||
const sourcePath = options.path ?? (options.project ? undefined : process.cwd());
|
||||
const sourcePath = callerPath ?? (options.project ? undefined : process.cwd());
|
||||
return buildWorktreeWorkspaceSource(options, sourcePath);
|
||||
}
|
||||
throw new Error(`Unsupported workspace isolation: ${String(options.isolation)}`);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/client",
|
||||
"version": "0.16.0-beta.2",
|
||||
"version": "0.16.2",
|
||||
"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.16.0-beta.2",
|
||||
"@getpaseo/relay": "0.16.0-beta.2",
|
||||
"@getpaseo/protocol": "0.16.2",
|
||||
"@getpaseo/relay": "0.16.2",
|
||||
"ws": "^8.20.0",
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
|
||||
@@ -449,7 +449,7 @@ test("a timed-out subscription rejects and cannot replay on reconnect", async ()
|
||||
h.open();
|
||||
await connecting;
|
||||
const observation = h.client.observeAgents({ timeout: 10 });
|
||||
await expect(observation.ready).rejects.toThrow(/timed out|timeout/i);
|
||||
await expect(observation.ready).rejects.toMatchObject({ code: "DAEMON_REQUEST_TIMEOUT" });
|
||||
await observation.release();
|
||||
const reconnecting = h.client.connect();
|
||||
h.open();
|
||||
|
||||
@@ -1492,7 +1492,7 @@ test("keeps the transport connected when a session RPC ping times out", async ()
|
||||
await connectPromise;
|
||||
expect(client.getConnectionState().status).toBe("connected");
|
||||
|
||||
await expect(client.ping({ timeoutMs: 1 })).rejects.toThrow("Timeout waiting for message");
|
||||
await expect(client.ping({ timeoutMs: 1 })).rejects.toThrow("No response to ping after");
|
||||
|
||||
expect(client.getConnectionState().status).toBe("connected");
|
||||
});
|
||||
@@ -1541,7 +1541,9 @@ test("bounds the wait for push token revocation", async () => {
|
||||
await connectPromise;
|
||||
|
||||
const revocation = client.unregisterPushToken("ExponentPushToken[test-device]");
|
||||
const rejection = expect(revocation).rejects.toThrow("Timeout waiting for message (2000ms)");
|
||||
const rejection = expect(revocation).rejects.toThrow(
|
||||
"No response to push.unregister.request after 2000ms",
|
||||
);
|
||||
await vi.advanceTimersByTimeAsync(1_999);
|
||||
expect(client.getConnectionState().status).toBe("connected");
|
||||
|
||||
@@ -1550,6 +1552,30 @@ test("bounds the wait for push token revocation", async () => {
|
||||
expect(client.getConnectionState().status).toBe("connected");
|
||||
});
|
||||
|
||||
test("identifies the request when marking an agent as read times out", async () => {
|
||||
useHeartbeatClock();
|
||||
const transport = createMockTransport();
|
||||
const client = new DaemonClient({
|
||||
url: "ws://test",
|
||||
clientId: "clsk_attention_timeout",
|
||||
reconnect: { enabled: false },
|
||||
transportFactory: () => transport.transport,
|
||||
});
|
||||
clients.push(client);
|
||||
const connected = client.connect();
|
||||
transport.triggerOpen();
|
||||
await connected;
|
||||
|
||||
const outcome = client.clearAgentAttention("agent-1").catch((error: unknown) => error);
|
||||
await vi.advanceTimersByTimeAsync(60_000);
|
||||
expect(await outcome).toMatchObject({
|
||||
name: "DaemonConnectionError",
|
||||
code: "DAEMON_REQUEST_TIMEOUT",
|
||||
message: "No response to clear_agent_attention after 60000ms",
|
||||
});
|
||||
expect(client.isConnected).toBe(true);
|
||||
});
|
||||
|
||||
test("defaults session RPC waiters to sixty seconds", async () => {
|
||||
useHeartbeatClock();
|
||||
const logger = createMockLogger();
|
||||
@@ -1594,7 +1620,7 @@ test("defaults session RPC waiters to sixty seconds", async () => {
|
||||
expect(settled).toBe(false);
|
||||
|
||||
await vi.advanceTimersByTimeAsync(1);
|
||||
await expect(responsePromise).rejects.toThrow("Timeout waiting for message (60000ms)");
|
||||
await expect(responsePromise).rejects.toThrow("No response to fetch_agent_request after 60000ms");
|
||||
});
|
||||
|
||||
test("honors explicit fetchAgent timeout below the session RPC default", async () => {
|
||||
@@ -1642,7 +1668,7 @@ test("honors explicit fetchAgent timeout below the session RPC default", async (
|
||||
expect(settled).toBe(false);
|
||||
|
||||
await vi.advanceTimersByTimeAsync(1);
|
||||
await expect(responsePromise).rejects.toThrow("Timeout waiting for message (5000ms)");
|
||||
await expect(responsePromise).rejects.toThrow("No response to fetch_agent_request after 5000ms");
|
||||
});
|
||||
|
||||
test("preserves legacy fetchAgent id overload", async () => {
|
||||
@@ -1806,7 +1832,9 @@ test("honors explicit fetchAgentTimeline timeout below the session RPC default",
|
||||
expect(settled).toBe(false);
|
||||
|
||||
await vi.advanceTimersByTimeAsync(1);
|
||||
await expect(responsePromise).rejects.toThrow("Timeout waiting for message (2000ms)");
|
||||
await expect(responsePromise).rejects.toThrow(
|
||||
"No response to fetch_agent_timeline_request after 2000ms",
|
||||
);
|
||||
});
|
||||
|
||||
test("lists the full agent prompt index", async () => {
|
||||
@@ -1899,7 +1927,7 @@ test("honors explicit fetchAgents timeout below the session RPC default", async
|
||||
expect(settled).toBe(false);
|
||||
|
||||
await vi.advanceTimersByTimeAsync(1);
|
||||
await expect(responsePromise).rejects.toThrow("Timeout waiting for message (1200ms)");
|
||||
await expect(responsePromise).rejects.toThrow("No response to fetch_agents_request after 1200ms");
|
||||
});
|
||||
|
||||
test("honors explicit shutdownServer timeout below the session RPC default", async () => {
|
||||
@@ -1945,7 +1973,9 @@ test("honors explicit shutdownServer timeout below the session RPC default", asy
|
||||
expect(settled).toBe(false);
|
||||
|
||||
await vi.advanceTimersByTimeAsync(1);
|
||||
await expect(responsePromise).rejects.toThrow("Timeout waiting for message (1500ms)");
|
||||
await expect(responsePromise).rejects.toThrow(
|
||||
"No response to shutdown_server_request after 1500ms",
|
||||
);
|
||||
});
|
||||
|
||||
test("honors explicit getDaemonStatus timeout below the session RPC default", async () => {
|
||||
@@ -1991,7 +2021,9 @@ test("honors explicit getDaemonStatus timeout below the session RPC default", as
|
||||
expect(settled).toBe(false);
|
||||
|
||||
await vi.advanceTimersByTimeAsync(1);
|
||||
await expect(responsePromise).rejects.toThrow("Timeout waiting for message (1500ms)");
|
||||
await expect(responsePromise).rejects.toThrow(
|
||||
"No response to daemon.get_status.request after 1500ms",
|
||||
);
|
||||
});
|
||||
|
||||
test("honors explicit getDaemonPairingOffer timeout below the session RPC default", async () => {
|
||||
@@ -2037,7 +2069,9 @@ test("honors explicit getDaemonPairingOffer timeout below the session RPC defaul
|
||||
expect(settled).toBe(false);
|
||||
|
||||
await vi.advanceTimersByTimeAsync(1);
|
||||
await expect(responsePromise).rejects.toThrow("Timeout waiting for message (1500ms)");
|
||||
await expect(responsePromise).rejects.toThrow(
|
||||
"No response to daemon.get_pairing_offer.request after 1500ms",
|
||||
);
|
||||
});
|
||||
|
||||
test("gates config reload on the daemon capability", async () => {
|
||||
@@ -2443,7 +2477,9 @@ test("keeps enable and disable inside the session RPC deadline", async () => {
|
||||
expect(settled).toBe(false);
|
||||
|
||||
await vi.advanceTimersByTimeAsync(1);
|
||||
await expect(pending).rejects.toThrow("Timeout waiting for message (60000ms)");
|
||||
await expect(pending).rejects.toThrow(
|
||||
`No response to plugin.${action}.request after 60000ms`,
|
||||
);
|
||||
}
|
||||
} finally {
|
||||
vi.useRealTimers();
|
||||
@@ -8619,7 +8655,9 @@ test("usage request timeout detaches its update listener", async () => {
|
||||
const result = client.listUsageReports({ requestId: "timeout-usage" }, (report) =>
|
||||
updates.push(report),
|
||||
);
|
||||
const rejected = expect(result).rejects.toThrow("Timeout waiting for message (60000ms)");
|
||||
const rejected = expect(result).rejects.toThrow(
|
||||
"No response to usage.list_reports.request after 60000ms",
|
||||
);
|
||||
await vi.advanceTimersByTimeAsync(60_001);
|
||||
await rejected;
|
||||
mock.triggerMessage(
|
||||
@@ -9403,7 +9441,7 @@ test("RPC deadlines remain active while a preceding frame waits for drain", asyn
|
||||
blocked = true;
|
||||
const first = client.sendHostFrame("route", new Uint8Array([1]));
|
||||
try {
|
||||
await expect(client.ping({ timeoutMs: 20 })).rejects.toThrow("Timeout waiting for message");
|
||||
await expect(client.ping({ timeoutMs: 20 })).rejects.toThrow("No response to ping after");
|
||||
expect(client.isConnected).toBe(true);
|
||||
} finally {
|
||||
drain();
|
||||
|
||||
@@ -1023,6 +1023,7 @@ interface WaitHandle<T> {
|
||||
interface WaitOptions {
|
||||
skipQueue?: boolean;
|
||||
requestId?: string;
|
||||
requestType?: SessionInboundMessage["type"];
|
||||
}
|
||||
|
||||
interface CorrelatedResponseIdentity {
|
||||
@@ -2359,7 +2360,7 @@ export class DaemonClient {
|
||||
return { kind: "ok", value };
|
||||
},
|
||||
timeout,
|
||||
{ ...params.options, requestId: params.requestId },
|
||||
{ ...params.options, requestId: params.requestId, requestType: params.message.type },
|
||||
);
|
||||
|
||||
// The response deadline still applies while the transport waits for drain.
|
||||
@@ -8107,7 +8108,9 @@ export class DaemonClient {
|
||||
): WaitHandle<T> {
|
||||
// Capture stack trace at call site, not inside setTimeout
|
||||
const timeoutError = new DaemonConnectionError(
|
||||
`Timeout waiting for message (${timeout}ms)`,
|
||||
options?.requestType
|
||||
? `No response to ${options.requestType} after ${timeout}ms`
|
||||
: `Timeout waiting for message (${timeout}ms)`,
|
||||
"DAEMON_REQUEST_TIMEOUT",
|
||||
);
|
||||
|
||||
|
||||
@@ -11,9 +11,6 @@ if not exist "%APP_EXECUTABLE%" (
|
||||
|
||||
set "ELECTRON_RUN_AS_NODE=1"
|
||||
set "PASEO_NODE_ENV=production"
|
||||
rem PASEO_DESKTOP_MANAGED marks daemons started through this bundled CLI as
|
||||
rem desktop-managed, so the desktop app restarts them when it upgrades.
|
||||
set "PASEO_DESKTOP_MANAGED=1"
|
||||
set "PASEO_CLI=%~f0"
|
||||
"%APP_EXECUTABLE%" --disable-warning=DEP0040 "%RESOURCES_DIR%\app.asar.unpacked\dist\daemon\node-entrypoint-runner.js" node-script "%RESOURCES_DIR%\app.asar\node_modules\@getpaseo\cli\dist\index.js" %*
|
||||
exit /b %errorlevel%
|
||||
|
||||
@@ -41,16 +41,24 @@ savePersistedConfig(home, {
|
||||
},
|
||||
});
|
||||
const main = path.join(root, "main.cjs");
|
||||
const updatedMain = path.join(root, "updated-main.cjs");
|
||||
const managerPath = path.join(repo, "packages/desktop/dist/daemon/daemon-manager.js");
|
||||
const desktopMain = (setup) =>
|
||||
`const { app } = require("electron"); ${setup} app.setPath("userData", ${JSON.stringify(path.join(root, "user-data"))}); app.whenReady().then(() => { global.lifecycle = require(${JSON.stringify(managerPath)}); });`;
|
||||
await writeFile(main, desktopMain(""));
|
||||
// An unpackaged Desktop reads its version from packages/desktop/package.json. This entry
|
||||
// reports a newer version, standing in for the Desktop an update installs.
|
||||
await writeFile(
|
||||
main,
|
||||
`const { app } = require("electron"); app.setPath("userData", ${JSON.stringify(path.join(root, "user-data"))}); app.whenReady().then(() => { global.lifecycle = require(${JSON.stringify(managerPath)}); });`,
|
||||
updatedMain,
|
||||
desktopMain(
|
||||
`const fs = require("node:fs"); const path = require("node:path"); const readFileSync = fs.readFileSync; fs.readFileSync = (file, ...rest) => typeof file === "string" && path.relative(${JSON.stringify(path.join(repo, "packages/desktop"))}, file) === "package.json" ? JSON.stringify({ version: "999.0.0" }) : readFileSync(file, ...rest);`,
|
||||
),
|
||||
);
|
||||
let desktop;
|
||||
let captured;
|
||||
async function openDesktop() {
|
||||
async function openDesktop(entry = main) {
|
||||
desktop = await electron.launch({
|
||||
args: ["--no-sandbox", "--ozone-platform=headless", main],
|
||||
args: ["--no-sandbox", "--ozone-platform=headless", entry],
|
||||
env: {
|
||||
...env,
|
||||
PASEO_LISTEN: "127.0.0.1:1",
|
||||
@@ -78,27 +86,31 @@ async function command(name, args) {
|
||||
);
|
||||
}
|
||||
try {
|
||||
// Simulate a legacy independent launch that carries the old Desktop flag.
|
||||
// A daemon the user started through the CLI, which Desktop must never stop on its own.
|
||||
// Older bundled CLIs exported PASEO_DESKTOP_MANAGED, and the CLI launch must not record it.
|
||||
const launch = await startDaemonInstance({
|
||||
home,
|
||||
command: process.execPath,
|
||||
args: [path.join(repo, "packages/server/dist/scripts/supervisor-entrypoint.js")],
|
||||
env,
|
||||
env: { ...env, PASEO_DESKTOP_MANAGED: "1" },
|
||||
mode: "deployment",
|
||||
desktopManaged: true,
|
||||
timeoutMs: 30_000,
|
||||
});
|
||||
captured = launch.instance;
|
||||
await openDesktop();
|
||||
const attached = await command("start_desktop_daemon");
|
||||
assert.equal(attached.pid, captured.pid);
|
||||
assert.equal(attached.desktopManaged, true);
|
||||
assert.equal(attached.desktopManaged, false);
|
||||
assert.equal(attached.ownedByDesktop, false);
|
||||
for (const reason of ["quit", "settings", "app_update", "host_remove", "version_mismatch"]) {
|
||||
const status = await command("stop_desktop_daemon", { reason });
|
||||
assert.equal(status.pid, captured.pid, `${reason} stopped an attached daemon`);
|
||||
process.kill(captured.pid, 0);
|
||||
}
|
||||
await closeDesktop();
|
||||
await openDesktop(updatedMain);
|
||||
const afterUpdate = await command("start_desktop_daemon");
|
||||
assert.equal(afterUpdate.pid, captured.pid, "a newer Desktop replaced a daemon the user started");
|
||||
const restarted = await command("restart_desktop_daemon");
|
||||
assert.equal(restarted.pid, captured.pid);
|
||||
await assert.rejects(
|
||||
@@ -134,18 +146,37 @@ try {
|
||||
desktop = null;
|
||||
process.kill(captured.pid, 0);
|
||||
await openDesktop();
|
||||
assert.equal((await command("start_desktop_daemon")).ownedByDesktop, false);
|
||||
await command("stop_desktop_daemon", { reason: "quit" });
|
||||
// The next session attaches to the daemon Desktop launched before it quit.
|
||||
const survivor = await command("start_desktop_daemon");
|
||||
assert.equal(survivor.pid, captured.pid);
|
||||
assert.equal(survivor.desktopManaged, true);
|
||||
assert.equal(survivor.ownedByDesktop, false);
|
||||
for (const reason of ["quit", "settings", "host_remove"]) {
|
||||
await command("stop_desktop_daemon", { reason });
|
||||
process.kill(captured.pid, 0);
|
||||
}
|
||||
// With management off, Desktop leaves the daemon running through an update.
|
||||
await command("patch_desktop_settings", { daemon: { manageBuiltInDaemon: false } });
|
||||
await command("stop_desktop_daemon", { reason: "app_update" });
|
||||
process.kill(captured.pid, 0);
|
||||
await command("stop_desktop_daemon", {
|
||||
reason: "manual_ipc",
|
||||
pid: captured.pid,
|
||||
startedAt: captured.startedAt,
|
||||
});
|
||||
await command("patch_desktop_settings", { daemon: { manageBuiltInDaemon: true } });
|
||||
// Installing an update stops it, so the updated Desktop starts its own daemon.
|
||||
const beforeInstall = await command("stop_desktop_daemon", { reason: "app_update" });
|
||||
assert.equal(beforeInstall.status, "stopped", "app_update left Desktop's daemon running");
|
||||
captured = null;
|
||||
const next = await command("start_desktop_daemon");
|
||||
captured = await readDaemonInstance(home);
|
||||
assert.equal(next.ownedByDesktop, true);
|
||||
await closeDesktop();
|
||||
process.kill(captured.pid, 0);
|
||||
// A newer Desktop replaces the daemon an older Desktop launched and kept running.
|
||||
const outdated = captured;
|
||||
await openDesktop(updatedMain);
|
||||
const replaced = await command("start_desktop_daemon");
|
||||
captured = await readDaemonInstance(home);
|
||||
assert.notEqual(replaced.pid, outdated.pid, "a newer Desktop kept the outdated daemon");
|
||||
assert.equal(replaced.ownedByDesktop, true);
|
||||
assert.throws(() => process.kill(outdated.pid, 0), "the outdated daemon is still running");
|
||||
await command("stop_desktop_daemon", { reason: "quit" });
|
||||
assert.equal(await readDaemonInstance(home), null);
|
||||
captured = null;
|
||||
@@ -195,7 +226,7 @@ try {
|
||||
);
|
||||
}
|
||||
console.log(
|
||||
"PASS: attached legacy daemon survives automatic actions; explicit captured stop, owned launch, managed settings, worker restart, and next-session attachment.",
|
||||
"PASS: a user-started daemon survives automatic actions and updates; explicit captured stop, owned launch, managed settings, worker restart, next-session attachment, and update replacement of an earlier session's daemon.",
|
||||
);
|
||||
} finally {
|
||||
await closeDesktop();
|
||||
|
||||
@@ -5,18 +5,25 @@ import { fileURLToPath } from "node:url";
|
||||
import { _electron as electron, expect } from "playwright/test";
|
||||
|
||||
const root = await mkdtemp(path.join(tmpdir(), "paseo-window-startup-"));
|
||||
const modulePath = fileURLToPath(new URL("../dist/window/show-when-ready.js", import.meta.url));
|
||||
const showWhenReadyPath = fileURLToPath(
|
||||
new URL("../dist/window/show-when-ready.js", import.meta.url),
|
||||
);
|
||||
const rendererRecoveryPath = fileURLToPath(
|
||||
new URL("../dist/window/renderer-recovery.js", import.meta.url),
|
||||
);
|
||||
|
||||
async function launchWindowWithoutHiddenFrames() {
|
||||
async function launchDesktopWindow() {
|
||||
const main = path.join(root, "main.cjs");
|
||||
await writeFile(
|
||||
main,
|
||||
`const { app, BrowserWindow } = require("electron");
|
||||
const { showWindowWhenReady } = require(${JSON.stringify(modulePath)});
|
||||
const { showWindowWhenReady } = require(${JSON.stringify(showWhenReadyPath)});
|
||||
const { reloadWhenRendererExits } = require(${JSON.stringify(rendererRecoveryPath)});
|
||||
app.setPath("userData", ${JSON.stringify(path.join(root, "user-data"))});
|
||||
app.whenReady().then(async () => {
|
||||
const win = global.mainWindow = new BrowserWindow({ show: false, paintWhenInitiallyHidden: false });
|
||||
showWindowWhenReady(win, { showOnLoad: true });
|
||||
reloadWhenRendererExits(win);
|
||||
await win.loadURL("data:text/html,<h1>Desktop ready</h1>");
|
||||
global.visibleAfterLoad = win.isVisible();
|
||||
});`,
|
||||
@@ -37,11 +44,32 @@ async function expectLoadedDesktopIsShown(desktop) {
|
||||
await expect(page.getByRole("heading", { name: "Desktop ready" })).toBeVisible();
|
||||
}
|
||||
|
||||
function rendererPid(desktop) {
|
||||
return desktop.evaluate(() => global.mainWindow.webContents.getOSProcessId());
|
||||
}
|
||||
|
||||
async function expectDesktopReloadsAfterRendererIsTerminated(desktop) {
|
||||
const terminated = await rendererPid(desktop);
|
||||
process.kill(terminated, "SIGTERM");
|
||||
await expect.poll(() => rendererPid(desktop), { timeout: 15_000 }).not.toBe(terminated);
|
||||
await expect
|
||||
.poll(
|
||||
() =>
|
||||
desktop.evaluate(() =>
|
||||
global.mainWindow.webContents.executeJavaScript("document.body.textContent"),
|
||||
),
|
||||
{ timeout: 15_000 },
|
||||
)
|
||||
.toBe("Desktop ready");
|
||||
}
|
||||
|
||||
let desktop;
|
||||
try {
|
||||
desktop = await launchWindowWithoutHiddenFrames();
|
||||
desktop = await launchDesktopWindow();
|
||||
await expectLoadedDesktopIsShown(desktop);
|
||||
console.log("Loaded desktop is visible without hidden compositor frames");
|
||||
await expectDesktopReloadsAfterRendererIsTerminated(desktop);
|
||||
console.log("Desktop reloads its window after the renderer is terminated");
|
||||
} finally {
|
||||
await desktop?.close();
|
||||
await rm(root, { recursive: true, force: true });
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/desktop",
|
||||
"version": "0.16.0-beta.2",
|
||||
"version": "0.16.2",
|
||||
"private": true,
|
||||
"description": "Paseo desktop app (Electron wrapper)",
|
||||
"homepage": "https://paseo.sh",
|
||||
|
||||
@@ -269,7 +269,7 @@ function normalizeVersion(version: string | null): string | null {
|
||||
}
|
||||
|
||||
function shouldRestartForVersion(current: DesktopDaemonStatus): boolean {
|
||||
if (!current.ownedByDesktop) return false;
|
||||
if (!current.desktopManaged) return false;
|
||||
const appVersion = normalizeVersion(resolveDesktopAppVersion());
|
||||
const daemonVersion = normalizeVersion(current.version);
|
||||
return Boolean(appVersion && daemonVersion && appVersion !== daemonVersion);
|
||||
@@ -336,12 +336,13 @@ export async function stopDesktopDaemon(
|
||||
): Promise<DesktopDaemonStatus> {
|
||||
const home = getPaseoHome();
|
||||
const instance = await readDaemonInstance(home);
|
||||
const owned = Boolean(
|
||||
const launchedThisSession = Boolean(
|
||||
instance &&
|
||||
ownedLaunch &&
|
||||
ownedLaunch.home === home &&
|
||||
isSameDaemonInstance(instance, ownedLaunch.instance),
|
||||
);
|
||||
const owned = launchedThisSession || (await replacesDesktopDaemon(reason, instance));
|
||||
const explicit =
|
||||
reason === "manual_ipc" &&
|
||||
confirmedInstance &&
|
||||
@@ -361,10 +362,28 @@ export async function stopDesktopDaemon(
|
||||
keepTerminals,
|
||||
});
|
||||
await stopCapturedDaemon({ home, instance, reason, keepTerminals });
|
||||
if (owned) ownedLaunch = null;
|
||||
if (launchedThisSession) ownedLaunch = null;
|
||||
return resolveDesktopDaemonStatus();
|
||||
}
|
||||
|
||||
/** An app update or a version mismatch replaces the daemon with the one this Desktop bundles. */
|
||||
function isReplacement(reason: DesktopDaemonStopReason): boolean {
|
||||
return reason === "app_update" || reason === "version_mismatch";
|
||||
}
|
||||
|
||||
/**
|
||||
* While Desktop manages the built-in daemon, a replacement applies to every daemon Desktop
|
||||
* launched, which `paseo.pid` records as `desktopManaged`. That includes one an earlier Desktop
|
||||
* session left running. Other automatic stops apply only to a daemon this session launched.
|
||||
*/
|
||||
async function replacesDesktopDaemon(
|
||||
reason: DesktopDaemonStopReason,
|
||||
instance: DaemonInstance | null,
|
||||
): Promise<boolean> {
|
||||
if (!isReplacement(reason) || instance?.desktopManaged !== true) return false;
|
||||
return (await getDesktopSettingsStore().get()).daemon.manageBuiltInDaemon;
|
||||
}
|
||||
|
||||
export interface StopCapturedDaemonInput {
|
||||
home: string;
|
||||
instance: DaemonInstance;
|
||||
@@ -428,7 +447,7 @@ export function keepsTerminalsOnStop(
|
||||
platform: NodeJS.Platform,
|
||||
): boolean {
|
||||
if (platform === "win32") return false;
|
||||
return reason === "app_update" || reason === "version_mismatch";
|
||||
return isReplacement(reason);
|
||||
}
|
||||
|
||||
async function restartDaemon(): Promise<DesktopDaemonStatus> {
|
||||
|
||||
@@ -46,6 +46,7 @@ import {
|
||||
buildStandardContextMenuItems,
|
||||
} from "./window/window-manager.js";
|
||||
import { setupDarwinCompositorWatchdog } from "./window/compositor-watchdog/index.js";
|
||||
import { reloadWhenRendererExits } from "./window/renderer-recovery.js";
|
||||
import { showWindowWhenReady } from "./window/show-when-ready.js";
|
||||
import { resolveDesktopWindowChromeMode, windowChromeModeArgument } from "./window/chrome.js";
|
||||
import { registerDialogHandlers } from "./features/dialogs.js";
|
||||
@@ -734,6 +735,7 @@ async function createWindow(
|
||||
}
|
||||
|
||||
setupDarwinCompositorWatchdog(mainWindow);
|
||||
reloadWhenRendererExits(mainWindow);
|
||||
setupWindowResizeEvents(mainWindow);
|
||||
if (windowStateStore) {
|
||||
setupWindowStatePersistence(mainWindow, windowStateStore);
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
import { EventEmitter } from "node:events";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { reloadWhenRendererExits } from "./renderer-recovery.js";
|
||||
|
||||
class Contents extends EventEmitter {
|
||||
reloads = 0;
|
||||
url = "paseo://app/";
|
||||
getURL() {
|
||||
return this.url;
|
||||
}
|
||||
reload() {
|
||||
this.reloads += 1;
|
||||
}
|
||||
exit(reason: string) {
|
||||
this.emit("render-process-gone", {}, { reason, exitCode: reason === "clean-exit" ? 0 : 15 });
|
||||
}
|
||||
}
|
||||
|
||||
class Window {
|
||||
webContents = new Contents();
|
||||
destroyed = false;
|
||||
isDestroyed() {
|
||||
return this.destroyed;
|
||||
}
|
||||
}
|
||||
|
||||
function recoverableWindow() {
|
||||
const win = new Window();
|
||||
let time = 0;
|
||||
reloadWhenRendererExits(win, { now: () => time });
|
||||
return {
|
||||
win,
|
||||
advance(ms: number) {
|
||||
time += ms;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
describe("reloadWhenRendererExits", () => {
|
||||
it("reloads the window when its renderer is killed", () => {
|
||||
const { win } = recoverableWindow();
|
||||
win.webContents.exit("killed");
|
||||
expect(win.webContents.reloads).toBe(1);
|
||||
});
|
||||
|
||||
it("reloads after a renderer crash or out-of-memory exit", () => {
|
||||
const { win, advance } = recoverableWindow();
|
||||
win.webContents.exit("crashed");
|
||||
advance(120_000);
|
||||
win.webContents.exit("oom");
|
||||
expect(win.webContents.reloads).toBe(2);
|
||||
});
|
||||
|
||||
it("leaves a renderer that exited cleanly alone", () => {
|
||||
const { win } = recoverableWindow();
|
||||
win.webContents.exit("clean-exit");
|
||||
expect(win.webContents.reloads).toBe(0);
|
||||
});
|
||||
|
||||
it("leaves a renderer that exits before the first page commits to Chromium", () => {
|
||||
const { win } = recoverableWindow();
|
||||
win.webContents.url = "";
|
||||
win.webContents.exit("killed");
|
||||
expect(win.webContents.reloads).toBe(0);
|
||||
});
|
||||
|
||||
it("leaves a closed window closed", () => {
|
||||
const { win } = recoverableWindow();
|
||||
win.destroyed = true;
|
||||
win.webContents.exit("killed");
|
||||
expect(win.webContents.reloads).toBe(0);
|
||||
});
|
||||
|
||||
it("stops reloading a renderer that keeps exiting, and recovers again later", () => {
|
||||
const { win, advance } = recoverableWindow();
|
||||
for (let exit = 0; exit < 5; exit += 1) {
|
||||
win.webContents.exit("crashed");
|
||||
advance(1_000);
|
||||
}
|
||||
expect(win.webContents.reloads).toBe(3);
|
||||
|
||||
advance(60_000);
|
||||
win.webContents.exit("killed");
|
||||
expect(win.webContents.reloads).toBe(4);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,56 @@
|
||||
import log from "electron-log/main";
|
||||
|
||||
// A window whose renderer exits keeps its frame but shows nothing until it is
|
||||
// reloaded. Reload it, but stop when the renderer keeps exiting so a page that
|
||||
// crashes on load does not restart in a loop.
|
||||
const MAX_RELOADS_PER_WINDOW = 3;
|
||||
const RELOAD_WINDOW_MS = 60_000;
|
||||
|
||||
interface RendererExit {
|
||||
reason: string;
|
||||
exitCode: number;
|
||||
}
|
||||
|
||||
interface RecoverableWindow {
|
||||
isDestroyed(): boolean;
|
||||
webContents: {
|
||||
on(
|
||||
event: "render-process-gone",
|
||||
listener: (event: unknown, details: RendererExit) => void,
|
||||
): unknown;
|
||||
getURL(): string;
|
||||
reload(): void;
|
||||
};
|
||||
}
|
||||
|
||||
export function reloadWhenRendererExits(
|
||||
win: RecoverableWindow,
|
||||
options: { now?: () => number } = {},
|
||||
): void {
|
||||
const now = options.now ?? Date.now;
|
||||
let reloadTimes: number[] = [];
|
||||
|
||||
win.webContents.on("render-process-gone", (_event, details) => {
|
||||
if (details.reason === "clean-exit" || win.isDestroyed()) return;
|
||||
// Before the first page commits, Chromium finishes the navigation in a new
|
||||
// renderer by itself. Reloading then would abort the window's initial load.
|
||||
if (win.webContents.getURL() === "") return;
|
||||
|
||||
const time = now();
|
||||
reloadTimes = reloadTimes.filter((reloadTime) => time - reloadTime < RELOAD_WINDOW_MS);
|
||||
if (reloadTimes.length >= MAX_RELOADS_PER_WINDOW) {
|
||||
log.error(
|
||||
`[renderer-recovery] Renderer exited (${details.reason}, code ${details.exitCode}); ` +
|
||||
`not reloading after ${reloadTimes.length} reloads in the last minute`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
reloadTimes.push(time);
|
||||
log.warn(
|
||||
`[renderer-recovery] Renderer exited (${details.reason}, code ${details.exitCode}); ` +
|
||||
`reloading the window (reload ${reloadTimes.length} in the last minute)`,
|
||||
);
|
||||
win.webContents.reload();
|
||||
});
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/expo-two-way-audio",
|
||||
"version": "0.16.0-beta.2",
|
||||
"version": "0.16.2",
|
||||
"description": "Native module for two way audio streaming",
|
||||
"keywords": [
|
||||
"ExpoTwoWayAudio",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/highlight",
|
||||
"version": "0.16.0-beta.2",
|
||||
"version": "0.16.2",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
"dist",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/plugin",
|
||||
"version": "0.16.0-beta.2",
|
||||
"version": "0.16.2",
|
||||
"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.16.0-beta.2",
|
||||
"@getpaseo/protocol": "0.16.0-beta.2",
|
||||
"@getpaseo/client": "0.16.2",
|
||||
"@getpaseo/protocol": "0.16.2",
|
||||
"@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.16.0-beta.2",
|
||||
"@getpaseo/protocol": "0.16.0-beta.2",
|
||||
"@getpaseo/client": "0.16.2",
|
||||
"@getpaseo/protocol": "0.16.2",
|
||||
"react": ">=19.1.0 <20",
|
||||
"react-native": ">=0.81.5",
|
||||
"zod": "^4.4.3"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/protocol",
|
||||
"version": "0.16.0-beta.2",
|
||||
"version": "0.16.2",
|
||||
"description": "Paseo shared protocol schemas and wire types",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/relay",
|
||||
"version": "0.16.0-beta.2",
|
||||
"version": "0.16.2",
|
||||
"description": "Paseo relay for bridging daemon and client connections",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/server",
|
||||
"version": "0.16.0-beta.2",
|
||||
"version": "0.16.2",
|
||||
"description": "Paseo backend server",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
@@ -107,13 +107,13 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "^0.17.1",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.246",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.326",
|
||||
"@anthropic-ai/sdk": "^0.104.2",
|
||||
"@getpaseo/client": "0.16.0-beta.2",
|
||||
"@getpaseo/highlight": "0.16.0-beta.2",
|
||||
"@getpaseo/plugin": "0.16.0-beta.2",
|
||||
"@getpaseo/protocol": "0.16.0-beta.2",
|
||||
"@getpaseo/relay": "0.16.0-beta.2",
|
||||
"@getpaseo/client": "0.16.2",
|
||||
"@getpaseo/highlight": "0.16.2",
|
||||
"@getpaseo/plugin": "0.16.2",
|
||||
"@getpaseo/protocol": "0.16.2",
|
||||
"@getpaseo/relay": "0.16.2",
|
||||
"@isaacs/ttlcache": "^2.1.4",
|
||||
"@modelcontextprotocol/sdk": "1.29.0",
|
||||
"@opencode-ai/sdk": "1.14.46",
|
||||
|
||||
@@ -3426,6 +3426,101 @@ test("cancelAgentRun succeeds when the provider queues completion before rejecti
|
||||
}
|
||||
});
|
||||
|
||||
test.each([
|
||||
{ binding: "foreground", agentId: "00000000-0000-4000-8000-000000000307" },
|
||||
{ binding: "autonomous", agentId: "00000000-0000-4000-8000-000000000308" },
|
||||
] as const)(
|
||||
"cancelAgentRun settles a $binding run bound to an already finalized turn",
|
||||
async ({ binding, agentId }) => {
|
||||
const fixture = await createControlledInterruptFixture({
|
||||
name: `interrupt-finalized-${binding}`,
|
||||
agentId,
|
||||
turnId: "finalized-turn",
|
||||
interrupt: async () => {},
|
||||
});
|
||||
|
||||
try {
|
||||
await fixture.startForegroundRun();
|
||||
await expect(fixture.manager.cancelAgentRun(fixture.agentId)).resolves.toEqual({
|
||||
status: "settled",
|
||||
});
|
||||
|
||||
if (binding === "foreground") {
|
||||
await fixture.startForegroundRun();
|
||||
} else {
|
||||
const running = waitForAgentLifecycle(fixture.manager, fixture.agentId, "running");
|
||||
fixture.session.pushEvent({
|
||||
type: "turn_started",
|
||||
provider: "codex",
|
||||
turnId: "finalized-turn",
|
||||
});
|
||||
await running;
|
||||
}
|
||||
|
||||
const cancellation = await Promise.race([
|
||||
fixture.manager.cancelAgentRun(fixture.agentId),
|
||||
new Promise<"pending">((resolve) => setTimeout(() => resolve("pending"), 3_000)),
|
||||
]);
|
||||
expect(cancellation).toEqual({ status: "settled" });
|
||||
expect(fixture.manager.getAgent(fixture.agentId)).toMatchObject({
|
||||
lifecycle: "idle",
|
||||
activeForegroundTurnId: null,
|
||||
});
|
||||
|
||||
await expect(fixture.manager.cancelAgentRun(fixture.agentId)).resolves.toEqual({
|
||||
status: "not_running",
|
||||
});
|
||||
await fixture.startForegroundRun();
|
||||
expect(fixture.manager.getAgent(fixture.agentId)).toMatchObject({
|
||||
lifecycle: "running",
|
||||
activeForegroundTurnId: "finalized-turn",
|
||||
});
|
||||
} finally {
|
||||
await fixture.cleanup();
|
||||
}
|
||||
},
|
||||
10_000,
|
||||
);
|
||||
|
||||
test("the provider's terminal for a run bound to an already finalized turn settles the run", async () => {
|
||||
const fixture = await createControlledInterruptFixture({
|
||||
name: "interrupt-finalized-provider-terminal",
|
||||
agentId: "00000000-0000-4000-8000-000000000309",
|
||||
turnId: "finalized-provider-terminal-turn",
|
||||
interrupt: async () => {},
|
||||
});
|
||||
|
||||
try {
|
||||
await fixture.startForegroundRun();
|
||||
await expect(fixture.manager.cancelAgentRun(fixture.agentId)).resolves.toEqual({
|
||||
status: "settled",
|
||||
});
|
||||
|
||||
await fixture.startForegroundRun();
|
||||
const idle = waitForAgentLifecycle(fixture.manager, fixture.agentId, "idle");
|
||||
fixture.session.pushEvent({
|
||||
type: "turn_completed",
|
||||
provider: "codex",
|
||||
turnId: "finalized-provider-terminal-turn",
|
||||
});
|
||||
const settlement = await Promise.race([
|
||||
idle.then(() => "idle" as const),
|
||||
new Promise<"pending">((resolve) => setTimeout(() => resolve("pending"), 1_000)),
|
||||
]);
|
||||
|
||||
expect(settlement).toBe("idle");
|
||||
expect(fixture.manager.getAgent(fixture.agentId)).toMatchObject({
|
||||
lifecycle: "idle",
|
||||
activeForegroundTurnId: null,
|
||||
});
|
||||
await expect(fixture.manager.cancelAgentRun(fixture.agentId)).resolves.toEqual({
|
||||
status: "not_running",
|
||||
});
|
||||
} finally {
|
||||
await fixture.cleanup();
|
||||
}
|
||||
}, 10_000);
|
||||
|
||||
test("listProviderAvailability uses registered client keys, including custom providers", async () => {
|
||||
const customClient: AgentClient = {
|
||||
provider: "zai",
|
||||
@@ -13532,6 +13627,33 @@ test("the last assistant message is the newest turn's reply, not joined to the p
|
||||
}
|
||||
});
|
||||
|
||||
test("the last assistant message read from rebuilt history is the newest reply, not joined to the one before it", async () => {
|
||||
// Rows replayed from provider history have no turn id. A reply the agent starts on its own,
|
||||
// such as Claude waking after a background subagent, follows the previous reply with no user
|
||||
// message between them; only their message ids tell them apart.
|
||||
const workdir = mkdtempSync(join(tmpdir(), "agent-manager-history-last-reply-"));
|
||||
const codex = fakeCodexEmitting({
|
||||
historyItems: [
|
||||
{ type: "user_message", text: "Start a background task.", messageId: "user-1" },
|
||||
{ type: "assistant_message", text: "Started it, ", messageId: "message-1" },
|
||||
{ type: "assistant_message", text: "I will report back.", messageId: "message-1" },
|
||||
{ type: "assistant_message", text: "The task finished.", messageId: "message-2" },
|
||||
],
|
||||
});
|
||||
const manager = new AgentManager({ clients: { codex }, logger });
|
||||
const agent = await manager.createAgent({ provider: "codex", cwd: workdir }, undefined, {
|
||||
workspaceId: undefined,
|
||||
});
|
||||
try {
|
||||
await manager.hydrateTimelineFromProvider(agent.id, { force: true });
|
||||
|
||||
expect(await manager.getLastAssistantMessage(agent.id)).toBe("The task finished.");
|
||||
} finally {
|
||||
await manager.closeAgent(agent.id);
|
||||
rmSync(workdir, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
test("reads the last durable assistant response without loading a stored-only child", async () => {
|
||||
const store = new RecordingTimelineStore();
|
||||
await store.appendCommitted("stored-child", {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { ProviderOptionsValidationError } from "./provider-options.js";
|
||||
import type { AgentToolResult } from "@getpaseo/plugin/server";
|
||||
import type { RuntimeCleanupCandidate } from "./idle-runtime-cleanup/index.js";
|
||||
import { AgentNotFoundError, ensureAgentLoaded } from "./agent-loading.js";
|
||||
import { projectTimelineRows } from "./timeline-projection.js";
|
||||
import { continuesAssistantMessage, projectTimelineRows } from "./timeline-projection.js";
|
||||
import type { PluginLifecycle } from "../plugins/lifecycle/index.js";
|
||||
import { describeHookAgent, publishAgentStream } from "../plugins/lifecycle/index.js";
|
||||
import { applyRecordPatch } from "../record-patch.js";
|
||||
@@ -4058,24 +4058,16 @@ export class AgentManager {
|
||||
private getLastAssistantMessageSegmentFromTimeline(
|
||||
timeline: readonly Pick<AgentTimelineRow, "item" | "turnId">[],
|
||||
): { text: string; startsAtBeginning: boolean } | null {
|
||||
// Collect the last contiguous assistant messages of one turn (Claude streams chunks).
|
||||
// A turn the provider starts on its own has no user message before its reply.
|
||||
// Collect the chunks of the last assistant message (Claude streams chunks). A turn the
|
||||
// provider starts on its own has no user message before its reply.
|
||||
const chunks: string[] = [];
|
||||
let replyTurnId: string | undefined;
|
||||
let startsAtBeginning = false;
|
||||
for (let i = timeline.length - 1; i >= 0; i--) {
|
||||
const { item, turnId } = timeline[i];
|
||||
if (item.type !== "assistant_message") {
|
||||
if (chunks.length) {
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (chunks.length === 0) {
|
||||
replyTurnId = turnId;
|
||||
} else if (turnId !== replyTurnId) {
|
||||
const { item } = timeline[i];
|
||||
if (chunks.length > 0 && !continuesAssistantMessage(timeline[i], timeline[i + 1])) {
|
||||
break;
|
||||
}
|
||||
if (item.type !== "assistant_message") continue;
|
||||
chunks.push(item.text);
|
||||
startsAtBeginning = i === 0;
|
||||
}
|
||||
@@ -5077,7 +5069,8 @@ export class AgentManager {
|
||||
if (
|
||||
eventTurnId &&
|
||||
isTurnTerminalEvent(event) &&
|
||||
this.runs.hasFinalizedTurn(agent, eventTurnId)
|
||||
this.runs.hasFinalizedTurn(agent, eventTurnId) &&
|
||||
this.runs.getTurnId(agent.id) !== eventTurnId
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -264,6 +264,7 @@ function buildAgentManagerSpies() {
|
||||
archiveAgent: vi.fn().mockResolvedValue({ archivedAt: new Date().toISOString() }),
|
||||
notifyAgentState: vi.fn(),
|
||||
getAgent: vi.fn(),
|
||||
getAgentBackgroundWorkSummary: vi.fn().mockReturnValue(undefined),
|
||||
listAgents: vi.fn().mockReturnValue([]),
|
||||
getTimeline: vi.fn().mockReturnValue([]),
|
||||
resumeAgentFromPersistence: vi.fn(),
|
||||
@@ -6181,6 +6182,36 @@ describe("agent snapshot MCP serialization", () => {
|
||||
expect(structured.agents[0]).not.toHaveProperty("pendingPermissions");
|
||||
});
|
||||
|
||||
it("reports an idle agent's background work from get_agent_status and list_agents", async () => {
|
||||
const { agentManager, agentStorage, spies } = createTestDeps();
|
||||
const agent = createManagedAgent({ id: "agent-with-shell", cwd: REPO_CWD });
|
||||
spies.agentManager.getAgent.mockReturnValue(agent);
|
||||
spies.agentManager.listAgents.mockReturnValue([agent]);
|
||||
spies.agentManager.getAgentBackgroundWorkSummary.mockReturnValue({ count: 1 });
|
||||
|
||||
const server = await createAgentMcpServer({
|
||||
agentManager,
|
||||
agentStorage,
|
||||
providerSnapshotManager: createOpenCodeManager().manager,
|
||||
logger,
|
||||
});
|
||||
const status = await registeredTool(server, "get_agent_status").handler({
|
||||
agentId: "agent-with-shell",
|
||||
});
|
||||
const list = await registeredTool(server, "list_agents").handler({});
|
||||
|
||||
expect(status.structuredContent).toEqual({
|
||||
status: "idle",
|
||||
snapshot: expect.objectContaining({ status: "idle", backgroundWork: { count: 1 } }),
|
||||
});
|
||||
expect(list.structuredContent).toEqual({
|
||||
agents: [expect.objectContaining({ status: "idle", backgroundWork: { count: 1 } })],
|
||||
});
|
||||
expect(spies.agentManager.getAgentBackgroundWorkSummary).toHaveBeenCalledWith(
|
||||
"agent-with-shell",
|
||||
);
|
||||
});
|
||||
|
||||
it("returns archived agent snapshots from storage for get_agent_status", async () => {
|
||||
const { agentManager, agentStorage, spies } = createTestDeps();
|
||||
const record = createStoredRecord({
|
||||
|
||||
@@ -51,7 +51,6 @@ import {
|
||||
} from "./copilot-acp-agent.js";
|
||||
import { GenericACPAgentClient } from "./generic-acp-agent.js";
|
||||
import { parseKiroExtensionCommands } from "./kiro-acp-agent.js";
|
||||
import { transformPiModels } from "./pi/agent.js";
|
||||
import type { AgentStreamEvent } from "../agent-sdk-types.js";
|
||||
import type {
|
||||
AgentCapabilityFlags,
|
||||
@@ -2260,7 +2259,12 @@ describe("ACPAgentClient modelTransformer", () => {
|
||||
provider: "pi",
|
||||
logger: createTestLogger(),
|
||||
defaultCommand: ["test-acp"],
|
||||
modelTransformer: transformPiModels,
|
||||
modelTransformer: (models) =>
|
||||
models.map((model) => ({
|
||||
...model,
|
||||
label: model.label.split("/").at(-1) ?? model.label,
|
||||
description: model.id,
|
||||
})),
|
||||
});
|
||||
|
||||
await expect(
|
||||
@@ -2914,60 +2918,6 @@ describe("ACP providers advertise session listing", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("transformPiModels", () => {
|
||||
test("keeps slash-free labels unchanged", () => {
|
||||
expect(
|
||||
transformPiModels([
|
||||
{
|
||||
provider: "pi",
|
||||
id: "gpt-4.1-mini",
|
||||
label: "GPT 4.1 Mini",
|
||||
description: "Fast",
|
||||
},
|
||||
]),
|
||||
).toEqual([
|
||||
{
|
||||
provider: "pi",
|
||||
id: "gpt-4.1-mini",
|
||||
label: "GPT 4.1 Mini",
|
||||
description: "Fast",
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
test("uses the last path segment as label and preserves existing descriptions", () => {
|
||||
expect(
|
||||
transformPiModels([
|
||||
{
|
||||
provider: "pi",
|
||||
id: "openrouter/openai/gpt-4.1-mini",
|
||||
label: "openrouter/openai/gpt-4.1-mini",
|
||||
description: undefined,
|
||||
},
|
||||
{
|
||||
provider: "pi",
|
||||
id: "anthropic/claude-sonnet-4",
|
||||
label: "anthropic/claude-sonnet-4",
|
||||
description: "Balanced",
|
||||
},
|
||||
]),
|
||||
).toEqual([
|
||||
{
|
||||
provider: "pi",
|
||||
id: "openrouter/openai/gpt-4.1-mini",
|
||||
label: "gpt-4.1-mini",
|
||||
description: "openrouter/openai/gpt-4.1-mini",
|
||||
},
|
||||
{
|
||||
provider: "pi",
|
||||
id: "anthropic/claude-sonnet-4",
|
||||
label: "claude-sonnet-4",
|
||||
description: "Balanced",
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("ACPAgentSession slash commands", () => {
|
||||
test("returns immediately for ACP sessions that do not wait for async command discovery", async () => {
|
||||
const session = new ACPAgentSession(
|
||||
|
||||
@@ -91,7 +91,7 @@ test.each([
|
||||
}
|
||||
});
|
||||
|
||||
test("bypass allows execution without publishing permission events and follows live mode changes", async () => {
|
||||
async function createBypassSession() {
|
||||
let requestPermission: CanUseTool | undefined;
|
||||
const query = Object.assign((async function* () {})(), {
|
||||
async setPermissionMode(_mode: PermissionMode) {},
|
||||
@@ -112,17 +112,25 @@ test("bypass allows execution without publishing permission events and follows l
|
||||
});
|
||||
const events: AgentStreamEvent[] = [];
|
||||
session.subscribe((event) => events.push(event));
|
||||
await session.setMode("bypassPermissions");
|
||||
if (!requestPermission) throw new Error("SDK permission callback was not installed");
|
||||
return { session, events, requestPermission };
|
||||
}
|
||||
|
||||
test("bypass approves Claude's own checks without publishing permission events and follows live mode changes", async () => {
|
||||
const { session, events, requestPermission } = await createBypassSession();
|
||||
try {
|
||||
await session.setMode("bypassPermissions");
|
||||
if (!requestPermission) throw new Error("SDK permission callback was not installed");
|
||||
const controller = new AbortController();
|
||||
const input = { command: "echo hello" };
|
||||
const result = requestPermission("Bash", input, {
|
||||
const input = { command: "rm -rf build" };
|
||||
// Claude Code sends these fields, but this SDK version does not declare them on CanUseTool.
|
||||
const ownCheck = {
|
||||
signal: controller.signal,
|
||||
toolUseID: "execution",
|
||||
decisionReason: "Explicit ask rule",
|
||||
});
|
||||
// Abort also settles the pre-fix callback, so this repro never hangs.
|
||||
decisionReason: "Dangerous rm command",
|
||||
decisionReasonType: "safetyCheck",
|
||||
};
|
||||
const result = requestPermission("Bash", input, ownCheck);
|
||||
// Abort also settles a prompting callback, so this test never hangs.
|
||||
controller.abort();
|
||||
await expect(result).resolves.toMatchObject({ behavior: "allow", updatedInput: input });
|
||||
expect(events.filter((event) => event.type.startsWith("permission_"))).toEqual([]);
|
||||
@@ -135,6 +143,7 @@ test("bypass allows execution without publishing permission events and follows l
|
||||
] as const) {
|
||||
await session.setMode(mode);
|
||||
const resolution = requestPermission(tool, toolInput, {
|
||||
...ownCheck,
|
||||
signal: new AbortController().signal,
|
||||
toolUseID: tool,
|
||||
});
|
||||
@@ -149,3 +158,44 @@ test("bypass allows execution without publishing permission events and follows l
|
||||
await session.close();
|
||||
}
|
||||
});
|
||||
|
||||
test.each([
|
||||
["an ask rule", { decisionReasonType: "rule" }],
|
||||
["a hook", { decisionReasonType: "hook", decisionReason: "Confirm before posting" }],
|
||||
[
|
||||
"an ask rule on Claude's own check",
|
||||
{
|
||||
decisionReasonType: "safetyCheck",
|
||||
matchedAskRule: { source: "policySettings", toolName: "Bash", ruleContent: "rm *" },
|
||||
},
|
||||
],
|
||||
[
|
||||
"a tool the user answers on the card",
|
||||
{ decisionReasonType: "other", requiresUserInteraction: true },
|
||||
],
|
||||
["a compound command with an ask rule in one part", { decisionReasonType: "subcommandResults" }],
|
||||
[
|
||||
"a read the user blocked outside the working directories",
|
||||
{ decisionReasonType: "safetyCheck", decisionReasonCode: "outside_reads_blocked" },
|
||||
],
|
||||
[
|
||||
"an organization's ask limit",
|
||||
{ decisionReasonType: "workingDir", decisionReasonCode: "org_ask_ceiling" },
|
||||
],
|
||||
["a sandbox override the user's read block raised", { decisionReasonType: "sandboxOverride" }],
|
||||
["a Claude Code that does not say why it asks", {}],
|
||||
])("bypass still asks the user about %s", async (_source, why) => {
|
||||
const { session, events, requestPermission } = await createBypassSession();
|
||||
try {
|
||||
const ask = { signal: new AbortController().signal, toolUseID: "execution", ...why };
|
||||
const resolution = requestPermission("Bash", { command: "gh pr comment 1" }, ask);
|
||||
const requestEvent = events.at(-1);
|
||||
expect(requestEvent?.type).toBe("permission_requested");
|
||||
if (requestEvent?.type !== "permission_requested")
|
||||
throw new Error("Missing permission request");
|
||||
await session.respondToPermission(requestEvent.request.id, { behavior: "deny" });
|
||||
await expect(resolution).resolves.toMatchObject({ behavior: "deny" });
|
||||
} finally {
|
||||
await session.close();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -2070,3 +2070,212 @@ test("does not use stream_event uuid as assistant message identity when message_
|
||||
|
||||
await session.close();
|
||||
});
|
||||
|
||||
// A background command's notification starts a turn. When Claude responds, the notification and
|
||||
// the response are one turn. When Claude does not respond, the notification is a turn in itself.
|
||||
// The frame sequences below are the ones Claude Code 2.1.321 sent on the wire.
|
||||
|
||||
function backgroundCommandNotification(taskId: string, status: "completed" | "stopped") {
|
||||
return {
|
||||
type: "system",
|
||||
subtype: "task_notification",
|
||||
task_id: taskId,
|
||||
tool_use_id: `toolu_${taskId}`,
|
||||
status,
|
||||
summary: `Background command ${status}`,
|
||||
output_file: `/tmp/${taskId}.output`,
|
||||
uuid: `uuid-${taskId}-${status}`,
|
||||
session_id: "sess-1",
|
||||
};
|
||||
}
|
||||
|
||||
const backgroundTasksChanged = {
|
||||
type: "system",
|
||||
subtype: "background_tasks_changed",
|
||||
tasks: [],
|
||||
uuid: "uuid-background-tasks-changed",
|
||||
session_id: "sess-1",
|
||||
};
|
||||
|
||||
function notificationRowTurnIds(events: AgentStreamEvent[]): (string | undefined)[] {
|
||||
return events
|
||||
.filter(
|
||||
(event): event is Extract<AgentStreamEvent, { type: "timeline" }> =>
|
||||
event.type === "timeline" &&
|
||||
event.item.type === "tool_call" &&
|
||||
event.item.name === "task_notification",
|
||||
)
|
||||
.map((event) => event.turnId);
|
||||
}
|
||||
|
||||
function startedTurnIds(events: AgentStreamEvent[]): (string | undefined)[] {
|
||||
return events
|
||||
.filter((event) => event.type === "turn_started")
|
||||
.map((event) => (event.type === "turn_started" ? event.turnId : undefined));
|
||||
}
|
||||
|
||||
async function createObservedSession() {
|
||||
sdkQueryFactory.mockImplementation(() => createPendingQueryMock());
|
||||
const session = await createSession();
|
||||
const internal: SessionStateInternals = asInternals(session);
|
||||
const queryMock = createPendingQueryMock();
|
||||
const events: AgentStreamEvent[] = [];
|
||||
session.subscribe((event) => events.push(event));
|
||||
async function route(...frames: Record<string, unknown>[]) {
|
||||
for (const frame of frames) await internal.routeSdkMessageFromPump(frame, queryMock);
|
||||
}
|
||||
return { session, internal, events, route };
|
||||
}
|
||||
|
||||
test("a completed command's notification and Claude's response to it are one turn", async () => {
|
||||
const { session, internal, events, route } = await createObservedSession();
|
||||
|
||||
await route(backgroundCommandNotification("sleep-40", "completed"), backgroundTasksChanged);
|
||||
const [notificationTurnId] = notificationRowTurnIds(events);
|
||||
expect(notificationTurnId).toEqual(expect.any(String));
|
||||
expect(startedTurnIds(events)).toEqual([]);
|
||||
expect(internal.turnState).toBe("idle");
|
||||
|
||||
await route(sessionState("running"), claudeTurnInit(), unboundTextDelta("SECOND REPLY"));
|
||||
expect(startedTurnIds(events)).toEqual([notificationTurnId]);
|
||||
expect(internal.turnState).toBe("autonomous");
|
||||
|
||||
await route(successResult(), sessionState("idle"));
|
||||
expect(internal.turnState).toBe("idle");
|
||||
|
||||
await session.close();
|
||||
});
|
||||
|
||||
test("a stopped command Claude does not respond to is a turn in itself, and the next notification starts the next turn", async () => {
|
||||
const { session, internal, events, route } = await createObservedSession();
|
||||
|
||||
await route(backgroundCommandNotification("sleep-300", "stopped"), backgroundTasksChanged);
|
||||
const [stoppedTurnId] = notificationRowTurnIds(events);
|
||||
expect(stoppedTurnId).toEqual(expect.any(String));
|
||||
expect(startedTurnIds(events)).toEqual([]);
|
||||
expect(internal.turnState).toBe("idle");
|
||||
|
||||
await route(backgroundCommandNotification("sleep-60", "completed"), backgroundTasksChanged);
|
||||
const [, completedTurnId] = notificationRowTurnIds(events);
|
||||
expect(completedTurnId).toEqual(expect.any(String));
|
||||
expect(completedTurnId).not.toBe(stoppedTurnId);
|
||||
|
||||
await route(sessionState("running"), claudeTurnInit(), successResult(), sessionState("idle"));
|
||||
expect(startedTurnIds(events)).toEqual([completedTurnId]);
|
||||
|
||||
await session.close();
|
||||
});
|
||||
|
||||
test("a run Claude announces as a queued command does not belong to the notification before it", async () => {
|
||||
const { session, events, route } = await createObservedSession();
|
||||
|
||||
await route(backgroundCommandNotification("sleep-300", "stopped"), backgroundTasksChanged);
|
||||
const [stoppedTurnId] = notificationRowTurnIds(events);
|
||||
|
||||
// A scheduled wake-up: Claude announces the queued command it starts before the run's init.
|
||||
await route(
|
||||
sessionState("running"),
|
||||
commandLifecycle("cron-prompt", "started"),
|
||||
claudeTurnInit(),
|
||||
);
|
||||
const [runTurnId] = startedTurnIds(events);
|
||||
expect(runTurnId).toEqual(expect.any(String));
|
||||
expect(runTurnId).not.toBe(stoppedTurnId);
|
||||
|
||||
await session.close();
|
||||
});
|
||||
|
||||
test("a run Claude starts for a finished background subagent does not belong to the notification before it", async () => {
|
||||
const { session, events, route } = await createObservedSession();
|
||||
|
||||
await route(helperTaskStarted);
|
||||
await route(backgroundCommandNotification("sleep-300", "stopped"), backgroundTasksChanged);
|
||||
const [stoppedTurnId] = notificationRowTurnIds(events);
|
||||
|
||||
await route(helperCompleted, claudeTurnInit());
|
||||
const [runTurnId] = startedTurnIds(events);
|
||||
expect(runTurnId).toEqual(expect.any(String));
|
||||
expect(runTurnId).not.toBe(stoppedTurnId);
|
||||
|
||||
await session.close();
|
||||
});
|
||||
|
||||
test("the user's next message starts its own turn after a notification Claude did not respond to", async () => {
|
||||
const { session, internal, events, route } = await createObservedSession();
|
||||
|
||||
await route(backgroundCommandNotification("sleep-300", "stopped"), backgroundTasksChanged);
|
||||
const [stoppedTurnId] = notificationRowTurnIds(events);
|
||||
|
||||
const { turnId } = await session.startTurn("PING");
|
||||
expect(turnId).not.toBe(stoppedTurnId);
|
||||
await route(claudeTurnInit(), successResult());
|
||||
expect(internal.activeForegroundTurnId).toBeNull();
|
||||
|
||||
// A run Claude starts later, with nothing announced, is not the stopped command's turn either.
|
||||
await route(claudeTurnInit());
|
||||
expect(startedTurnIds(events).at(-1)).not.toBe(stoppedTurnId);
|
||||
|
||||
await session.close();
|
||||
});
|
||||
|
||||
test("a run Claude starts without announcing anything belongs to the last notification", async () => {
|
||||
const { session, events, route } = await createObservedSession();
|
||||
|
||||
// Claude sends no frame for a Monitor event, so its wake-up reads as the response to the stop.
|
||||
await route(backgroundCommandNotification("sleep-300", "stopped"), backgroundTasksChanged);
|
||||
const [stoppedTurnId] = notificationRowTurnIds(events);
|
||||
|
||||
await route(sessionState("running"), claudeTurnInit());
|
||||
expect(startedTurnIds(events)).toEqual([stoppedTurnId]);
|
||||
|
||||
await session.close();
|
||||
});
|
||||
|
||||
test("a notification during a turn belongs to that turn", async () => {
|
||||
const { session, events, route } = await createObservedSession();
|
||||
|
||||
await route(claudeTurnInit());
|
||||
const [runTurnId] = startedTurnIds(events);
|
||||
await route(backgroundCommandNotification("sleep-40", "completed"));
|
||||
expect(notificationRowTurnIds(events)).toEqual([runTurnId]);
|
||||
await route(successResult(), claudeTurnInit());
|
||||
expect(startedTurnIds(events)).toHaveLength(2);
|
||||
expect(startedTurnIds(events)[1]).not.toBe(runTurnId);
|
||||
|
||||
await session.close();
|
||||
});
|
||||
|
||||
test("a background subagent's own job notification does not start a main-session turn", async () => {
|
||||
const { session, events, route } = await createObservedSession();
|
||||
|
||||
// The helper runs a background Bash of its own; its notification reports to the helper.
|
||||
await route(helperTaskStarted, {
|
||||
type: "assistant",
|
||||
parent_tool_use_id: "toolu_helper",
|
||||
session_id: "sess-1",
|
||||
message: {
|
||||
id: "msg-helper-bash",
|
||||
role: "assistant",
|
||||
model: "opus",
|
||||
content: [{ type: "tool_use", id: "toolu_subagent_bash", name: "Bash", input: {} }],
|
||||
},
|
||||
});
|
||||
|
||||
await route(backgroundCommandNotification("sleep-40", "completed"), backgroundTasksChanged);
|
||||
const [notificationTurnId] = notificationRowTurnIds(events);
|
||||
await route(subagentOwnedTaskNotification);
|
||||
expect(
|
||||
events.some(
|
||||
(event) =>
|
||||
event.type === "provider_subagent" &&
|
||||
event.event.type === "timeline" &&
|
||||
event.event.item.type === "tool_call" &&
|
||||
event.event.item.name === "task_notification",
|
||||
),
|
||||
).toBe(true);
|
||||
|
||||
await route(claudeTurnInit());
|
||||
expect(startedTurnIds(events)).toEqual([notificationTurnId]);
|
||||
|
||||
await session.close();
|
||||
});
|
||||
|
||||
@@ -1544,6 +1544,60 @@ describe("ClaudeAgentSession features", () => {
|
||||
}
|
||||
});
|
||||
|
||||
test("accepts a steer while Claude compacts, so the compaction is not interrupted", async () => {
|
||||
const { queryFactory, push } = createStreamingQueryMock();
|
||||
const client = new ClaudeAgentClient({
|
||||
logger,
|
||||
queryFactory,
|
||||
resolveBinary: async () => "/test/claude/bin",
|
||||
});
|
||||
const session = await client.createSession({ provider: "claude", cwd: process.cwd() });
|
||||
const events: AgentStreamEvent[] = [];
|
||||
const unsubscribe = session.subscribe((event) => events.push(event));
|
||||
try {
|
||||
const { turnId } = await session.startTurn("/compact");
|
||||
const input = queryFactory.mock.calls[0]?.[0].prompt as AsyncIterable<SDKUserMessage>;
|
||||
const iterator = input[Symbol.asyncIterator]();
|
||||
await expect(iterator.next()).resolves.toMatchObject({ value: { type: "user" } });
|
||||
await vi.waitFor(() =>
|
||||
expect(events).toContainEqual(
|
||||
expect.objectContaining({
|
||||
type: "timeline",
|
||||
item: expect.objectContaining({ type: "user_message" }),
|
||||
}),
|
||||
),
|
||||
);
|
||||
push({
|
||||
type: "system",
|
||||
subtype: "status",
|
||||
status: "compacting",
|
||||
session_id: "session-1",
|
||||
} as unknown as SDKMessage);
|
||||
await vi.waitFor(() =>
|
||||
expect(events).toContainEqual(
|
||||
expect.objectContaining({
|
||||
type: "timeline",
|
||||
item: { type: "compaction", status: "loading" },
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
const admission = await session.steerActiveTurn?.("message during compaction", {
|
||||
expectedTurnId: turnId,
|
||||
});
|
||||
|
||||
// Claude Code holds a `next` message until the compaction finishes. Refusing it makes the
|
||||
// manager replace the turn, and the interrupt cancels the compaction.
|
||||
expect(admission).toEqual({ status: "accepted", providerMessageId: expect.any(String) });
|
||||
await expect(iterator.next()).resolves.toMatchObject({
|
||||
value: { type: "user", priority: "next" },
|
||||
});
|
||||
} finally {
|
||||
unsubscribe();
|
||||
await session.close();
|
||||
}
|
||||
});
|
||||
|
||||
test("a human steer supersedes blocking permissions until Claude reads it", async () => {
|
||||
const { queryFactory } = createQueryMock();
|
||||
const client = new ClaudeAgentClient({
|
||||
|
||||
@@ -11,6 +11,7 @@ import path from "node:path";
|
||||
import { LRUCache } from "lru-cache";
|
||||
import stripAnsi from "strip-ansi";
|
||||
import { createImportDescriptorScheduler } from "./import-descriptor-scheduler.js";
|
||||
import { bypassApprovesAsk } from "./bypass-approval.js";
|
||||
import {
|
||||
type AgentDefinition,
|
||||
type CanUseTool,
|
||||
@@ -83,7 +84,7 @@ import {
|
||||
type ClaudeProviderOptions,
|
||||
} from "./options.js";
|
||||
import { renderPromptAttachmentAsText } from "../../prompt-attachments.js";
|
||||
import { discoverClaudeModels } from "./model-discovery.js";
|
||||
import { discoverClaudeModels, killExitingClaudeModelDiscoveries } from "./model-discovery.js";
|
||||
import { claudeQuery, type ClaudeOptions, type ClaudeQueryFactory } from "./query.js";
|
||||
import {
|
||||
findSteeredMessageParent,
|
||||
@@ -1751,6 +1752,10 @@ export class ClaudeAgentClient implements AgentClient {
|
||||
};
|
||||
}
|
||||
|
||||
async shutdown(): Promise<void> {
|
||||
await killExitingClaudeModelDiscoveries();
|
||||
}
|
||||
|
||||
async resolveDefaultModeId({ env: launchEnv }: ResolveAgentDefaultModeInput): Promise<string> {
|
||||
return claudeModeCatalog(this.buildProviderEnv(launchEnv)).defaultModeId;
|
||||
}
|
||||
@@ -2334,6 +2339,14 @@ class ClaudeAgentSession implements AgentSession {
|
||||
private pendingPermissions = new Map<string, PendingPermission>();
|
||||
private activeForegroundTurnId: string | null = null;
|
||||
private autonomousTurn: AutonomousTurnState | null = null;
|
||||
/**
|
||||
* The turn the last background task notification started. A notification that arrives while no
|
||||
* turn runs starts a turn, and Claude's next run belongs to it unless Claude announces another
|
||||
* start first: a later notification starts the next turn, and a queued command (the user's
|
||||
* message, a scheduled wake-up) starts its own. When Claude does not respond, the notification is
|
||||
* a turn in itself. See observeNotificationTurn.
|
||||
*/
|
||||
private notificationTurnId: string | null = null;
|
||||
private readonly subscribers = new Set<(event: AgentStreamEvent) => void>();
|
||||
private readonly timelineAssembler = new TimelineAssembler();
|
||||
private readonly taskState = new ClaudeTaskState();
|
||||
@@ -2554,6 +2567,7 @@ class ClaudeAgentSession implements AgentSession {
|
||||
this.rememberRewindUserAnchor(sdkUserMessageId);
|
||||
const turnId = this.createTurnId("foreground");
|
||||
this.activeForegroundTurnId = turnId;
|
||||
this.notificationTurnId = null;
|
||||
this.foregroundHasVisibleActivity = false;
|
||||
this.activeTurnHasAssistantText = false;
|
||||
this.withheldErrorReply = [];
|
||||
@@ -2632,7 +2646,10 @@ class ClaudeAgentSession implements AgentSession {
|
||||
return { status: "unavailable" };
|
||||
}
|
||||
const activeTurnId = this.activeForegroundTurnId ?? this.autonomousTurn?.id;
|
||||
if (this.compacting || activeTurnId !== options.expectedTurnId) {
|
||||
// A compacting turn still takes a steer: Claude Code holds a `next` message until the
|
||||
// compaction finishes. Refusing it makes the manager replace the turn, and that interrupt
|
||||
// cancels the compaction.
|
||||
if (activeTurnId !== options.expectedTurnId) {
|
||||
return { status: "unavailable" };
|
||||
}
|
||||
|
||||
@@ -3091,6 +3108,7 @@ class ClaudeAgentSession implements AgentSession {
|
||||
this.activeForegroundQuery = null;
|
||||
this.activeForegroundInput = null;
|
||||
this.autonomousTurn = null;
|
||||
this.notificationTurnId = null;
|
||||
this.cancelCurrentTurn = null;
|
||||
this.turnState = "idle";
|
||||
this.sidechainTracker.clear();
|
||||
@@ -4131,8 +4149,9 @@ class ClaudeAgentSession implements AgentSession {
|
||||
return;
|
||||
}
|
||||
this.autonomousTurn = {
|
||||
id: this.createTurnId("autonomous"),
|
||||
id: this.notificationTurnId ?? this.createTurnId("autonomous"),
|
||||
};
|
||||
this.notificationTurnId = null;
|
||||
this.activeForegroundQuery = this.query;
|
||||
this.activeForegroundInput = this.input;
|
||||
this.activeTurnHasAssistantText = false;
|
||||
@@ -4402,6 +4421,20 @@ class ClaudeAgentSession implements AgentSession {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tracks notificationTurnId from the starts Claude announces between turns. A task a subagent
|
||||
* started reports to that subagent, so its notification starts no main-session turn.
|
||||
*/
|
||||
private observeNotificationTurn(message: SDKMessage): void {
|
||||
if (this.activeForegroundTurnId || this.autonomousTurn) return;
|
||||
if (message.type === "system" && message.subtype === "task_notification") {
|
||||
if (this.taskProtocolSource.resolveTaskOwner(message.task_id, message.tool_use_id)) return;
|
||||
this.notificationTurnId = this.createTurnId("autonomous");
|
||||
} else if (readClaudeCommandLifecycle(message)?.state === "started") {
|
||||
this.notificationTurnId = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Only the main session's own turn start opens an autonomous turn. Everything a background
|
||||
* subagent emits (its task frames, its own background jobs' notifications, rate limit events)
|
||||
@@ -4420,6 +4453,7 @@ class ClaudeAgentSession implements AgentSession {
|
||||
return;
|
||||
}
|
||||
this.observeMainTurnBracket(message);
|
||||
this.observeNotificationTurn(message);
|
||||
if (this.shouldSuppressStaleResult(message)) {
|
||||
return;
|
||||
}
|
||||
@@ -4970,6 +5004,7 @@ class ClaudeAgentSession implements AgentSession {
|
||||
type: "timeline",
|
||||
item: taskNotificationItem,
|
||||
provider: "claude",
|
||||
...(this.notificationTurnId ? { turnId: this.notificationTurnId } : {}),
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -5307,10 +5342,8 @@ class ClaudeAgentSession implements AgentSession {
|
||||
input,
|
||||
options,
|
||||
): Promise<PermissionResult> => {
|
||||
// Decide before publishing anything: bypassed tools never enter the permission UI.
|
||||
// Claude also routes questions and plan review through this callback.
|
||||
const needsUserAnswer = toolName === "AskUserQuestion" || toolName === "ExitPlanMode";
|
||||
if (this.currentMode === "bypassPermissions" && !needsUserAnswer) {
|
||||
// Decide before publishing anything: bypassed asks never enter the permission UI.
|
||||
if (this.currentMode === "bypassPermissions" && bypassApprovesAsk(toolName, options)) {
|
||||
return { behavior: "allow", updatedInput: input, toolUseID: options.toolUseID };
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
import type { CanUseTool } from "@anthropic-ai/claude-agent-sdk";
|
||||
|
||||
type PermissionOptions = Parameters<CanUseTool>[2];
|
||||
|
||||
// In bypassPermissions, Claude Code still forwards an ask when the user configured one
|
||||
// (a permissions.ask rule, including managed policy, or a PreToolUse hook), when the tool
|
||||
// needs an answer, or when one of its own checks fires. Bypass approves only Claude's own
|
||||
// checks. A missing or unknown reason type stays with the user.
|
||||
// `subcommandResults` is left out: a compound or piped command uses it as a container,
|
||||
// including when a user's ask rule matched one of its parts. `sandboxOverride` is left
|
||||
// out: in Bypass, Claude Code forwards it only when the user's read block or hook raised it.
|
||||
const CLAUDE_OWN_CHECK_TYPES: ReadonlySet<string> = new Set([
|
||||
"safetyCheck",
|
||||
"workingDir",
|
||||
"mode",
|
||||
"classifier",
|
||||
"asyncAgent",
|
||||
]);
|
||||
|
||||
// Settings the user or organization chose, which Claude Code reports under its own types:
|
||||
// permissions.blockReadsOutsideWorkingDirectories, and an organization's ask limit.
|
||||
const CONFIGURED_ASK_CODES: ReadonlySet<string> = new Set([
|
||||
"outside_reads_blocked",
|
||||
"org_ask_ceiling",
|
||||
]);
|
||||
|
||||
const QUESTION_TOOLS: ReadonlySet<string> = new Set(["AskUserQuestion", "ExitPlanMode"]);
|
||||
|
||||
export function bypassApprovesAsk(toolName: string, options: PermissionOptions): boolean {
|
||||
if (QUESTION_TOOLS.has(toolName) || options.matchedAskRule) {
|
||||
return false;
|
||||
}
|
||||
// The SDK forwards these from Claude Code without declaring them on CanUseTool.
|
||||
if ("requiresUserInteraction" in options && options.requiresUserInteraction === true) {
|
||||
return false;
|
||||
}
|
||||
const reasonCode = "decisionReasonCode" in options ? options.decisionReasonCode : undefined;
|
||||
if (typeof reasonCode === "string" && CONFIGURED_ASK_CODES.has(reasonCode)) {
|
||||
return false;
|
||||
}
|
||||
const reasonType = "decisionReasonType" in options ? options.decisionReasonType : undefined;
|
||||
return typeof reasonType === "string" && CLAUDE_OWN_CHECK_TYPES.has(reasonType);
|
||||
}
|
||||
@@ -6,6 +6,10 @@ import type { ProviderRuntimeSettings } from "../../provider-launch-config.js";
|
||||
import { terminateWithTreeKill } from "../../../../utils/tree-kill.js";
|
||||
import { claudeQuery, type ClaudeQueryInput, type ClaudeQueryContext } from "./query.js";
|
||||
|
||||
const DISCOVERY_WAIT_MS = 5_000;
|
||||
// Long enough for the CLI to finish an OAuth token refresh it started before the wait ended.
|
||||
const DISCOVERY_EXIT_GRACE_MS = 60_000;
|
||||
|
||||
interface ClaudeModelDiscoveryOptions {
|
||||
resolveBinary: () => Promise<string>;
|
||||
runtimeSettings?: ProviderRuntimeSettings;
|
||||
@@ -18,19 +22,24 @@ type OpenDiscoveryQuery = (
|
||||
context: ClaudeQueryContext,
|
||||
) => Pick<Query, "supportedModels" | "close">;
|
||||
|
||||
type DiscoveryQuery = ReturnType<OpenDiscoveryQuery>;
|
||||
|
||||
// Discovery processes left to exit on their own after their caller stopped waiting.
|
||||
const exitingDiscoveries = new Map<ChildProcess, () => Promise<void>>();
|
||||
|
||||
// The curated catalog survives a failed or slow probe. This process never receives
|
||||
// a prompt and must not persist a session or launch user MCP servers/hooks.
|
||||
export async function discoverClaudeModels(
|
||||
options: ClaudeModelDiscoveryOptions,
|
||||
openQuery: OpenDiscoveryQuery = claudeQuery,
|
||||
): Promise<ModelInfo[]> {
|
||||
const controller = new AbortController();
|
||||
const waitController = new AbortController();
|
||||
const signal = options.signal
|
||||
? AbortSignal.any([options.signal, controller.signal])
|
||||
: controller.signal;
|
||||
? AbortSignal.any([options.signal, waitController.signal])
|
||||
: waitController.signal;
|
||||
const timer = setTimeout(
|
||||
() => controller.abort(new Error("Claude model discovery timed out")),
|
||||
5_000,
|
||||
() => waitController.abort(new Error("Claude model discovery timed out")),
|
||||
DISCOVERY_WAIT_MS,
|
||||
);
|
||||
let endInput!: () => void;
|
||||
const ended = new Promise<void>((resolve) => {
|
||||
@@ -46,7 +55,7 @@ export async function discoverClaudeModels(
|
||||
};
|
||||
},
|
||||
};
|
||||
let query: ReturnType<OpenDiscoveryQuery> | undefined;
|
||||
let query: DiscoveryQuery | undefined;
|
||||
let child: ChildProcess | undefined;
|
||||
try {
|
||||
signal.throwIfAborted();
|
||||
@@ -64,7 +73,8 @@ export async function discoverClaudeModels(
|
||||
strictMcpConfig: true,
|
||||
settingSources: ["user"],
|
||||
settings: { disableAllHooks: true },
|
||||
abortController: controller,
|
||||
// No abortController: the SDK kills the process when it aborts, and the end of
|
||||
// the wait must not.
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -78,12 +88,56 @@ export async function discoverClaudeModels(
|
||||
} finally {
|
||||
clearTimeout(timer);
|
||||
endInput();
|
||||
try {
|
||||
query?.close();
|
||||
} finally {
|
||||
if (child) {
|
||||
await terminateWithTreeKill(child, { gracefulTimeoutMs: 200, forceTimeoutMs: 200 });
|
||||
}
|
||||
if (query && child && !hasExited(child)) {
|
||||
// The CLI may be refreshing an expired OAuth token, even after it has answered.
|
||||
// Claude Code rotates the refresh token before saving the new pair, so killing it now
|
||||
// leaves a revoked token on disk and logs the user out (#9314). With its input ended
|
||||
// it exits once that work is done; the grace period and daemon shutdown bound the wait.
|
||||
letDiscoveryExit(query, child);
|
||||
} else {
|
||||
await retireDiscovery(query, child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Kills discovery processes still exiting after their wait ended. Called on daemon shutdown. */
|
||||
export async function killExitingClaudeModelDiscoveries(): Promise<void> {
|
||||
await Promise.all(Array.from(exitingDiscoveries.values(), (kill) => kill()));
|
||||
}
|
||||
|
||||
function letDiscoveryExit(query: DiscoveryQuery, child: ChildProcess): void {
|
||||
function forget(): void {
|
||||
clearTimeout(graceTimer);
|
||||
child.off("exit", onExit);
|
||||
exitingDiscoveries.delete(child);
|
||||
}
|
||||
function onExit(): void {
|
||||
forget();
|
||||
query.close();
|
||||
}
|
||||
async function kill(): Promise<void> {
|
||||
forget();
|
||||
await retireDiscovery(query, child);
|
||||
}
|
||||
const graceTimer = setTimeout(() => void kill(), DISCOVERY_EXIT_GRACE_MS);
|
||||
graceTimer.unref();
|
||||
child.once("exit", onExit);
|
||||
exitingDiscoveries.set(child, kill);
|
||||
}
|
||||
|
||||
async function retireDiscovery(
|
||||
query: DiscoveryQuery | undefined,
|
||||
child: ChildProcess | undefined,
|
||||
): Promise<void> {
|
||||
try {
|
||||
query?.close();
|
||||
} finally {
|
||||
if (child) {
|
||||
await terminateWithTreeKill(child, { gracefulTimeoutMs: 200, forceTimeoutMs: 200 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function hasExited(child: ChildProcess): boolean {
|
||||
return child.exitCode !== null || child.signalCode !== null;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { ChildProcess } from "node:child_process";
|
||||
import * as fs from "node:fs/promises";
|
||||
import * as os from "node:os";
|
||||
import * as path from "node:path";
|
||||
@@ -1173,4 +1174,127 @@ describe("Claude model discovery process", () => {
|
||||
await expect(result).rejects.toBe(failure);
|
||||
expect(closed).toBe(true);
|
||||
});
|
||||
|
||||
describe("when the CLI is still starting up at the deadline", () => {
|
||||
// Without a pid, terminateWithTreeKill signals the child directly instead of a real tree.
|
||||
class StartingClaudeProcess extends ChildProcess {
|
||||
readonly signals: string[] = [];
|
||||
override kill(signal?: NodeJS.Signals | number): boolean {
|
||||
this.signals.push(String(signal));
|
||||
this.emit("exit", null, signal);
|
||||
return true;
|
||||
}
|
||||
exitOnItsOwn(): void {
|
||||
this.emit("exit", 0, null);
|
||||
}
|
||||
}
|
||||
|
||||
interface StalledDiscoveryState {
|
||||
closed: boolean;
|
||||
inputEnded: boolean;
|
||||
}
|
||||
|
||||
async function recordInputEnd(
|
||||
prompt: AsyncIterable<unknown>,
|
||||
state: StalledDiscoveryState,
|
||||
): Promise<void> {
|
||||
await prompt[Symbol.asyncIterator]().next();
|
||||
state.inputEnded = true;
|
||||
}
|
||||
|
||||
// By default the CLI never answers: an expired OAuth token is refreshed first.
|
||||
function startStalledDiscovery(
|
||||
supportedModels: () => Promise<ModelInfo[]> = () => new Promise<ModelInfo[]>(() => {}),
|
||||
) {
|
||||
const child = new StartingClaudeProcess();
|
||||
const state: StalledDiscoveryState = { closed: false, inputEnded: false };
|
||||
const result = discoverClaudeModels(
|
||||
{ resolveBinary: async () => "/claude", env: {} },
|
||||
(input, context) => {
|
||||
if (typeof input.prompt === "string") throw new Error("unexpected inference prompt");
|
||||
void recordInputEnd(input.prompt, state);
|
||||
context.onChildProcess?.(child);
|
||||
return {
|
||||
supportedModels,
|
||||
close: () => {
|
||||
state.closed = true;
|
||||
},
|
||||
};
|
||||
},
|
||||
);
|
||||
return { child, state, result };
|
||||
}
|
||||
|
||||
afterEach(() => {
|
||||
vi.useRealTimers();
|
||||
});
|
||||
|
||||
it("stops waiting at the limit but lets the CLI finish instead of killing it", async () => {
|
||||
vi.useFakeTimers();
|
||||
const { child, state, result } = startStalledDiscovery();
|
||||
const settled = expect(result).rejects.toThrow("Claude model discovery timed out");
|
||||
|
||||
await vi.advanceTimersByTimeAsync(5_000);
|
||||
await settled;
|
||||
expect(state.inputEnded).toBe(true);
|
||||
expect(child.signals).toEqual([]);
|
||||
expect(state.closed).toBe(false);
|
||||
|
||||
await vi.advanceTimersByTimeAsync(59_999);
|
||||
expect(child.signals).toEqual([]);
|
||||
|
||||
await vi.advanceTimersByTimeAsync(1);
|
||||
expect(child.signals).toEqual(["SIGTERM"]);
|
||||
expect(state.closed).toBe(true);
|
||||
});
|
||||
|
||||
async function answerAtOnce(): Promise<ModelInfo[]> {
|
||||
return [];
|
||||
}
|
||||
|
||||
it("lets the CLI finish after it answers instead of killing it", async () => {
|
||||
// The CLI answers supportedModels() before its startup token refresh has saved the
|
||||
// rotated refresh token, so a kill right after the answer also logs the user out.
|
||||
vi.useFakeTimers();
|
||||
const { child, state, result } = startStalledDiscovery(answerAtOnce);
|
||||
await expect(result).resolves.toEqual([]);
|
||||
await vi.advanceTimersByTimeAsync(0);
|
||||
expect(state.inputEnded).toBe(true);
|
||||
expect(child.signals).toEqual([]);
|
||||
|
||||
await vi.advanceTimersByTimeAsync(1_000);
|
||||
child.exitOnItsOwn();
|
||||
expect(state.closed).toBe(true);
|
||||
await vi.advanceTimersByTimeAsync(120_000);
|
||||
expect(child.signals).toEqual([]);
|
||||
});
|
||||
|
||||
it("never signals a CLI that exits on its own during the grace period", async () => {
|
||||
vi.useFakeTimers();
|
||||
const { child, state, result } = startStalledDiscovery();
|
||||
const settled = expect(result).rejects.toThrow("Claude model discovery timed out");
|
||||
await vi.advanceTimersByTimeAsync(5_000);
|
||||
await settled;
|
||||
|
||||
await vi.advanceTimersByTimeAsync(2_000);
|
||||
child.exitOnItsOwn();
|
||||
expect(state.closed).toBe(true);
|
||||
|
||||
await vi.advanceTimersByTimeAsync(120_000);
|
||||
expect(child.signals).toEqual([]);
|
||||
});
|
||||
|
||||
it("tree-kills a still-running CLI when the daemon shuts down", async () => {
|
||||
vi.useFakeTimers();
|
||||
const { child, state, result } = startStalledDiscovery();
|
||||
const settled = expect(result).rejects.toThrow("Claude model discovery timed out");
|
||||
await vi.advanceTimersByTimeAsync(5_000);
|
||||
await settled;
|
||||
expect(child.signals).toEqual([]);
|
||||
|
||||
await new ClaudeAgentClient({ logger: createTestLogger() }).shutdown();
|
||||
expect(child.signals).toEqual(["SIGTERM"]);
|
||||
expect(state.closed).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2215,6 +2215,36 @@ describe("Codex app-server provider", () => {
|
||||
appServer.assertNoErrors();
|
||||
});
|
||||
|
||||
test("lets idle cleanup release a session opened only to read its history", async () => {
|
||||
let spawns = 0;
|
||||
const appServer = createFakeCodexAppServer({
|
||||
"thread/resume": () =>
|
||||
Promise.reject(new Error(archivedThreadErrorMessage("archived-thread-id"))),
|
||||
"thread/read": () => ({ thread: { turns: [] } }),
|
||||
});
|
||||
const provider = new CodexAppServerAgentClient(createTestLogger(), undefined, {
|
||||
appServerProcess: createFakeCodexAppServerProcess(() => {
|
||||
spawns += 1;
|
||||
return appServer.child;
|
||||
}),
|
||||
});
|
||||
const internals = castInternals<{
|
||||
goalsEnabledPromise: Promise<boolean> | null;
|
||||
autoReviewEnabledPromise: Promise<boolean> | null;
|
||||
}>(provider);
|
||||
internals.goalsEnabledPromise = Promise.resolve(false);
|
||||
internals.autoReviewEnabledPromise = Promise.resolve(false);
|
||||
|
||||
const session = await provider.resumeSession(archivedThreadHandle(), undefined, undefined, {
|
||||
purpose: "history",
|
||||
});
|
||||
|
||||
expect(await session.canStopRuntime!()).toBe(true);
|
||||
expect(spawns).toBe(1);
|
||||
await session.close();
|
||||
appServer.assertNoErrors();
|
||||
});
|
||||
|
||||
test("unarchives Codex when an active Paseo agent resumes an archived thread", async () => {
|
||||
const threadRequests: string[] = [];
|
||||
let resumeAttempts = 0;
|
||||
|
||||
@@ -5341,6 +5341,8 @@ export class CodexAppServerAgentSession implements AgentSession {
|
||||
}
|
||||
|
||||
async canStopRuntime(): Promise<boolean> {
|
||||
// A history session released its app-server once it read the thread, so nothing runs.
|
||||
if (this.connectionState === "history-ready") return true;
|
||||
if (
|
||||
!this.client ||
|
||||
this.client.hasPendingRequests() ||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user