mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-27 18:55:41 +00:00
Compare commits
71
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
57bdc689cc | ||
|
|
062fd4d5a9 | ||
|
|
4810eb2d74 | ||
|
|
79a32f40c6 | ||
|
|
a997246655 | ||
|
|
3b8fd4ab3d | ||
|
|
9416336d73 | ||
|
|
5715467245 | ||
|
|
8e8b383f4c | ||
|
|
1fd744795d | ||
|
|
bec63111f1 | ||
|
|
dbba977ab8 | ||
|
|
29179ba27f | ||
|
|
dcdd327cdf | ||
|
|
91613f516d | ||
|
|
31aa498a5b | ||
|
|
8037d79330 | ||
|
|
8c002cc750 | ||
|
|
237cfe91f1 | ||
|
|
d4fd6dcafd | ||
|
|
518e58cd63 | ||
|
|
82dcf7821e | ||
|
|
5d003d9613 | ||
|
|
9868ebc11c | ||
|
|
965e28e3d6 | ||
|
|
690f6970c3 | ||
|
|
bcb0097344 | ||
|
|
9eab3b278f | ||
|
|
fcfcdf156a | ||
|
|
15390b7168 | ||
|
|
539f4af006 | ||
|
|
fbda126f42 | ||
|
|
6d2db423d8 | ||
|
|
4fd21252af | ||
|
|
63eb8c0dec | ||
|
|
294093e8b9 | ||
|
|
bb0588ecb0 | ||
|
|
c7ad1dae52 | ||
|
|
39410ae7d0 | ||
|
|
e6f0ad272d | ||
|
|
02e4b8e3e9 | ||
|
|
203398fa44 | ||
|
|
21c2e55dd1 | ||
|
|
74c33b03d3 | ||
|
|
e4dc119df8 | ||
|
|
903b71180f | ||
|
|
4201a4de35 | ||
|
|
3c0553d9db | ||
|
|
2be71aedcb | ||
|
|
a27f0819c8 | ||
|
|
46eb98d604 | ||
|
|
7d3e045ff8 | ||
|
|
20b70e37e7 | ||
|
|
fcac35d3b9 | ||
|
|
2636c4384f | ||
|
|
17c08edccf | ||
|
|
0687c370ec | ||
|
|
a7dbeadd5f | ||
|
|
d46038ee4b | ||
|
|
be6b5eb169 | ||
|
|
c0903be174 | ||
|
|
5238bfb641 | ||
|
|
90c8446fb8 | ||
|
|
717e75d032 | ||
|
|
62cdc2f2cf | ||
|
|
eaef730f1e | ||
|
|
f0bf09efee | ||
|
|
ad068bd21d | ||
|
|
25666d9172 | ||
|
|
6c237aabf1 | ||
|
|
22baf9e344 |
@@ -342,6 +342,8 @@ jobs:
|
||||
run: |
|
||||
npm run test:unit --workspace=@getpaseo/server -- \
|
||||
src/server/file-observer \
|
||||
src/server/workspace-reconciliation-observation.test.ts \
|
||||
src/utils/checkout-git-identity.test.ts \
|
||||
src/server/workspace-git-service.observation.test.ts \
|
||||
src/server/workspace-git-service.observation.integration.test.ts \
|
||||
--bail=1
|
||||
|
||||
@@ -38,9 +38,9 @@ on:
|
||||
- "true"
|
||||
- "false"
|
||||
rollout_hours:
|
||||
description: "Linear rollout duration in hours. Use 0 for instant rollout."
|
||||
description: "Rollout duration in hours: a 5% canary hold, then a ramp to 100%. Use 0 to admit everyone at once."
|
||||
required: false
|
||||
default: "36"
|
||||
default: "18"
|
||||
type: string
|
||||
|
||||
concurrency:
|
||||
@@ -51,7 +51,7 @@ env:
|
||||
SOURCE_TAG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref_name }}
|
||||
CHECKOUT_REF: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.checkout_ref || github.ref_name) || github.ref_name }}
|
||||
SHOULD_PUBLISH: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.publish != 'false' }}
|
||||
ROLLOUT_HOURS: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.rollout_hours || '36' }}
|
||||
ROLLOUT_HOURS: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.rollout_hours || '18' }}
|
||||
DESKTOP_PACKAGE_PATH: "packages/desktop"
|
||||
|
||||
jobs:
|
||||
@@ -96,6 +96,7 @@ jobs:
|
||||
publish-macos:
|
||||
needs: [create-release]
|
||||
if: ${{ always() && (needs.create-release.result == 'success' || needs.create-release.result == 'skipped') && ((github.event_name == 'workflow_dispatch' && (github.event.inputs.platform == 'all' || github.event.inputs.platform == 'macos')) || (github.event_name == 'push' && (startsWith(github.ref_name, 'v') || startsWith(github.ref_name, 'desktop-v') || startsWith(github.ref_name, 'desktop-macos-v')))) }}
|
||||
timeout-minutes: 45
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -181,7 +182,7 @@ jobs:
|
||||
npm run build:desktop "${build_args[@]}"
|
||||
|
||||
- name: Upload packaged smoke diagnostics
|
||||
if: failure()
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: desktop-smoke-macos-${{ matrix.electron_arch }}
|
||||
|
||||
+134
@@ -1,5 +1,139 @@
|
||||
# Changelog
|
||||
|
||||
## 0.18.1 - 2026-11-27
|
||||
|
||||
- **Host metadata instructions:** Set host-wide instructions once to guide language, tone, and formatting for generated workspace titles, branch names, commit messages, and pull requests. ([#11064](https://github.com/getpaseo/paseo/pull/11064))
|
||||
- **Enterprise spending usage:** Usage now shows Claude extra-usage spending and Codex individual spending limits with reset times. ([#8976](https://github.com/getpaseo/paseo/pull/8976) by [@mcowger](https://github.com/mcowger), [@JasprW](https://github.com/JasprW))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed Android agent push notifications arriving minutes late during Doze ([#8501](https://github.com/getpaseo/paseo/pull/8501) by [@truelecter](https://github.com/truelecter))
|
||||
- Fixed Command Center results reordering mid-word while typing ([#11085](https://github.com/getpaseo/paseo/pull/11085))
|
||||
- Fixed composer slash and `@` autocomplete stopping after closing a web overlay or opening while a prompt submits ([#11041](https://github.com/getpaseo/paseo/pull/11041))
|
||||
- Fixed the Starting ref popover in New Workspace jumping in height and shifting rows on first open ([#11042](https://github.com/getpaseo/paseo/pull/11042))
|
||||
- Fixed the iOS Home Screen web app status bar overlapping focus-mode tabs, the overlay sidebar, and the Mermaid fullscreen viewer on wide layouts ([#9970](https://github.com/getpaseo/paseo/pull/9970) by [@mywaffles](https://github.com/mywaffles))
|
||||
- Fixed Mark as read on a workspace not clearing finished terminal attention ([#11040](https://github.com/getpaseo/paseo/pull/11040))
|
||||
- Fixed GitLab merge request checks and pipeline details failing with 404 when the pipeline runs in a fork project ([#11074](https://github.com/getpaseo/paseo/pull/11074))
|
||||
- Fixed messages sent while Pi runs a turn it started itself failing instead of queuing ([#11077](https://github.com/getpaseo/paseo/pull/11077))
|
||||
- Fixed OpenCode v2 tool approvals staying stuck after OpenCode already dropped the request ([#11061](https://github.com/getpaseo/paseo/pull/11061) by [@rhettjay](https://github.com/rhettjay))
|
||||
- Fixed idle cleanup keeping OpenCode v2 chats in memory while another session runs on the shared server ([#11039](https://github.com/getpaseo/paseo/pull/11039))
|
||||
- Fixed idle ACP agents failing permanently after their process exits instead of reopening on the next message ([#11047](https://github.com/getpaseo/paseo/pull/11047))
|
||||
- Fixed Kimi usage failing or showing an expired login for global `kimi.ai` accounts ([#8505](https://github.com/getpaseo/paseo/pull/8505) by [@benthecarman](https://github.com/benthecarman))
|
||||
- Fixed the Z.ai Usage card missing when GLM Agent is signed in via `Z_AI_API_KEY` or its credentials file ([#8376](https://github.com/getpaseo/paseo/pull/8376) by [@Peanut-HZM](https://github.com/Peanut-HZM))
|
||||
|
||||
### Plugins
|
||||
|
||||
- Added OMP tool-call intent to `item.metadata.intent` for timeline plugins ([#10727](https://github.com/getpaseo/paseo/pull/10727) by [@mcowger](https://github.com/mcowger))
|
||||
|
||||
## 0.18.0 - 2026-11-27
|
||||
|
||||
- **Remote workspace browser proxy:** Desktop browser tabs in remote workspaces now route through the workspace daemon, so remote `localhost` servers open directly in Paseo. ([#10944](https://github.com/getpaseo/paseo/pull/10944) by [@airon-assustadus](https://github.com/airon-assustadus))
|
||||
- **Per-device notification preferences:** Each device can choose which agent, terminal, and plugin events send notifications, and plugins can send notifications and handle taps. ([#10888](https://github.com/getpaseo/paseo/pull/10888))
|
||||
- **Agent profile system prompts:** Save an optional system prompt on an agent profile to apply it to new agents started from that profile. ([#10996](https://github.com/getpaseo/paseo/pull/10996))
|
||||
- **More syntax highlighting:** Syntax highlighting now covers diff and patch files along with Ruby, Kotlin, TOML, SQL, Lua, Protobuf, PowerShell, Groovy, Gradle, Scala, CMake, Properties, INI, R, Perl, and LaTeX. ([#11026](https://github.com/getpaseo/paseo/pull/11026) by [@hmalaspina](https://github.com/hmalaspina), [@kukicola](https://github.com/kukicola), [@MaximeConan](https://github.com/MaximeConan), [@singleton11](https://github.com/singleton11), [@chandlerok](https://github.com/chandlerok))
|
||||
|
||||
### Changed
|
||||
|
||||
- Changed ACP providers to cache model catalogs across daemon restarts instead of probing in the background, and cleaned up Antigravity ACP flags and metadata. Requires [Antigravity CLI 1.5.1 or later](https://paseo.sh/docs/supported-providers/antigravity) ([#10992](https://github.com/getpaseo/paseo/pull/10992))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed Paseo iOS crashing shortly after connecting when an enabled client plugin imports `react-native` ([#11011](https://github.com/getpaseo/paseo/pull/11011))
|
||||
- Fixed OpenCode v2 agents staying stuck in running after Stop when stream events were missed or chat history was large ([#10955](https://github.com/getpaseo/paseo/pull/10955))
|
||||
- Fixed steering a Pi agent during a run it started on its own aborting the run instead of steering it ([#10977](https://github.com/getpaseo/paseo/pull/10977) by [@viiqswim](https://github.com/viiqswim))
|
||||
- Fixed creating a workspace from a pull request in a fork clone checking out the fork's pull request with the same number ([#10987](https://github.com/getpaseo/paseo/pull/10987))
|
||||
- Fixed dropping images or files onto the composer leaving the input unfocused ([#11022](https://github.com/getpaseo/paseo/pull/11022))
|
||||
|
||||
## 0.17.6 - 2026-11-27
|
||||
|
||||
### Improved
|
||||
|
||||
- Reorganized Settings into Device and Host sections and consolidated sparse pages ([#10933](https://github.com/getpaseo/paseo/pull/10933))
|
||||
- Added arrow-key navigation for models, providers, and profiles in the model picker ([#10929](https://github.com/getpaseo/paseo/pull/10929), [#10962](https://github.com/getpaseo/paseo/pull/10962))
|
||||
- Added an in-place Refresh control for Tailscale availability in host settings and setup ([#10903](https://github.com/getpaseo/paseo/pull/10903))
|
||||
|
||||
### Changed
|
||||
|
||||
- Removed the Antigravity usage source that ran `agy -p /usage` in the background ([#10953](https://github.com/getpaseo/paseo/pull/10953) by [@luoph](https://github.com/luoph))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed Paseo Android crashing on Samsung devices when a chat shows a code block or quote ([#10964](https://github.com/getpaseo/paseo/pull/10964))
|
||||
- Fixed mouse clicks not selecting model picker rows on Android ([#10972](https://github.com/getpaseo/paseo/pull/10972))
|
||||
- Fixed macOS Desktop freezing during startup because of Dock progress bar updates ([#10939](https://github.com/getpaseo/paseo/pull/10939))
|
||||
- Fixed Linux AppImage leaking its runtime environment into shells and child processes ([#10920](https://github.com/getpaseo/paseo/pull/10920))
|
||||
- Fixed background Git fetches on Linux spawning orphan D-Bus daemons and retrying failing auth in a loop ([#10921](https://github.com/getpaseo/paseo/pull/10921))
|
||||
- Fixed flashes when restoring archived workspaces and agents, and added an unarchiving state ([#10928](https://github.com/getpaseo/paseo/pull/10928))
|
||||
- Fixed worktree ownership drifting outside the configured worktrees root ([#10878](https://github.com/getpaseo/paseo/pull/10878))
|
||||
- Fixed new web tabs losing projects after another tab evicts the directory cache ([#10942](https://github.com/getpaseo/paseo/pull/10942))
|
||||
- Fixed timelines dropping rows when a rewind epoch changes ([#8794](https://github.com/getpaseo/paseo/pull/8794) by [@LiebeLee](https://github.com/LiebeLee))
|
||||
|
||||
## 0.17.5 - 2026-11-26
|
||||
|
||||
- **Archive workspaces together:** Cmd/Ctrl+click a workspace in the sidebar to select multiple workspaces and archive them in one step. ([#10798](https://github.com/getpaseo/paseo/pull/10798), [#10821](https://github.com/getpaseo/paseo/pull/10821))
|
||||
- **Copy quoted drafts:** Copy a quote from a reply with one tap, without the `>` markers. ([#10608](https://github.com/getpaseo/paseo/pull/10608) by [@pedrovieira](https://github.com/pedrovieira), [@dinhphieu](https://github.com/dinhphieu))
|
||||
- **Redesigned agent profiles page:** Agent profiles have their own dedicated settings page, and the model picker saves a new profile in one tap. ([#10789](https://github.com/getpaseo/paseo/pull/10789), [#10824](https://github.com/getpaseo/paseo/pull/10824))
|
||||
- **Redesigned Add project:** Add project opens on folder search, with Clone and New folder one tab away. ([#10767](https://github.com/getpaseo/paseo/pull/10767))
|
||||
- **Choose how Desktop updates:** Desktop can download updates automatically, only notify you, or never check. ([#10785](https://github.com/getpaseo/paseo/pull/10785))
|
||||
- **First-class Tailscale support:** Turn on Tailscale for a host from its settings or from setup, without editing its configuration. ([#10801](https://github.com/getpaseo/paseo/pull/10801))
|
||||
|
||||
### Added
|
||||
|
||||
- Added host icons, connection types, and latency to the host picker ([#10702](https://github.com/getpaseo/paseo/pull/10702) by [@artile](https://github.com/artile))
|
||||
- Added agent profiles to model picker search and the Command Center ([#10774](https://github.com/getpaseo/paseo/pull/10774))
|
||||
- Added Archive on finish to `paseo schedule create`, `paseo schedule update`, and the schedule MCP tools ([#8479](https://github.com/getpaseo/paseo/pull/8479) by [@ArnoldHueteG](https://github.com/ArnoldHueteG))
|
||||
- Added newer Factory Droid models by updating its catalog entry to Droid 1.20.0 ([#10779](https://github.com/getpaseo/paseo/pull/10779) by [@dsingal0](https://github.com/dsingal0))
|
||||
|
||||
### Changed
|
||||
|
||||
- Changed automatic stable Desktop updates to check at most every 6 hours and to wait 24 hours after each update ([#10882](https://github.com/getpaseo/paseo/pull/10882), [#10901](https://github.com/getpaseo/paseo/pull/10901))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed agents hiding the subagents they create from tabs and the subagent track ([#10887](https://github.com/getpaseo/paseo/pull/10887))
|
||||
- Fixed parent agents getting a Claude subagent's interim reply instead of its final reply when the subagent waits on background work ([#10864](https://github.com/getpaseo/paseo/pull/10864))
|
||||
- Fixed agents that watch a pull request staying in Running after their turn ends ([#10740](https://github.com/getpaseo/paseo/pull/10740) by [@drgould](https://github.com/drgould))
|
||||
- Fixed the Changes pane offering no Push or Pull when the remote is not named `origin` ([#10679](https://github.com/getpaseo/paseo/pull/10679))
|
||||
- Fixed a pane switching to the wrong tab after you split or move its active tab out ([#10716](https://github.com/getpaseo/paseo/pull/10716))
|
||||
- Fixed New workspace leaving focus on the project button after you choose a project ([#10632](https://github.com/getpaseo/paseo/pull/10632))
|
||||
- Fixed archived chats staying in memory until the window reloads ([#10866](https://github.com/getpaseo/paseo/pull/10866))
|
||||
- Fixed hover cards and other overlays slowing down in long app sessions ([#10778](https://github.com/getpaseo/paseo/pull/10778) by [@maci0](https://github.com/maci0))
|
||||
- Fixed Desktop freezing when you open a chat whose last turn has hundreds of tool calls ([#8661](https://github.com/getpaseo/paseo/pull/8661) by [@luoph](https://github.com/luoph))
|
||||
- Fixed direct connections dropping on slow links while a large timeline loads ([#10651](https://github.com/getpaseo/paseo/pull/10651) by [@apple-ouyang](https://github.com/apple-ouyang))
|
||||
- Fixed large Git workspaces stalling the daemon while their file watchers scan ([#10788](https://github.com/getpaseo/paseo/pull/10788), [#10602](https://github.com/getpaseo/paseo/pull/10602))
|
||||
- Fixed a Git change in one repository rescanning every checkout ([#10863](https://github.com/getpaseo/paseo/pull/10863) by [@viiqswim](https://github.com/viiqswim))
|
||||
- Fixed iOS chats staying blank when a pending question is taller than the screen ([#10759](https://github.com/getpaseo/paseo/pull/10759))
|
||||
- Fixed Android long-press text selection in chat leaving the magnifier stuck on screen ([#10844](https://github.com/getpaseo/paseo/pull/10844))
|
||||
- Fixed mobile sheet footers dropping behind the system bar when the keyboard closes ([#10827](https://github.com/getpaseo/paseo/pull/10827))
|
||||
- Fixed the sidebar toggle covering plugin screen titles on macOS ([#10773](https://github.com/getpaseo/paseo/pull/10773))
|
||||
- Fixed Windows file links with a slash before the drive letter failing to open ([#7711](https://github.com/getpaseo/paseo/pull/7711))
|
||||
- Fixed Import Session giving up on slow providers and hiding provider errors ([#10516](https://github.com/getpaseo/paseo/pull/10516) by [@chirag127](https://github.com/chirag127), [@derek-geekdive](https://github.com/derek-geekdive))
|
||||
- Fixed OMP 19.1 `ask` questions not showing a question card ([#10862](https://github.com/getpaseo/paseo/pull/10862) by [@gtoxlili](https://github.com/gtoxlili))
|
||||
- Fixed OpenCode 2 agents with their own MCP servers failing when a shared OpenCode server is running. Requires OpenCode 2.0.29 or later ([#10752](https://github.com/getpaseo/paseo/pull/10752))
|
||||
- Fixed deleted OpenCode subagents staying in the subagent track ([#8332](https://github.com/getpaseo/paseo/pull/8332))
|
||||
- Fixed stopped Claude background subagents showing as running after you reopen the parent ([#9013](https://github.com/getpaseo/paseo/pull/9013))
|
||||
- Fixed plugin and Paseo instructions replacing a Codex agent's own `developer_instructions` ([#10792](https://github.com/getpaseo/paseo/pull/10792))
|
||||
- Fixed the OpenCode Go usage card missing when the Go key is in OpenCode's `auth.json` ([#10678](https://github.com/getpaseo/paseo/pull/10678))
|
||||
- Fixed GitHub, GitLab, and Gitea commands on Windows breaking multiline arguments and expanding `%VAR%` text ([#10685](https://github.com/getpaseo/paseo/pull/10685))
|
||||
- Fixed `paseo hub login` printing a link without the code ([#10751](https://github.com/getpaseo/paseo/pull/10751))
|
||||
- Fixed Hub trigger runs failing on Antigravity and other plugin providers without tool policy support ([#10889](https://github.com/getpaseo/paseo/pull/10889))
|
||||
- Fixed Hub sessions being refused when they read a daemon's provider controls ([#10794](https://github.com/getpaseo/paseo/pull/10794))
|
||||
- Fixed Hermes and other plugin ACP providers leaving processes running after a model list refresh times out ([#10867](https://github.com/getpaseo/paseo/pull/10867))
|
||||
- Fixed a plugin's agent tools returning `Tool not found` after the plugin reloads during a turn ([#10106](https://github.com/getpaseo/paseo/pull/10106) by [@tomgrin10](https://github.com/tomgrin10))
|
||||
- Fixed replies changed by a timeline plugin losing Copy, Fork, and turn duration ([#10795](https://github.com/getpaseo/paseo/pull/10795) by [@Brandon168](https://github.com/Brandon168))
|
||||
- Fixed idle plugin sessions waking the daemon every 10 seconds ([#9363](https://github.com/getpaseo/paseo/pull/9363) by [@Brandon168](https://github.com/Brandon168))
|
||||
|
||||
### Security
|
||||
|
||||
- Changed Claude Code 2.1.326 or later to receive MCP server tokens over stdin instead of in process arguments that other local users can read ([#10698](https://github.com/getpaseo/paseo/pull/10698) by [@mdbraber](https://github.com/mdbraber))
|
||||
- Fixed repository teardown commands running on archive for pull request worktrees whose setup you have not approved ([#10694](https://github.com/getpaseo/paseo/pull/10694))
|
||||
|
||||
### Plugins
|
||||
|
||||
- Added launch wraps so plugins can run agents, terminals, and worktree commands inside a sandbox ([#10786](https://github.com/getpaseo/paseo/pull/10786) by [@clkao](https://github.com/clkao), [@bendavid](https://github.com/bendavid))
|
||||
- Added the parent workspace to plugin workspace snapshots ([#10781](https://github.com/getpaseo/paseo/pull/10781) by [@spatenotte](https://github.com/spatenotte))
|
||||
- Updated the bundled `paseo-plugin` skill to the current plugin API ([#10793](https://github.com/getpaseo/paseo/pull/10793))
|
||||
|
||||
## 0.17.4 - 2026-11-23
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -1,5 +1,139 @@
|
||||
# Changelog
|
||||
|
||||
## 0.18.1 - 2026-11-27
|
||||
|
||||
- **主机元数据指令**:设置一次主机级指令,即可统一控制自动生成的工作区标题、分支名、提交信息和 PR 的语言、语气与格式。([#11064](https://github.com/getpaseo/paseo/pull/11064))
|
||||
- **企业消费用量**:使用情况现已显示 Claude 额外消费用量以及 Codex 个人消费限额和重置时间。([#8976](https://github.com/getpaseo/paseo/pull/8976),贡献者:[@mcowger](https://github.com/mcowger), [@JasprW](https://github.com/JasprW))
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复 Android 在 Doze 休眠模式下 Agent 推送通知延迟数分钟送达的问题 ([#8501](https://github.com/getpaseo/paseo/pull/8501),贡献者:[@truelecter](https://github.com/truelecter))
|
||||
- 修复在命令中心输入时结果顺序在单词输入中途跳动的问题 ([#11085](https://github.com/getpaseo/paseo/pull/11085))
|
||||
- 修复关闭网页浮层后 Composer 的斜杠与 `@` 自动补全失效,以及提交提示词时自动补全弹出的问题 ([#11041](https://github.com/getpaseo/paseo/pull/11041))
|
||||
- 修复在“新建工作区”中首次打开“起始 ref”浮层时高度跳动和行位偏移的问题 ([#11042](https://github.com/getpaseo/paseo/pull/11042))
|
||||
- 修复宽屏布局下 iOS 主屏幕网页应用的状态栏遮挡专注模式标签栏、覆盖侧边栏和 Mermaid 全屏查看器的问题 ([#9970](https://github.com/getpaseo/paseo/pull/9970),贡献者:[@mywaffles](https://github.com/mywaffles))
|
||||
- 修复将工作区标记为已读时未清除已完成终端提醒的问题 ([#11040](https://github.com/getpaseo/paseo/pull/11040))
|
||||
- 修复 GitLab 合并请求的流水线运行在 fork 项目中时,检查状态和流水线详情返回 404 的问题 ([#11074](https://github.com/getpaseo/paseo/pull/11074))
|
||||
- 修复 Pi 运行其自行启动的轮次时发送的消息直接失败而不是排队的问题 ([#11077](https://github.com/getpaseo/paseo/pull/11077))
|
||||
- 修复 OpenCode v2 已丢弃工具审批请求后,审批卡片仍一直卡住的问题 ([#11061](https://github.com/getpaseo/paseo/pull/11061),贡献者:[@rhettjay](https://github.com/rhettjay))
|
||||
- 修复共享服务器上运行其他会话时,空闲清理不会卸载闲置 OpenCode v2 对话的问题 ([#11039](https://github.com/getpaseo/paseo/pull/11039))
|
||||
- 修复空闲 ACP Agent 的进程意外退出后永久失败,而不是在下一条消息时重新打开会话的问题 ([#11047](https://github.com/getpaseo/paseo/pull/11047))
|
||||
- 修复使用全局 `kimi.ai` 账号登录时 Kimi 用量加载失败或显示登录已过期的问题 ([#8505](https://github.com/getpaseo/paseo/pull/8505),贡献者:[@benthecarman](https://github.com/benthecarman))
|
||||
- 修复通过 `Z_AI_API_KEY` 或凭据文件登录 GLM Agent 时缺少 Z.ai 使用情况卡片的问题 ([#8376](https://github.com/getpaseo/paseo/pull/8376),贡献者:[@Peanut-HZM](https://github.com/Peanut-HZM))
|
||||
|
||||
### 插件
|
||||
|
||||
- 为时间线插件在 `item.metadata.intent` 中新增 OMP 工具调用意图 ([#10727](https://github.com/getpaseo/paseo/pull/10727),贡献者:[@mcowger](https://github.com/mcowger))
|
||||
|
||||
## 0.18.0 - 2026-11-27
|
||||
|
||||
- **远程工作区浏览器代理**:远程工作区中的桌面端浏览器标签页现在会通过该工作区的 daemon 转发流量,远程 `localhost` 服务可以直接在 Paseo 中打开。([#10944](https://github.com/getpaseo/paseo/pull/10944),贡献者:[@airon-assustadus](https://github.com/airon-assustadus))
|
||||
- **按设备配置通知偏好**:每台设备都可以分别选择哪些 Agent、终端和插件事件发送通知,插件现在也可以发送通知并处理点击。([#10888](https://github.com/getpaseo/paseo/pull/10888))
|
||||
- **智能体配置文件系统提示词**:在智能体配置文件中保存可选的系统提示词,以便在通过该配置启动新 Agent 时应用。([#10996](https://github.com/getpaseo/paseo/pull/10996))
|
||||
- **更多语法高亮语言**:语法高亮现已支持 diff 和 patch 文件,以及 Ruby、Kotlin、TOML、SQL、Lua、Protobuf、PowerShell、Groovy、Gradle、Scala、CMake、Properties、INI、R、Perl 和 LaTeX。([#11026](https://github.com/getpaseo/paseo/pull/11026),贡献者:[@hmalaspina](https://github.com/hmalaspina), [@kukicola](https://github.com/kukicola), [@MaximeConan](https://github.com/MaximeConan), [@singleton11](https://github.com/singleton11), [@chandlerok](https://github.com/chandlerok))
|
||||
|
||||
### 变更
|
||||
|
||||
- ACP Provider 现在会在 daemon 重启间将已发现的模型目录缓存到磁盘,不再在后台轮询,同时清理了多余的 Antigravity ACP 参数和元数据。需要 [Antigravity CLI 1.5.1 或更高版本](https://paseo.sh/zh-CN/docs/supported-providers/antigravity) ([#10992](https://github.com/getpaseo/paseo/pull/10992))
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复已启用的客户端插件导入 `react-native` 时,Paseo iOS 在连接后不久崩溃的问题 ([#11011](https://github.com/getpaseo/paseo/pull/11011))
|
||||
- 修复流事件丢失或对话历史较大时,OpenCode v2 Agent 在点击停止后仍停留在运行中的问题 ([#10955](https://github.com/getpaseo/paseo/pull/10955))
|
||||
- 修复在 Pi Agent 运行其自行启动的轮次时发送引导消息会中止该轮次而不是引导它的问题 ([#10977](https://github.com/getpaseo/paseo/pull/10977),贡献者:[@viiqswim](https://github.com/viiqswim))
|
||||
- 修复在 fork 克隆中根据 PR 创建工作区时,检出到 fork 中同编号 PR 的问题 ([#10987](https://github.com/getpaseo/paseo/pull/10987))
|
||||
- 修复向 Composer 拖放图片或文件后输入框未获得焦点的问题 ([#11022](https://github.com/getpaseo/paseo/pull/11022))
|
||||
|
||||
## 0.17.6 - 2026-11-27
|
||||
|
||||
### 改进
|
||||
|
||||
- 将设置重组为设备和主机两个范围,并合并了内容较少的页面 ([#10933](https://github.com/getpaseo/paseo/pull/10933))
|
||||
- 为模型选择器中的模型、Provider 和配置文件新增方向键导航 ([#10929](https://github.com/getpaseo/paseo/pull/10929), [#10962](https://github.com/getpaseo/paseo/pull/10962))
|
||||
- 在主机设置和初始设置中新增就地刷新 Tailscale 可用性的按钮 ([#10903](https://github.com/getpaseo/paseo/pull/10903))
|
||||
|
||||
### 变更
|
||||
|
||||
- 移除了在后台运行 `agy -p /usage` 的 Antigravity 用量数据源 ([#10953](https://github.com/getpaseo/paseo/pull/10953),贡献者:[@luoph](https://github.com/luoph))
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复对话中出现代码块或引用时 Paseo Android 在三星设备上崩溃的问题 ([#10964](https://github.com/getpaseo/paseo/pull/10964))
|
||||
- 修复在 Android 上使用鼠标点击无法选择模型选择器行的问题 ([#10972](https://github.com/getpaseo/paseo/pull/10972))
|
||||
- 修复 macOS 桌面端因 Dock 进度条更新在启动时卡死的问题 ([#10939](https://github.com/getpaseo/paseo/pull/10939))
|
||||
- 修复 Linux AppImage 将其运行时环境变量泄漏到 Shell 和子进程的问题 ([#10920](https://github.com/getpaseo/paseo/pull/10920))
|
||||
- 修复 Linux 上后台 Git fetch 启动孤立 D-Bus 进程并在认证失败后循环重试的问题 ([#10921](https://github.com/getpaseo/paseo/pull/10921))
|
||||
- 修复恢复已归档工作区和 Agent 时的界面闪烁问题,并新增恢复中状态提示 ([#10928](https://github.com/getpaseo/paseo/pull/10928))
|
||||
- 修复 worktree 所有权超出已配置 worktrees 根目录的问题 ([#10878](https://github.com/getpaseo/paseo/pull/10878))
|
||||
- 修复另一个标签页淘汰目录缓存后,新打开的网页标签页丢失 project 的问题 ([#10942](https://github.com/getpaseo/paseo/pull/10942))
|
||||
- 修复 rewind epoch 变更时时间线丢失行的问题 ([#8794](https://github.com/getpaseo/paseo/pull/8794),贡献者:[@LiebeLee](https://github.com/LiebeLee))
|
||||
|
||||
## 0.17.5 - 2026-11-26
|
||||
|
||||
- **批量归档工作区**:在侧边栏按住 Cmd/Ctrl 点击工作区即可多选,一步归档。([#10798](https://github.com/getpaseo/paseo/pull/10798), [#10821](https://github.com/getpaseo/paseo/pull/10821))
|
||||
- **复制引用草稿**:一键复制回复中的引用内容,不带 `>` 标记。([#10608](https://github.com/getpaseo/paseo/pull/10608),贡献者:[@pedrovieira](https://github.com/pedrovieira), [@dinhphieu](https://github.com/dinhphieu))
|
||||
- **重新设计的智能体配置文件页面**:智能体配置文件现在有专属的设置页面,模型选择器一键即可保存新的配置文件。([#10789](https://github.com/getpaseo/paseo/pull/10789), [#10824](https://github.com/getpaseo/paseo/pull/10824))
|
||||
- **重新设计的添加 project**:“添加 project”直接打开文件夹搜索,克隆和新建文件夹只需切换一个标签页。([#10767](https://github.com/getpaseo/paseo/pull/10767))
|
||||
- **选择桌面端的更新方式**:桌面端可以自动下载更新、仅通知你,或完全不检查。([#10785](https://github.com/getpaseo/paseo/pull/10785))
|
||||
- **全面支持 Tailscale**:在主机设置或初始设置中为主机开启 Tailscale,无需编辑配置。([#10801](https://github.com/getpaseo/paseo/pull/10801))
|
||||
|
||||
### 新增
|
||||
|
||||
- 在主机选择器中新增主机图标、连接类型和延迟 ([#10702](https://github.com/getpaseo/paseo/pull/10702),贡献者:[@artile](https://github.com/artile))
|
||||
- 在模型选择器搜索和命令中心中新增智能体配置文件 ([#10774](https://github.com/getpaseo/paseo/pull/10774))
|
||||
- 为 `paseo schedule create`、`paseo schedule update` 和定时任务 MCP 工具新增“完成后归档”选项 ([#8479](https://github.com/getpaseo/paseo/pull/8479),贡献者:[@ArnoldHueteG](https://github.com/ArnoldHueteG))
|
||||
- 将 Factory Droid 的目录条目更新到 Droid 1.20.0,新增其较新的模型 ([#10779](https://github.com/getpaseo/paseo/pull/10779),贡献者:[@dsingal0](https://github.com/dsingal0))
|
||||
|
||||
### 变更
|
||||
|
||||
- 桌面端稳定版的自动更新改为最多每 6 小时检查一次,每次更新后等待 24 小时 ([#10882](https://github.com/getpaseo/paseo/pull/10882), [#10901](https://github.com/getpaseo/paseo/pull/10901))
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复 Agent 将自己创建的子 Agent 从标签页和子 Agent 列表中隐藏的问题 ([#10887](https://github.com/getpaseo/paseo/pull/10887))
|
||||
- 修复 Claude 子 Agent 等待后台任务时,父 Agent 收到的是中间回复而不是最终回复的问题 ([#10864](https://github.com/getpaseo/paseo/pull/10864))
|
||||
- 修复监视 PR 的 Agent 在轮次结束后仍显示为运行中的问题 ([#10740](https://github.com/getpaseo/paseo/pull/10740),贡献者:[@drgould](https://github.com/drgould))
|
||||
- 修复远程名称不是 `origin` 时“变更”面板不显示推送或拉取的问题 ([#10679](https://github.com/getpaseo/paseo/pull/10679))
|
||||
- 修复拆分窗格或移出当前标签后,原窗格切换到错误标签的问题 ([#10716](https://github.com/getpaseo/paseo/pull/10716))
|
||||
- 修复在“新建工作区”中选择 project 后,焦点停留在 project 按钮上的问题 ([#10632](https://github.com/getpaseo/paseo/pull/10632))
|
||||
- 修复已归档的对话在窗口重新加载前一直占用内存的问题 ([#10866](https://github.com/getpaseo/paseo/pull/10866))
|
||||
- 修复应用长时间运行后悬停卡片等浮层变慢的问题 ([#10778](https://github.com/getpaseo/paseo/pull/10778),贡献者:[@maci0](https://github.com/maci0))
|
||||
- 修复打开最后一轮包含数百次工具调用的对话时桌面端卡顿的问题 ([#8661](https://github.com/getpaseo/paseo/pull/8661),贡献者:[@luoph](https://github.com/luoph))
|
||||
- 修复在慢速网络上加载大型时间线时直接连接断开的问题 ([#10651](https://github.com/getpaseo/paseo/pull/10651),贡献者:[@apple-ouyang](https://github.com/apple-ouyang))
|
||||
- 修复大型 Git 工作区在文件监视器扫描时阻塞 daemon 的问题 ([#10788](https://github.com/getpaseo/paseo/pull/10788), [#10602](https://github.com/getpaseo/paseo/pull/10602))
|
||||
- 修复一个仓库中的 Git 变更导致所有检出重新扫描的问题 ([#10863](https://github.com/getpaseo/paseo/pull/10863),贡献者:[@viiqswim](https://github.com/viiqswim))
|
||||
- 修复待回答问题高于屏幕时 iOS 对话一直空白的问题 ([#10759](https://github.com/getpaseo/paseo/pull/10759))
|
||||
- 修复 Android 上在对话中长按选择文本后放大镜卡在屏幕上的问题 ([#10844](https://github.com/getpaseo/paseo/pull/10844))
|
||||
- 修复移动端弹窗底部栏在键盘收起时落到系统栏后面的问题 ([#10827](https://github.com/getpaseo/paseo/pull/10827))
|
||||
- 修复 macOS 上侧边栏切换按钮遮挡插件页面标题的问题 ([#10773](https://github.com/getpaseo/paseo/pull/10773))
|
||||
- 修复 Windows 上盘符前带斜杠的文件链接无法打开的问题 ([#7711](https://github.com/getpaseo/paseo/pull/7711))
|
||||
- 修复导入会话在 Provider 响应慢时提前放弃并隐藏 Provider 错误的问题 ([#10516](https://github.com/getpaseo/paseo/pull/10516),贡献者:[@chirag127](https://github.com/chirag127), [@derek-geekdive](https://github.com/derek-geekdive))
|
||||
- 修复 OMP 19.1 的 `ask` 问题不显示问题卡片的问题 ([#10862](https://github.com/getpaseo/paseo/pull/10862),贡献者:[@gtoxlili](https://github.com/gtoxlili))
|
||||
- 修复共享 OpenCode 服务器运行时,带有自己 MCP 服务器的 OpenCode 2 Agent 启动失败的问题。需要 OpenCode 2.0.29 或更高版本 ([#10752](https://github.com/getpaseo/paseo/pull/10752))
|
||||
- 修复已删除的 OpenCode 子 Agent 一直留在子 Agent 列表中的问题 ([#8332](https://github.com/getpaseo/paseo/pull/8332))
|
||||
- 修复重新打开父 Agent 后,已停止的 Claude 后台子 Agent 显示为运行中的问题 ([#9013](https://github.com/getpaseo/paseo/pull/9013))
|
||||
- 修复插件和 Paseo 的指令替换 Codex Agent 自身 `developer_instructions` 的问题 ([#10792](https://github.com/getpaseo/paseo/pull/10792))
|
||||
- 修复 Go 密钥保存在 OpenCode 的 `auth.json` 中时 OpenCode Go 用量卡片消失的问题 ([#10678](https://github.com/getpaseo/paseo/pull/10678))
|
||||
- 修复 Windows 上 GitHub、GitLab 和 Gitea 命令破坏多行参数并展开 `%VAR%` 文本的问题 ([#10685](https://github.com/getpaseo/paseo/pull/10685))
|
||||
- 修复 `paseo hub login` 输出的链接不包含验证码的问题 ([#10751](https://github.com/getpaseo/paseo/pull/10751))
|
||||
- 修复 Hub 触发器在 Antigravity 等不支持工具策略的插件 Provider 上运行失败的问题 ([#10889](https://github.com/getpaseo/paseo/pull/10889))
|
||||
- 修复 Hub 会话读取 daemon 的 Provider 控件时被拒绝的问题 ([#10794](https://github.com/getpaseo/paseo/pull/10794))
|
||||
- 修复模型列表刷新超时后,Hermes 等插件 ACP Provider 留下进程继续运行的问题 ([#10867](https://github.com/getpaseo/paseo/pull/10867))
|
||||
- 修复插件在轮次进行中重新加载后,其 Agent 工具返回 `Tool not found` 的问题 ([#10106](https://github.com/getpaseo/paseo/pull/10106),贡献者:[@tomgrin10](https://github.com/tomgrin10))
|
||||
- 修复被时间线插件改写的回复缺少复制、分叉和轮次耗时的问题 ([#10795](https://github.com/getpaseo/paseo/pull/10795),贡献者:[@Brandon168](https://github.com/Brandon168))
|
||||
- 修复空闲的插件会话每 10 秒唤醒一次 daemon 的问题 ([#9363](https://github.com/getpaseo/paseo/pull/9363),贡献者:[@Brandon168](https://github.com/Brandon168))
|
||||
|
||||
### 安全
|
||||
|
||||
- Claude Code 2.1.326 或更高版本现在通过 stdin 接收 MCP 服务器令牌,不再放在其他本地用户可读取的进程参数中 ([#10698](https://github.com/getpaseo/paseo/pull/10698),贡献者:[@mdbraber](https://github.com/mdbraber))
|
||||
- 修复归档未批准设置的 PR worktree 时仍运行仓库 teardown 命令的问题 ([#10694](https://github.com/getpaseo/paseo/pull/10694))
|
||||
|
||||
### 插件
|
||||
|
||||
- 新增启动包装,插件可以在沙箱中运行 Agent、终端和 worktree 命令 ([#10786](https://github.com/getpaseo/paseo/pull/10786),贡献者:[@clkao](https://github.com/clkao), [@bendavid](https://github.com/bendavid))
|
||||
- 在插件的工作区快照中新增父工作区 ([#10781](https://github.com/getpaseo/paseo/pull/10781),贡献者:[@spatenotte](https://github.com/spatenotte))
|
||||
- 将内置的 `paseo-plugin` 技能更新到当前的插件 API ([#10793](https://github.com/getpaseo/paseo/pull/10793))
|
||||
|
||||
## 0.17.4 - 2026-11-23
|
||||
|
||||
### 修复
|
||||
|
||||
+2
-2
@@ -57,9 +57,9 @@
|
||||
|
||||
<!-- Sponsors: one cell per sponsor in the order of packages/website/src/data/sponsors.ts, then "become a sponsor" cells up to three. -->
|
||||
<table>
|
||||
<tr>
|
||||
<tr valign="top">
|
||||
<td align="center" width="33%"><a href="https://hoplite.sh/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/hoplite-on-dark.svg"><img src="packages/website/public/sponsors/hoplite-on-light.svg" alt="Hoplite" height="40"></picture></a><br><sub>Cloud coding agents</sub></td>
|
||||
<td align="center" width="33%"><a href="https://paseo.sh/sponsor">Paseo のスポンサーになる</a></td>
|
||||
<td align="center" width="33%"><a href="https://encore.dev/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/encore-on-dark.svg"><img src="packages/website/public/sponsors/encore-on-light.svg" alt="Encore" height="40"></picture></a><br><sub>Encore lets AI agents ship to production safely, at scale, in your own cloud.</sub></td>
|
||||
<td align="center" width="33%"><a href="https://paseo.sh/sponsor">Paseo のスポンサーになる</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
+2
-2
@@ -51,9 +51,9 @@
|
||||
|
||||
<!-- Sponsors: one cell per sponsor in the order of packages/website/src/data/sponsors.ts, then "become a sponsor" cells up to three. -->
|
||||
<table>
|
||||
<tr>
|
||||
<tr valign="top">
|
||||
<td align="center" width="33%"><a href="https://hoplite.sh/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/hoplite-on-dark.svg"><img src="packages/website/public/sponsors/hoplite-on-light.svg" alt="Hoplite" height="40"></picture></a><br><sub>Cloud coding agents</sub></td>
|
||||
<td align="center" width="33%"><a href="https://paseo.sh/sponsor">Paseo 스폰서 되기</a></td>
|
||||
<td align="center" width="33%"><a href="https://encore.dev/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/encore-on-dark.svg"><img src="packages/website/public/sponsors/encore-on-light.svg" alt="Encore" height="40"></picture></a><br><sub>Encore lets AI agents ship to production safely, at scale, in your own cloud.</sub></td>
|
||||
<td align="center" width="33%"><a href="https://paseo.sh/sponsor">Paseo 스폰서 되기</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -56,9 +56,9 @@ Paseo is an open source agentic development environment for desktop, mobile, web
|
||||
|
||||
<!-- Sponsors: one cell per sponsor in the order of packages/website/src/data/sponsors.ts, then "become a sponsor" cells up to three. -->
|
||||
<table>
|
||||
<tr>
|
||||
<tr valign="top">
|
||||
<td align="center" width="33%"><a href="https://hoplite.sh/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/hoplite-on-dark.svg"><img src="packages/website/public/sponsors/hoplite-on-light.svg" alt="Hoplite" height="56"></picture></a><br><sub>Cloud coding agents</sub></td>
|
||||
<td align="center" width="33%"><a href="https://paseo.sh/sponsor">Become a sponsor</a></td>
|
||||
<td align="center" width="33%"><a href="https://encore.dev/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/encore-on-dark.svg"><img src="packages/website/public/sponsors/encore-on-light.svg" alt="Encore" height="56"></picture></a><br><sub>Encore lets AI agents ship to production safely, at scale, in your own cloud.</sub></td>
|
||||
<td align="center" width="33%"><a href="https://paseo.sh/sponsor">Become a sponsor</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
+2
-2
@@ -57,9 +57,9 @@
|
||||
|
||||
<!-- Sponsors: one cell per sponsor in the order of packages/website/src/data/sponsors.ts, then "become a sponsor" cells up to three. -->
|
||||
<table>
|
||||
<tr>
|
||||
<tr valign="top">
|
||||
<td align="center" width="33%"><a href="https://hoplite.sh/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/hoplite-on-dark.svg"><img src="packages/website/public/sponsors/hoplite-on-light.svg" alt="Hoplite" height="40"></picture></a><br><sub>Cloud coding agents</sub></td>
|
||||
<td align="center" width="33%"><a href="https://paseo.sh/zh-CN/sponsor">成为 Paseo 赞助商</a></td>
|
||||
<td align="center" width="33%"><a href="https://encore.dev/?utm_source=paseo&utm_medium=readme&utm_campaign=sponsor"><picture><source media="(prefers-color-scheme: dark)" srcset="packages/website/public/sponsors/encore-on-dark.svg"><img src="packages/website/public/sponsors/encore-on-light.svg" alt="Encore" height="40"></picture></a><br><sub>Encore lets AI agents ship to production safely, at scale, in your own cloud.</sub></td>
|
||||
<td align="center" width="33%"><a href="https://paseo.sh/zh-CN/sponsor">成为 Paseo 赞助商</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
+17
-3
@@ -15,7 +15,7 @@ Each live agent in `AgentManager` carries a `lastStatus` of `initializing`, `idl
|
||||
## Daemon restart recovery
|
||||
|
||||
Restart recovery is off by default. Enable `agents.resumeOnStartup` in host config or
|
||||
Host settings → Agents to resume interrupted agents after graceful shutdown or a crash. The daemon
|
||||
Settings → Host → Daemon to resume interrupted agents after graceful shutdown or a crash. The daemon
|
||||
reopens the saved provider conversation and settings, then sends `Resume working.`. Customize
|
||||
the prompt with `agents.resumePrompt` or the same settings page.
|
||||
Disabling recovery consumes pending intent; enabling it later does not revive old work.
|
||||
@@ -80,7 +80,9 @@ Provider checks follow the signals their runtimes expose:
|
||||
- Codex queries background terminals for loaded threads, including native children, and protects
|
||||
pending provider requests. App servers without the terminal-list RPC stay resident.
|
||||
- OpenCode checks active executions and descendants. V1 checks PTYs; v2 also checks shell and
|
||||
inbox inventories. The shared server remains leased while a session vetoes collection.
|
||||
inbox inventories. The shared server remains leased while a session vetoes collection. V2 lets
|
||||
another session's execution veto only when releasing the lease would stop the server; the shared
|
||||
server stays up after its last lease goes.
|
||||
- Pi checks streaming, compaction, pending replies, and adapter-owned operations. Known native
|
||||
subagent signals also protect their parent through the daemon's subagent store.
|
||||
- OMP additionally requires `get_state.isSettled: true` and `hasPendingAsyncWork: false`.
|
||||
@@ -183,7 +185,7 @@ caller, child, and host into one watch.
|
||||
|
||||
Bootstrap restores these watches after repairing stale running records to `closed` and before opening
|
||||
ingress. Reading a closed child's result does not load its provider. A finish notification reports that
|
||||
the child's run has settled; the parent decides whether its task is complete. A child chosen for restart
|
||||
the child has settled (see below); the parent decides whether its task is complete. A child chosen for restart
|
||||
recovery is observed only after its resume was sent, so the parent never hears that it was closed
|
||||
in between. Archived or deleted parents suppress delivery;
|
||||
parent-owned creation watches also stop
|
||||
@@ -196,6 +198,18 @@ outstanding intent. A crash after successful dispatch but before removal commits
|
||||
notification. Clean shutdown can also flush an already queued callback while retaining its intent,
|
||||
so that callback can repeat after restart. This is an at-least-once wakeup, without turn attribution or exactly-once delivery.
|
||||
|
||||
A turn end is not always a settled child. When the child ends its turn with work that will start its
|
||||
next turn by itself, the caller gets one `message` notice ("ended its turn but is still working") and
|
||||
the subscription keeps following the child. That work is a running turn, queued messages, a pending
|
||||
provider wake-up (`AgentSession.hasPendingWakeup`: Claude background tasks, task notifications, and
|
||||
one-shot wake-ups), or the child's own outstanding finish subscriptions as a caller. Heartbeats,
|
||||
recurring crons, change-request watches, and other daemon background items never count: they are
|
||||
external triggers, not work the caller is waiting for. While following, turn ends and work changes stay
|
||||
silent until nothing is pending, which sends `finished` and removes the subscription. `followingSince`
|
||||
is stored before the notice is sent, so restarts resume following without repeating it, and following
|
||||
ends after 24 hours with an "is still working" notice. Remote children and providers without the probe
|
||||
report their first turn end as `finished`.
|
||||
|
||||
Permission requests are notification checkpoints, not the end of that subscription. The caller is notified again after a permission response when the child finishes, errors, or requests another permission.
|
||||
The permission notification includes the normalized request plus the child and request IDs, so the caller can inspect it and respond without fetching agent status.
|
||||
A watched child that closes before its finish event also notifies the caller so delegated work cannot disappear silently during archive or workspace teardown.
|
||||
|
||||
+8
-2
@@ -240,7 +240,8 @@ snapshot so a mixed edit can apply its live subset and still name the paths that
|
||||
// `extends` (one of the built-ins or `"acp"`) and `label`. See `provider-launch-config.ts`.
|
||||
providers: Record<providerId, ProviderOverride>,
|
||||
metadataGeneration: {
|
||||
providers: [{ provider, model?, thinkingOptionId? }]
|
||||
providers: [{ provider, model?, thinkingOptionId? }],
|
||||
instructions?: string
|
||||
}
|
||||
},
|
||||
pluginsEnabled: boolean,
|
||||
@@ -319,7 +320,7 @@ Paseo tools; otherwise the provider policy applies. Provider and global policy a
|
||||
session is created, resumed, imported, or reloaded, so configuration changes affect the next
|
||||
session rather than an already-running one.
|
||||
|
||||
`agents.metadataGeneration.providers` selects the models for daemon-side metadata tasks: commit messages, PR text, branch names, and generated titles. An empty list is Automatic; a non-empty list is Manual and only those models are tried. See [public-docs/metadata-generation.md](../public-docs/metadata-generation.md#how-a-model-is-chosen).
|
||||
`agents.metadataGeneration.providers` selects the models for daemon-side metadata tasks: commit messages, PR text, branch names, and generated titles. An empty list is Automatic; a non-empty list is Manual and only those models are tried. `agents.metadataGeneration.instructions` adds host-wide guidance to every metadata generation prompt alongside the built-in or per-project style. See [public-docs/metadata-generation.md](../public-docs/metadata-generation.md#how-a-model-is-chosen).
|
||||
|
||||
### Git process limits
|
||||
|
||||
@@ -591,6 +592,11 @@ then retry only when a requested row changes during the read. Unrelated agent st
|
||||
invalidate the read. Directory baseline replacements and host removal or renaming still invalidate
|
||||
the affected reads.
|
||||
|
||||
On web and Electron, tabs share IndexedDB but hold independent directory snapshots in memory. A
|
||||
tab can commit directory deltas only while the persisted checkpoint revision matches the one it
|
||||
read or wrote. If a different tab evicts or rewrites that baseline, the next full directory refresh
|
||||
can replace it. Timeline writes do not depend on the directory checkpoint.
|
||||
|
||||
The cache is capped at 32 MiB and evicts whole hosts in least-recently-written order. After an
|
||||
eviction, only a baseline replacement stores that host's directory again. Mutations queued around
|
||||
the eviction are dropped when they are written, so a checkpoint never outlives its rows. Budget
|
||||
|
||||
+1
-1
@@ -177,7 +177,7 @@ Electron window controls are top-corner obstructions, not a compact-layout condi
|
||||
|
||||
Windows and Linux controls are fixed window chrome, outside scrolling header content. A tab rail that reaches them ends at their obstruction and shows the shared overflow fade. On macOS, the Explorer toggle occupies a fixed top-right window slot so opening and closing Explorer does not move the pointer target.
|
||||
|
||||
Each window edge has one safe-area owner. `WindowLayoutProvider` publishes the bottom inset that every surface reads through `useSafeAreaInsets()`: on iOS 27.1 and later it is UIKit's bottom-bar clearance, which refines the rectangular home-indicator inset to the screen's corners, and elsewhere the system inset. Surfaces apply that value once and never stack their own spacing under it; `WindowLayoutSurface` owns the horizontal insets the same way.
|
||||
Each window edge has one safe-area owner. `WindowLayoutProvider` publishes the bottom inset that every surface reads through `useSafeAreaInsets()`: on iOS 27.1 and later it is UIKit's bottom-bar clearance, which refines the rectangular home-indicator inset to the screen's corners, and elsewhere the system inset. Surfaces apply that value once and never stack their own spacing under it; `WindowLayoutSurface` owns the horizontal insets the same way, and on wide web layouts it also owns the top inset: it pads the status bar of an iOS Home Screen web app once and gives its content a top inset of 0. Content inside the surface that draws against the window instead of the padded content reads the window's insets; see Gotcha 8 in `docs/floating-panels.md`.
|
||||
|
||||
A new list+detail feature copies the settings shell. A new workspace-shaped feature copies the workspace shell. Inventing a third shape happens in design review, not in a PR.
|
||||
|
||||
|
||||
+16
-5
@@ -459,10 +459,15 @@ Wrapping providers _around_ the modal does nothing. They land on the wrong side.
|
||||
|
||||
## Gotcha 8 — Read safe-area insets where the overlay draws
|
||||
|
||||
A compact sheet tab's body (`SheetBottomInset` in `adaptive-modal-sheet.tsx`) pads the bottom
|
||||
inset and gives its content a bottom inset of 0, so the composer dock sits the same in a sheet as
|
||||
in a tab. An overlay opened from that content and calling `useSafeAreaInsets()` at its call site
|
||||
gets that 0 and draws over the navigation bar.
|
||||
Two containers spend an inset and give their content 0 for that edge:
|
||||
|
||||
- A compact sheet tab's body (`SheetBottomInset` in `adaptive-modal-sheet.tsx`) pads the bottom
|
||||
inset, so the composer dock sits the same in a sheet as in a tab.
|
||||
- `WindowLayoutSurface` on a wide web layout pads the top inset, the status bar of an iOS Home
|
||||
Screen web app (`docs/design.md`, section 9).
|
||||
|
||||
An overlay opened from that content and calling `useSafeAreaInsets()` at its call site gets that 0
|
||||
and draws over the navigation bar or under the status bar. Read the inset where the overlay draws:
|
||||
|
||||
- A Gorhom sheet reads the inset inside its children, which render in the app's sheet host. See
|
||||
`SheetVisibleFrame` (used by `CompactSheetBody` and `ComboboxSheetFrame`) and `MenuSheetScrollView`.
|
||||
@@ -470,7 +475,13 @@ gets that 0 and draws over the navigation bar.
|
||||
`WindowSafeArea` from `@/window-layout` and read the inset below that. It provides the insets of
|
||||
the whole window, published by `WindowLayoutProvider`. Do not put a `SafeAreaProvider` inside the
|
||||
modal: on Android it measures the dialog window, whose bottom inset reads 24, then 0, then 24
|
||||
again over the first frames, and everything padded by it jumps. See `attachment-lightbox.tsx`.
|
||||
again over the first frames, and everything padded by it jumps. See `attachment-lightbox.tsx`
|
||||
and the Mermaid fullscreen viewer.
|
||||
- A panel in a `FloatingPanelPortalHost` reads `useSafeAreaInsets()` inside the portal, where it
|
||||
resolves at the host's position (Gotcha 2): the root host sits outside the layout surface and
|
||||
gets the window's inset, a workspace host inside it gets 0. See the autocomplete `PopoverFrame`.
|
||||
- An absolutely positioned view that covers the surface's padding, such as the overlay left
|
||||
sidebar, reads the window's insets with `useWindowSafeAreaInsets()`.
|
||||
|
||||
## Recipe for a new anchored panel
|
||||
|
||||
|
||||
+2
-1
@@ -10,6 +10,7 @@ Authoritative terminology. UI label wins. Don't invent synonyms; use what's here
|
||||
- **Agent** — See **Agent session**. UI still says "Agent" / "New Agent" in places, but moving toward **Agent session** as the canonical term. Code: `AgentSnapshotPayload` (`packages/protocol/src/messages.ts:608`). Forbidden: "Task", "Job", "Run".
|
||||
- **Daemon** — Local Paseo server process; identified by `serverId`. UI: "Daemon" (system contexts only). Code: `serverId` in `ServerInfoStatusPayloadSchema` (`packages/protocol/src/messages.ts:1936`), `DaemonClient` (`packages/client/src/daemon-client.ts`).
|
||||
- **Host** — Client-side connection profile pointing at a daemon; bundles one or more `HostConnection`s. UI: "Host" / "Add host" / "Switch host". Code: `HostProfile` (`packages/app/src/types/host-connection.ts:37`). Forbidden: "Connection" (means `HostConnection`, not host).
|
||||
- **Device** — A computer or phone running a Paseo client. Open **Devices** in a host’s settings to connect another device.
|
||||
- **Host badge** — The item on a sidebar workspace row's meta row naming which host that workspace lives on. Three things gate it, and they compose as a lattice rather than competing: the sidebar must span more than one host (automatic), **Show → Host** in the sidebar's display preferences must be on (global, all hosts at once), and then that host's own display mode decides _how_ it draws — **Name** / **Icon only** / **Hidden**. Name, color, and display mode are per-host, per-device, and live client-side on `HostProfile.appearance`; nothing about it reaches the daemon. Never add a fourth way to hide it. UI: the "Appearance" group on a host's settings page, and the "Show" submenu in the sidebar's display preferences. Code: `selectHostBadges` (`packages/app/src/hosts/appearance.ts`) takes the first two as its `enabled` input; `WorkspaceMetaRow` (`packages/app/src/components/sidebar/workspace-meta-row/index.tsx`) draws it. Don't confuse with **Status pill**, which reports state rather than identity.
|
||||
- **Project host entry** — One row in a project for a single (project, daemon) pair, aggregating that daemon's workspaces in the project. Internal. Code: `ProjectHostEntry` (`packages/app/src/utils/projects.ts:11`). Don't introduce "Checkout" as a synonym.
|
||||
- **Placement** — One workspace's stable foreign-key relationship to its project plus its git checkout snapshot. Internal. An explicit creation `projectId` is authoritative when active.
|
||||
@@ -33,7 +34,7 @@ Authoritative terminology. UI label wins. Don't invent synonyms; use what's here
|
||||
- **Agent session** — One running instance of an agent inside a workspace (one provider, one model, one cwd, one timeline). The conceptual unit; in the UI this opens as a tab. Moving toward this as the canonical term over "Agent". Code: `AgentSnapshotPayload` (`packages/protocol/src/messages.ts:608`).
|
||||
- **Session** — Two senses: (a) per-client connection to a daemon, internal; (b) user-facing agent session, see **Agent session**. Code: `Session` (`packages/server/src/server/session.ts`) for (a). Don't confuse with: provider-side agent session log.
|
||||
- **Profile** — Internal name for the persisted shape of a host. Code: `HostProfile` (`packages/app/src/types/host-connection.ts:37`). Never user-facing. Three other things are called "profile" in this codebase, so always qualify: **Agent profile**, **Terminal profile**, and the provider aliases in [custom-providers.md](custom-providers.md). Bare "profile" is forbidden in UI copy.
|
||||
- **Agent profile** — A named launch bundle: provider, model, mode, thinking option, feature values, and free-text notes. Applying one writes those values into the **Agent controls** and is then forgotten — there is no selected profile, no default profile, and no drift tracking. The notes are written for orchestrating agents and are what the `list_profiles` MCP tool surfaces. Stored host-wide in daemon config as `agentProfiles`. UI: "Agent profiles". Code: `AgentProfile` (`packages/protocol/src/messages.ts:161`). Carries no system prompt, because a per-agent system prompt can only be set at creation. Forbidden: "Favourite", which this replaced.
|
||||
- **Agent profile** — A named launch bundle: provider, model, mode, thinking option, feature values, optional system prompt, and free-text notes. Applying one writes those values into the **Agent controls** and is then forgotten — there is no selected profile, no default profile, and no drift tracking. The system prompt applies only when creating a new agent and is ignored when applying the profile to a running one. The notes are written for orchestrating agents and are what the `list_profiles` MCP tool surfaces. Stored host-wide in daemon config as `agentProfiles`. UI: "Agent profiles". Code: `AgentProfile` (`packages/protocol/src/agent-profile.ts`). Forbidden: "Favourite", which this replaced.
|
||||
- **Terminal profile** — A named shell command a terminal can launch. Stored host-wide in daemon config as `terminalProfiles`. UI: "Terminal profiles". Code: `TerminalProfile` (`packages/protocol/src/messages.ts:135`), `resolveTerminalProfiles` (`packages/protocol/src/terminal-profiles.ts`). Also selectable as a New Workspace launch target, where the alternative is the chat agent.
|
||||
- **Provider** — Agent backend (Claude Code, Codex, Copilot, OpenCode, Pi, Oh My Pi). UI: "Provider". Code: `ProviderSnapshotEntry` (`packages/protocol/src/messages.ts:198`).
|
||||
- **Hook** — A plugin lifecycle handler registered with `server.addHook`, named `subject.operation.position` with `before` or `after`; each hook declares whether Paseo waits. See [hooks](../public-docs/plugins/hooks.md).
|
||||
|
||||
+12
-2
@@ -10,10 +10,20 @@ Agent payloads name a host and agent. Ignore their workspace hint when opening:
|
||||
the agent can move after a notification is sent. Use `navigateToAgent`, which
|
||||
uses the current store record or the agent route to resolve the workspace from
|
||||
the host. Terminal payloads name their workspace and use `navigateToWorkspace`.
|
||||
Plugin payloads carry `kind: "plugin"`, `serverId`, `pluginId`, `notificationId`,
|
||||
and optional `open` and `data`; `openPluginNotification` in
|
||||
`packages/app/src/plugins/notification-open.ts` waits up to 8 seconds for the
|
||||
target host's plugin catalog to settle on cold launch, runs registered
|
||||
`client.onNotificationOpen` handlers with caught error isolation, and falls back
|
||||
to declarative `open` (`agent`, `workspace`, `screen`) or the host root route.
|
||||
|
||||
See [agent targets and deferred opens](expo-router.md#agent-targets) for route
|
||||
ownership and workspace recovery. Notification generation, presence, and push
|
||||
eligibility remain daemon concerns.
|
||||
ownership and workspace recovery. Per-device two-knob notification preferences
|
||||
(`@getpaseo/protocol/notification-preferences`) sync with mobile push tokens via
|
||||
`register_push_token` (gated on `server_info.features.pushNotificationPreferences`)
|
||||
so the daemon filters Expo pushes per token, while desktop and web clients filter
|
||||
in-app OS notifications locally before calling `sendOsNotification`. Notification
|
||||
generation and presence remain daemon concerns.
|
||||
|
||||
## Native delivery
|
||||
|
||||
|
||||
+25
-1
@@ -1,7 +1,7 @@
|
||||
# Plugins
|
||||
|
||||
Local plugins contribute daemon RPCs, native app surfaces, workspace panels, Command Center items,
|
||||
client slash commands, timeline items, header buttons, composer pills, app themes, composer attachment sources, and settings screens.
|
||||
client slash commands, timeline items, notifications, header buttons, composer pills, app themes, composer attachment sources, and settings screens.
|
||||
Paseo executes `index.server.ts` in a subprocess and `index.client.tsx` in every connected app.
|
||||
|
||||
> **Trust every plugin you add.** `paseo plugin add` and `paseo plugin install` mean “I trust this codebase.” Plugins are unsandboxed: server code and preparation commands run with the daemon user's access on the daemon host, and client contributions run inside Paseo. The repository's dependencies and future updates are part of that trust decision. With `--host`, preparation runs on that remote daemon host.
|
||||
@@ -549,6 +549,26 @@ The same holds for a hook that runs inside an agent's lifecycle lane: an `agent.
|
||||
an option, model, thinking or mode change) waits on the open, which waits on the hook. The hooks
|
||||
reference tells plugin authors to start such a write without awaiting it.
|
||||
|
||||
## Send notifications
|
||||
|
||||
Server plugins call `server.notifications.send(input)` over the `notification.send` /
|
||||
`notification.result` / `notification.error` IPC messages. `PluginNotificationDispatcher` in
|
||||
`packages/server/src/server/plugins/notifications.ts` trims and truncates `title` (<= 160 chars)
|
||||
and `body` (<= 500 chars), validates `key` (<= 128 chars), `open` (IDs <= 256 chars, serialized
|
||||
<= 1,024 UTF-8 bytes), and `data` (<= 1,024 UTF-8 bytes so APNs and FCM envelopes stay within
|
||||
4 KiB), drops duplicate `(pluginId, key)` pairs for 60 seconds, and enforces a per-plugin token
|
||||
bucket (burst 10, refill 1 per 6 seconds). Stopping a plugin clears its deduplication and
|
||||
rate-limit state.
|
||||
|
||||
`WebSocketServer.sendPluginNotification` stamps the runtime `pluginId`, `serverId`, and
|
||||
`notificationId`, runs `computeNotificationPlan` (using `open.agentId` as the focus target when
|
||||
`open.type === "agent"`), filters Expo pushes per token with `{ kind: "plugin", pluginId }`, and
|
||||
publishes `plugin.notification` to sessions subscribed to that event category. Clients gate their
|
||||
`"plugin.notification"` subscription on `server_info.features.pluginNotifications` (`COMPAT(pluginNotifications)`).
|
||||
See [notifications.md](notifications.md) for tap routing and cold-launch catalog readiness, and the
|
||||
[public notifications reference](../public-docs/plugins/reference.md#notifications) for the author
|
||||
contract.
|
||||
|
||||
## Contribute a provider
|
||||
|
||||
Register a provider from `index.server.ts`. The provider connection is callback-based and owns all
|
||||
@@ -952,6 +972,10 @@ reply text once, forks at its message, and shows its duration and stats. Read th
|
||||
`getAssistantReply` (`packages/app/src/types/stream.ts`) instead of checking `kind ===
|
||||
"assistant_message"`.
|
||||
|
||||
A provider-only fact about a tool call goes in the item's `metadata`, which transformers already
|
||||
receive. Do not add a shared tool-call field for it. OMP's intent string is
|
||||
[`metadata.intent`](../public-docs/plugins/reference.md#timeline-items).
|
||||
|
||||
Transformers run synchronously and must be deterministic. When several transformers match, the
|
||||
first one that returns a result owns that source item. Plugin and registration ordering is stable.
|
||||
See `plugin-examples/timeline-items` for the complete contract.
|
||||
|
||||
+7
-1
@@ -225,7 +225,10 @@ aborts the shared refresh signal at the deadline, and when it stops. Shutdown wa
|
||||
probes to settle before it shuts down provider clients, so a probe cannot start provider work,
|
||||
such as an OpenCode server, after its client has cleaned up. Providers name active catalog operations and
|
||||
finish subprocess, server, or session cleanup before rejecting. Timeout errors list the operations
|
||||
that were still active when the deadline expired.
|
||||
that were still active when the deadline expired. A plugin provider's connection is shared with its
|
||||
running sessions, so the bridge cannot close it at the deadline; it sends `request.cancel` for the
|
||||
abandoned request instead, and the provider stops that request's work
|
||||
([provider guide](../public-docs/plugins/providers.md#stop-a-request-paseo-cancels)).
|
||||
|
||||
Catalogue results stay cached by identity until a refresh or a change to that provider's configuration.
|
||||
Providers change their model lists on the server without a CLI update, so the daemon refreshes
|
||||
@@ -337,6 +340,9 @@ See the [public usage source reference](../public-docs/plugins/reference.md#usag
|
||||
contract, account and window identity, provider-derived period names, login fallback, and
|
||||
read-only credential rules. Usage adapters own the interpretation of provider fields; the app
|
||||
renders their names and resolves pins without provider-specific duration guesses.
|
||||
Claude's OAuth usage endpoint is undocumented. Extra-usage amounts are reported in minor currency
|
||||
units and displayed only for USD; the balance contract does not represent other currencies.
|
||||
Codex individual spending limits provide percentages, not dollar amounts.
|
||||
|
||||
---
|
||||
|
||||
|
||||
+202
-102
@@ -4,29 +4,41 @@ All workspaces share one version and release together.
|
||||
|
||||
## Two steps
|
||||
|
||||
A release has exactly two steps. The agent does the first, the user authorizes the second.
|
||||
A release has two steps. The agent runs Preparation before approval, and the user authorizes Ship.
|
||||
|
||||
**Preparation** (reversible — agent does this on the release branch):
|
||||
### Preparation
|
||||
|
||||
- resolve the [release base](#release-base-and-source) and get the [release inventory](#release-inventory) approved when one applies
|
||||
- classify the diff from the previous stable to the release source as patch or minor, then show the
|
||||
target version and rationale to the user
|
||||
- draft `CHANGELOG.md` and `CHANGELOG.zh-CN.md`, show the draft to the user, and wait for review
|
||||
- run the pre-release sanity check (stable only) and surface findings to the user
|
||||
- commit the approved changelog and any requested ACP update, run format, lint, and typecheck, then
|
||||
run `npm run release:prep:<mode>` to create the `chore(release): cut <version>` commit without a tag
|
||||
- push the `release/vX.Y.Z` or `release/vX.Y.Z-beta.N` branch and confirm its `CI` and
|
||||
`Desktop Packages` runs pass (never wait on `main` CI)
|
||||
- run the [pre-release dependency checks](#pre-release-dependency-checks) on the release commit
|
||||
Preparation is reversible and runs on the release branch before the user authorizes shipping.
|
||||
|
||||
**Go-ahead** (user says "go ahead"):
|
||||
1. Resolve the [release base](#release-base-and-source) and get the [release inventory](#release-inventory) approved when one applies.
|
||||
2. Classify the diff from the previous stable release to the release source as patch or minor, then show the target version and rationale to the user.
|
||||
3. Draft `CHANGELOG.md` and `CHANGELOG.zh-CN.md`, show the draft to the user, and wait for approval.
|
||||
4. Run the [pre-release sanity check](#pre-release-sanity-check) for stable releases, and report any findings to the user.
|
||||
5. Commit the approved changelog and any requested ACP update, then run `npm run format`, `npm run lint`, and `npm run typecheck`.
|
||||
6. Run `npm run release:prep:<mode>` to create the `chore(release): cut <version>` commit without a tag.
|
||||
7. Push `release/vX.Y.Z` or `release/vX.Y.Z-beta.N` and wait for `CI` and `Desktop Packages` on that branch to pass (never wait on `main` CI).
|
||||
8. Run the [pre-release dependency checks](#pre-release-dependency-checks) on the release commit.
|
||||
|
||||
- run `npm run release:ship` (stable) or `npm run release:ship:beta` (beta), which publishes npm
|
||||
with retry and registry visibility checks, advances the `beta` dist-tag on stable when newer, and
|
||||
pushes the tag on the already-verified commit
|
||||
- create the release heartbeat immediately and babysit it to completion
|
||||
- open the [reconcile `main`](#reconcile-main) PR right away so its CI runs in parallel with release
|
||||
builds, then delete the remote release branch once the PR merges
|
||||
### Ship
|
||||
|
||||
Ship starts after the user says "go ahead". All tag-triggered GitHub Actions workflows and EAS workflows build from the checked-out tag commit with local workspace packages, so none of them install `@getpaseo/*` from the public npm registry.
|
||||
|
||||
1. Run `npm run release:push` first to verify the clean release branch and push `vX.Y.Z` or `vX.Y.Z-beta.N`. Pushing the tag takes a few seconds and starts `Desktop Release`, `Android APK Release`, `Docker`, `Release Notes Sync`, and (for stable tags) `Deploy App` on GitHub Actions, plus `Release Mobile` (stable) or `Release iOS Beta` (beta) on EAS. (`Deploy Website` runs later on the `release: published` event when `Desktop Release` publishes the stable GitHub Release.)
|
||||
2. Run `npm run release:publish` (stable) or `npm run release:publish:beta` (beta) in parallel with the remote builds. `scripts/publish-release-packages.mjs` publishes the seven `@getpaseo/*` packages in dependency waves and polls npm visibility between packages to avoid `E409` or `E404` propagation races.
|
||||
3. Open the [reconcile `main`](#reconcile-main) PR from `reconcile/vX.Y.Z` or `reconcile/vX.Y.Z-beta.N` right after `npm run release:push` finishes, so its CI run overlaps with npm publication and the release builds.
|
||||
4. Create the release heartbeat immediately with `create_heartbeat` to track every ship step to completion.
|
||||
|
||||
### Sync gates
|
||||
|
||||
Wait until every gate below passes before deleting the remote release branch or reporting the release as shipped:
|
||||
|
||||
- All seven `@getpaseo/*` npm packages are visible on `latest` (stable) or `beta` (beta), and on stable the `beta` dist-tag points to the shipped version unless an active newer beta exists.
|
||||
- All tag-triggered GitHub Actions workflows are green (`Desktop Release`, `Android APK Release`, `Docker`, `Release Notes Sync`, and `Deploy App` for stable), and `Deploy Website` ran after stable publication.
|
||||
- The GitHub Release is published and non-draft (marked prerelease for beta) with the synced changelog body, all macOS, Linux, and Windows assets, the Android APK asset, and all three channel manifests (`latest-mac.yml`, `latest-linux.yml`, `latest.yml` for stable; `beta-mac.yml`, `beta-linux.yml`, `beta.yml` for beta).
|
||||
- The matching EAS workflow is green (`Release Mobile` with all six build, distribution, screenshot, and review-submission jobs for stable; `Release iOS Beta` for beta).
|
||||
- The reconcile PR is merged into `main`.
|
||||
|
||||
Once all sync gates pass, delete the remote release branch (`git push origin --delete release/vX.Y.Z` or `release/vX.Y.Z-beta.N`), delete the heartbeat, and report the release as shipped.
|
||||
|
||||
Rules that apply to both steps:
|
||||
|
||||
@@ -48,7 +60,7 @@ the shipped source.
|
||||
The user decides when the changes on `main` warrant a release and how much risk it takes:
|
||||
|
||||
1. **Direct stable release** for a low-risk batch of polish and bug fixes. Stable desktop updates
|
||||
already ramp over 36 hours (see [Staged rollout](#staged-rollout-stable-channel)), and store
|
||||
start with a 5% canary and ramp over 18 hours (see [Staged rollout](#staged-rollout-stable-channel)), and store
|
||||
review often takes about a day, with no guaranteed timing.
|
||||
2. **Beta flow**, the default for changes that need testing. Release candidates on the `beta`
|
||||
channel. Each beta folds into the series' single changelog entry, publishes npm only on the
|
||||
@@ -110,18 +122,20 @@ An explicit user instruction can select another base.
|
||||
runs on every merge. Wait for both runs on the release branch commit to pass before shipping.
|
||||
Complete the [pre-release dependency checks](#pre-release-dependency-checks) on that commit.
|
||||
Pushing a `release/**` branch without a `v*` tag triggers no publish workflows.
|
||||
6. After go-ahead, run `npm run release:ship` (stable) or `npm run release:ship:beta` (beta). This
|
||||
publishes to npm and pushes the `v*` tag on the already-verified commit. Because the release
|
||||
branch is already pushed at `HEAD`, no second CI run starts and only the tag release workflows
|
||||
run.
|
||||
7. Start [Reconcile `main`](#reconcile-main) immediately so its PR checks overlap with desktop and
|
||||
EAS builds.
|
||||
6. After go-ahead, push the tag first with `npm run release:push` so remote builds start right away.
|
||||
Because the release branch is already pushed at `HEAD`, no second branch CI run starts, and only
|
||||
the tag release workflows run.
|
||||
7. Immediately in parallel after `npm run release:push` finishes: publish npm packages with
|
||||
`npm run release:publish` (stable) or `npm run release:publish:beta` (beta), start
|
||||
[Reconcile `main`](#reconcile-main) so its PR checks overlap with desktop and EAS builds, and
|
||||
create the release heartbeat. (`npm run release:ship` and `npm run release:ship:beta` also run
|
||||
`release:push` before `release:publish`, so tag builds never wait behind npm.)
|
||||
|
||||
When promoting or branching from a tag created before `release:prep:*`, `release:ship`, and the
|
||||
`release/**` workflow triggers existed (for example `v0.17.0-beta.1`), either cherry-pick the
|
||||
release-tooling commit onto the release branch (leaving product code unchanged) or follow the
|
||||
older tag's scripts (`version:all:*`, manual `gh workflow run ci.yml --ref <branch>`,
|
||||
`release:publish`, and `release:push`) until the next tag carries the new tooling.
|
||||
`release:push`, and `release:publish`) until the next tag carries the new tooling.
|
||||
|
||||
A stable hotfix can take the version a patch beta line would promote to, such as `0.13.3`
|
||||
shipping while `0.13.3-beta.2` soaks. Never republish or reuse a shipped version. Continue the line
|
||||
@@ -130,7 +144,7 @@ computes that from a prerelease, so run `npm run release:check`, bump with
|
||||
`npm version 0.13.4-beta.1 --include-workspace-root --no-git-tag-version && git commit -m "chore(release): cut 0.13.4-beta.1"`,
|
||||
push the release branch for `CI` and `Desktop Packages`, and complete the
|
||||
[pre-release dependency checks](#pre-release-dependency-checks) before shipping with
|
||||
`npm run release:ship:beta`.
|
||||
`npm run release:push` and `npm run release:publish:beta` (or `npm run release:ship:beta`).
|
||||
Record the tested beta tag as its source so its soak still counts for the unchanged content.
|
||||
|
||||
## Release inventory
|
||||
@@ -159,8 +173,7 @@ For a promotion, every item defaults to defer.
|
||||
|
||||
## Reconcile main
|
||||
|
||||
Right after the tag push (in parallel with desktop and EAS builds), open a PR into `main` from a
|
||||
fresh branch off `origin/main` named `reconcile/vX.Y.Z` or `reconcile/vX.Y.Z-beta.N`:
|
||||
Right after `npm run release:push` pushes the tag (in parallel with npm publication and all desktop, APK, Docker, and EAS builds), open a PR into `main` from a fresh branch off `origin/main` named `reconcile/vX.Y.Z` or `reconcile/vX.Y.Z-beta.N`. Reconcile reads only the tagged git commit, so it does not wait for npm or any release build:
|
||||
|
||||
```bash
|
||||
git fetch origin --tags
|
||||
@@ -180,10 +193,10 @@ hunks from the release base:
|
||||
- Leaves unshipped work on `main` untouched and makes no claims about unshipped work in the
|
||||
changelog entry.
|
||||
|
||||
Commit, open the PR into `main`, and merge once its checks pass. After the reconcile PR merges and
|
||||
the release completes, delete the remote release branch (`git push origin --delete release/vX.Y.Z`
|
||||
or `release/vX.Y.Z-beta.N`). The tag is the record of shipped source; Paseo maintains no release
|
||||
track besides `main`.
|
||||
Commit, open the PR into `main`, and merge once its checks pass. Delete the remote release branch
|
||||
(`git push origin --delete release/vX.Y.Z` or `release/vX.Y.Z-beta.N`) only after the reconcile PR
|
||||
merges and every [sync gate](#sync-gates) passes. The tag is the record of shipped source, and
|
||||
Paseo maintains no release track besides `main`.
|
||||
|
||||
## ACP catalog updates
|
||||
|
||||
@@ -240,24 +253,30 @@ npm run release:prep:minor
|
||||
git push -u origin HEAD
|
||||
# Complete the pre-release dependency checks on this commit.
|
||||
|
||||
# 3. After go-ahead and green release-branch checks: publish npm and push the tag.
|
||||
npm run release:ship
|
||||
# 3. After go-ahead and green release-branch checks: push the tag first to start builds.
|
||||
npm run release:push
|
||||
|
||||
# 4. Run these in parallel immediately after step 3:
|
||||
npm run release:publish
|
||||
# Also open the reconcile/vX.Y.Z PR into main and create the release heartbeat.
|
||||
# (`npm run release:ship` runs `release:push` before `release:publish` if used standalone.)
|
||||
```
|
||||
|
||||
`release:ship` runs `scripts/publish-release-packages.mjs` and `scripts/push-current-release-tag.mjs`:
|
||||
`scripts/push-current-release-tag.mjs` refuses non-`release/*` branches, checks that `HEAD` matches `origin/release/*`, tags `HEAD` with `vX.Y.Z`, and pushes the tag. Because `HEAD` is already on the pushed release branch, no second branch CI run starts.
|
||||
|
||||
- Publishes all seven `@getpaseo/*` packages in dependency order, skips versions already on npm,
|
||||
retries transient 429/5xx/network errors, and waits until each version is visible on npm before
|
||||
continuing.
|
||||
- Checks `npm view @getpaseo/cli dist-tags` and moves npm's `beta` dist-tag to the new stable
|
||||
version across all seven packages whenever the stable version is newer than `beta` (leaving
|
||||
`beta` untouched during a stable hotfix on an older line).
|
||||
- Refuses non-`release/*` branches, tags `HEAD` with `vX.Y.Z`, and pushes the tag. Because `HEAD`
|
||||
is already on the release branch, no second CI run starts.
|
||||
`scripts/publish-release-packages.mjs` publishes the seven `@getpaseo/*` packages in dependency-wave order:
|
||||
|
||||
The tag push triggers `Desktop Release`, `Android APK Release`, `Docker`, and `Release Notes Sync` on GitHub Actions. The workflows create the GitHub Release as a draft while builds and release-note sync run. EAS picks up the same tag via the EAS GitHub app and starts the iOS + Android store builds in parallel (see "Mobile builds (EAS)" below) — there is no mobile-release workflow under `.github/workflows`.
|
||||
1. Wave 1: `@getpaseo/highlight`, `@getpaseo/relay`, and `@getpaseo/protocol` (no `@getpaseo/*` dependencies).
|
||||
2. Wave 2: `@getpaseo/client` (depends on `@getpaseo/protocol` and `@getpaseo/relay`).
|
||||
3. Wave 3: `@getpaseo/plugin` (depends on `@getpaseo/client` and `@getpaseo/protocol`).
|
||||
4. Wave 4: `@getpaseo/server` (depends on `@getpaseo/client`, `@getpaseo/highlight`, `@getpaseo/plugin`, `@getpaseo/protocol`, and `@getpaseo/relay`).
|
||||
5. Wave 5: `@getpaseo/cli` (depends on `@getpaseo/client`, `@getpaseo/protocol`, and `@getpaseo/server`).
|
||||
|
||||
Verify `npm view @getpaseo/cli dist-tags` shows `latest` at the shipped version, and `beta` at the shipped version or an active newer beta, before considering the stable release complete.
|
||||
After each `npm publish`, the script polls `npm view` (up to 12 checks, 5 seconds apart) until the published version is visible on npm before moving to the next package. Waiting for registry visibility prevents dependent publishes and manual retries from hitting `E409` conflicts or `E404` propagation lag. On stable releases, the script also checks `npm view @getpaseo/cli dist-tags` and moves npm's `beta` dist-tag to the new stable version across all seven packages whenever the stable version is newer than `beta` (leaving `beta` untouched during a stable hotfix on an older line).
|
||||
|
||||
The tag push triggers `Desktop Release`, `Android APK Release`, `Docker`, `Release Notes Sync`, and `Deploy App` (`app.paseo.sh`, stable tags only) on GitHub Actions. `Desktop Release` and `Release Notes Sync` create the GitHub Release as a draft while builds and release-note sync run. `Deploy Website` triggers later on `release: published` when `Desktop Release` publishes the non-draft stable GitHub Release. EAS picks up the same tag through the EAS GitHub app and starts `Release Mobile` (iOS and Android store builds) in parallel, with no mobile-release workflow under `.github/workflows`. None of these workflows install `@getpaseo/*` from the public npm registry because all of them build from the checked-out tag commit and workspace packages.
|
||||
|
||||
Confirm that `npm view @getpaseo/cli dist-tags` shows `latest` at the shipped version, and `beta` at the shipped version or an active newer beta, before considering the stable release complete.
|
||||
|
||||
The Docker workflow builds images from the checked-out source tree on `main` as non-publishing checks (cancelling superseded `main` runs). Stable `vX.Y.Z` tag pushes publish `ghcr.io/getpaseo/paseo:X.Y.Z` and `ghcr.io/getpaseo/paseo:latest`; beta `vX.Y.Z-beta.N` tag pushes publish only `ghcr.io/getpaseo/paseo:X.Y.Z-beta.N` and never move `latest`.
|
||||
|
||||
@@ -276,8 +295,10 @@ npm run version:all:minor
|
||||
git push -u origin HEAD # Trigger CI + Desktop Packages on release/vX.Y.Z
|
||||
# Wait for CI and Desktop Packages and complete the pre-release dependency checks.
|
||||
# After go-ahead:
|
||||
npm run release:push # Create tag vX.Y.Z on HEAD and push (starts release builds)
|
||||
# In parallel right after release:push:
|
||||
npm run release:publish # Publish to npm (idempotent, with propagation + beta dist-tag sync)
|
||||
npm run release:push # Create tag vX.Y.Z on HEAD and push (triggers release workflows)
|
||||
# Open reconcile/vX.Y.Z PR into main and create the release heartbeat.
|
||||
```
|
||||
|
||||
## Beta flow
|
||||
@@ -294,15 +315,19 @@ npm run release:prep:beta:next # Cut X.Y.Z-beta.2, beta.3, ...
|
||||
git push -u origin HEAD
|
||||
# Complete the pre-release dependency checks on this commit.
|
||||
|
||||
# 3. After go-ahead:
|
||||
npm run release:ship:beta
|
||||
# 3. After go-ahead: push the tag first, then run npm publish, reconcile, and heartbeat in parallel:
|
||||
npm run release:push
|
||||
npm run release:publish:beta
|
||||
# (Or run `npm run release:ship:beta` in one shell while opening reconcile/vX.Y.Z-beta.N.)
|
||||
|
||||
# Later, after soak, promote on release/vX.Y.Z:
|
||||
npm run release:prep:promote
|
||||
git push -u origin HEAD
|
||||
# Wait for CI + Desktop Packages and complete the pre-release dependency checks.
|
||||
# After go-ahead:
|
||||
npm run release:ship
|
||||
npm run release:push
|
||||
npm run release:publish
|
||||
# Open reconcile/vX.Y.Z PR into main and create the release heartbeat in parallel.
|
||||
```
|
||||
|
||||
- Beta tags are published GitHub prereleases like `v0.1.41-beta.1`
|
||||
@@ -324,11 +349,33 @@ Use the beta path when you need to:
|
||||
|
||||
## Staged rollout (stable channel)
|
||||
|
||||
Stable desktop releases go out via a linear time-based rollout for automatic update checks: 0% admitted when the updater manifests appear, 100% admitted 36 hours later, linear ramp in between. Manual checks bypass the rollout so a user can install immediately when they click **Check**. Beta releases bypass the rollout entirely — beta users always receive updates immediately.
|
||||
A stable desktop release reaches automatic updates in stages, so a bad release reaches few installs before you stop it. Each install decides locally from two fields in the release manifests, `releaseDate` and `rolloutHours`. No server tracks installs.
|
||||
|
||||
The rollout is driven by a `rolloutHours` field stamped into the GitHub Release manifests (`latest-mac.yml`, `latest-linux.yml`, `latest.yml`) by the `finalize-rollout` job in `desktop-release.yml`.
|
||||
| Stage | Rule |
|
||||
| -------------- | -------------------------------------------------------------------------------------------------------- |
|
||||
| Canary | For the first 8 hours, 5% of installs are admitted. |
|
||||
| Ramp | From 8 hours to `rolloutHours` (18 by default), admission rises in a straight line from 5% to 100%. |
|
||||
| Check interval | An install asks GitHub for the latest release at most once every 6 hours. |
|
||||
| Cooldown | After an install updates, it skips paced releases for 24 hours. |
|
||||
| Staged update | An install that holds a downloaded update keeps it and does not download the paced release that follows. |
|
||||
|
||||
Desktop release builds now publish in two phases:
|
||||
A paced release is a stable release with `rolloutHours` above 0. When `rolloutHours` is under 16, the canary hold is half of `rolloutHours`.
|
||||
|
||||
Every release places each install at a new position in the rollout, so the canary group changes with each release. With one or two releases per day, an install updates at most once every 24 hours and skips the releases in between.
|
||||
|
||||
These paths skip the stages:
|
||||
|
||||
- A manual check (**Check**) always asks GitHub and always offers the latest release.
|
||||
- A release with `rolloutHours: 0` is an emergency release. Every install takes it at its next check, during a cooldown too, and it replaces a staged update.
|
||||
- The beta channel has no stages. A beta install takes each release at its next check.
|
||||
|
||||
The **Notify** update mode follows the same stages and prompts instead of downloading. **Off** makes no automatic requests.
|
||||
|
||||
`packages/desktop/src/features/app-update-rollout.ts` owns the curve. `app-update-pacing.ts` owns the check interval and the cooldown, and `app-update-service.ts` owns the staged update.
|
||||
|
||||
### How a release is published
|
||||
|
||||
The `finalize-rollout` job in `desktop-release.yml` stamps `releaseDate` and `rolloutHours` into the GitHub Release manifests (`latest-mac.yml`, `latest-linux.yml`, `latest.yml`). Desktop release builds publish in two phases:
|
||||
|
||||
- The GitHub Release stays a draft while platform build jobs upload the installers/packages (`.dmg`, `.zip`, `.exe`, `.AppImage`, etc.).
|
||||
- The final job merges and stamps every channel manifest, uploads them with the final `releaseDate` and `rolloutHours`, then publishes the GitHub Release.
|
||||
@@ -338,20 +385,20 @@ Drafts do not appear in GitHub's releases feed. Updater clients continue to see
|
||||
### Default behavior
|
||||
|
||||
Follow the [standard stable release procedure](#standard-release-stable). The tag push starts
|
||||
the desktop release workflow, which sets a 36-hour rollout when it publishes the release.
|
||||
the desktop release workflow, which sets an 18-hour rollout when it publishes the release.
|
||||
|
||||
The `rollout_hours` input on `desktop-release.yml` is **only read on `workflow_dispatch`** — tag-push runs always default to 36. To get any other rollout duration on a fresh release, use the post-publish flip below.
|
||||
The `rollout_hours` input on `desktop-release.yml` is read only on `workflow_dispatch`. Tag-push runs always use 18. To get any other rollout duration on a fresh release, use the post-publish flip below.
|
||||
|
||||
### Instant-admit release (rollout_hours=0)
|
||||
### Emergency release (rollout_hours=0)
|
||||
|
||||
Follow the [standard stable release procedure](#standard-release-stable). Wait for Desktop
|
||||
Release to publish, then update the manifests to admit everyone immediately.
|
||||
Release to publish, then update the manifests to admit everyone at once.
|
||||
|
||||
```bash
|
||||
# 1. Wait for Desktop Release to publish the GitHub Release.
|
||||
gh run watch <desktop-release-run-id> --exit-status
|
||||
|
||||
# 2. Flip the published manifests to instant admit.
|
||||
# 2. Flip the published manifests to an emergency release.
|
||||
gh workflow run desktop-rollout.yml \
|
||||
-f tag=v0.1.64 \
|
||||
-f rollout_hours=0
|
||||
@@ -359,23 +406,13 @@ gh workflow run desktop-rollout.yml \
|
||||
|
||||
Dispatch only after `finalize-rollout` has published the release. Until then the release is a draft, and a draft has no tag: `desktop-rollout.yml` looks the release up by tag and fails with `release not found`. The concurrency group `desktop-rollout-<tag>` that the two workflows share orders them only once both are queued; it does not hold an early dispatch until the draft is published.
|
||||
|
||||
The first public manifests carry `rolloutHours=36` for the minutes between publish and the flip. The renderer polls every 30 minutes, so active stable users pick up the new manifest on their next check.
|
||||
The first public manifests carry `rolloutHours=18` for the minutes between publish and the flip. An install sees the flip at its next check, which is up to 6 hours after its previous one. In automatic mode it then downloads the release and installs it when the app quits.
|
||||
|
||||
### Adjusting an already-published release
|
||||
|
||||
To change the rollout duration on a release that's already shipped — e.g. flip a hotfix to instant admit, or slow a release down — use the dedicated `desktop-rollout.yml` workflow. It edits the manifests in place on the GitHub release without rebuilding anything. It only rewrites `rolloutHours`; `releaseDate` is preserved, so the rollout clock keeps ticking from the original publish time.
|
||||
To change the rollout duration on a release that already shipped, use the `desktop-rollout.yml` workflow. It edits the manifests in place on the GitHub release without rebuilding anything. It rewrites only `rolloutHours`. `releaseDate` is preserved, so the rollout clock keeps running from the original publish time.
|
||||
|
||||
**Hotfix (instant admit) on an already-shipped release:**
|
||||
|
||||
```bash
|
||||
gh workflow run desktop-rollout.yml \
|
||||
-f tag=v0.1.42 \
|
||||
-f rollout_hours=0
|
||||
```
|
||||
|
||||
`rollout_hours=0` admits 100% of stable users on their next update check (within ~30 min for active clients).
|
||||
|
||||
**Slow a rollout down** (e.g. extend total duration to 72h since the original release):
|
||||
To slow a rollout down, for example to 72 hours since the original release:
|
||||
|
||||
```bash
|
||||
gh workflow run desktop-rollout.yml \
|
||||
@@ -383,13 +420,59 @@ gh workflow run desktop-rollout.yml \
|
||||
-f rollout_hours=72
|
||||
```
|
||||
|
||||
`rollout_hours` is **total duration since the original release date**, not "extend by N more hours from now." If `v0.1.42` was published 2h ago and you set `rollout_hours=72`, the ramp finishes 70h from now.
|
||||
`rollout_hours` is the total duration since the original release date. If `v0.1.42` was published 2 hours ago and you set `rollout_hours=72`, the ramp finishes 70 hours from now.
|
||||
|
||||
A longer rollout does not stop a release. The canary group still updates. To stop a release, [halt it](#halt-a-release).
|
||||
|
||||
The dispatch is idempotent and shares the `desktop-rollout-<tag>` concurrency group with `desktop-release.yml`'s `finalize-rollout` job, so it serializes safely against an in-flight tag-push pipeline targeting the same release.
|
||||
|
||||
### Halt a release
|
||||
|
||||
Stable installs and the download page follow the release that GitHub marks as latest. To stop a release, mark the last good release as latest:
|
||||
|
||||
```bash
|
||||
# v0.1.41 is the last good release.
|
||||
gh release edit v0.1.41 --latest
|
||||
|
||||
# Prints v0.1.41 when the halt is in effect.
|
||||
gh api repos/getpaseo/paseo/releases/latest --jq .tag_name
|
||||
```
|
||||
|
||||
The halt applies to every stable install from its next check, including installs older than the staged rollout:
|
||||
|
||||
- An install that has not downloaded the halted release no longer sees it.
|
||||
- An install that downloaded it asks GitHub again before it installs at quit, and drops the download.
|
||||
- An install that already runs the halted release stays on it, because the app never downgrades. [Ship a fix](#fix-a-bad-release).
|
||||
|
||||
A halt does not reach the beta channel. Beta installs read the release list by date and still take the halted release.
|
||||
|
||||
To resume a halted release, run `gh release edit v0.1.42 --latest` with its tag.
|
||||
|
||||
### Fix a bad release
|
||||
|
||||
1. [Halt](#halt-a-release) the bad release.
|
||||
2. Ship the fix as the next patch with the [standard stable release procedure](#standard-release-stable).
|
||||
3. After Desktop Release publishes the fix, make sure that GitHub marks it as latest:
|
||||
|
||||
```bash
|
||||
gh api repos/getpaseo/paseo/releases/latest --jq .tag_name
|
||||
```
|
||||
|
||||
If the command prints another tag, run `gh release edit <fix-tag> --latest`.
|
||||
|
||||
4. Flip the fix to an [emergency release](#emergency-release-rollout_hours0):
|
||||
|
||||
```bash
|
||||
gh workflow run desktop-rollout.yml \
|
||||
-f tag=<fix-tag> \
|
||||
-f rollout_hours=0
|
||||
```
|
||||
|
||||
Do not leave the fix as a paced release. The installs that took the bad release are in their 24-hour cooldown and skip a paced release. An install that holds the bad release as a staged update, and did not check during the halt, keeps it when a paced release follows. An emergency release reaches both.
|
||||
|
||||
### Custom ramp on a manually-dispatched build
|
||||
|
||||
`desktop-release.yml` accepts `rollout_hours` only on `workflow_dispatch`, which is the path used to **rebuild an existing tag** (retry a failed release, force a rebuild on a different ref). When you go that route, you can stamp a non-default ramp directly:
|
||||
`desktop-release.yml` accepts `rollout_hours` only on `workflow_dispatch`, which is the path used to rebuild an existing tag (retry a failed release, force a rebuild on a different ref). On that path, you can stamp a different ramp directly:
|
||||
|
||||
```bash
|
||||
gh workflow run desktop-release.yml \
|
||||
@@ -397,14 +480,18 @@ gh workflow run desktop-release.yml \
|
||||
-f rollout_hours=6
|
||||
```
|
||||
|
||||
For a fresh release with a custom ramp, follow the [instant-admit procedure](#instant-admit-release-rollout_hours0)
|
||||
For a fresh release with a custom ramp, follow the [emergency release procedure](#emergency-release-rollout_hours0)
|
||||
and set `rollout_hours` to your chosen duration.
|
||||
|
||||
### Releasing during an active rollout
|
||||
|
||||
If you ship N+1 while N is still ramping, N+1 starts a fresh rollout from its own publish timestamp. N's rollout effectively ends — the newer manifest supersedes it. Rollout-aware clients revalidate the manifest for up to five seconds before installing a downloaded update on quit. If N+1 has replaced N but the client is not admitted to N+1 yet, it skips the downloaded N and waits rather than installing two updates in succession. If revalidation times out, the app exits without installing the cached update.
|
||||
If you ship N+1 while N is still ramping, N+1 starts a new rollout from its own publish time, and the rollout of N ends because installs no longer see its manifests.
|
||||
|
||||
If N+1 is a hotfix for a bug in N, dispatch `desktop-rollout.yml -f tag=v0.1.<N+1> -f rollout_hours=0` after N+1 publishes so the users who already got N reach the fix fast.
|
||||
An install that holds N as a staged update keeps N when N+1 is a paced release, and installs N when the app quits. It then waits out its cooldown before it takes a later paced release. The hold covers only paced patch releases that the install saw one after the other. If the install missed a release, it evaluates the newest release instead: it replaces N when it is admitted, and drops N when it is not.
|
||||
|
||||
A minor or major release always ends the hold. The version numbers do not show whether a fix shipped between `0.17.4` and `0.18.0`, so the install treats `0.18.0` as if it missed a release.
|
||||
|
||||
Before an install at quit, the app asks GitHub for the latest release for up to five seconds. If that check does not finish in time, the app exits without installing the staged update.
|
||||
|
||||
### macOS system floor
|
||||
|
||||
@@ -417,17 +504,17 @@ macOS 13 maps to Darwin 22. The two values use different version domains; do not
|
||||
|
||||
### Limitations
|
||||
|
||||
- **No pause / kill switch.** To stop new admissions, ship a superseding release. Clients revalidate on quit and will not install the superseded download, but a client that already completed installation cannot be recalled; ship a hotfix `+1` patch.
|
||||
- **No rollback.** `allowDowngrade = false`. Bad release = ship a hotfix.
|
||||
- **Bootstrap caveat.** Clients running a build older than the rollout feature ignore `rolloutHours` and admit immediately. Rollout protection only applies to clients running the rollout-aware version or later.
|
||||
- **Up to ~30 min automatic admission latency.** Renderer polls every 30 minutes, so a stable user may take up to that long to be evaluated against the rollout window. Clicking **Check** is manual and bypasses rollout admission.
|
||||
- A release cannot be recalled from an install that runs it. `allowDowngrade` is `false`. [Halt](#halt-a-release) the release to protect the other installs, then [ship a fix](#fix-a-bad-release).
|
||||
- An emergency release reaches a running install at its next check, up to 6 hours after its previous one. A manual check sees it at once.
|
||||
- Installs older than the canary and cooldown build have neither. They ramp in a straight line over `rolloutHours` and check every 30 minutes. Installs older than the staged rollout ignore `rolloutHours` and update at once.
|
||||
- The app window starts every automatic check. A release whose window does not load cannot update itself, and its users must download a new build from the website. Smoke the packaged app before you publish.
|
||||
|
||||
## Mobile builds (EAS)
|
||||
|
||||
iOS and Android store builds are not in `.github/workflows`. They are triggered by the EAS GitHub app the moment the `v*` tag is pushed:
|
||||
|
||||
- **Android (Play Store)** — EAS builds with profile `production` and auto-submits to the Play Store via `eas submit` (EAS-managed credentials). A Fastlane lane then replaces the store screenshots.
|
||||
- **iOS (TestFlight + App Store)** — EAS builds with profile `production`, uploads once through a `testflight` job, distributes the build to the `Paseo Beta` external group with Beta App Review submission, and a Fastlane lane uploads the store screenshots and submits that same build for App Store review.
|
||||
- **iOS (TestFlight + App Store)** — EAS builds with profile `production`, uploads once through a `testflight` job, distributes the build to the `Paseo Beta` external group with Beta App Review submission, and a Fastlane lane uploads the store screenshots and submits that same build for App Store review. When an earlier iOS version is already in Apple's review or release queue (`WAITING_FOR_REVIEW`, `IN_REVIEW`, `PENDING_APPLE_RELEASE`, `PENDING_DEVELOPER_RELEASE`, `PROCESSING_FOR_DISTRIBUTION`, `WAITING_FOR_EXPORT_COMPLIANCE`, or `ACCEPTED`), `submit_review` leaves it untouched, logs `IOS_REVIEW_SKIPPED` with the in-review version and the waiting TestFlight build, and exits `0` so `Release Mobile` stays green.
|
||||
- **Android APK (GitHub Release asset)** — separate, via `.github/workflows/android-apk-release.yml`. This is the only Android-related workflow that lives in this repo.
|
||||
|
||||
EAS uses the local app version source. `packages/app/app.config.js` derives the native version from the package version. Android `versionCode` is `major * 1_000_000 + minor * 1_000 + patch`. iOS reserves 1,000 build slots per app version: beta `N` uses slot `N`, and stable uses slot `999`. For example, `0.2.6-beta.2` appears in App Store Connect as version `0.2.6` build `2006002`; stable uses build `2006999`. Rebuilding the same tag produces the same native build number; if a store has already accepted a binary and you need a different binary, cut the next beta or patch instead of relying on EAS remote auto-increment.
|
||||
@@ -473,11 +560,22 @@ npx eas build:view <build-id>
|
||||
# and submit_ios_for_review.
|
||||
npx eas workflow:view <workflow-run-id> --json
|
||||
|
||||
# Read failed submit/review job logs.
|
||||
# Read submit/review job logs (also check for IOS_REVIEW_SKIPPED on green runs).
|
||||
npx eas workflow:logs <workflow-job-id> --all-steps --non-interactive
|
||||
|
||||
# Stream logs for a build.
|
||||
npx eas build:view <build-id> --json | jq '.logFiles[]'
|
||||
|
||||
# Check live App Store Connect review state + top 5 recent iOS TestFlight builds.
|
||||
npx eas workflow:run ios-review-status.yml
|
||||
|
||||
# Submit a waiting TestFlight build once the review slot is free (default replace_in_review=false skips if still active).
|
||||
npx eas workflow:run resubmit-ios-review.yml
|
||||
# Or force-replace an in-flight review for an urgent iOS hotfix:
|
||||
npx eas workflow:run resubmit-ios-review.yml -F app_version=0.18.1 -F app_build_version=18001999 -F replace_in_review=true
|
||||
|
||||
# Cancel an active in-flight iOS App Store review (pass expected_version to guard against version drift).
|
||||
npx eas workflow:run cancel-ios-review.yml -F expected_version=0.18.0
|
||||
```
|
||||
|
||||
A build's `gitCommitHash` must match the release tag commit. `status` walks through `NEW` → `IN_QUEUE` → `IN_PROGRESS` → `FINISHED` (or `ERRORED`/`CANCELED`). The EAS workflow run's `gitCommitHash` and `trigger` must also match the release tag.
|
||||
@@ -493,15 +591,14 @@ For the `Release Mobile` EAS workflow, these jobs must pass:
|
||||
- `submit_android` — Android binary submitted to the Play Store
|
||||
- `upload_android_screenshots` — Google Play screenshots replaced from the repo
|
||||
|
||||
Do not treat `build_ios: SUCCESS` or `distribute_ios: SUCCESS` as a completed iOS release. `submit_ios_for_review: FAILURE` means the iOS release is blocked even if the build is visible in TestFlight.
|
||||
Do not treat `build_ios: SUCCESS` or `distribute_ios: SUCCESS` as a completed iOS release. `submit_ios_for_review: FAILURE` means the iOS release is blocked even if the build is visible in TestFlight. Even when `submit_ios_for_review` passes, inspect its log with `npx eas workflow:logs <workflow-job-id> --all-steps --non-interactive` for `IOS_REVIEW_SKIPPED`. If App Store submission was skipped because an earlier version is already in flight, explicitly notify the maintainer with both the in-review version/state and the waiting TestFlight version/build so they can either let the current review finish and run `npx eas workflow:run resubmit-ios-review.yml` later, or replace it with `replace_in_review=true`.
|
||||
|
||||
To confirm the submission landed, inspect the EAS workflow with `npx eas workflow:view <workflow-run-id> --json`. App Store Connect (review state for the matching version/build) and the Play Console track are the final ground truth.
|
||||
|
||||
## Release completion and heartbeat
|
||||
|
||||
A release is **in progress** after npm publication and tag push. Report it as
|
||||
**shipped** only after every applicable build, publication, asset, manifest, and
|
||||
store submission passes the completion checklist.
|
||||
A release is in progress once the tag is pushed. Report it as shipped only after every applicable
|
||||
[sync gate](#sync-gates) and completion checklist item passes.
|
||||
|
||||
Immediately after every beta, stable, or promotion tag push, create a heartbeat
|
||||
that resumes the release in the current conversation. Create it automatically
|
||||
@@ -510,9 +607,10 @@ the completion checklist or finds a failure that needs new user authority.
|
||||
|
||||
Each heartbeat checks the release tag commit, `CI` and `Desktop Packages` for the release branch,
|
||||
every tag-triggered GitHub Actions run (`Desktop Release`, `Android APK Release`, `Docker`,
|
||||
`Release Notes Sync`), npm dist-tags, the GitHub Release body and assets, desktop updater
|
||||
manifests, the published Docker image, the applicable EAS workflow, the reconcile PR, and remote
|
||||
release branch cleanup. Inspect the GitHub Release itself and confirm that the macOS, Linux,
|
||||
`Release Notes Sync`, and `Deploy App` for stable), `Deploy Website` after stable release
|
||||
publication, npm dist-tags, the GitHub Release body and assets, desktop updater manifests, the
|
||||
published Docker image, the applicable EAS workflow, the reconcile PR, and remote release branch
|
||||
cleanup. Inspect the GitHub Release itself and confirm that the macOS, Linux,
|
||||
Windows, and Android APK assets are present along with the channel manifests
|
||||
(`latest-mac.yml`, `latest-linux.yml`, and `latest.yml` for stable;
|
||||
`beta-mac.yml`, `beta-linux.yml`, and `beta.yml` for beta).
|
||||
@@ -535,7 +633,7 @@ Pattern:
|
||||
"timezone": "UTC",
|
||||
"maxRuns": 120,
|
||||
"expiresIn": "24h",
|
||||
"prompt": "Resume the vX.Y.Z release babysit for commit <sha>. Check npm tags; CI and Desktop Packages on release/vX.Y.Z; every tag-triggered GitHub Actions run; the published GitHub Release body, expected desktop/APK assets, and channel manifests; the Docker image; the matching EAS workflow; and the reconcile PR into main. Completion requires every applicable checklist item. For stable, require build_ios, distribute_ios (Paseo Beta external distribution and Beta App Review submission), submit_ios_for_review, build_android, and submit_android to succeed. For beta, require the beta TestFlight distribution and Beta App Review path. If work is pending, wait for the next heartbeat. If a failure can be retried safely for the same version, follow the failed-release procedure; otherwise report the blocker. When every applicable completion-checklist item passes and the reconcile PR is merged, delete origin/release/vX.Y.Z, delete THIS heartbeat, report shipped, and stop.",
|
||||
"prompt": "Resume the vX.Y.Z release babysit for commit <sha>. Check npm tags; CI and Desktop Packages on release/vX.Y.Z; every tag-triggered GitHub Actions run (Desktop Release, Android APK Release, Docker, Release Notes Sync, and Deploy App on stable) plus Deploy Website after release publish; the published GitHub Release body, expected desktop/APK assets, and channel manifests; the Docker image; the matching EAS workflow; and the reconcile PR into main. Completion requires every applicable checklist item. For stable, require build_ios, distribute_ios (Paseo Beta external distribution and Beta App Review submission), submit_ios_for_review, build_android, submit_android, and upload_android_screenshots to succeed, and inspect the submit_ios_for_review log for IOS_REVIEW_SKIPPED (if skipped, explicitly report both the in-review version and the waiting TestFlight build to the maintainer). For beta, require the beta TestFlight distribution and Beta App Review path. If work is pending, wait for the next heartbeat. If a failure can be retried safely for the same version, follow the failed-release procedure; otherwise report the blocker. When every applicable completion-checklist item passes and the reconcile PR is merged, delete origin/release/vX.Y.Z, delete THIS heartbeat, report shipped, and stop.",
|
||||
}
|
||||
```
|
||||
|
||||
@@ -560,6 +658,8 @@ The GitHub Release body is populated automatically by the `Release Notes Sync` w
|
||||
|
||||
**NEVER bump the version to fix a build problem.** New versions are reserved for meaningful product changes (features, fixes, improvements). Build/CI failures are fixed on the current version.
|
||||
|
||||
If `npm run release:publish` or `npm run release:publish:beta` fails after `npm run release:push` pushed the tag, fix the npm authentication, OTP, or local build issue and rerun the publish command on the same commit. Do not move or force-push the `v*` tag, because `scripts/publish-release-packages.mjs` skips packages already visible on npm and resumes from the remaining packages.
|
||||
|
||||
**Do not rely on `workflow_dispatch` for tagged code fixes.** The `workflow_dispatch` trigger runs the workflow file from the default branch but checks out the code at the tag ref (`ref: ${{ inputs.tag }}`). That means fixes committed to `main` won't change the tagged source tree being built. `workflow_dispatch` only helps when the fix lives in the workflow file itself.
|
||||
|
||||
For Docker-only retries, **do not push or force-push a `v*` release tag**.
|
||||
@@ -644,9 +744,7 @@ intentionally unavailable to desktop updater clients.
|
||||
- The npm `version` lifecycle regenerates F-Droid changelog files from `CHANGELOG.md` for stable releases only (`npm run fdroid:changelogs`) and stages them, so the release commit and tag carry them. Betas are a no-op. A stable run **aborts the release** if `CHANGELOG.md` has no entry for the version being cut — commit the changelog entry first. See [docs/android.md](android.md) for why these files are generated per ABI.
|
||||
- `release:prepare` refreshes workspace `node_modules` links to prevent stale types.
|
||||
- `npm run dev:desktop` and `npm run build:desktop` target the Electron desktop package in `packages/desktop`.
|
||||
- `release:publish` and `release:publish:beta` run `scripts/publish-release-packages.mjs`: if a run
|
||||
fails partway through, re-running skips versions already published on npm, retries transient
|
||||
registry errors, and waits for each version to become visible on npm before continuing.
|
||||
- `release:publish` and `release:publish:beta` run `scripts/publish-release-packages.mjs`. They publish the seven `@getpaseo/*` packages in dependency waves, skip versions already visible on npm, retry transient registry errors, and poll `npm view` between packages so dependents do not hit `E409` or `E404` propagation lag. `release:ship` and `release:ship:beta` run `release:push` before `release:publish` or `release:publish:beta`.
|
||||
- The website uses GitHub's latest published release API for download links, so published beta prereleases do not replace the stable download target.
|
||||
|
||||
## Changelog format
|
||||
@@ -907,8 +1005,8 @@ Every entry covers `previous stable release → release source`: first beta, lat
|
||||
- [ ] The diff from the previous stable to the resolved release source is classified as patch or minor, with the target version and rationale approved
|
||||
- [ ] `npm run release:prep:beta:patch`, `release:prep:beta:minor`, or `release:prep:beta:next` created the version commit on `release/vX.Y.Z-beta.N` without a tag, and the pushed branch passed `CI` and `Desktop Packages` before shipping (never relying on `main` CI)
|
||||
- [ ] Complete the [pre-release dependency checks](#pre-release-dependency-checks) on the release commit
|
||||
- [ ] After go-ahead, `npm run release:ship:beta` published npm and pushed the `vX.Y.Z-beta.N` tag without triggering a second CI run
|
||||
- [ ] npm shows the version under the `beta` dist-tag, not `latest`
|
||||
- [ ] After go-ahead, `npm run release:push` pushed the `vX.Y.Z-beta.N` tag without triggering a second CI run, while `npm run release:publish:beta`, the `reconcile/vX.Y.Z-beta.N` PR, and the release heartbeat started in parallel
|
||||
- [ ] All seven `@getpaseo/*` npm packages show the version under the `beta` dist-tag, not `latest`
|
||||
- [ ] The GitHub prerelease was published only after the three beta manifests were uploaded, and it has the changelog body and every expected macOS, Linux, Windows, and Android APK asset
|
||||
- [ ] GitHub `Desktop Release` workflow for the `v*-beta.N` tag is green
|
||||
- [ ] The GitHub prerelease contains `beta-mac.yml`, `beta-linux.yml`, and `beta.yml`
|
||||
@@ -916,7 +1014,7 @@ Every entry covers `previous stable release → release source`: first beta, lat
|
||||
- [ ] GitHub `Docker` workflow is green and the versioned beta image is published without moving `latest`
|
||||
- [ ] GitHub `Release Notes Sync` mirrored the beta entry into the prerelease body
|
||||
- [ ] EAS `Release iOS Beta` completed its build, TestFlight distribution, external beta group, and Beta App Review path
|
||||
- [ ] The [reconcile PR](#reconcile-main) brought the shipped changelog entries and version into `main`, and `origin/release/vX.Y.Z-beta.N` was deleted
|
||||
- [ ] The [reconcile PR](#reconcile-main) brought the shipped changelog entries and version into `main` and merged before cleanup, and `origin/release/vX.Y.Z-beta.N` was deleted after all sync gates passed
|
||||
- [ ] The release heartbeat was created after the tag push and deleted only after every item above passed
|
||||
|
||||
### Stable release (or promotion)
|
||||
@@ -926,13 +1024,13 @@ Every entry covers `previous stable release → release source`: first beta, lat
|
||||
- [ ] The release base and changes match the [release base table](#release-base-and-source) and any approved [inventory](#release-inventory)
|
||||
- [ ] A promotion ships the tested beta's product content after its soak, unless the user explicitly overrode either default
|
||||
- [ ] Every PR in the release range has been opened, and its full description and every linked issue have been read before drafting the changelog
|
||||
- [ ] Update `CHANGELOG.md` with user-facing release notes (features, fixes — not refactors). Promotion renames the series' `## X.Y.Z-beta.N` entry to `## X.Y.Z - YYYY-MM-DD` and re-checks it covers the full release. Commit the matching [`CHANGELOG.zh-CN.md` entry](#changelog-translations) with it
|
||||
- [ ] Update `CHANGELOG.md` with user-facing release notes (features, fixes, not refactors). Promotion renames the series' `## X.Y.Z-beta.N` entry to `## X.Y.Z - YYYY-MM-DD` and re-checks it covers the full release. Commit the matching [`CHANGELOG.zh-CN.md` entry](#changelog-translations) with it
|
||||
- [ ] Verify the changelog heading follows strict `## X.Y.Z - YYYY-MM-DD` format
|
||||
- [ ] Ensure local format, lint, and typecheck pass and the working tree is clean before running `release:prep:*`
|
||||
- [ ] `npm run release:prep:patch`, `release:prep:minor`, or `release:prep:promote` created the version commit on `release/vX.Y.Z` without a tag, and the pushed branch passed `CI` and `Desktop Packages` before shipping (never relying on `main` CI)
|
||||
- [ ] Complete the [pre-release dependency checks](#pre-release-dependency-checks) on the release commit
|
||||
- [ ] After go-ahead, `npm run release:ship` published npm, updated dist-tags, and pushed the `vX.Y.Z` tag without triggering a second CI run
|
||||
- [ ] `latest` resolves to the new stable, and `beta` resolves to it too unless an active newer beta holds `beta`
|
||||
- [ ] After go-ahead, `npm run release:push` pushed the `vX.Y.Z` tag without triggering a second CI run, while `npm run release:publish`, the `reconcile/vX.Y.Z` PR, and the release heartbeat started in parallel
|
||||
- [ ] All seven `@getpaseo/*` npm packages show `latest` at the new stable, and `beta` at the new stable too unless an active newer beta holds `beta`
|
||||
- [ ] The GitHub Release was published only after the three stable manifests were uploaded, and it has the changelog body and every expected macOS, Linux, Windows, and Android APK asset
|
||||
- [ ] GitHub `Desktop Release` workflow for the `v*` tag is green
|
||||
- [ ] The GitHub Release contains `latest-mac.yml`, `latest-linux.yml`, and `latest.yml`
|
||||
@@ -940,11 +1038,13 @@ Every entry covers `previous stable release → release source`: first beta, lat
|
||||
- [ ] GitHub `Android APK Release` workflow for the same tag is green
|
||||
- [ ] GitHub `Docker` workflow is green and both the versioned and `latest` images are published
|
||||
- [ ] GitHub `Release Notes Sync` is green and the release body matches the stable changelog entry
|
||||
- [ ] GitHub `Deploy App` workflow for the same tag is green, and `Deploy Website` succeeded after the release published
|
||||
- [ ] EAS `Release Mobile` workflow for the same tag is green
|
||||
- [ ] EAS iOS `build_ios` completes for the same tag
|
||||
- [ ] EAS iOS `distribute_ios` succeeds, uploading the binary once, distributing it to `Paseo Beta`, and submitting it for Beta App Review
|
||||
- [ ] EAS iOS `submit_ios_for_review` succeeds, putting the build into App Store review
|
||||
- [ ] EAS iOS `submit_ios_for_review` succeeds, putting the build into App Store review (or its log was checked for `IOS_REVIEW_SKIPPED` and the maintainer was notified with both the in-review version and the waiting TestFlight build)
|
||||
- [ ] EAS Android `build_android` completes for the same tag
|
||||
- [ ] EAS Android `submit_android` succeeds, putting the build on its Play Store track
|
||||
- [ ] The [reconcile PR](#reconcile-main) brought the shipped changelog entries, F-Droid changelogs, and version into `main`, and `origin/release/vX.Y.Z` was deleted
|
||||
- [ ] EAS Android `upload_android_screenshots` succeeds for the same tag
|
||||
- [ ] The [reconcile PR](#reconcile-main) brought the shipped changelog entries, F-Droid changelogs, and version into `main` and merged before cleanup, and `origin/release/vX.Y.Z` was deleted after all sync gates passed
|
||||
- [ ] The release heartbeat was created after the tag push and deleted only after every item above passed
|
||||
|
||||
@@ -30,7 +30,7 @@ Terminal directory snapshots (`terminalsChanged`) and workspace contribution cha
|
||||
|
||||
Each `onChange` delivers both the new snapshot and the `previous` one (`{ state, changedAt }`). The transition flows unchanged up through `TerminalSession.onActivityChange` (as `{ activity, previous }`), the worker protocol's `terminalActivityChange` event, and the manager-level `subscribeTerminalActivity(listener)` stream (`{ terminalId, name, cwd, activity, previous }`).
|
||||
|
||||
The daemon consumes these transitions, not snapshots. When a transition moves from `working` to `idle`, the tracker records finished attention, so the terminal shows the same green finished dot as an idle agent that needs review. The websocket layer also fires a "Terminal finished" attention notification. A terminal that exits while still working emits no turn-end notification.
|
||||
The daemon consumes these transitions, not snapshots. When a transition moves from `working` to `idle`, the tracker records finished attention, so the terminal shows the same green finished dot as an idle agent that needs review. Focusing the terminal tab or using Mark as read on its owning workspace clears finished attention. Mark as read leaves needs-input attention alone, the same way it leaves an agent's pending permission. The websocket layer also fires a "Terminal finished" attention notification. A terminal that exits while still working emits no turn-end notification.
|
||||
|
||||
Terminal list visibility is `workspaceId`-scoped: a terminal belongs to the workspace that created it, and same-`cwd` sibling workspaces do not see it in their terminal lists. Terminal status routing starts from that owning workspace, uses the owning workspace's `cwd`, then fans the status bucket out to every active workspace with the same `cwd`.
|
||||
|
||||
|
||||
+22
-4
@@ -61,6 +61,11 @@ the chat and its replica cache would keep only the end of the reply. A recovery
|
||||
running catch-up starts after whatever that catch-up applied, because the app applies a forward page
|
||||
row by row and an older cursor repeats rows.
|
||||
|
||||
A live row whose epoch differs from the local cursor is a rewind or replacement this client never
|
||||
saw as an invalidation, not a stale row. The app recovers like a gap: it asks `after` its own
|
||||
cursor, and the daemon answers that stale epoch with a reset tail. Dropping the rows instead would
|
||||
leave the chat on pre-rewind history while the new epoch streams.
|
||||
|
||||
Initialization timeouts guard lack of catch-up progress, not the full multi-page sync. A successful page that queues the next `after` page refreshes the watchdog.
|
||||
|
||||
Opening or resuming an agent fetches the latest available turns with a soft target of 40
|
||||
@@ -202,10 +207,23 @@ owner wraps cached preparation, network catch-up, accepted timeline application,
|
||||
behind one interface. React supplies transport and projection operations without selecting a cache
|
||||
path or issuing a separate persistence notification.
|
||||
|
||||
Active-agent list reconciliation does not own transcript lifetime. An archived agent's fresh
|
||||
history response can arrive before the active-list response that omits it. Clearing history there
|
||||
would discard accepted rows while the viewed owner still considers them synchronized. Entity
|
||||
deletion clears the transcript; list membership changes do not.
|
||||
The viewed-timeline owner also owns how long a transcript stays in memory. An active agent's
|
||||
transcript stays resident while its chat is hidden, so switching back to it needs no fetch. An
|
||||
archived agent's transcript stays resident only while its chat is shown, for example when it is
|
||||
opened from History. When an agent is archived, or the active list drops it because its workspace
|
||||
was archived, the owner releases the transcript unless the chat is shown. It also releases the
|
||||
transcript when the chat stops being shown. A released chat leaves the opened chats. When it is
|
||||
shown again, it reads the replica cache and catches up again. A history page, live event, or cache
|
||||
read that arrives after the release is dropped.
|
||||
|
||||
The active-list reconciliation does not release transcripts itself. An archived agent's fresh
|
||||
history response can arrive before the active-list response that omits it, while the chat is
|
||||
open in History. Clearing history there would discard rows the user is reading.
|
||||
|
||||
An agent counts as archived when the active list omits it, when its row has an archive timestamp,
|
||||
or when the workspace list omits its workspace. The workspace check matters because a workspace
|
||||
archive can complete while one of its agents keeps a row with no archive timestamp. Until a list
|
||||
first hydrates, it marks no agent as archived. Deleting the agent clears the transcript.
|
||||
|
||||
Removing the host from the registry is the destructive boundary: it stops the runtime and clears the
|
||||
session and host-scoped setup state together.
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
- Archive workspaces together: Cmd/Ctrl+click a workspace in the sidebar to select multiple workspaces and archive them in one step.
|
||||
- Copy quoted drafts: Copy a quote from a reply with one tap, without the > markers.
|
||||
- Redesigned agent profiles page: Agent profiles have their own dedicated settings page, and the model picker saves a new profile in one tap.
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,5 @@
|
||||
- Archive workspaces together: Cmd/Ctrl+click a workspace in the sidebar to select multiple workspaces and archive them in one step.
|
||||
- Copy quoted drafts: Copy a quote from a reply with one tap, without the > markers.
|
||||
- Redesigned agent profiles page: Agent profiles have their own dedicated settings page, and the model picker saves a new profile in one tap.
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,5 @@
|
||||
- Archive workspaces together: Cmd/Ctrl+click a workspace in the sidebar to select multiple workspaces and archive them in one step.
|
||||
- Copy quoted drafts: Copy a quote from a reply with one tap, without the > markers.
|
||||
- Redesigned agent profiles page: Agent profiles have their own dedicated settings page, and the model picker saves a new profile in one tap.
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,5 @@
|
||||
- Archive workspaces together: Cmd/Ctrl+click a workspace in the sidebar to select multiple workspaces and archive them in one step.
|
||||
- Copy quoted drafts: Copy a quote from a reply with one tap, without the > markers.
|
||||
- Redesigned agent profiles page: Agent profiles have their own dedicated settings page, and the model picker saves a new profile in one tap.
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,12 @@
|
||||
Improved
|
||||
- Reorganized Settings into Device and Host sections and consolidated sparse pages
|
||||
- Added arrow-key navigation for models, providers, and profiles in the model picker
|
||||
- Added an in-place Refresh control for Tailscale availability in host settings and setup
|
||||
|
||||
Changed
|
||||
- Removed the Antigravity usage source that ran agy -p /usage in the background
|
||||
|
||||
Fixed
|
||||
- Fixed Paseo Android crashing on Samsung devices when a chat shows a code block or quote
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,12 @@
|
||||
Improved
|
||||
- Reorganized Settings into Device and Host sections and consolidated sparse pages
|
||||
- Added arrow-key navigation for models, providers, and profiles in the model picker
|
||||
- Added an in-place Refresh control for Tailscale availability in host settings and setup
|
||||
|
||||
Changed
|
||||
- Removed the Antigravity usage source that ran agy -p /usage in the background
|
||||
|
||||
Fixed
|
||||
- Fixed Paseo Android crashing on Samsung devices when a chat shows a code block or quote
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,12 @@
|
||||
Improved
|
||||
- Reorganized Settings into Device and Host sections and consolidated sparse pages
|
||||
- Added arrow-key navigation for models, providers, and profiles in the model picker
|
||||
- Added an in-place Refresh control for Tailscale availability in host settings and setup
|
||||
|
||||
Changed
|
||||
- Removed the Antigravity usage source that ran agy -p /usage in the background
|
||||
|
||||
Fixed
|
||||
- Fixed Paseo Android crashing on Samsung devices when a chat shows a code block or quote
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,12 @@
|
||||
Improved
|
||||
- Reorganized Settings into Device and Host sections and consolidated sparse pages
|
||||
- Added arrow-key navigation for models, providers, and profiles in the model picker
|
||||
- Added an in-place Refresh control for Tailscale availability in host settings and setup
|
||||
|
||||
Changed
|
||||
- Removed the Antigravity usage source that ran agy -p /usage in the background
|
||||
|
||||
Fixed
|
||||
- Fixed Paseo Android crashing on Samsung devices when a chat shows a code block or quote
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,4 @@
|
||||
- Remote workspace browser proxy: Desktop browser tabs in remote workspaces now route through the workspace daemon, so remote localhost servers open directly in Paseo.
|
||||
- Per-device notification preferences: Each device can choose which agent, terminal, and plugin events send notifications, and plugins can send notifications and handle taps.
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,4 @@
|
||||
- Remote workspace browser proxy: Desktop browser tabs in remote workspaces now route through the workspace daemon, so remote localhost servers open directly in Paseo.
|
||||
- Per-device notification preferences: Each device can choose which agent, terminal, and plugin events send notifications, and plugins can send notifications and handle taps.
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,4 @@
|
||||
- Remote workspace browser proxy: Desktop browser tabs in remote workspaces now route through the workspace daemon, so remote localhost servers open directly in Paseo.
|
||||
- Per-device notification preferences: Each device can choose which agent, terminal, and plugin events send notifications, and plugins can send notifications and handle taps.
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,4 @@
|
||||
- Remote workspace browser proxy: Desktop browser tabs in remote workspaces now route through the workspace daemon, so remote localhost servers open directly in Paseo.
|
||||
- Per-device notification preferences: Each device can choose which agent, terminal, and plugin events send notifications, and plugins can send notifications and handle taps.
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,8 @@
|
||||
- Host metadata instructions: Set host-wide instructions once to guide language, tone, and formatting for generated workspace titles, branch names, commit messages, and pull requests.
|
||||
- Enterprise spending usage: Usage now shows Claude extra-usage spending and Codex individual spending limits with reset times.
|
||||
|
||||
Fixed
|
||||
- Fixed Android agent push notifications arriving minutes late during Doze
|
||||
- Fixed Command Center results reordering mid-word while typing
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,8 @@
|
||||
- Host metadata instructions: Set host-wide instructions once to guide language, tone, and formatting for generated workspace titles, branch names, commit messages, and pull requests.
|
||||
- Enterprise spending usage: Usage now shows Claude extra-usage spending and Codex individual spending limits with reset times.
|
||||
|
||||
Fixed
|
||||
- Fixed Android agent push notifications arriving minutes late during Doze
|
||||
- Fixed Command Center results reordering mid-word while typing
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,8 @@
|
||||
- Host metadata instructions: Set host-wide instructions once to guide language, tone, and formatting for generated workspace titles, branch names, commit messages, and pull requests.
|
||||
- Enterprise spending usage: Usage now shows Claude extra-usage spending and Codex individual spending limits with reset times.
|
||||
|
||||
Fixed
|
||||
- Fixed Android agent push notifications arriving minutes late during Doze
|
||||
- Fixed Command Center results reordering mid-word while typing
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,8 @@
|
||||
- Host metadata instructions: Set host-wide instructions once to guide language, tone, and formatting for generated workspace titles, branch names, commit messages, and pull requests.
|
||||
- Enterprise spending usage: Usage now shows Claude extra-usage spending and Codex individual spending limits with reset times.
|
||||
|
||||
Fixed
|
||||
- Fixed Android agent push notifications arriving minutes late during Doze
|
||||
- Fixed Command Center results reordering mid-word while typing
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
+1
-1
@@ -1 +1 @@
|
||||
sha256-TAVzJzziWDAapQkG4TLkLzOlodkdFNKSl3y/Tm9HB28=
|
||||
sha256-SZV3WTKLb+JhxWNo/jWyx+2sipzfL93YbbqQSihd3Wo=
|
||||
|
||||
Generated
+30
-29
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "paseo",
|
||||
"version": "0.17.4",
|
||||
"version": "0.18.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "paseo",
|
||||
"version": "0.17.4",
|
||||
"version": "0.18.1",
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
"workspaces": [
|
||||
@@ -37541,7 +37541,7 @@
|
||||
},
|
||||
"packages/app": {
|
||||
"name": "@getpaseo/app",
|
||||
"version": "0.17.4",
|
||||
"version": "0.18.1",
|
||||
"dependencies": {
|
||||
"@codemirror/commands": "6.10.4",
|
||||
"@codemirror/language": "6.12.4",
|
||||
@@ -39694,13 +39694,13 @@
|
||||
},
|
||||
"packages/cli": {
|
||||
"name": "@getpaseo/cli",
|
||||
"version": "0.17.4",
|
||||
"version": "0.18.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@clack/prompts": "^1.0.0",
|
||||
"@getpaseo/client": "0.17.4",
|
||||
"@getpaseo/protocol": "0.17.4",
|
||||
"@getpaseo/server": "0.17.4",
|
||||
"@getpaseo/client": "0.18.1",
|
||||
"@getpaseo/protocol": "0.18.1",
|
||||
"@getpaseo/server": "0.18.1",
|
||||
"chalk": "^5.3.0",
|
||||
"commander": "^12.0.0",
|
||||
"mime-types": "^2.1.35",
|
||||
@@ -39947,11 +39947,11 @@
|
||||
},
|
||||
"packages/client": {
|
||||
"name": "@getpaseo/client",
|
||||
"version": "0.17.4",
|
||||
"version": "0.18.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@getpaseo/protocol": "0.17.4",
|
||||
"@getpaseo/relay": "0.17.4",
|
||||
"@getpaseo/protocol": "0.18.1",
|
||||
"@getpaseo/relay": "0.18.1",
|
||||
"ws": "^8.20.0",
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
@@ -39963,7 +39963,7 @@
|
||||
},
|
||||
"packages/desktop": {
|
||||
"name": "@getpaseo/desktop",
|
||||
"version": "0.17.4",
|
||||
"version": "0.18.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@getpaseo/cli": "*",
|
||||
@@ -40206,7 +40206,7 @@
|
||||
},
|
||||
"packages/expo-two-way-audio": {
|
||||
"name": "@getpaseo/expo-two-way-audio",
|
||||
"version": "0.17.4",
|
||||
"version": "0.18.1",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.14",
|
||||
@@ -40252,7 +40252,7 @@
|
||||
},
|
||||
"packages/highlight": {
|
||||
"name": "@getpaseo/highlight",
|
||||
"version": "0.17.4",
|
||||
"version": "0.18.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@codemirror/language": "6.12.4",
|
||||
@@ -40282,7 +40282,7 @@
|
||||
},
|
||||
"packages/plugin": {
|
||||
"name": "@getpaseo/plugin",
|
||||
"version": "0.17.4",
|
||||
"version": "0.18.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "^1.4.0",
|
||||
@@ -40290,8 +40290,8 @@
|
||||
"use-sync-external-store": "^1.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@getpaseo/client": "0.17.4",
|
||||
"@getpaseo/protocol": "0.17.4",
|
||||
"@getpaseo/client": "0.18.1",
|
||||
"@getpaseo/protocol": "0.18.1",
|
||||
"@types/node": "^20.9.0",
|
||||
"@types/react": "~19.2.0",
|
||||
"react": "19.2.3",
|
||||
@@ -40301,8 +40301,8 @@
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@getpaseo/client": "0.17.4",
|
||||
"@getpaseo/protocol": "0.17.4",
|
||||
"@getpaseo/client": "0.18.1",
|
||||
"@getpaseo/protocol": "0.18.1",
|
||||
"react": ">=19.1.0 <20",
|
||||
"react-native": ">=0.81.5",
|
||||
"zod": "^4.4.3"
|
||||
@@ -40324,7 +40324,7 @@
|
||||
},
|
||||
"packages/protocol": {
|
||||
"name": "@getpaseo/protocol",
|
||||
"version": "0.17.4",
|
||||
"version": "0.18.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"semver": "^7.8.5",
|
||||
@@ -40351,7 +40351,7 @@
|
||||
}
|
||||
},
|
||||
"packages/react-native-enriched-markdown": {
|
||||
"version": "0.17.4",
|
||||
"version": "0.18.1",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
@@ -40367,7 +40367,7 @@
|
||||
},
|
||||
"packages/relay": {
|
||||
"name": "@getpaseo/relay",
|
||||
"version": "0.17.4",
|
||||
"version": "0.18.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@noble/ciphers": "^2.4.0",
|
||||
@@ -40589,17 +40589,17 @@
|
||||
},
|
||||
"packages/server": {
|
||||
"name": "@getpaseo/server",
|
||||
"version": "0.17.4",
|
||||
"version": "0.18.1",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "^0.17.1",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.326",
|
||||
"@anthropic-ai/sdk": "^0.104.2",
|
||||
"@getpaseo/client": "0.17.4",
|
||||
"@getpaseo/highlight": "0.17.4",
|
||||
"@getpaseo/plugin": "0.17.4",
|
||||
"@getpaseo/protocol": "0.17.4",
|
||||
"@getpaseo/relay": "0.17.4",
|
||||
"@getpaseo/client": "0.18.1",
|
||||
"@getpaseo/highlight": "0.18.1",
|
||||
"@getpaseo/plugin": "0.18.1",
|
||||
"@getpaseo/protocol": "0.18.1",
|
||||
"@getpaseo/relay": "0.18.1",
|
||||
"@isaacs/ttlcache": "^2.1.4",
|
||||
"@modelcontextprotocol/node": "2.1.2",
|
||||
"@modelcontextprotocol/sdk": "1.29.0",
|
||||
@@ -40625,6 +40625,7 @@
|
||||
"p-limit": "^7.3.0",
|
||||
"p-memoize": "^8.0.0",
|
||||
"p-throttle": "^8.1.0",
|
||||
"parse5": "^7.3.0",
|
||||
"pino": "^10.2.0",
|
||||
"pino-pretty": "^13.1.3",
|
||||
"qrcode": "^1.5.4",
|
||||
@@ -41549,7 +41550,7 @@
|
||||
},
|
||||
"packages/website": {
|
||||
"name": "@getpaseo/website",
|
||||
"version": "0.17.4",
|
||||
"version": "0.18.1",
|
||||
"dependencies": {
|
||||
"@cloudflare/vite-plugin": "^1.29.1",
|
||||
"@cloudflare/workers-types": "^4.20260317.1",
|
||||
@@ -43160,7 +43161,7 @@
|
||||
},
|
||||
"plugins": {
|
||||
"name": "@getpaseo/builtin-plugins",
|
||||
"version": "0.17.4",
|
||||
"version": "0.18.1",
|
||||
"dependencies": {
|
||||
"@getpaseo/plugin": "*",
|
||||
"zod": "^4.4.3"
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "paseo",
|
||||
"version": "0.17.4",
|
||||
"version": "0.18.1",
|
||||
"private": true,
|
||||
"description": "Paseo: voice-controlled development environment for local AI coding agents",
|
||||
"keywords": [
|
||||
@@ -124,8 +124,8 @@
|
||||
"release:publish": "node scripts/publish-release-packages.mjs",
|
||||
"release:publish:beta": "node scripts/publish-release-packages.mjs --beta",
|
||||
"release:push": "node scripts/push-current-release-tag.mjs",
|
||||
"release:ship": "node scripts/push-current-release-tag.mjs --check && npm run release:publish && npm run release:push",
|
||||
"release:ship:beta": "node scripts/push-current-release-tag.mjs --check && npm run release:publish:beta && npm run release:push",
|
||||
"release:ship": "npm run release:push && npm run release:publish",
|
||||
"release:ship:beta": "npm run release:push && npm run release:publish:beta",
|
||||
"release:reconcile": "node scripts/reconcile-release.mjs"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
name: Cancel iOS App Store review
|
||||
|
||||
# Cancel an active in-flight iOS App Store review submission on App Store
|
||||
# Connect. Pass expected_version to abort safely if Apple has already moved on
|
||||
# to a different version.
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
expected_version:
|
||||
type: string
|
||||
required: false
|
||||
description: "Expected marketing version currently in review, e.g. 0.18.0. Fails without cancelling if the active submission is for a different version."
|
||||
|
||||
jobs:
|
||||
cancel_ios_review:
|
||||
name: Cancel iOS App Store review
|
||||
environment: production
|
||||
runs_on: macos-medium
|
||||
steps:
|
||||
- uses: eas/checkout
|
||||
- name: Install fastlane
|
||||
run: bundle install
|
||||
- name: Cancel review
|
||||
run: |
|
||||
export EXPECTED_VERSION="${{ inputs.expected_version }}"
|
||||
bundle exec fastlane ios cancel_review
|
||||
@@ -0,0 +1,20 @@
|
||||
name: Check iOS App Store review status
|
||||
|
||||
# Inspect live App Store Connect state for sh.paseo: the live App Store
|
||||
# version, any active or pending App Store versions, active review submissions,
|
||||
# and the five most recently uploaded iOS TestFlight builds.
|
||||
|
||||
on:
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
check_ios_review_status:
|
||||
name: Check iOS App Store review status
|
||||
environment: production
|
||||
runs_on: macos-medium
|
||||
steps:
|
||||
- uses: eas/checkout
|
||||
- name: Install fastlane
|
||||
run: bundle install
|
||||
- name: Check review status
|
||||
run: bundle exec fastlane ios review_status
|
||||
@@ -69,4 +69,5 @@ jobs:
|
||||
run: |
|
||||
export APP_VERSION="${{ needs.build_ios.outputs.app_version }}"
|
||||
export APP_BUILD_VERSION="${{ needs.build_ios.outputs.app_build_version }}"
|
||||
export REPLACE_IN_REVIEW="false"
|
||||
bundle exec fastlane ios submit_review
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
name: Resubmit iOS for App Store review
|
||||
|
||||
# Standalone re-trigger for the App Store review submission step. The iOS
|
||||
# binary is already uploaded to TestFlight via the EAS GitHub app's tag-push
|
||||
# build; this workflow just runs the fastlane submit_review lane against the
|
||||
# latest TestFlight build, without rebuilding or re-uploading.
|
||||
# Standalone trigger for the App Store review submission step. The iOS binary
|
||||
# is already uploaded to TestFlight via the EAS GitHub app's tag-push build;
|
||||
# this workflow runs fastlane ios submit_review without rebuilding or
|
||||
# re-uploading. By default (replace_in_review=false) it skips cleanly if
|
||||
# another App Store review is already in flight; pass replace_in_review=true
|
||||
# to cancel an in-flight review and submit an urgent replacement.
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
@@ -16,6 +18,11 @@ on:
|
||||
type: string
|
||||
required: false
|
||||
description: "CFBundleVersion to resubmit, e.g. 2. Only used when app_version is set."
|
||||
replace_in_review:
|
||||
type: boolean
|
||||
required: false
|
||||
default: false
|
||||
description: "Cancel an in-flight App Store review and submit this build instead. Leave false to skip safely while another review is active."
|
||||
|
||||
jobs:
|
||||
submit_ios_for_review:
|
||||
@@ -30,4 +37,5 @@ jobs:
|
||||
run: |
|
||||
export APP_VERSION="${{ inputs.app_version }}"
|
||||
export APP_BUILD_VERSION="${{ inputs.app_build_version }}"
|
||||
export REPLACE_IN_REVIEW="${{ inputs.replace_in_review }}"
|
||||
bundle exec fastlane ios submit_review
|
||||
|
||||
@@ -32,6 +32,7 @@ import {
|
||||
waitForWorkspaceTabsVisible,
|
||||
} from "../support/helpers/workspace-tabs";
|
||||
import { getServerId } from "../support/helpers/server-id";
|
||||
import { openSettingsSection } from "../support/helpers/settings";
|
||||
import { buildHostWorkspaceRoute } from "@/utils/host-routes";
|
||||
import { WORKSPACE_DECK_MAX_MOUNTED_WORKSPACES } from "@/screens/workspace/workspace-deck-retention";
|
||||
import { delayBrowserAgentCreatedStatus } from "../support/helpers/new-workspace";
|
||||
@@ -350,6 +351,7 @@ async function selectSendBehaviorInSettings(
|
||||
behaviorLabel: string,
|
||||
stored: string,
|
||||
): Promise<void> {
|
||||
await openSettingsSection(page, "chat");
|
||||
await page.getByRole("button", { name: /^Default send: / }).click();
|
||||
await page.getByRole("menuitem", { name: behaviorLabel, exact: true }).click();
|
||||
await expect
|
||||
|
||||
@@ -67,6 +67,9 @@ test.describe("Agent profiles settings", () => {
|
||||
try {
|
||||
await test.step("the section starts empty", async () => {
|
||||
await openAgentProfileSettings(page);
|
||||
await expect(page.getByTestId("agent-profiles-description")).toHaveText(
|
||||
"Save agent settings that you can pick quickly and that agents can use to delegate work",
|
||||
);
|
||||
await expectNoAgentProfiles(page);
|
||||
});
|
||||
|
||||
@@ -77,11 +80,18 @@ test.describe("Agent profiles settings", () => {
|
||||
model: "Ten second stream",
|
||||
thinking: "High",
|
||||
mode: "Approval test",
|
||||
systemPrompt: "Focus on layout, accessibility, and design tokens.",
|
||||
notes: "Use for UI work — components, layout and design tokens.",
|
||||
});
|
||||
await expectAgentProfile(page, {
|
||||
name: "UI work",
|
||||
tags: [MOCK_PROVIDER_LABEL, "Ten second stream", "Approval test", "High"],
|
||||
tags: [
|
||||
MOCK_PROVIDER_LABEL,
|
||||
"Ten second stream",
|
||||
"Approval test",
|
||||
"High",
|
||||
"System prompt",
|
||||
],
|
||||
notes: "Use for UI work — components, layout and design tokens.",
|
||||
});
|
||||
});
|
||||
@@ -89,11 +99,12 @@ test.describe("Agent profiles settings", () => {
|
||||
await test.step("editing to a model without thinking levels drops the level", async () => {
|
||||
await editAgentProfile(page, "UI work", {
|
||||
model: "One minute stream",
|
||||
systemPrompt: "Keep replies concise.",
|
||||
notes: "Now for quick checks.",
|
||||
});
|
||||
await expectAgentProfile(page, {
|
||||
name: "UI work",
|
||||
tags: [MOCK_PROVIDER_LABEL, "One minute stream", "Approval test"],
|
||||
tags: [MOCK_PROVIDER_LABEL, "One minute stream", "Approval test", "System prompt"],
|
||||
notes: "Now for quick checks.",
|
||||
});
|
||||
await expectAgentProfileTagsGone(page, {
|
||||
@@ -107,6 +118,7 @@ test.describe("Agent profiles settings", () => {
|
||||
provider: MOCK_PROVIDER_LABEL,
|
||||
model: "One minute stream",
|
||||
mode: "Approval test",
|
||||
systemPrompt: "Keep replies concise.",
|
||||
notes: "Now for quick checks.",
|
||||
});
|
||||
});
|
||||
@@ -272,13 +284,15 @@ test.describe("Agent profiles settings", () => {
|
||||
await test.step("switching Settings sections asks before discarding an edited draft", async () => {
|
||||
await fillAgentProfileName(page, "Unsaved sidebar edit");
|
||||
|
||||
await switchSettingsSectionWithConfirm(page, "Agents", "dismiss");
|
||||
await switchSettingsSectionWithConfirm(page, "Tools & prompts", "dismiss");
|
||||
await expect(page.getByTestId("agent-profile-drawer")).toBeVisible();
|
||||
await expectAgentProfileNameDraft(page, "Unsaved sidebar edit");
|
||||
|
||||
await switchSettingsSectionWithConfirm(page, "Agents", "accept");
|
||||
await switchSettingsSectionWithConfirm(page, "Tools & prompts", "accept");
|
||||
await expect(page.getByTestId("agent-profile-drawer")).toHaveCount(0, { timeout: 30_000 });
|
||||
await expect(page.getByTestId("settings-detail-header-title")).toHaveText("Agents");
|
||||
await expect(page.getByTestId("settings-detail-header-title")).toHaveText(
|
||||
"Tools & prompts",
|
||||
);
|
||||
});
|
||||
|
||||
await test.step("confirming browser Back leaves Agent profiles and discards the draft", async () => {
|
||||
|
||||
@@ -47,7 +47,7 @@ async function openHostOverview(page: Page, daemon: IsolatedHostDaemon): Promise
|
||||
endpoint: `127.0.0.1:${daemon.port}`,
|
||||
},
|
||||
]);
|
||||
await page.goto(`/settings/hosts/${daemon.serverId}/host`);
|
||||
await page.goto(`/settings/hosts/${daemon.serverId}/daemon`);
|
||||
await expect(page.getByText("Online", { exact: true })).toBeVisible();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import type { Locator } from "@playwright/test";
|
||||
import { test, expect, type Page } from "../support/fixtures";
|
||||
import { gotoAppShell } from "../support/helpers/app";
|
||||
import { daemonWsRoutePattern } from "../support/helpers/daemon-port";
|
||||
import { openAgentRoute, seedMockAgentWorkspace } from "../support/helpers/mock-agent";
|
||||
import { seedWorkspace, type SeededWorkspace } from "../support/helpers/seed-client";
|
||||
import { getServerId } from "../support/helpers/server-id";
|
||||
|
||||
@@ -142,6 +143,38 @@ test.describe("Command center workspace management", () => {
|
||||
}
|
||||
});
|
||||
|
||||
test("keeps Rename workspace ahead of Rename agent across renam and rename", async ({ page }) => {
|
||||
const workspace = await seedMockAgentWorkspace({
|
||||
repoPrefix: "cc-rename-order-",
|
||||
title: "Command center rename order",
|
||||
model: "five-minute-stream",
|
||||
});
|
||||
|
||||
try {
|
||||
await openAgentRoute(page, workspace);
|
||||
const panel = await openCommandCenter(page);
|
||||
const searchInput = panel.getByTestId("command-center-input");
|
||||
const renameWorkspace = action(panel, "Rename workspace");
|
||||
const renameAgent = action(panel, "Rename agent");
|
||||
|
||||
for (const query of ["renam", "rename"]) {
|
||||
await searchInput.fill(query);
|
||||
await expect(renameWorkspace).toBeVisible({ timeout: 15_000 });
|
||||
await expect(renameAgent).toBeVisible({ timeout: 15_000 });
|
||||
const workspaceTop = (await renameWorkspace.boundingBox())?.y ?? Number.NaN;
|
||||
const agentTop = (await renameAgent.boundingBox())?.y ?? Number.NaN;
|
||||
expect(workspaceTop, query).toBeLessThan(agentTop);
|
||||
}
|
||||
|
||||
await page.keyboard.press("Enter");
|
||||
await expect(page.getByTestId("workspace-rename-modal-global-input")).toBeFocused({
|
||||
timeout: 15_000,
|
||||
});
|
||||
} finally {
|
||||
await workspace.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
test("copies the workspace path and confirms with a toast", async ({ page }) => {
|
||||
const workspace = await seedWorkspace({ repoPrefix: "cc-copy-path-" });
|
||||
|
||||
|
||||
@@ -12,9 +12,12 @@ import {
|
||||
openImageLightbox,
|
||||
closeImageLightbox,
|
||||
pressInterruptShortcut,
|
||||
blurComposerInput,
|
||||
expectComposerDraft,
|
||||
expectComposerDisabled,
|
||||
expectComposerEditable,
|
||||
expectComposerFocused,
|
||||
expectComposerNotFocused,
|
||||
expectAttachButtonDisabled,
|
||||
fillComposerDraft,
|
||||
dropFileOnComposer,
|
||||
@@ -175,8 +178,19 @@ test.describe("Composer attachments", () => {
|
||||
await test.step("remove the image and attach a dropped file", async () => {
|
||||
await removeAttachmentPill(page, "composer-image-attachment-pill", "Remove image attachment");
|
||||
await expect(page.getByTestId("composer-image-attachment-pill")).toHaveCount(0);
|
||||
await blurComposerInput(page);
|
||||
await expectComposerNotFocused(page);
|
||||
await dropFileOnComposer(page, TEST_JSON);
|
||||
await expectAttachmentPill(page, "composer-file-attachment-pill");
|
||||
await expectComposerFocused(page);
|
||||
});
|
||||
|
||||
await test.step("dropping an image focuses the composer", async () => {
|
||||
await blurComposerInput(page);
|
||||
await expectComposerNotFocused(page);
|
||||
await dropFileOnComposer(page, TEST_IMAGE);
|
||||
await expectAttachmentPill(page, "composer-image-attachment-pill");
|
||||
await expectComposerFocused(page);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -198,9 +212,12 @@ test.describe("Composer attachments", () => {
|
||||
projectDisplayName: workspace.projectDisplayName,
|
||||
});
|
||||
|
||||
await blurComposerInput(page);
|
||||
await expectComposerNotFocused(page);
|
||||
await dropFileOnComposer(page, TEST_JSON);
|
||||
|
||||
await expectAttachmentPill(page, "composer-file-attachment-pill");
|
||||
await expectComposerFocused(page);
|
||||
} finally {
|
||||
await workspace.cleanup();
|
||||
}
|
||||
|
||||
@@ -12,14 +12,25 @@ import {
|
||||
import { expectWorkspaceTabVisible, openSessions } from "../support/helpers/archive-tab";
|
||||
import { daemonWsRoutePattern } from "../support/helpers/daemon-port";
|
||||
import { getServerId } from "../support/helpers/server-id";
|
||||
import { switchWorkspaceViaSidebar } from "../support/helpers/workspace-ui";
|
||||
import {
|
||||
switchWorkspaceViaSidebar,
|
||||
waitForSidebarHydration,
|
||||
} from "../support/helpers/workspace-ui";
|
||||
import {
|
||||
closeMobileAgentSidebar,
|
||||
expectMobileAgentSidebarHidden,
|
||||
expectMobileAgentSidebarVisible,
|
||||
openMobileAgentSidebar,
|
||||
} from "../support/helpers/sidebar";
|
||||
import { expectNewWorkspaceProjectSelected } from "../support/helpers/new-workspace";
|
||||
import {
|
||||
expectNewWorkspaceProjectSelected,
|
||||
openGlobalNewWorkspaceComposer,
|
||||
openStartingRefPicker,
|
||||
selectBranchInPicker,
|
||||
selectWorkspaceIsolation,
|
||||
} from "../support/helpers/new-workspace";
|
||||
import { gotoAppShell } from "../support/helpers/app";
|
||||
import { seedWorkspace } from "../support/helpers/seed-client";
|
||||
|
||||
const TEST_COMMANDS = [
|
||||
{
|
||||
@@ -119,11 +130,18 @@ const TEST_COMMANDS_REPLY: ListCommandsReply = { commands: TEST_COMMANDS, error:
|
||||
async function installListCommandsStub(
|
||||
page: Page,
|
||||
reply: () => ListCommandsReply | Promise<ListCommandsReply> = () => TEST_COMMANDS_REPLY,
|
||||
options?: {
|
||||
onClientMessage?: (message: string | Buffer, forward: () => void) => void;
|
||||
},
|
||||
): Promise<void> {
|
||||
await page.routeWebSocket(daemonWsRoutePattern(), (ws) => {
|
||||
const server = ws.connectToServer();
|
||||
|
||||
ws.onMessage((message) => {
|
||||
if (options?.onClientMessage) {
|
||||
options.onClientMessage(message, () => server.send(message));
|
||||
return;
|
||||
}
|
||||
server.send(message);
|
||||
});
|
||||
|
||||
@@ -169,6 +187,24 @@ async function installListCommandsStub(
|
||||
});
|
||||
}
|
||||
|
||||
async function holdWorkspaceCreateWithCommandsStub(page: Page): Promise<{ release: () => void }> {
|
||||
let release: (() => void) | null = null;
|
||||
await installListCommandsStub(page, undefined, {
|
||||
onClientMessage(message, forward) {
|
||||
if (typeof message === "string" && message.includes('"workspace.create.request"')) {
|
||||
release = forward;
|
||||
return;
|
||||
}
|
||||
forward();
|
||||
},
|
||||
});
|
||||
return {
|
||||
release: () => {
|
||||
release?.();
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
function createHeldReply(): {
|
||||
reply: () => Promise<ListCommandsReply>;
|
||||
release: () => void;
|
||||
@@ -450,6 +486,44 @@ test.describe("Composer autocomplete", () => {
|
||||
}
|
||||
});
|
||||
|
||||
test("shows autocomplete after closing the New Workspace branch picker and hides it while submitting", async ({
|
||||
page,
|
||||
}) => {
|
||||
const heldCreate = await holdWorkspaceCreateWithCommandsStub(page);
|
||||
|
||||
const seeded = await seedWorkspace({ repoPrefix: "autocomplete-branch-picker-" });
|
||||
try {
|
||||
await gotoAppShell(page);
|
||||
await waitForSidebarHydration(page);
|
||||
await openGlobalNewWorkspaceComposer(page);
|
||||
|
||||
const input = composerLocator(page);
|
||||
await expect(input).toBeEditable({ timeout: 30_000 });
|
||||
await selectWorkspaceIsolation(page, "worktree");
|
||||
await expect(page.getByTestId("new-workspace-ref-picker-trigger")).toBeVisible({
|
||||
timeout: 30_000,
|
||||
});
|
||||
|
||||
await openStartingRefPicker(page);
|
||||
await selectBranchInPicker(page, "main");
|
||||
await expect(input).toBeFocused();
|
||||
|
||||
await page.keyboard.type("/h");
|
||||
const popover = page.getByTestId("composer-autocomplete-popover");
|
||||
await expect(popover.getByText("/help", { exact: true }).first()).toBeVisible({
|
||||
timeout: 30_000,
|
||||
});
|
||||
|
||||
// Submitting while locked hides the autocomplete popover instead of leaving it over loading.
|
||||
await page.getByTestId("workspace-create-submit").click();
|
||||
await expect(input).not.toBeEditable({ timeout: 10_000 });
|
||||
await expect(popover).toHaveCount(0);
|
||||
} finally {
|
||||
heldCreate.release();
|
||||
await seeded.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
test("keeps New workspace off the running-agent command list before a project is chosen", async ({
|
||||
page,
|
||||
}) => {
|
||||
|
||||
@@ -0,0 +1,235 @@
|
||||
import { mkdir, writeFile } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { expect, test, type Page } from "../support/fixtures";
|
||||
import {
|
||||
openFileExplorer,
|
||||
openFileFromExplorer,
|
||||
expectFileTabOpen,
|
||||
} from "../support/helpers/file-explorer";
|
||||
import { openAgentRoute, seedMockAgentWorkspace } from "../support/helpers/mock-agent";
|
||||
|
||||
const APP_SETTINGS_KEY = "@paseo:app-settings";
|
||||
|
||||
const DIFF_FIXTURE = [
|
||||
"Here is a diff block:",
|
||||
"",
|
||||
"```diff",
|
||||
"diff --git a/src/greet.ts b/src/greet.ts",
|
||||
"--- a/src/greet.ts",
|
||||
"+++ b/src/greet.ts",
|
||||
"@@ -1,3 +1,4 @@ export function greet(name: string) {",
|
||||
" const prefix = 'Hello';",
|
||||
"- return `${prefix}, ${name}`;",
|
||||
"+ const trimmed = name.trim();",
|
||||
"+ return `${prefix}, ${trimmed}!`;",
|
||||
"```",
|
||||
"",
|
||||
"And a patch block:",
|
||||
"",
|
||||
"```patch",
|
||||
"--- a/README.md",
|
||||
"+++ b/README.md",
|
||||
"@@ -1,2 +1,2 @@",
|
||||
" # Paseo",
|
||||
"-Old description",
|
||||
"+New description",
|
||||
"```",
|
||||
"",
|
||||
"Plus Ruby, Kotlin, TOML, and SQL:",
|
||||
"",
|
||||
"```ruby",
|
||||
"class Greeter",
|
||||
' def hi(name) = "Hello #{name}"',
|
||||
"end",
|
||||
"```",
|
||||
"",
|
||||
"```kotlin",
|
||||
'val message: String = "Kotlin ready"',
|
||||
"```",
|
||||
"",
|
||||
"```toml",
|
||||
"[server]",
|
||||
'host = "localhost"',
|
||||
"```",
|
||||
"",
|
||||
"```sql",
|
||||
"SELECT id, name FROM users WHERE active = TRUE;",
|
||||
"```",
|
||||
].join("\n");
|
||||
|
||||
const FILE_DIFF_CONTENT = [
|
||||
"diff --git a/app.py b/app.py",
|
||||
"index 1111111..2222222 100644",
|
||||
"--- a/app.py",
|
||||
"+++ b/app.py",
|
||||
"@@ -1,3 +1,3 @@ def greet():",
|
||||
" print('hello')",
|
||||
"-old_value = 1",
|
||||
"+new_value = 2",
|
||||
].join("\n");
|
||||
|
||||
async function saveScreenshot(page: Page, name: string): Promise<void> {
|
||||
const dir = process.env.PASEO_QA_SCREENSHOT_DIR;
|
||||
if (!dir) return;
|
||||
await mkdir(dir, { recursive: true });
|
||||
await page.screenshot({ path: path.join(dir, name), fullPage: true });
|
||||
}
|
||||
|
||||
function assistantMessages(page: Page) {
|
||||
return page.locator("[data-message-id]").filter({ has: page.getByTestId("assistant-message") });
|
||||
}
|
||||
|
||||
test.describe("diff and patch syntax highlighting", () => {
|
||||
for (const theme of ["dark", "light"] as const) {
|
||||
test(`highlights diff and patch fences in chat (${theme} theme)`, async ({ page }) => {
|
||||
await page.addInitScript(
|
||||
({ key, mode }) => {
|
||||
localStorage.setItem(key, JSON.stringify({ theme: mode }));
|
||||
},
|
||||
{ key: APP_SETTINGS_KEY, mode: theme },
|
||||
);
|
||||
|
||||
const agent = await seedMockAgentWorkspace({
|
||||
repoPrefix: `diff-chat-${theme}-`,
|
||||
title: `Diff highlight (${theme})`,
|
||||
initialPrompt: "Show me the diff and patch.",
|
||||
featureValues: { mockAssistantResponse: DIFF_FIXTURE },
|
||||
});
|
||||
|
||||
try {
|
||||
await agent.client.waitForAgentUpsert(
|
||||
agent.agentId,
|
||||
(snapshot) => snapshot.status === "idle",
|
||||
30_000,
|
||||
);
|
||||
await openAgentRoute(page, agent);
|
||||
|
||||
const message = assistantMessages(page);
|
||||
const expectedColors =
|
||||
theme === "dark"
|
||||
? {
|
||||
addition: "rgb(152, 195, 121)",
|
||||
deletion: "rgb(224, 108, 117)",
|
||||
meta: "rgb(92, 99, 112)",
|
||||
}
|
||||
: {
|
||||
addition: "rgb(52, 130, 51)",
|
||||
deletion: "rgb(214, 59, 47)",
|
||||
meta: "rgb(160, 161, 167)",
|
||||
};
|
||||
|
||||
const diffAdd = message.getByText("+ const trimmed = name.trim();", { exact: true });
|
||||
const diffDel = message.getByText("- return `${prefix}, ${name}`;", { exact: true });
|
||||
const diffMeta = message.getByText(
|
||||
"@@ -1,3 +1,4 @@ export function greet(name: string) {",
|
||||
{
|
||||
exact: true,
|
||||
},
|
||||
);
|
||||
const patchAdd = message.getByText("+New description", { exact: true });
|
||||
const patchDel = message.getByText("-Old description", { exact: true });
|
||||
|
||||
await expect(diffAdd).toBeVisible({ timeout: 30_000 });
|
||||
await expect(diffAdd).toHaveCSS("color", expectedColors.addition);
|
||||
await expect(diffDel).toHaveCSS("color", expectedColors.deletion);
|
||||
await expect(diffMeta).toHaveCSS("color", expectedColors.meta);
|
||||
await expect(patchAdd).toHaveCSS("color", expectedColors.addition);
|
||||
await expect(patchDel).toHaveCSS("color", expectedColors.deletion);
|
||||
|
||||
const rubyDef = message.getByText("def", { exact: true });
|
||||
const kotlinVal = message.getByText("val", { exact: true });
|
||||
const tomlHost = message.getByText("host", { exact: true });
|
||||
const sqlSelect = message.getByText("SELECT", { exact: true });
|
||||
const expectedKeyword = theme === "dark" ? "rgb(198, 120, 221)" : "rgb(166, 38, 164)";
|
||||
const expectedProperty = theme === "dark" ? "rgb(209, 154, 102)" : "rgb(152, 104, 1)";
|
||||
await expect(rubyDef).toHaveCSS("color", expectedKeyword);
|
||||
await expect(kotlinVal).toHaveCSS("color", expectedKeyword);
|
||||
await expect(tomlHost).toHaveCSS("color", expectedProperty);
|
||||
await expect(sqlSelect).toHaveCSS("color", expectedKeyword);
|
||||
|
||||
await saveScreenshot(page, `chat-diff-patch-${theme}.png`);
|
||||
} finally {
|
||||
await agent.cleanup();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
test("highlights a .diff file in the Files viewer", async ({ page, withWorkspace }) => {
|
||||
await page.addInitScript(
|
||||
({ key }) => {
|
||||
localStorage.setItem(key, JSON.stringify({ theme: "dark" }));
|
||||
},
|
||||
{ key: APP_SETTINGS_KEY },
|
||||
);
|
||||
const workspace = await withWorkspace({ prefix: "diff-file-viewer-" });
|
||||
await writeFile(path.join(workspace.repoPath, "changes.diff"), FILE_DIFF_CONTENT);
|
||||
|
||||
await workspace.navigateTo();
|
||||
await openFileExplorer(page);
|
||||
await openFileFromExplorer(page, "changes.diff");
|
||||
await expectFileTabOpen(page, "changes.diff");
|
||||
|
||||
const editor = page.getByTestId("file-source-editor").filter({ visible: true });
|
||||
await expect(editor).toBeVisible({ timeout: 30_000 });
|
||||
|
||||
const addLine = editor
|
||||
.locator(".cm-line", { hasText: "+new_value = 2" })
|
||||
.locator("span")
|
||||
.first();
|
||||
const delLine = editor
|
||||
.locator(".cm-line", { hasText: "-old_value = 1" })
|
||||
.locator("span")
|
||||
.first();
|
||||
const metaLine = editor
|
||||
.locator(".cm-line", { hasText: "@@ -1,3 +1,3 @@ def greet():" })
|
||||
.locator("span")
|
||||
.first();
|
||||
|
||||
await expect(addLine).toHaveCSS("color", "rgb(152, 195, 121)");
|
||||
await expect(delLine).toHaveCSS("color", "rgb(224, 108, 117)");
|
||||
await expect(metaLine).toHaveCSS("color", "rgb(92, 99, 112)");
|
||||
|
||||
await saveScreenshot(page, "files-viewer-diff-dark.png");
|
||||
});
|
||||
|
||||
test("highlights a .patch file in the Files viewer (light theme)", async ({
|
||||
page,
|
||||
withWorkspace,
|
||||
}) => {
|
||||
await page.addInitScript(
|
||||
({ key }) => {
|
||||
localStorage.setItem(key, JSON.stringify({ theme: "light" }));
|
||||
},
|
||||
{ key: APP_SETTINGS_KEY },
|
||||
);
|
||||
const workspace = await withWorkspace({ prefix: "patch-file-viewer-" });
|
||||
await writeFile(path.join(workspace.repoPath, "fix.patch"), FILE_DIFF_CONTENT);
|
||||
|
||||
await workspace.navigateTo();
|
||||
await openFileExplorer(page);
|
||||
await openFileFromExplorer(page, "fix.patch");
|
||||
await expectFileTabOpen(page, "fix.patch");
|
||||
|
||||
const editor = page.getByTestId("file-source-editor").filter({ visible: true });
|
||||
await expect(editor).toBeVisible({ timeout: 30_000 });
|
||||
|
||||
const addLine = editor
|
||||
.locator(".cm-line", { hasText: "+new_value = 2" })
|
||||
.locator("span")
|
||||
.first();
|
||||
const delLine = editor
|
||||
.locator(".cm-line", { hasText: "-old_value = 1" })
|
||||
.locator("span")
|
||||
.first();
|
||||
const metaLine = editor
|
||||
.locator(".cm-line", { hasText: "@@ -1,3 +1,3 @@ def greet():" })
|
||||
.locator("span")
|
||||
.first();
|
||||
|
||||
await expect(addLine).toHaveCSS("color", "rgb(52, 130, 51)");
|
||||
await expect(delLine).toHaveCSS("color", "rgb(214, 59, 47)");
|
||||
await expect(metaLine).toHaveCSS("color", "rgb(160, 161, 167)");
|
||||
|
||||
await saveScreenshot(page, "files-viewer-patch-light.png");
|
||||
});
|
||||
});
|
||||
@@ -84,7 +84,7 @@ async function expectHelpHostVersion(page: Page, serverId: string, version: stri
|
||||
async function openHostPage(page: Page, host: RestartableHostDaemon): Promise<void> {
|
||||
await openSettings(page);
|
||||
await selectSettingsHost(page, host.serverId);
|
||||
await openHostSection(page, host.serverId, "host");
|
||||
await openHostSection(page, host.serverId, "daemon");
|
||||
}
|
||||
|
||||
function hostIdentity(page: Page) {
|
||||
|
||||
@@ -13,8 +13,8 @@ async function openMetadataGenerationSettings(page: Page) {
|
||||
await gotoAppShell(page);
|
||||
await openSettings(page);
|
||||
await openSettingsHost(page, serverId);
|
||||
await openHostSection(page, serverId, "metadata");
|
||||
await expectSettingsHeader(page, "Metadata");
|
||||
await openHostSection(page, serverId, "workspaces");
|
||||
await expectSettingsHeader(page, "Workspaces");
|
||||
}
|
||||
|
||||
async function openManualMetadataModelPicker(page: Page) {
|
||||
@@ -111,3 +111,102 @@ test("replaces only the first configured metadata model", async ({ page }) => {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test("saves and clears host-wide metadata instructions without overwriting providers", async ({
|
||||
page,
|
||||
}, testInfo) => {
|
||||
const client = await connectNewWorkspaceDaemonClient({ ownProjects: false });
|
||||
const previousConfig = await client.getDaemonConfig();
|
||||
|
||||
try {
|
||||
await client.patchDaemonConfig({
|
||||
metadataGeneration: {
|
||||
providers: [{ provider: "mock", model: "ten-second-stream" }],
|
||||
instructions: "",
|
||||
},
|
||||
});
|
||||
await openMetadataGenerationSettings(page);
|
||||
|
||||
const instructionsRow = page.getByTestId("metadata-generation-instructions-row");
|
||||
await expect(instructionsRow).toBeVisible();
|
||||
await page.screenshot({
|
||||
path: testInfo.outputPath("metadata-instructions-tucked-empty.png"),
|
||||
fullPage: true,
|
||||
});
|
||||
|
||||
await instructionsRow.click();
|
||||
|
||||
const instructionsSheet = page.getByTestId("metadata-generation-instructions-sheet");
|
||||
const instructionsInput = page.getByTestId("metadata-generation-instructions-input");
|
||||
const saveButton = page.getByTestId("metadata-generation-instructions-save");
|
||||
|
||||
await expect(instructionsSheet).toBeVisible();
|
||||
await expect(saveButton).toBeDisabled();
|
||||
await page.screenshot({
|
||||
path: testInfo.outputPath("metadata-instructions-sheet-empty.png"),
|
||||
fullPage: true,
|
||||
animations: "disabled",
|
||||
});
|
||||
|
||||
await instructionsInput.fill("Write in Simplified Chinese. Do not use em dashes.");
|
||||
await expect(saveButton).toBeEnabled();
|
||||
await saveButton.click();
|
||||
|
||||
await expect(instructionsSheet).toHaveCount(0);
|
||||
await expect
|
||||
.poll(async () => (await client.getDaemonConfig()).config.metadataGeneration)
|
||||
.toEqual({
|
||||
providers: [{ provider: "mock", model: "ten-second-stream" }],
|
||||
instructions: "Write in Simplified Chinese. Do not use em dashes.",
|
||||
});
|
||||
|
||||
await page.reload();
|
||||
await expect(
|
||||
page
|
||||
.getByTestId("metadata-generation-instructions-row")
|
||||
.getByText("Write in Simplified Chinese. Do not use em dashes."),
|
||||
).toBeVisible();
|
||||
await page.screenshot({
|
||||
path: testInfo.outputPath("metadata-instructions-tucked-saved.png"),
|
||||
fullPage: true,
|
||||
});
|
||||
|
||||
// Verify compact layout keeps the tucked row and bottom sheet clean.
|
||||
await page.setViewportSize({ width: 390, height: 844 });
|
||||
await expect(page.getByTestId("metadata-generation-instructions-row")).toBeVisible();
|
||||
await page.screenshot({
|
||||
path: testInfo.outputPath("metadata-instructions-compact-row.png"),
|
||||
fullPage: true,
|
||||
});
|
||||
await page.getByTestId("metadata-generation-instructions-row").click();
|
||||
await expect(page.getByTestId("metadata-generation-instructions-input")).toHaveValue(
|
||||
"Write in Simplified Chinese. Do not use em dashes.",
|
||||
);
|
||||
await page.screenshot({
|
||||
path: testInfo.outputPath("metadata-instructions-compact-sheet.png"),
|
||||
fullPage: true,
|
||||
});
|
||||
|
||||
await page.getByTestId("metadata-generation-instructions-input").fill("");
|
||||
await expect(page.getByTestId("metadata-generation-instructions-save")).toBeEnabled();
|
||||
await page.getByTestId("metadata-generation-instructions-save").click();
|
||||
|
||||
await expect(page.getByTestId("metadata-generation-instructions-sheet")).toHaveCount(0);
|
||||
await expect
|
||||
.poll(async () => (await client.getDaemonConfig()).config.metadataGeneration)
|
||||
.toEqual({
|
||||
providers: [{ provider: "mock", model: "ten-second-stream" }],
|
||||
});
|
||||
} finally {
|
||||
try {
|
||||
await client.patchDaemonConfig({
|
||||
metadataGeneration: {
|
||||
providers: previousConfig.config.metadataGeneration.providers,
|
||||
instructions: previousConfig.config.metadataGeneration.instructions ?? "",
|
||||
},
|
||||
});
|
||||
} finally {
|
||||
await client.close().catch(() => undefined);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -3,7 +3,9 @@ import type { DaemonClient } from "@getpaseo/client/internal/daemon-client";
|
||||
import { test, expect, type Page } from "../support/fixtures";
|
||||
import { connectDaemonClient } from "../support/helpers/daemon-client-loader";
|
||||
import {
|
||||
clickModelRowWhileProviderOpens,
|
||||
closeModelPicker,
|
||||
expectModelListScrollKeepsSearchFocused,
|
||||
expectModelSearchEmptyState,
|
||||
expectModelPickerHeight,
|
||||
expectModelPickerWidth,
|
||||
@@ -154,6 +156,137 @@ test.describe("Cross-provider model search", () => {
|
||||
await expectModelPickerHeight(page, restingHeight);
|
||||
await expectModelPickerWidth(page, restingWidth);
|
||||
});
|
||||
|
||||
await test.step("ArrowUp wraps to the end of a virtualized catalog and Enter selects it", async () => {
|
||||
await searchAllModels(page, "bulk model");
|
||||
await page.keyboard.press("ArrowUp");
|
||||
// Tie-broken lexicographically by modelLabel, so "Bulk model 99" sits at the bottom.
|
||||
const lastRow = page
|
||||
.getByTestId("combobox-desktop-container")
|
||||
.getByTestId(`model-row-${LARGE_CATALOG.id}-bulk-99`);
|
||||
await expect(lastRow).toBeVisible();
|
||||
await expect(lastRow).toHaveAttribute("data-active", "true");
|
||||
await page.keyboard.press("Enter");
|
||||
await expect(page.getByTestId("combobox-desktop-container")).toHaveCount(0);
|
||||
await expect(
|
||||
page.getByTestId("combined-model-selector").filter({ visible: true }).first(),
|
||||
).toContainText("Bulk model 99");
|
||||
});
|
||||
} finally {
|
||||
await workspace.cleanup();
|
||||
await profile.restore();
|
||||
await provider.restore();
|
||||
}
|
||||
});
|
||||
|
||||
test("arrow keys navigate profiles, providers, models, and search results in the composer", async ({
|
||||
page,
|
||||
}) => {
|
||||
const provider = await seedModelProvider(STUDIO);
|
||||
const profile = await seedAgentProfiles([
|
||||
{
|
||||
id: "agent_profile_e2e_arrows",
|
||||
name: "Arrow Profile",
|
||||
provider: STUDIO.id,
|
||||
modelId: "studio-fast",
|
||||
},
|
||||
]);
|
||||
const workspace = await seedWorkspace({ repoPrefix: "model-picker-arrows-" });
|
||||
|
||||
try {
|
||||
await test.step("open the composer model picker on the root view", async () => {
|
||||
await gotoWorkspace(page, workspace.workspaceId);
|
||||
await clickNewChat(page);
|
||||
await expectComposerVisible(page);
|
||||
await openModelPicker(page);
|
||||
});
|
||||
|
||||
const viewport = page.getByTestId("combobox-desktop-container");
|
||||
const trigger = page.getByTestId("combined-model-selector").filter({ visible: true }).first();
|
||||
const profileRow = viewport.getByTestId("model-profile-row-agent_profile_e2e_arrows");
|
||||
const studioProviderRow = viewport.getByTestId(`model-provider-${STUDIO.id}`);
|
||||
|
||||
await test.step("move from profiles to providers, drill in with ArrowRight, and go back with ArrowLeft", async () => {
|
||||
await expect(profileRow).toHaveAttribute("data-active", "true");
|
||||
// Root view keeps aria-selected absent while keyboard-active uses data-active.
|
||||
await expect(viewport.locator("[aria-selected]")).toHaveCount(0);
|
||||
|
||||
// Step down until Mock Studio is active (provider order can vary across environments).
|
||||
for (let step = 0; step < 10; step += 1) {
|
||||
if ((await studioProviderRow.getAttribute("data-active")) === "true") break;
|
||||
await page.keyboard.press("ArrowDown");
|
||||
}
|
||||
await expect(studioProviderRow).toHaveAttribute("data-active", "true");
|
||||
|
||||
await page.keyboard.press("ArrowRight");
|
||||
await expect(viewport.getByTestId(`model-row-${STUDIO.id}-studio-fast`)).toBeVisible();
|
||||
|
||||
await page.keyboard.press("ArrowLeft");
|
||||
await expect(studioProviderRow).toHaveAttribute("data-active", "true");
|
||||
});
|
||||
|
||||
await test.step("Enter drills into the active provider and ArrowDown + Enter selects a model", async () => {
|
||||
await page.keyboard.press("Enter");
|
||||
const deepRow = viewport.getByTestId(`model-row-${STUDIO.id}-studio-deep`);
|
||||
await expect(deepRow).toBeVisible();
|
||||
await expectModelListScrollKeepsSearchFocused(page);
|
||||
|
||||
for (let step = 0; step < 5; step += 1) {
|
||||
if ((await deepRow.getAttribute("data-active")) === "true") break;
|
||||
await page.keyboard.press("ArrowDown");
|
||||
}
|
||||
await expect(deepRow).toHaveAttribute("data-active", "true");
|
||||
|
||||
await page.keyboard.press("Enter");
|
||||
await expect(viewport).toHaveCount(0);
|
||||
await expect(trigger).toContainText("Studio deep think");
|
||||
});
|
||||
|
||||
await test.step("typing filters results while arrow keys select across search matches", async () => {
|
||||
await openModelPicker(page);
|
||||
await searchAllModels(page, "ten second stream");
|
||||
const studioFast = viewport.getByTestId(`model-row-${STUDIO.id}-studio-fast`);
|
||||
const mockFast = viewport.getByTestId("model-row-mock-ten-second-stream");
|
||||
await expect(studioFast).toBeVisible();
|
||||
await expect(mockFast).toBeVisible();
|
||||
|
||||
// Advance to the second match and confirm with Enter.
|
||||
const initialMockActive = (await mockFast.getAttribute("data-active")) === "true";
|
||||
await page.keyboard.press("ArrowDown");
|
||||
const targetRow = initialMockActive ? studioFast : mockFast;
|
||||
await expect(targetRow).toHaveAttribute("data-active", "true");
|
||||
await page.keyboard.press("Enter");
|
||||
await expect(viewport).toHaveCount(0);
|
||||
await expect(trigger).toContainText("Ten second stream");
|
||||
});
|
||||
|
||||
await test.step("a press on a model row selects it while the provider list is still opening", async () => {
|
||||
await openModelPicker(page);
|
||||
await clickModelRowWhileProviderOpens(page, {
|
||||
provider: "mock",
|
||||
modelLabel: "One minute stream",
|
||||
});
|
||||
await expect(viewport).toHaveCount(0);
|
||||
await expect(trigger).toContainText("One minute stream");
|
||||
});
|
||||
|
||||
await test.step("Enter on the active profile row applies it", async () => {
|
||||
await openModelPicker(page);
|
||||
await expect(profileRow).toHaveAttribute("data-active", "true");
|
||||
await page.keyboard.press("Enter");
|
||||
await expect(viewport).toHaveCount(0);
|
||||
await expect(trigger).toContainText("Ten second stream");
|
||||
});
|
||||
|
||||
await test.step("folded compact sheet also supports Enter on the active profile row", async () => {
|
||||
await page.setViewportSize({ width: 390, height: 800 });
|
||||
await page.getByTestId("combined-model-selector").filter({ visible: true }).first().click();
|
||||
const sheetProfileRow = page.getByTestId("model-profile-row-agent_profile_e2e_arrows");
|
||||
await expect(sheetProfileRow).toBeVisible();
|
||||
await expect(sheetProfileRow).toHaveAttribute("data-active", "true");
|
||||
await page.keyboard.press("Enter");
|
||||
await expect(sheetProfileRow).toHaveCount(0);
|
||||
});
|
||||
} finally {
|
||||
await workspace.cleanup();
|
||||
await profile.restore();
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
openStartingRefPicker,
|
||||
selectBranchInPicker,
|
||||
selectWorkspaceIsolation,
|
||||
watchBrowserBranchSuggestions,
|
||||
} from "../support/helpers/new-workspace";
|
||||
import { seedWorkspace, type SeededWorkspace } from "../support/helpers/seed-client";
|
||||
import { getServerId } from "../support/helpers/server-id";
|
||||
@@ -16,6 +17,21 @@ const LONG_HOST_NAME =
|
||||
"development-macbook-pro.local-connected-through-a-very-long-private-hostname";
|
||||
const LONG_BRANCH_NAME =
|
||||
"feat/app/add-amoled-theme-with-a-very-long-pull-request-and-branch-description";
|
||||
const MANY_BRANCHES = Array.from(
|
||||
{ length: 12 },
|
||||
(_, index) => `feat/branch-${String(index + 1).padStart(2, "0")}`,
|
||||
);
|
||||
|
||||
interface PopoverFrameSample {
|
||||
t: number;
|
||||
opacity: number;
|
||||
top: number;
|
||||
left: number;
|
||||
width: number;
|
||||
height: number;
|
||||
rowCount: number;
|
||||
mainTop: number | null;
|
||||
}
|
||||
|
||||
function measureControlRightEdges(controls: HTMLElement[]) {
|
||||
const measurements: Array<{ label: string | null; right: number }> = [];
|
||||
@@ -26,13 +42,69 @@ function measureControlRightEdges(controls: HTMLElement[]) {
|
||||
return measurements;
|
||||
}
|
||||
|
||||
async function startPopoverFrameSampler(page: import("@playwright/test").Page): Promise<void> {
|
||||
await page.evaluate(() => {
|
||||
const win = window as unknown as {
|
||||
__popoverFrames?: PopoverFrameSample[];
|
||||
__popoverSamplerStop?: () => void;
|
||||
};
|
||||
const samples: PopoverFrameSample[] = [];
|
||||
const start = performance.now();
|
||||
let stopped = false;
|
||||
let rafId = 0;
|
||||
const tick = () => {
|
||||
if (stopped) return;
|
||||
const el = document.querySelector<HTMLElement>('[data-testid="combobox-desktop-container"]');
|
||||
if (el) {
|
||||
const style = getComputedStyle(el);
|
||||
const opacity = Number.parseFloat(style.opacity || "1");
|
||||
const rect = el.getBoundingClientRect();
|
||||
const rows = el.querySelectorAll("[data-combobox-option-index]");
|
||||
const mainEl = el.querySelector<HTMLElement>(
|
||||
'[data-testid="new-workspace-ref-picker-branch-main"]',
|
||||
);
|
||||
samples.push({
|
||||
t: Math.round(performance.now() - start),
|
||||
opacity,
|
||||
top: Math.round(rect.top),
|
||||
left: Math.round(rect.left),
|
||||
width: Math.round(rect.width),
|
||||
height: Math.round(rect.height),
|
||||
rowCount: rows.length,
|
||||
mainTop: mainEl ? Math.round(mainEl.getBoundingClientRect().top) : null,
|
||||
});
|
||||
}
|
||||
rafId = requestAnimationFrame(tick);
|
||||
};
|
||||
rafId = requestAnimationFrame(tick);
|
||||
win.__popoverFrames = samples;
|
||||
win.__popoverSamplerStop = () => {
|
||||
stopped = true;
|
||||
cancelAnimationFrame(rafId);
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
async function stopPopoverFrameSampler(
|
||||
page: import("@playwright/test").Page,
|
||||
): Promise<PopoverFrameSample[]> {
|
||||
return page.evaluate(() => {
|
||||
const win = window as unknown as {
|
||||
__popoverFrames?: PopoverFrameSample[];
|
||||
__popoverSamplerStop?: () => void;
|
||||
};
|
||||
win.__popoverSamplerStop?.();
|
||||
return win.__popoverFrames ?? [];
|
||||
});
|
||||
}
|
||||
|
||||
test.describe("New workspace metadata row layout", () => {
|
||||
let workspace: SeededWorkspace;
|
||||
|
||||
test.beforeEach(async () => {
|
||||
workspace = await seedWorkspace({
|
||||
repoPrefix: "new-workspace-layout-",
|
||||
repo: { branches: [LONG_BRANCH_NAME] },
|
||||
repo: { branches: [LONG_BRANCH_NAME, ...MANY_BRANCHES] },
|
||||
});
|
||||
});
|
||||
|
||||
@@ -84,4 +156,110 @@ test.describe("New workspace metadata row layout", () => {
|
||||
).toBeLessThanOrEqual(composerRightRail + 1);
|
||||
}
|
||||
});
|
||||
|
||||
test("starting ref popover holds height and row positions on a cold first open", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.setViewportSize({ width: 1280, height: 900 });
|
||||
const branchWatch = await watchBrowserBranchSuggestions(page, { hold: true });
|
||||
|
||||
await gotoAppShell(page);
|
||||
await waitForSidebarHydration(page);
|
||||
await openNewWorkspaceComposer(page, {
|
||||
projectKey: workspace.projectKey,
|
||||
projectDisplayName: workspace.projectDisplayName,
|
||||
});
|
||||
await selectWorkspaceIsolation(page, "worktree");
|
||||
|
||||
await startPopoverFrameSampler(page);
|
||||
await openStartingRefPicker(page);
|
||||
|
||||
const popover = page.getByTestId("combobox-desktop-container");
|
||||
await expect(popover).toBeVisible({ timeout: 10_000 });
|
||||
await branchWatch.waitForResponse();
|
||||
|
||||
// Give the loading state several frames to paint before releasing the branch list.
|
||||
await page.waitForTimeout(120);
|
||||
const loadingBox = await popover.boundingBox();
|
||||
expect(loadingBox).not.toBeNull();
|
||||
|
||||
branchWatch.release();
|
||||
await expect(page.getByTestId("new-workspace-ref-picker-branch-feat/branch-12")).toBeVisible({
|
||||
timeout: 10_000,
|
||||
});
|
||||
await page.waitForTimeout(80);
|
||||
const settledBox = await popover.boundingBox();
|
||||
expect(settledBox).not.toBeNull();
|
||||
|
||||
const samples = await stopPopoverFrameSampler(page);
|
||||
const visibleSamples = samples.filter((s) => s.opacity > 0.9);
|
||||
expect(visibleSamples.length).toBeGreaterThan(0);
|
||||
|
||||
const heights = visibleSamples.map((s) => s.height);
|
||||
const tops = visibleSamples.map((s) => s.top);
|
||||
const mainTops = visibleSamples
|
||||
.map((s) => s.mainTop)
|
||||
.filter((value): value is number => value !== null);
|
||||
|
||||
expect(
|
||||
Math.max(...heights) - Math.min(...heights),
|
||||
`popover height shifted across visible frames: ${JSON.stringify(visibleSamples)}`,
|
||||
).toBeLessThanOrEqual(1);
|
||||
expect(
|
||||
Math.max(...tops) - Math.min(...tops),
|
||||
`popover top shifted across visible frames: ${JSON.stringify(visibleSamples)}`,
|
||||
).toBeLessThanOrEqual(1);
|
||||
expect(
|
||||
mainTops.length > 0 ? Math.max(...mainTops) - Math.min(...mainTops) : 0,
|
||||
`main row jumped vertically across visible frames: ${JSON.stringify(visibleSamples)}`,
|
||||
).toBeLessThanOrEqual(1);
|
||||
|
||||
// Switching to Pull requests keeps the same frame height.
|
||||
await page.getByTestId("new-workspace-ref-picker-tab-pull-requests").click();
|
||||
await page.waitForTimeout(80);
|
||||
const prBox = await popover.boundingBox();
|
||||
expect(prBox).not.toBeNull();
|
||||
expect(Math.abs(prBox!.height - settledBox!.height)).toBeLessThanOrEqual(1);
|
||||
});
|
||||
|
||||
test("starting ref popover prefetches branches before the first click and clamps to short viewports", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.setViewportSize({ width: 1280, height: 900 });
|
||||
const branchWatch = await watchBrowserBranchSuggestions(page, { hold: false });
|
||||
|
||||
await gotoAppShell(page);
|
||||
await waitForSidebarHydration(page);
|
||||
await openNewWorkspaceComposer(page, {
|
||||
projectKey: workspace.projectKey,
|
||||
projectDisplayName: workspace.projectDisplayName,
|
||||
});
|
||||
await selectWorkspaceIsolation(page, "worktree");
|
||||
|
||||
// Branches must prefetch before the user ever clicks the trigger.
|
||||
await branchWatch.waitForResponse();
|
||||
await page.waitForTimeout(100);
|
||||
|
||||
await startPopoverFrameSampler(page);
|
||||
await openStartingRefPicker(page);
|
||||
await expect(page.getByTestId("new-workspace-ref-picker-branch-feat/branch-12")).toBeVisible({
|
||||
timeout: 10_000,
|
||||
});
|
||||
await page.waitForTimeout(80);
|
||||
const samples = await stopPopoverFrameSampler(page);
|
||||
const firstVisible = samples.find((s) => s.opacity > 0.9);
|
||||
expect(firstVisible).toBeDefined();
|
||||
expect(firstVisible!.rowCount).toBeGreaterThan(5);
|
||||
|
||||
// Close and verify short viewport clamping keeps the popover inside the window.
|
||||
await page.keyboard.press("Escape");
|
||||
await page.setViewportSize({ width: 1280, height: 500 });
|
||||
await openStartingRefPicker(page);
|
||||
const popover = page.getByTestId("combobox-desktop-container");
|
||||
await expect(popover).toBeVisible({ timeout: 10_000 });
|
||||
await page.waitForTimeout(100);
|
||||
const shortBox = await popover.boundingBox();
|
||||
expect(shortBox).not.toBeNull();
|
||||
expect(shortBox!.y + shortBox!.height).toBeLessThanOrEqual(500);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,245 @@
|
||||
import { expect, test } from "../support/fixtures";
|
||||
import { gotoAppShell, openSettings } from "../support/helpers/app";
|
||||
import {
|
||||
clearRecordedBrowserNotifications,
|
||||
clickRecordedBrowserNotification,
|
||||
expectDefaultNotificationSettings,
|
||||
expectNotificationSubControlsDisabled,
|
||||
expectNotificationSwitchState,
|
||||
expectRecordedAgentNotifications,
|
||||
expectRecordedPluginNotifications,
|
||||
installBrowserNotificationRecorder,
|
||||
openNotificationSettings,
|
||||
readRecordedBrowserNotifications,
|
||||
setNotificationSwitch,
|
||||
setPluginNotificationSwitch,
|
||||
} from "../support/helpers/notification-settings";
|
||||
import { copyPluginExample } from "../support/helpers/plugin-fixture";
|
||||
import { seedWorkspace, type SeedDaemonClient } from "../support/helpers/seed-client";
|
||||
|
||||
const FAST_FINISHED_PROMPT =
|
||||
"emit settled assistant image markdown: ";
|
||||
const PERMISSION_PROMPT = "emit a synthetic plan approval";
|
||||
const ERROR_PROMPT = "emit a synthetic turn failure";
|
||||
|
||||
async function runMockAgentTurn(
|
||||
client: SeedDaemonClient,
|
||||
input: {
|
||||
cwd: string;
|
||||
workspaceId: string;
|
||||
title: string;
|
||||
prompt: string;
|
||||
waitForStatus: "idle" | "error" | "running";
|
||||
},
|
||||
): Promise<string> {
|
||||
const agent = await client.createAgent({
|
||||
provider: "mock",
|
||||
cwd: input.cwd,
|
||||
workspaceId: input.workspaceId,
|
||||
title: input.title,
|
||||
modeId: "load-test",
|
||||
model: "e2e-fast-stream",
|
||||
initialPrompt: input.prompt,
|
||||
});
|
||||
await client.waitForAgentUpsert(
|
||||
agent.id,
|
||||
(snapshot) => snapshot.status === input.waitForStatus,
|
||||
15_000,
|
||||
);
|
||||
return agent.id;
|
||||
}
|
||||
|
||||
test.describe("Settings → Notifications and OS notification filtering", () => {
|
||||
test("displays defaults, persists switch changes across reload, disables sub-controls when paused, and filters OS notifications", async ({
|
||||
page,
|
||||
}) => {
|
||||
await installBrowserNotificationRecorder(page);
|
||||
const seeded = await seedWorkspace({ repoPrefix: "notification-settings-" });
|
||||
const pluginExample = await copyPluginExample("notifications");
|
||||
let installedPlugin = false;
|
||||
|
||||
try {
|
||||
await gotoAppShell(page);
|
||||
await openSettings(page);
|
||||
await openNotificationSettings(page);
|
||||
|
||||
await test.step("renders Settings → Notifications with expected out-of-the-box defaults", async () => {
|
||||
await expectDefaultNotificationSettings(page);
|
||||
await expect(
|
||||
page.getByText("Installed plugins appear here so you can mute them individually", {
|
||||
exact: true,
|
||||
}),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
await test.step("default preferences suppress finished turn notifications while delivering permission and error notifications", async () => {
|
||||
await clearRecordedBrowserNotifications(page);
|
||||
|
||||
await runMockAgentTurn(seeded.client, {
|
||||
cwd: seeded.repoPath,
|
||||
workspaceId: seeded.workspaceId,
|
||||
title: "Default finished agent",
|
||||
prompt: FAST_FINISHED_PROMPT,
|
||||
waitForStatus: "idle",
|
||||
});
|
||||
|
||||
const permissionAgentId = await runMockAgentTurn(seeded.client, {
|
||||
cwd: seeded.repoPath,
|
||||
workspaceId: seeded.workspaceId,
|
||||
title: "Default permission agent",
|
||||
prompt: PERMISSION_PROMPT,
|
||||
waitForStatus: "running",
|
||||
});
|
||||
|
||||
const errorAgentId = await runMockAgentTurn(seeded.client, {
|
||||
cwd: seeded.repoPath,
|
||||
workspaceId: seeded.workspaceId,
|
||||
title: "Default error agent",
|
||||
prompt: ERROR_PROMPT,
|
||||
waitForStatus: "error",
|
||||
});
|
||||
|
||||
await expectRecordedAgentNotifications(page, [
|
||||
{ agentId: permissionAgentId, reason: "permission" },
|
||||
{ agentId: errorAgentId, reason: "error" },
|
||||
]);
|
||||
});
|
||||
|
||||
await test.step("enabling Agent finished persists across page reload and allows finished notifications", async () => {
|
||||
await setNotificationSwitch(page, "Agent finished", true);
|
||||
await page.reload();
|
||||
await expectNotificationSwitchState(page, "Agent finished", {
|
||||
checked: true,
|
||||
disabled: false,
|
||||
});
|
||||
|
||||
await clearRecordedBrowserNotifications(page);
|
||||
|
||||
const finishedAgentId = await runMockAgentTurn(seeded.client, {
|
||||
cwd: seeded.repoPath,
|
||||
workspaceId: seeded.workspaceId,
|
||||
title: "Enabled finished agent",
|
||||
prompt: FAST_FINISHED_PROMPT,
|
||||
waitForStatus: "idle",
|
||||
});
|
||||
|
||||
await expectRecordedAgentNotifications(page, [
|
||||
{ agentId: finishedAgentId, reason: "finished" },
|
||||
]);
|
||||
});
|
||||
|
||||
await test.step("toggling Enable notifications off disables sub-controls, persists across reload, and suppresses all notifications", async () => {
|
||||
await setNotificationSwitch(page, "Enable notifications", false);
|
||||
await expect(
|
||||
page.getByText("All notifications, including plugins, are paused on this device", {
|
||||
exact: true,
|
||||
}),
|
||||
).toBeVisible();
|
||||
await expectNotificationSubControlsDisabled(page, true);
|
||||
|
||||
await page.reload();
|
||||
await expectNotificationSwitchState(page, "Enable notifications", {
|
||||
checked: false,
|
||||
disabled: false,
|
||||
});
|
||||
await expectNotificationSubControlsDisabled(page, true);
|
||||
|
||||
await clearRecordedBrowserNotifications(page);
|
||||
|
||||
await runMockAgentTurn(seeded.client, {
|
||||
cwd: seeded.repoPath,
|
||||
workspaceId: seeded.workspaceId,
|
||||
title: "Paused error agent",
|
||||
prompt: ERROR_PROMPT,
|
||||
waitForStatus: "error",
|
||||
});
|
||||
|
||||
await runMockAgentTurn(seeded.client, {
|
||||
cwd: seeded.repoPath,
|
||||
workspaceId: seeded.workspaceId,
|
||||
title: "Paused finished agent",
|
||||
prompt: FAST_FINISHED_PROMPT,
|
||||
waitForStatus: "idle",
|
||||
});
|
||||
|
||||
// Give any in-flight event delivery a chance to settle and verify none fired.
|
||||
await page.waitForTimeout(300);
|
||||
expect(await readRecordedBrowserNotifications(page)).toEqual([]);
|
||||
});
|
||||
|
||||
await test.step("delivers plugin notifications, routes OS notification taps through client.onNotificationOpen, and suppresses notifications when the plugin is muted", async () => {
|
||||
await setNotificationSwitch(page, "Enable notifications", true);
|
||||
await seeded.client.patchDaemonConfig({ pluginsEnabled: true });
|
||||
await seeded.client.installDirectoryPlugin(pluginExample.directory);
|
||||
installedPlugin = true;
|
||||
|
||||
const pluginToggle = page.getByRole("switch", { name: "Build alerts", exact: true });
|
||||
await expect(pluginToggle).toBeVisible();
|
||||
await expect(pluginToggle).toHaveAttribute("aria-checked", "true");
|
||||
|
||||
await clearRecordedBrowserNotifications(page);
|
||||
|
||||
const sent = (await seeded.client.invokePluginRpc("notifications-example", "alerts.send", {
|
||||
buildId: "204",
|
||||
title: "Build #204 failed",
|
||||
body: "Playwright suite failed on main",
|
||||
})) as { status: string; notificationId: string };
|
||||
expect(sent.status).toBe("sent");
|
||||
|
||||
await expectRecordedPluginNotifications(page, [
|
||||
{
|
||||
pluginId: "notifications-example",
|
||||
title: "Build #204 failed",
|
||||
body: "Playwright suite failed on main",
|
||||
notificationId: sent.notificationId,
|
||||
},
|
||||
]);
|
||||
|
||||
await clickRecordedBrowserNotification(page, 0);
|
||||
await expect(page.getByText("Build alert #204", { exact: true })).toBeVisible();
|
||||
await expect(
|
||||
page.getByText("Playwright suite failed on main", { exact: true }),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByText(`Notification ID: ${sent.notificationId}`, { exact: true }),
|
||||
).toBeVisible();
|
||||
|
||||
await openSettings(page);
|
||||
await openNotificationSettings(page);
|
||||
await setPluginNotificationSwitch(page, "Build alerts", false);
|
||||
await clearRecordedBrowserNotifications(page);
|
||||
|
||||
const mutedResult = (await seeded.client.invokePluginRpc(
|
||||
"notifications-example",
|
||||
"alerts.send",
|
||||
{
|
||||
buildId: "205",
|
||||
title: "Build #205 failed",
|
||||
body: "Muted build alert",
|
||||
},
|
||||
)) as { status: string };
|
||||
expect(mutedResult.status).toBe("sent");
|
||||
|
||||
// Trigger an unmuted agent error notification so we prove delivery settled and only
|
||||
// the unmuted notification arrived (Build #205 was suppressed).
|
||||
const sentinelErrorAgentId = await runMockAgentTurn(seeded.client, {
|
||||
cwd: seeded.repoPath,
|
||||
workspaceId: seeded.workspaceId,
|
||||
title: "Sentinel unmuted error agent",
|
||||
prompt: ERROR_PROMPT,
|
||||
waitForStatus: "error",
|
||||
});
|
||||
|
||||
await expectRecordedAgentNotifications(page, [
|
||||
{ agentId: sentinelErrorAgentId, reason: "error" },
|
||||
]);
|
||||
});
|
||||
} finally {
|
||||
if (installedPlugin) {
|
||||
await seeded.client.removePlugin("notifications-example").catch(() => undefined);
|
||||
}
|
||||
await pluginExample.cleanup().catch(() => undefined);
|
||||
await seeded.cleanup();
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
closeRelayPairing,
|
||||
emptyHome,
|
||||
loadingScreen,
|
||||
openTailscaleDocsFromSetup,
|
||||
expectTailscaleSwitchDisabled,
|
||||
paseoToolsSwitch,
|
||||
pickTheme,
|
||||
projectSuggestion,
|
||||
@@ -105,7 +105,7 @@ test("a new user is walked through setup once", async ({ page }, testInfo) => {
|
||||
await expectSetupStep(page, "Let agents use Paseo");
|
||||
await expect(paseoToolsSwitch(setupModal(page))).toBeChecked();
|
||||
await expect(
|
||||
setupModal(page).getByRole("switch", { name: "Orchestration skills", exact: true }),
|
||||
setupModal(page).getByRole("switch", { name: "Paseo skills", exact: true }),
|
||||
).toBeChecked();
|
||||
await page.screenshot({ path: testInfo.outputPath("4-orchestration.png") });
|
||||
});
|
||||
@@ -403,12 +403,10 @@ test("setup choices carry over to Settings and the phone step pairs over relay",
|
||||
await continueSetup(page);
|
||||
});
|
||||
|
||||
await test.step("Phone offers Tailscale docs and pairs over relay in its own modal", async () => {
|
||||
await test.step("Phone shows a disabled Tailscale switch and pairs over relay", async () => {
|
||||
await expectSetupStep(page, "Take your agents with you");
|
||||
await page.screenshot({ path: testInfo.outputPath("5-phone.png") });
|
||||
expect(await openTailscaleDocsFromSetup(page)).toBe(
|
||||
"https://paseo.sh/docs/connectivity#tailscale",
|
||||
);
|
||||
await expectTailscaleSwitchDisabled(page);
|
||||
const pairing = await openRelayPairingFromSetup(page);
|
||||
await expect(pairing.getByText("Enable relay?", { exact: true })).toBeVisible();
|
||||
await enableRelayAndExpectOffer(page);
|
||||
@@ -419,7 +417,7 @@ test("setup choices carry over to Settings and the phone step pairs over relay",
|
||||
await test.step("Finish closes setup and Settings shows the same Paseo tools value", async () => {
|
||||
await finishSetup(page);
|
||||
await page.locator('[data-testid="sidebar-settings"]:visible').first().click();
|
||||
await openSettingsHostSection(page, host.serverId, "agents");
|
||||
await openSettingsHostSection(page, host.serverId, "tools");
|
||||
await expect(paseoToolsSwitch(page)).toBeChecked();
|
||||
await page.screenshot({ path: testInfo.outputPath("7-settings-agents.png") });
|
||||
});
|
||||
@@ -441,7 +439,7 @@ test("with no skills picked, skills read as off and Continue moves on", async ({
|
||||
await chooseCustomSkills(page, []);
|
||||
await saveSkillSelection(page);
|
||||
const skillsSwitch = setupModal(page).getByRole("switch", {
|
||||
name: "Orchestration skills",
|
||||
name: "Paseo skills",
|
||||
exact: true,
|
||||
});
|
||||
await expect(skillsSwitch).not.toBeChecked();
|
||||
@@ -478,7 +476,7 @@ test("in the compact layout, Finish on Orchestration applies its switches", asyn
|
||||
await step("Let agents use Paseo");
|
||||
await expect(paseoToolsSwitch(page)).toBeChecked();
|
||||
// Skills are not installed, so leaving them off has nothing to apply.
|
||||
const skillsSwitch = page.getByRole("switch", { name: "Orchestration skills", exact: true });
|
||||
const skillsSwitch = page.getByRole("switch", { name: "Paseo skills", exact: true });
|
||||
await skillsSwitch.click();
|
||||
await expect(skillsSwitch).not.toBeChecked();
|
||||
gate.holdNextClientRequest("set_daemon_config_request");
|
||||
|
||||
@@ -1,7 +1,28 @@
|
||||
import { gotoAppShell, openSettings } from "../support/helpers/app";
|
||||
import {
|
||||
addDirectHostFromSettings,
|
||||
openSettingsHostSection,
|
||||
selectSettingsHost,
|
||||
} from "../support/helpers/settings";
|
||||
import { test } from "../support/fixtures";
|
||||
import { startTailscaleTestDaemon } from "../support/helpers/tailscale-daemon";
|
||||
import { startIsolatedHostDaemon } from "../support/helpers/isolated-host-daemon";
|
||||
import {
|
||||
expectPairingOffer,
|
||||
cancelTailscaleTurnOff,
|
||||
confirmTailscaleTurnOff,
|
||||
connectThroughTailscale,
|
||||
disableTailscale,
|
||||
enableTailscale,
|
||||
expectTailscaleAddress,
|
||||
expectTailscaleAvailable,
|
||||
expectTailscaleRowLoadsOn,
|
||||
expectTailscaleUnavailable,
|
||||
observeDaemonStatusPolling,
|
||||
openSetupMobileStep,
|
||||
refreshTailscaleAvailability,
|
||||
slowConnectionToHost,
|
||||
expectTailscaleUpdateRequired,
|
||||
expectCompletePairingQr,
|
||||
expectRelayConsent,
|
||||
openPairDeviceModal,
|
||||
@@ -37,3 +58,115 @@ test("keeps the pairing QR code inside its compact tile", async ({ page }, testI
|
||||
await daemon.close();
|
||||
}
|
||||
});
|
||||
|
||||
test("asks for a host update when Tailscale controls are unavailable", async ({ page }) => {
|
||||
const daemon = await startIsolatedHostDaemon("pair-device-browser-old-host", {
|
||||
publishedVersion: "0.13.0-beta.2",
|
||||
});
|
||||
try {
|
||||
await gotoAppShell(page);
|
||||
await openSettings(page);
|
||||
await addDirectHostFromSettings(page, { host: "127.0.0.1", port: daemon.port });
|
||||
await selectSettingsHost(page, daemon.serverId);
|
||||
await openSettingsHostSection(page, daemon.serverId, "devices");
|
||||
await expectTailscaleUpdateRequired(page);
|
||||
} finally {
|
||||
await daemon.close();
|
||||
}
|
||||
});
|
||||
|
||||
test("turns Tailscale on and off from Devices, asking first over Tailscale", async ({
|
||||
page,
|
||||
baseURL,
|
||||
}, testInfo) => {
|
||||
test.skip(process.platform !== "linux", "Uses a second IPv4 loopback address");
|
||||
// The journey opens Devices or the setup six times, two of them over a slowed connection.
|
||||
test.setTimeout(120_000);
|
||||
if (!baseURL) throw new Error("Expected the app base URL");
|
||||
const daemon = await startTailscaleTestDaemon(baseURL);
|
||||
try {
|
||||
await preparePairingHost(page, daemon);
|
||||
await enableTailscale(page);
|
||||
await expectTailscaleAddress(page, daemon.tailscaleAddress);
|
||||
await page.screenshot({ path: testInfo.outputPath("devices.png") });
|
||||
|
||||
await test.step("While its status loads, the row never shows Tailscale off", async () => {
|
||||
const address = daemon.tailscaleAddress;
|
||||
await expectTailscaleRowLoadsOn(page, address, () => preparePairingHost(page, daemon));
|
||||
await expectTailscaleRowLoadsOn(page, address, () => openSetupMobileStep(page, daemon));
|
||||
const restoreSpeed = await slowConnectionToHost(page, daemon.port, 300);
|
||||
await expectTailscaleRowLoadsOn(page, address, () => openSetupMobileStep(page, daemon));
|
||||
await expectTailscaleRowLoadsOn(page, address, () => preparePairingHost(page, daemon));
|
||||
await test.step("Turning Tailscale off and back on settles over a slow connection", async () => {
|
||||
await disableTailscale(page, address);
|
||||
await enableTailscale(page);
|
||||
await expectTailscaleAddress(page, address);
|
||||
});
|
||||
restoreSpeed();
|
||||
});
|
||||
|
||||
await disableTailscale(page, daemon.tailscaleAddress);
|
||||
|
||||
await test.step("Over Tailscale, turning it off asks first and Cancel changes nothing", async () => {
|
||||
await enableTailscale(page);
|
||||
await connectThroughTailscale(page, daemon);
|
||||
await cancelTailscaleTurnOff(page, daemon.tailscaleAddress);
|
||||
});
|
||||
await test.step("Confirming turns it off and cuts this connection", async () => {
|
||||
await confirmTailscaleTurnOff(page, daemon.tailscaleAddress);
|
||||
});
|
||||
} finally {
|
||||
await daemon.close();
|
||||
}
|
||||
});
|
||||
|
||||
test("refreshes Tailscale availability in place after Tailscale starts", async ({
|
||||
page,
|
||||
baseURL,
|
||||
}) => {
|
||||
test.skip(process.platform !== "linux", "Uses a second IPv4 loopback address");
|
||||
test.setTimeout(120_000);
|
||||
if (!baseURL) throw new Error("Expected the app base URL");
|
||||
const daemon = await startTailscaleTestDaemon(baseURL, { initialAvailable: false });
|
||||
const statusPolling = observeDaemonStatusPolling(page, daemon.port);
|
||||
try {
|
||||
await preparePairingHost(page, daemon);
|
||||
await expectTailscaleUnavailable(page);
|
||||
|
||||
await test.step("Refreshing while still unavailable shows progress and stays unavailable", async () => {
|
||||
const restoreSpeed = await slowConnectionToHost(page, daemon.port, 250);
|
||||
await preparePairingHost(page, daemon);
|
||||
await expectTailscaleUnavailable(page);
|
||||
await refreshTailscaleAvailability(page);
|
||||
await page.getByRole("button", { name: "Refreshing...", exact: true }).waitFor();
|
||||
await expectTailscaleUnavailable(page);
|
||||
restoreSpeed();
|
||||
});
|
||||
|
||||
await test.step("Refreshing after Tailscale starts enables the switch in place", async () => {
|
||||
await statusPolling.waitForFreshPollWindow();
|
||||
await daemon.setTailscaleAvailable(true);
|
||||
const refreshRequest = statusPolling.waitForStatusRequest(1_000);
|
||||
await refreshTailscaleAvailability(page);
|
||||
await refreshRequest;
|
||||
await expectTailscaleAvailable(page, { timeout: 1_000 });
|
||||
await enableTailscale(page);
|
||||
await expectTailscaleAddress(page, daemon.tailscaleAddress);
|
||||
await disableTailscale(page, daemon.tailscaleAddress);
|
||||
});
|
||||
|
||||
await test.step("Setup mobile step also refreshes Tailscale availability in place", async () => {
|
||||
await daemon.setTailscaleAvailable(false);
|
||||
await openSetupMobileStep(page, daemon);
|
||||
await expectTailscaleUnavailable(page);
|
||||
await statusPolling.waitForFreshPollWindow();
|
||||
await daemon.setTailscaleAvailable(true);
|
||||
const refreshRequest = statusPolling.waitForStatusRequest(1_000);
|
||||
await refreshTailscaleAvailability(page);
|
||||
await refreshRequest;
|
||||
await expectTailscaleAvailable(page, { timeout: 1_000 });
|
||||
});
|
||||
} finally {
|
||||
await daemon.close();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -33,7 +33,7 @@ function askAgain(page: Page) {
|
||||
|
||||
async function openFilesSettings(page: Page) {
|
||||
await openSettings(page);
|
||||
await openSettingsSection(page, "files");
|
||||
await openSettingsSection(page, "chat");
|
||||
await expect(page.getByTestId("file-panel-settings")).toBeVisible();
|
||||
}
|
||||
|
||||
@@ -91,6 +91,7 @@ test("Settings > Files chooses which panel opens .md and asks again on request",
|
||||
await page.setViewportSize({ width: 390, height: 844 });
|
||||
await page.goto("/settings/files");
|
||||
await expect(markdownDropdown(page, PLUGIN_MARKDOWN_OPTION)).toBeVisible({ timeout: 30_000 });
|
||||
await askAgain(page).scrollIntoViewIfNeeded();
|
||||
await expect(askAgain(page)).toBeInViewport({ ratio: 1 });
|
||||
await capture(page, testInfo, "file-panel-settings-compact");
|
||||
await markdownDropdown(page, PLUGIN_MARKDOWN_OPTION).click();
|
||||
@@ -113,22 +114,20 @@ test("Settings > Files chooses which panel opens .md and asks again on request",
|
||||
}
|
||||
});
|
||||
|
||||
test("Settings > Files explains where file panels come from when no plugin adds one", async ({
|
||||
test("Settings > Chat & panes hides file panels when no plugin adds one", async ({
|
||||
page,
|
||||
}, testInfo) => {
|
||||
await page.setViewportSize({ width: 1280, height: 900 });
|
||||
await page.goto("/settings/files");
|
||||
const empty = page.getByTestId("file-panel-settings-empty");
|
||||
await expect(empty).toHaveText("File panels appear here when a plugin adds one", {
|
||||
timeout: 30_000,
|
||||
});
|
||||
await expect(page).toHaveURL(/\/settings\/chat$/);
|
||||
await expect(page.getByTestId("file-panel-settings")).toHaveCount(0);
|
||||
await capture(page, testInfo, "file-panel-settings-empty-wide");
|
||||
await page.setViewportSize({ width: 390, height: 844 });
|
||||
await expect(empty).toBeVisible();
|
||||
await expect(page.getByTestId("file-panel-settings")).toHaveCount(0);
|
||||
await capture(page, testInfo, "file-panel-settings-empty-compact");
|
||||
});
|
||||
|
||||
test("Settings > Files offers Source in place of a panel no host has, and forgets it", async ({
|
||||
test("Settings > Chat & panes offers Source in place of a panel no host has, and forgets it", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.addInitScript(() => {
|
||||
@@ -146,5 +145,5 @@ test("Settings > Files offers Source in place of a panel no host has, and forget
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(page.getByRole("menuitem", { name: SOURCE_OPTION })).toBeHidden();
|
||||
await row.getByRole("button", { name: "Ask again for .pdf", exact: true }).click();
|
||||
await expect(page.getByTestId("file-panel-settings-empty")).toBeVisible();
|
||||
await expect(page.getByTestId("file-panel-settings")).toHaveCount(0);
|
||||
});
|
||||
|
||||
@@ -3,7 +3,7 @@ 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";
|
||||
import { openClientHostSettings } from "../support/helpers/settings";
|
||||
|
||||
const REGISTRY_KEY = "@paseo:daemon-registry";
|
||||
const SEED_NONCE_KEY = "@paseo:e2e-seed-nonce";
|
||||
@@ -87,8 +87,7 @@ test("saved hosts survive a registry entry this build can't read, and saving kee
|
||||
|
||||
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 openClientHostSettings(page, OFFLINE_HOST.serverId);
|
||||
await renameHostFromSettings(page, "Renamed offline host");
|
||||
|
||||
await expect
|
||||
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
expectProviderNotOnHost,
|
||||
expectProviderPageLoaded,
|
||||
gotoProviderPage,
|
||||
openClientHostSettings,
|
||||
openSettingsHost,
|
||||
openHostSection,
|
||||
expectHostLabelDisplayed,
|
||||
@@ -53,36 +54,30 @@ test.describe("Settings host page", () => {
|
||||
const port = getE2EDaemonPort();
|
||||
await gotoAppShell(page);
|
||||
await openSettings(page);
|
||||
await openSettingsHost(page, serverId);
|
||||
await test.step("connections section shows the seeded connection endpoint", async () => {
|
||||
await expectSettingsHeader(page, "Connections");
|
||||
await test.step("client host detail shows the seeded connection endpoint and label editor", async () => {
|
||||
await openClientHostSettings(page, serverId);
|
||||
await expectHostConnectionsCard(page, port);
|
||||
await expectHostLabelDisplayed(page);
|
||||
await clickEditHostLabel(page);
|
||||
await expectHostLabelEditMode(page, TEST_HOST_LABEL);
|
||||
await page.keyboard.press("Escape");
|
||||
});
|
||||
await test.step("agents section shows the inject MCP toggle", async () => {
|
||||
await openHostSection(page, serverId, "agents");
|
||||
await expectSettingsHeader(page, "Agents");
|
||||
await test.step("tools section shows the inject MCP toggle", async () => {
|
||||
await openHostSection(page, serverId, "tools");
|
||||
await expectSettingsHeader(page, "Tools & prompts");
|
||||
await expectHostInjectMcpCard(page);
|
||||
});
|
||||
await test.step("providers section shows the providers card", async () => {
|
||||
await expectHostProvidersCard(page, serverId);
|
||||
await expectSettingsHeader(page, "Providers");
|
||||
});
|
||||
await test.step("host section shows the host label and restart/remove action cards", async () => {
|
||||
await openHostSection(page, serverId, "host");
|
||||
await expectSettingsHeader(page, "Overview");
|
||||
await expectHostLabelDisplayed(page);
|
||||
await test.step("daemon section shows restart and client host shows remove", async () => {
|
||||
await openHostSection(page, serverId, "daemon");
|
||||
await expectSettingsHeader(page, "Daemon");
|
||||
await expectHostActionCards(page, serverId);
|
||||
});
|
||||
await test.step("clicking the label pencil reveals the inline editor", async () => {
|
||||
await openHostSection(page, serverId, "host");
|
||||
|
||||
await expectHostLabelDisplayed(page);
|
||||
await clickEditHostLabel(page);
|
||||
await expectHostLabelEditMode(page, TEST_HOST_LABEL);
|
||||
await page.keyboard.press("Escape");
|
||||
});
|
||||
await test.step("host section does not render daemon lifecycle controls for a remote daemon", async () => {
|
||||
await openHostSection(page, serverId, "host");
|
||||
await test.step("daemon section does not render daemon lifecycle controls for a remote daemon", async () => {
|
||||
await openHostSection(page, serverId, "daemon");
|
||||
|
||||
await expectHostNoDaemonLifecycleRow(page);
|
||||
});
|
||||
@@ -99,7 +94,7 @@ test.describe("Settings host page", () => {
|
||||
await page.reload();
|
||||
await openSettings(page);
|
||||
await openSettingsHost(page, outdatedDaemon.serverId);
|
||||
await openHostSection(page, outdatedDaemon.serverId, "host");
|
||||
await openHostSection(page, outdatedDaemon.serverId, "daemon");
|
||||
|
||||
page.once("dialog", (dialog) => dialog.accept());
|
||||
const updateButton = page.getByTestId("host-page-update-button");
|
||||
@@ -138,8 +133,7 @@ test.describe("Settings host page", () => {
|
||||
]);
|
||||
await page.reload();
|
||||
await openSettings(page);
|
||||
await selectSettingsHost(page, daemon.serverId);
|
||||
await openHostSection(page, daemon.serverId, "host");
|
||||
await openClientHostSettings(page, daemon.serverId);
|
||||
|
||||
await test.step("the host page shows the reason and the re-add guidance, with no password UI", async () => {
|
||||
await expectHostRejectedWithReAddGuidance(page, "Password required");
|
||||
@@ -149,7 +143,7 @@ test.describe("Settings host page", () => {
|
||||
await test.step("removing the host and adding it again with the password brings it online", async () => {
|
||||
await removeHostFromHostPage(page, daemon.serverId);
|
||||
await addDirectHostFromSettings(page, { host: "127.0.0.1", port: daemon.port, password });
|
||||
await openHostSection(page, daemon.serverId, "host");
|
||||
await openHostSection(page, daemon.serverId, "daemon");
|
||||
await expectHostOnlineWithoutError(page);
|
||||
});
|
||||
} finally {
|
||||
@@ -192,7 +186,7 @@ test.describe("Settings host page", () => {
|
||||
await page.reload();
|
||||
await openSettings(page);
|
||||
await selectSettingsHost(page, serverId);
|
||||
await openHostSection(page, serverId, "agents");
|
||||
await openHostSection(page, serverId, "daemon");
|
||||
};
|
||||
try {
|
||||
await test.step("idle agent release starts on and turns off", async () => {
|
||||
@@ -213,7 +207,7 @@ test.describe("Settings host page", () => {
|
||||
|
||||
await test.step("other hosts keep their own setting", async () => {
|
||||
await selectSettingsHost(page, primaryServerId);
|
||||
await openHostSection(page, primaryServerId, "agents");
|
||||
await openHostSection(page, primaryServerId, "daemon");
|
||||
await expectIdleAgentRelease(page, true);
|
||||
await expectLiveSavedSetting(false);
|
||||
});
|
||||
@@ -232,7 +226,7 @@ test.describe("Settings host page", () => {
|
||||
]);
|
||||
await page.reload();
|
||||
await openSettings(page);
|
||||
await openHostSection(page, daemon.serverId, "agents");
|
||||
await openHostSection(page, daemon.serverId, "daemon");
|
||||
await expectIdleAgentRelease(page, true);
|
||||
// A real filesystem failure, with the daemon and RPC path intact.
|
||||
await rename(configPath, `${configPath}.saved`);
|
||||
@@ -251,7 +245,7 @@ test.describe("Settings host page", () => {
|
||||
}
|
||||
});
|
||||
|
||||
test("navigating to /settings/hosts/[serverId] redirects to the connections section", async ({
|
||||
test("navigating to /settings/hosts/[serverId] redirects to the daemon section", async ({
|
||||
page,
|
||||
}) => {
|
||||
const serverId = getServerId();
|
||||
@@ -260,10 +254,9 @@ test.describe("Settings host page", () => {
|
||||
await page.goto(`/settings/hosts/${encodeURIComponent(serverId)}`);
|
||||
|
||||
await expectHostPageVisible(page, serverId);
|
||||
await expectSettingsHeader(page, "Connections");
|
||||
await openHostSection(page, serverId, "host");
|
||||
await expectHostLabelDisplayed(page);
|
||||
await expectSettingsHeader(page, "Daemon");
|
||||
await expectHostActionCards(page, serverId);
|
||||
await expectHostLabelDisplayed(page);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -286,7 +279,7 @@ test("restart recovery defaults off and persists opt-in and custom prompt", asyn
|
||||
await gotoAppShell(page);
|
||||
await openSettings(page);
|
||||
await openSettingsHost(page, serverId);
|
||||
await openHostSection(page, serverId, "agents");
|
||||
await openHostSection(page, serverId, "daemon");
|
||||
await expectRestartRecoveryEnabled(page, false);
|
||||
await setRestartRecoveryEnabled(page, true);
|
||||
await page.reload();
|
||||
@@ -354,12 +347,12 @@ test("sidebar Add host completes without navigating", async ({ page }) => {
|
||||
await expect(page.getByRole("button", { name: "Hosts", exact: true })).toBeVisible();
|
||||
});
|
||||
|
||||
test("Settings Add host opens the saved host Overview", async ({ page }) => {
|
||||
test("Settings Add host opens the saved host detail", async ({ page }) => {
|
||||
await gotoAppShell(page);
|
||||
await openSettings(page);
|
||||
await addDirectHostFromSettings(page, { host: "127.0.0.1", port: Number(getE2EDaemonPort()) });
|
||||
await expectSettingsHeader(page, "Overview");
|
||||
await expect(page).toHaveURL(new RegExp(`/settings/hosts/${getServerId()}/host$`));
|
||||
await expect(page.getByTestId("host-page-connections-card")).toBeVisible();
|
||||
await expect(page).toHaveURL(new RegExp(`/settings/device-hosts/${getServerId()}$`));
|
||||
});
|
||||
|
||||
test("New workspace Add host preserves the prompt after connecting", async ({ page }) => {
|
||||
|
||||
@@ -46,15 +46,15 @@ test.describe("Settings host selection", () => {
|
||||
|
||||
await openSettings(page);
|
||||
|
||||
await openSettingsHostSection(page, remoteDaemon.serverId, "connections");
|
||||
await openSettingsHostSection(page, remoteDaemon.serverId, "daemon");
|
||||
|
||||
await selectSettingsHost(page, getServerId());
|
||||
await openSettingsSection(page, "appearance");
|
||||
await openSettingsHostSection(page, getServerId(), "connections");
|
||||
await openSettingsHostSection(page, getServerId(), "daemon");
|
||||
|
||||
await clickSettingsBackToWorkspace(page);
|
||||
await openSettings(page);
|
||||
await openSettingsHostSection(page, remoteDaemon.serverId, "connections");
|
||||
await openSettingsHostSection(page, remoteDaemon.serverId, "daemon");
|
||||
} finally {
|
||||
await remoteWorkspace.cleanup().catch(() => undefined);
|
||||
await remoteDaemon.close().catch(() => undefined);
|
||||
|
||||
@@ -9,17 +9,17 @@ test("Settings language selector switches General labels", async ({ page }) => {
|
||||
await openSettings(page);
|
||||
await openSettingsSection(page, "general");
|
||||
|
||||
await expect(page.getByText("Default send", { exact: true }).first()).toBeVisible();
|
||||
await expect(page.getByText("Language", { exact: true }).first()).toBeVisible();
|
||||
|
||||
await page.getByRole("button", { name: "System", exact: true }).click();
|
||||
await page.getByRole("menuitem", { name: "简体中文 - Simplified Chinese", exact: true }).click();
|
||||
|
||||
await expect(page.getByText("默认发送", { exact: true }).first()).toBeVisible();
|
||||
await expect(page.getByText("语言", { exact: true }).first()).toBeVisible();
|
||||
|
||||
await page.getByRole("button", { name: "简体中文", exact: true }).click();
|
||||
await page.getByRole("menuitem", { name: "English - 英语", exact: true }).click();
|
||||
|
||||
await expect(page.getByText("Default send", { exact: true }).first()).toBeVisible();
|
||||
await expect(page.getByText("Language", { exact: true }).first()).toBeVisible();
|
||||
});
|
||||
|
||||
test("Settings language selector switches to Korean", async ({ page }) => {
|
||||
@@ -32,10 +32,10 @@ test("Settings language selector switches to Korean", async ({ page }) => {
|
||||
await page.getByRole("button", { name: "System", exact: true }).click();
|
||||
await page.getByRole("menuitem", { name: "한국어 - Korean", exact: true }).click();
|
||||
|
||||
await expect(page.getByText("기본 전송", { exact: true }).first()).toBeVisible();
|
||||
await expect(page.getByText("언어", { exact: true }).first()).toBeVisible();
|
||||
|
||||
await page.getByRole("button", { name: "한국어", exact: true }).click();
|
||||
await page.getByRole("menuitem", { name: "English - 영어", exact: true }).click();
|
||||
|
||||
await expect(page.getByText("Default send", { exact: true }).first()).toBeVisible();
|
||||
await expect(page.getByText("Language", { exact: true }).first()).toBeVisible();
|
||||
});
|
||||
|
||||
@@ -62,6 +62,7 @@ import {
|
||||
seedSavedSettingsHosts,
|
||||
selectSettingsHost,
|
||||
expectSettingsHostPickerLabel,
|
||||
openClientHostSettings,
|
||||
openSettingsHostSection,
|
||||
removeCurrentHostFromSettings,
|
||||
openSidebarHostPicker,
|
||||
@@ -176,28 +177,28 @@ test.describe("Settings sidebar scroll position", () => {
|
||||
}
|
||||
|
||||
const sidebar = page.getByTestId("settings-sidebar");
|
||||
const appScrollTop = await revealSettingsSidebarSection(page, "diagnostics");
|
||||
const appScrollTop = await revealSettingsSidebarSection(page, "about");
|
||||
await expect(sidebar.getByRole("button", { name: "About", exact: true })).toBeInViewport();
|
||||
|
||||
await openSettingsSection(page, "about");
|
||||
await expectAboutContent(page);
|
||||
await expectDiagnosticsContent(page);
|
||||
await expectSettingsSidebarScrollOffset(page, appScrollTop);
|
||||
|
||||
await openSettingsSection(page, "diagnostics");
|
||||
await expectDiagnosticsContent(page);
|
||||
await openSettingsSection(page, "shortcuts");
|
||||
await expectSettingsSidebarScrollOffset(page, appScrollTop);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test.describe("Settings sidebar navigation", () => {
|
||||
test("the sidebar host row opens Overview in one click", async ({ page, withWorkspace }) => {
|
||||
test("the sidebar host row opens Daemon in one click", async ({ page, withWorkspace }) => {
|
||||
const workspace = await withWorkspace({ prefix: "sidebar-host-settings-" });
|
||||
await openWorkspace(page, workspace);
|
||||
await openSidebarHostPicker(page);
|
||||
await sidebarHostRowButton(page).click();
|
||||
|
||||
await expectAppRoute(page, buildSettingsHostSectionRoute(getServerId(), "host"));
|
||||
await expectAppRoute(page, buildSettingsHostSectionRoute(getServerId(), "daemon"));
|
||||
});
|
||||
|
||||
test("Enter opens the active sidebar host row", async ({ page, withWorkspace }) => {
|
||||
@@ -207,7 +208,7 @@ test.describe("Settings sidebar navigation", () => {
|
||||
await openSidebarHostPicker(page);
|
||||
await activateSidebarHostSettingsWithKeyboard(page);
|
||||
|
||||
await expectAppRoute(page, buildSettingsHostSectionRoute(getServerId(), "host"));
|
||||
await expectAppRoute(page, buildSettingsHostSectionRoute(getServerId(), "daemon"));
|
||||
});
|
||||
|
||||
test("opening Settings closes the composer model selector until it is opened again", async ({
|
||||
@@ -282,13 +283,10 @@ test.describe("Settings sidebar navigation", () => {
|
||||
await gotoAppShell(page);
|
||||
await openSettings(page);
|
||||
|
||||
await openSettingsSection(page, "diagnostics");
|
||||
await expectSettingsHeader(page, "Diagnostics");
|
||||
await expectDiagnosticsContent(page);
|
||||
|
||||
await openSettingsSection(page, "about");
|
||||
await expectSettingsHeader(page, "About");
|
||||
await expectAboutContent(page);
|
||||
await expectDiagnosticsContent(page);
|
||||
|
||||
await openSettingsSection(page, "general");
|
||||
await expectSettingsHeader(page, "General");
|
||||
@@ -313,18 +311,18 @@ test.describe("Settings sidebar navigation", () => {
|
||||
await gotoAppShell(page);
|
||||
await openSettings(page);
|
||||
await selectSettingsHost(page, secondaryServerId);
|
||||
await openSettingsHostSection(page, secondaryServerId, "connections");
|
||||
await openSettingsHostSection(page, secondaryServerId, "daemon");
|
||||
await openSettingsSection(page, "appearance");
|
||||
await expectSettingsHostPickerLabel(page, "Stable horse");
|
||||
await openSettingsSection(page, "general");
|
||||
await expectSettingsHostPickerLabel(page, "Stable horse");
|
||||
await openSettingsHostSection(page, secondaryServerId, "connections");
|
||||
await openSettingsHostSection(page, secondaryServerId, "daemon");
|
||||
await selectSettingsHost(page, primaryServerId);
|
||||
await openSettingsSection(page, "about");
|
||||
await expectSettingsHostPickerLabel(page, "First horse");
|
||||
});
|
||||
|
||||
test("/h/[serverId]/settings redirects to the host connections section", async ({ page }) => {
|
||||
test("/h/[serverId]/settings redirects to the host daemon section", async ({ page }) => {
|
||||
await gotoAppShell(page);
|
||||
await verifyLegacyHostSettingsRedirect(page);
|
||||
});
|
||||
@@ -528,12 +526,12 @@ test.describe("Settings — compact master-detail", () => {
|
||||
await gotoAppShell(page);
|
||||
await openCompactSettings(page, buildOpenProjectRoute());
|
||||
|
||||
await expectSettingsSidebarSections(page, ["general", "diagnostics", "about"]);
|
||||
await expectSettingsSidebarSections(page, ["general", "hosts", "about"]);
|
||||
await expectCompactSettingsList(page);
|
||||
|
||||
await test.step("open app details and return to the list", async () => {
|
||||
await openSettingsSection(page, "diagnostics");
|
||||
await expectAppRoute(page, buildSettingsSectionRoute("diagnostics"));
|
||||
await openSettingsSection(page, "about");
|
||||
await expectAppRoute(page, buildSettingsSectionRoute("about"));
|
||||
await expectDiagnosticsContent(page);
|
||||
await expectSettingsSidebarHidden(page);
|
||||
await expectSettingsBackButton(page);
|
||||
@@ -554,7 +552,7 @@ test.describe("Settings — compact master-detail", () => {
|
||||
});
|
||||
});
|
||||
|
||||
test("host picker settings opens Overview and backs through the settings list", async ({
|
||||
test("host picker settings opens Daemon and backs through the settings list", async ({
|
||||
page,
|
||||
withWorkspace,
|
||||
}) => {
|
||||
@@ -566,8 +564,8 @@ test.describe("Settings — compact master-detail", () => {
|
||||
await page.getByTestId("sidebar-hosts-trigger").click();
|
||||
await sidebarHostRowButton(page).click();
|
||||
|
||||
await expectAppRoute(page, buildSettingsHostSectionRoute(getServerId(), "host"));
|
||||
await expect(page.getByText("Overview", { exact: true })).toBeVisible();
|
||||
await expectAppRoute(page, buildSettingsHostSectionRoute(getServerId(), "daemon"));
|
||||
await expect(page.getByText("Daemon", { exact: true }).first()).toBeVisible();
|
||||
|
||||
await goBackInSettings(page);
|
||||
await expectCompactSettingsList(page);
|
||||
@@ -597,14 +595,14 @@ test.describe("Settings — compact master-detail", () => {
|
||||
await expectSettingsSidebarVisible(page);
|
||||
await expectSettingsHostPickerLabel(page, secondaryHostLabel);
|
||||
|
||||
await openSettingsHostSection(page, secondaryServerId, "connections");
|
||||
await openSettingsHostSection(page, secondaryServerId, "daemon");
|
||||
await goBackInSettings(page);
|
||||
await expectSettingsHostPickerLabel(page, secondaryHostLabel);
|
||||
|
||||
await openSettingsSection(page, "appearance");
|
||||
await goBackInSettings(page);
|
||||
await expectSettingsHostPickerLabel(page, secondaryHostLabel);
|
||||
await openSettingsHostSection(page, secondaryServerId, "connections");
|
||||
await openSettingsHostSection(page, secondaryServerId, "daemon");
|
||||
await goBackInSettings(page);
|
||||
await expectSettingsHostPickerLabel(page, secondaryHostLabel);
|
||||
});
|
||||
@@ -617,8 +615,9 @@ test.describe("Settings — compact master-detail", () => {
|
||||
|
||||
await openWorkspace(page, workspace);
|
||||
await openCompactSettings(page, buildHostWorkspaceRoute(getServerId(), workspace.workspaceId));
|
||||
await openSettingsHostSection(page, getServerId(), "host");
|
||||
await openClientHostSettings(page, getServerId());
|
||||
await removeCurrentHostFromSettings(page);
|
||||
await goBackInSettings(page);
|
||||
await closeCompactSettings(page);
|
||||
|
||||
await expect(page).toHaveURL(/\/welcome$/);
|
||||
|
||||
@@ -5,6 +5,7 @@ import { createMockIdleAgent, openWorkspaceWithAgents } from "../support/helpers
|
||||
import { waitForTabBar, expectAgentTabActive } from "../support/helpers/launcher";
|
||||
import { seedWorkspace } from "../support/helpers/seed-client";
|
||||
import { getServerId } from "../support/helpers/server-id";
|
||||
import { openSettingsSection } from "../support/helpers/settings";
|
||||
|
||||
async function pressSettingsToggleShortcut(page: import("@playwright/test").Page) {
|
||||
const modifier = process.platform === "darwin" ? "Meta" : "Control";
|
||||
@@ -134,6 +135,7 @@ test.describe("Settings toggle tab regression", () => {
|
||||
|
||||
await pressSettingsToggleShortcut(page);
|
||||
await expect(page).toHaveURL(/\/settings\/general$/);
|
||||
await openSettingsSection(page, "chat");
|
||||
|
||||
const defaultSendTrigger = page.getByRole("button", {
|
||||
name: "Default send: Steer",
|
||||
@@ -324,6 +326,7 @@ test("send shortcut selection persists and controls the composer", async ({ page
|
||||
});
|
||||
await test.step("choose the explicit modifier shortcut and retain it after reload", async () => {
|
||||
await pressSettingsToggleShortcut(page);
|
||||
await openSettingsSection(page, "chat");
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Send shortcut: Enter", exact: true }),
|
||||
).toBeVisible();
|
||||
@@ -351,6 +354,7 @@ test("send shortcut selection persists and controls the composer", async ({ page
|
||||
});
|
||||
await test.step("switch back to Enter without changing the default send behavior", async () => {
|
||||
await pressSettingsToggleShortcut(page);
|
||||
await openSettingsSection(page, "chat");
|
||||
await selectSendingOption(page, "Send shortcut", "Enter");
|
||||
await pressSettingsToggleShortcut(page);
|
||||
await composer.fill("Shift still edits");
|
||||
@@ -375,6 +379,7 @@ for (const behavior of ["Steer", "Interrupt", "Queue"] as const) {
|
||||
await openAgentRoute(page, agent);
|
||||
await expect(page.getByRole("textbox", { name: "Message agent..." })).toBeVisible();
|
||||
await pressSettingsToggleShortcut(page);
|
||||
await openSettingsSection(page, "chat");
|
||||
await selectSendingOption(page, "Send shortcut", `${modifierLabel}+Enter`);
|
||||
await selectSendingOption(page, "Default send", behavior);
|
||||
await pressSettingsToggleShortcut(page);
|
||||
|
||||
@@ -175,7 +175,7 @@ test("searches keyboard shortcuts from the sidebar help menu", async ({ page })
|
||||
test("keeps diagnostics available from Settings after globalizing the sheet", async ({ page }) => {
|
||||
await gotoAppShell(page);
|
||||
await openSettings(page);
|
||||
await openSettingsSection(page, "diagnostics");
|
||||
await openSettingsSection(page, "about");
|
||||
|
||||
await page.getByRole("button", { name: "Run", exact: true }).click();
|
||||
await expectDiagnosticReport(page);
|
||||
|
||||
@@ -210,14 +210,14 @@ async function simulateDamagedLegacyDirectoryCache(
|
||||
return;
|
||||
}
|
||||
const stored = JSON.parse(checkpoint.payload);
|
||||
// Read the cursors from whichever version wrote them, then store them as version 1:
|
||||
// the format whose writer could keep a checkpoint after evicting the rows it describes.
|
||||
// Read the cursors from whichever version wrote them, then store them as version 2:
|
||||
// the format whose writer could keep a checkpoint after another tab evicted its rows.
|
||||
const cursors = typeof stored.version === "number" ? stored.cursors : stored;
|
||||
if (!cursors?.workspaces?.generation) {
|
||||
transaction.abort();
|
||||
return;
|
||||
}
|
||||
store.put({ ...checkpoint, payload: JSON.stringify({ version: 1, cursors }) });
|
||||
store.put({ ...checkpoint, payload: JSON.stringify({ version: 2, cursors }) });
|
||||
for (const row of rows) {
|
||||
if (
|
||||
row.serverId === serverId &&
|
||||
|
||||
@@ -2,6 +2,7 @@ import type { Page } from "@playwright/test";
|
||||
import { expect, test } from "../support/fixtures";
|
||||
import { gotoAppShell } from "../support/helpers/app";
|
||||
import {
|
||||
archiveLocalWorkspaceFromDaemon,
|
||||
archiveWorkspaceFromDaemon,
|
||||
connectNewWorkspaceDaemonClient,
|
||||
createWorktreeViaDaemon,
|
||||
@@ -9,7 +10,12 @@ import {
|
||||
} from "../support/helpers/new-workspace";
|
||||
import { getServerId } from "../support/helpers/server-id";
|
||||
import { expectWorkspaceAbsentFromSidebar } from "../support/helpers/sidebar";
|
||||
import { createMockIdleAgent, openWorkspaceWithAgents } from "../support/helpers/archive-tab";
|
||||
import {
|
||||
createMockIdleAgent,
|
||||
fetchAgentArchivedAt,
|
||||
openSessions,
|
||||
openWorkspaceWithAgents,
|
||||
} from "../support/helpers/archive-tab";
|
||||
import { connectSeedClient } from "../support/helpers/seed-client";
|
||||
import { createTempGitRepo } from "../support/helpers/workspace";
|
||||
import { getWorkspaceTabTestIds } from "../support/helpers/workspace-tabs";
|
||||
@@ -38,6 +44,61 @@ import {
|
||||
waitForWorkspaceInSidebar,
|
||||
} from "../support/helpers/workspace-ui";
|
||||
|
||||
async function clearIndexedDbDatabases(page: Page): Promise<void> {
|
||||
await page.evaluate(async () => {
|
||||
const dbs = (await indexedDB.databases?.()) ?? [];
|
||||
for (const db of dbs) {
|
||||
if (!db.name) continue;
|
||||
await new Promise<void>((resolve) => {
|
||||
const req = indexedDB.deleteDatabase(db.name!);
|
||||
const done = () => resolve();
|
||||
req.addEventListener("success", done, { once: true });
|
||||
req.addEventListener("error", done, { once: true });
|
||||
req.addEventListener("blocked", done, { once: true });
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function delayRefreshAgentRequests(page: Page, delayMs: number): Promise<void> {
|
||||
await page.routeWebSocket(/\/ws/, (ws) => {
|
||||
const server = ws.connectToServer();
|
||||
ws.onMessage((message) => {
|
||||
if (typeof message === "string" && isRefreshAgentRequestMessage(message)) {
|
||||
setTimeout(() => {
|
||||
server.send(message);
|
||||
}, delayMs);
|
||||
return;
|
||||
}
|
||||
server.send(message);
|
||||
});
|
||||
server.onMessage((message) => {
|
||||
ws.send(message);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function isRefreshAgentRequestMessage(message: string): boolean {
|
||||
try {
|
||||
const parsed = JSON.parse(message) as { type?: string; message?: { type?: string } };
|
||||
return (
|
||||
parsed.type === "refresh_agent_request" || parsed.message?.type === "refresh_agent_request"
|
||||
);
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async function isSidebarFooterHitTestable(page: Page): Promise<boolean> {
|
||||
return page.evaluate(() => {
|
||||
const footer = document.querySelector('[data-testid="sidebar-footer"]');
|
||||
if (!(footer instanceof HTMLElement)) return false;
|
||||
const rect = footer.getBoundingClientRect();
|
||||
const topEl = document.elementFromPoint(rect.left + rect.width / 2, rect.top + rect.height / 2);
|
||||
return Boolean(topEl && footer.contains(topEl));
|
||||
});
|
||||
}
|
||||
|
||||
test.describe("Workspace archive undo", () => {
|
||||
let client: Awaited<ReturnType<typeof connectNewWorkspaceDaemonClient>>;
|
||||
let tempRepo: { path: string; cleanup: () => Promise<void> };
|
||||
@@ -296,6 +357,12 @@ test.describe("Workspace archive undo", () => {
|
||||
await createMockIdleAgent(seedClient, { ...target, title: "first" }),
|
||||
await createMockIdleAgent(seedClient, { ...target, title: "second" }),
|
||||
] as const;
|
||||
const preArchivedAgent = await createMockIdleAgent(seedClient, {
|
||||
...target,
|
||||
title: "pre-archived",
|
||||
});
|
||||
await seedClient.archiveAgent(preArchivedAgent.id);
|
||||
await expect.poll(() => fetchAgentArchivedAt(seedClient, preArchivedAgent.id)).not.toBeNull();
|
||||
await openWorkspaceWithAgents(page, [agents[0], agents[1]]);
|
||||
const tabsBefore = await getWorkspaceTabTestIds(page);
|
||||
|
||||
@@ -308,9 +375,66 @@ test.describe("Workspace archive undo", () => {
|
||||
for (const agent of agents) {
|
||||
await expect(page.getByTestId(`workspace-tab-agent_${agent.id}`).first()).toBeVisible();
|
||||
}
|
||||
await expect(
|
||||
page.getByTestId("agent-unarchiving-callout").filter({ visible: true }),
|
||||
).toHaveCount(1);
|
||||
await expect(page.getByRole("button", { name: "Unarchive", exact: true })).toHaveCount(0);
|
||||
|
||||
// Opening an agent that was already archived before the workspace archive still shows
|
||||
// the manual Unarchive callout rather than claiming it is unarchiving with the workspace.
|
||||
await openSessions(page);
|
||||
await page.getByTestId(`agent-row-${getServerId()}-${preArchivedAgent.id}`).click();
|
||||
await expect(page.getByTestId("agent-archived-callout")).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "Unarchive", exact: true })).toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId("agent-unarchiving-callout").filter({ visible: true }),
|
||||
).toHaveCount(0);
|
||||
|
||||
await page.getByTestId(`workspace-tab-agent_${agents[0].id}`).first().click();
|
||||
await expect(
|
||||
page.getByTestId("agent-unarchiving-callout").filter({ visible: true }),
|
||||
).toHaveCount(1);
|
||||
|
||||
await page.evaluate(() => {
|
||||
const win = window as unknown as Record<string, unknown>;
|
||||
let sawAgentLoading = false;
|
||||
let running = true;
|
||||
const isVisible = (el: Element | null) => {
|
||||
if (!el || !(el instanceof HTMLElement)) return false;
|
||||
const rect = el.getBoundingClientRect();
|
||||
if (rect.width === 0 || rect.height === 0) return false;
|
||||
const style = getComputedStyle(el);
|
||||
return style.display !== "none" && style.visibility !== "hidden" && style.opacity !== "0";
|
||||
};
|
||||
const tick = () => {
|
||||
if (!running) return;
|
||||
if (
|
||||
Array.from(document.querySelectorAll('[data-testid="agent-loading"]')).some(isVisible)
|
||||
) {
|
||||
sawAgentLoading = true;
|
||||
}
|
||||
requestAnimationFrame(tick);
|
||||
};
|
||||
win.__stopMidUndoLoadingCheck = () => {
|
||||
running = false;
|
||||
return sawAgentLoading;
|
||||
};
|
||||
requestAnimationFrame(tick);
|
||||
});
|
||||
|
||||
teardown.release();
|
||||
await expectHostWorkspaceSettledActive(client, worktree.workspaceId);
|
||||
await expect.poll(() => getWorkspaceTabTestIds(page)).toEqual(tabsBefore);
|
||||
await expect(page.getByRole("textbox", { name: "Message agent..." })).toBeEditable({
|
||||
timeout: 30_000,
|
||||
});
|
||||
const sawMidUndoLoading = await page.evaluate(() => {
|
||||
const win = window as unknown as { __stopMidUndoLoadingCheck?: () => boolean };
|
||||
return win.__stopMidUndoLoadingCheck?.();
|
||||
});
|
||||
expect(sawMidUndoLoading).toBe(false);
|
||||
await expect
|
||||
.poll(() => getWorkspaceTabTestIds(page))
|
||||
.toEqual([...tabsBefore, `workspace-tab-agent_${preArchivedAgent.id}`]);
|
||||
} finally {
|
||||
teardown.release();
|
||||
await seedClient.close().catch(() => undefined);
|
||||
@@ -357,4 +481,318 @@ test.describe("Workspace archive undo", () => {
|
||||
await expect(undoButton(page)).toHaveCount(0);
|
||||
await expect(workspaceRow(page, worktree.workspaceId)).toBeVisible();
|
||||
});
|
||||
|
||||
test("unarchiving a workspace with archived agents skips archived-callout and loading flashes", async ({
|
||||
page,
|
||||
}) => {
|
||||
const seedClient = await connectSeedClient();
|
||||
const project = await openProjectViaDaemon(client, tempRepo.path);
|
||||
try {
|
||||
const agent1 = await createMockIdleAgent(seedClient, {
|
||||
cwd: project.workspaceDirectory,
|
||||
workspaceId: project.workspaceId,
|
||||
title: "Atomic restore agent 1",
|
||||
});
|
||||
const agent2 = await createMockIdleAgent(seedClient, {
|
||||
cwd: project.workspaceDirectory,
|
||||
workspaceId: project.workspaceId,
|
||||
title: "Atomic restore agent 2",
|
||||
});
|
||||
// Seed 25 turns so the archived conversation spans multiple timeline pages (hasOlder=true).
|
||||
for (let i = 0; i < 25; i += 1) {
|
||||
await seedClient.sendAgentMessage(
|
||||
agent1.id,
|
||||
`atomic-restore-turn-${i}: emit 1 coalesced agent stream updates`,
|
||||
);
|
||||
await seedClient.waitForFinish(agent1.id, 15_000);
|
||||
}
|
||||
|
||||
await archiveLocalWorkspaceFromDaemon(client, project.workspaceId);
|
||||
await expect.poll(() => fetchAgentArchivedAt(seedClient, agent1.id)).not.toBeNull();
|
||||
await expect.poll(() => fetchAgentArchivedAt(seedClient, agent2.id)).not.toBeNull();
|
||||
|
||||
await gotoAppShell(page);
|
||||
// Clear persisted replica IndexedDB so this tests a true cold restore.
|
||||
await clearIndexedDbDatabases(page);
|
||||
await page.reload();
|
||||
await waitForSidebarHydration(page);
|
||||
await openSessions(page);
|
||||
await page.getByTestId(`agent-row-${getServerId()}-${agent1.id}`).click();
|
||||
await expect(page.getByTestId("workspace-recovery-action")).toHaveText("Unarchive", {
|
||||
timeout: 30_000,
|
||||
});
|
||||
|
||||
// Verify the compact left sidebar overlays the recovery gate rather than painting behind it.
|
||||
const desktopViewport = page.viewportSize() ?? { width: 1280, height: 720 };
|
||||
await page.setViewportSize({ width: 390, height: 720 });
|
||||
await page.getByRole("button", { name: "Open menu", exact: true }).first().click();
|
||||
const sidebarFooter = page.getByTestId("sidebar-footer").first();
|
||||
await expect(sidebarFooter).toBeVisible();
|
||||
await expect.poll(() => isSidebarFooterHitTestable(page)).toBe(true);
|
||||
await page.setViewportSize(desktopViewport);
|
||||
await expect(page.getByTestId("workspace-recovery-action")).toBeVisible();
|
||||
|
||||
await page.evaluate(() => {
|
||||
const win = window as unknown as Record<string, unknown>;
|
||||
const recoveryButton = document.querySelector('[data-testid="workspace-recovery-action"]');
|
||||
const seen = {
|
||||
archivedCallout: false,
|
||||
agentLoading: false,
|
||||
agentInitialFill: false,
|
||||
updatingToast: false,
|
||||
recoveryButtonRemounted: false,
|
||||
firstRevealedTabsCount: -1,
|
||||
firstRevealedRowCount: -1,
|
||||
firstRevealedStreamOpacity: -1,
|
||||
firstRevealedDistanceFromBottom: -1,
|
||||
};
|
||||
let running = true;
|
||||
const isVisible = (el: Element | null) => {
|
||||
if (!el || !(el instanceof HTMLElement)) return false;
|
||||
const rect = el.getBoundingClientRect();
|
||||
if (rect.width === 0 || rect.height === 0) return false;
|
||||
const style = getComputedStyle(el);
|
||||
return style.display !== "none" && style.visibility !== "hidden" && style.opacity !== "0";
|
||||
};
|
||||
const tick = () => {
|
||||
if (!running) return;
|
||||
const currentRecoveryButton = document.querySelector(
|
||||
'[data-testid="workspace-recovery-action"]',
|
||||
);
|
||||
if (currentRecoveryButton && recoveryButton && currentRecoveryButton !== recoveryButton) {
|
||||
seen.recoveryButtonRemounted = true;
|
||||
}
|
||||
if (
|
||||
Array.from(document.querySelectorAll('[data-testid="agent-archived-callout"]')).some(
|
||||
isVisible,
|
||||
)
|
||||
) {
|
||||
seen.archivedCallout = true;
|
||||
}
|
||||
if (
|
||||
Array.from(document.querySelectorAll('[data-testid="agent-loading"]')).some(isVisible)
|
||||
) {
|
||||
seen.agentLoading = true;
|
||||
}
|
||||
if (
|
||||
Array.from(document.querySelectorAll('[data-testid="agent-initial-fill"]')).some(
|
||||
isVisible,
|
||||
)
|
||||
) {
|
||||
seen.agentInitialFill = true;
|
||||
}
|
||||
if (
|
||||
Array.from(document.querySelectorAll('[data-testid="agent-updating-toast"]')).some(
|
||||
isVisible,
|
||||
)
|
||||
) {
|
||||
seen.updatingToast = true;
|
||||
}
|
||||
const composerVisible = Array.from(
|
||||
document.querySelectorAll(
|
||||
'textarea[aria-label="Message agent..."], [role="textbox"][aria-label="Message agent..."]',
|
||||
),
|
||||
).some(isVisible);
|
||||
if (seen.firstRevealedTabsCount === -1 && composerVisible) {
|
||||
seen.firstRevealedTabsCount = Array.from(
|
||||
document.querySelectorAll('[data-testid^="workspace-tab-"]'),
|
||||
).filter(isVisible).length;
|
||||
const stream =
|
||||
Array.from(document.querySelectorAll('[data-testid="agent-chat-scroll"]')).find(
|
||||
isVisible,
|
||||
) ?? null;
|
||||
if (stream instanceof HTMLElement) {
|
||||
seen.firstRevealedRowCount = stream.querySelectorAll("[data-history-row-id]").length;
|
||||
seen.firstRevealedStreamOpacity = Number.parseFloat(
|
||||
getComputedStyle(stream).opacity || "1",
|
||||
);
|
||||
seen.firstRevealedDistanceFromBottom = Math.max(
|
||||
0,
|
||||
Math.round(stream.scrollHeight - stream.scrollTop - stream.clientHeight),
|
||||
);
|
||||
}
|
||||
}
|
||||
requestAnimationFrame(tick);
|
||||
};
|
||||
win.__stopUnarchiveFlashCheck = () => {
|
||||
running = false;
|
||||
return seen;
|
||||
};
|
||||
requestAnimationFrame(tick);
|
||||
});
|
||||
|
||||
await page.getByTestId("workspace-recovery-action").click();
|
||||
await expect(page.getByRole("textbox", { name: "Message agent..." })).toBeEditable({
|
||||
timeout: 30_000,
|
||||
});
|
||||
await expect(
|
||||
page.getByText("atomic-restore-turn-24", { exact: false }).first(),
|
||||
).toBeVisible();
|
||||
const seen = await page.evaluate(() => {
|
||||
const win = window as unknown as {
|
||||
__stopUnarchiveFlashCheck?: () => {
|
||||
archivedCallout: boolean;
|
||||
agentLoading: boolean;
|
||||
agentInitialFill: boolean;
|
||||
updatingToast: boolean;
|
||||
recoveryButtonRemounted: boolean;
|
||||
firstRevealedTabsCount: number;
|
||||
firstRevealedRowCount: number;
|
||||
firstRevealedStreamOpacity: number;
|
||||
firstRevealedDistanceFromBottom: number;
|
||||
};
|
||||
};
|
||||
return win.__stopUnarchiveFlashCheck?.();
|
||||
});
|
||||
expect(seen).toBeDefined();
|
||||
expect({
|
||||
archivedCallout: seen?.archivedCallout,
|
||||
agentLoading: seen?.agentLoading,
|
||||
agentInitialFill: seen?.agentInitialFill,
|
||||
updatingToast: seen?.updatingToast,
|
||||
recoveryButtonRemounted: seen?.recoveryButtonRemounted,
|
||||
firstRevealedTabsCount: seen?.firstRevealedTabsCount,
|
||||
firstRevealedStreamOpacity: seen?.firstRevealedStreamOpacity,
|
||||
}).toEqual({
|
||||
archivedCallout: false,
|
||||
agentLoading: false,
|
||||
agentInitialFill: false,
|
||||
updatingToast: false,
|
||||
recoveryButtonRemounted: false,
|
||||
firstRevealedTabsCount: 2,
|
||||
firstRevealedStreamOpacity: 1,
|
||||
});
|
||||
expect(seen!.firstRevealedRowCount).toBeGreaterThan(0);
|
||||
expect(seen!.firstRevealedDistanceFromBottom).toBeLessThanOrEqual(16);
|
||||
} finally {
|
||||
await client.removeProject(project.projectKey).catch(() => undefined);
|
||||
await seedClient.close().catch(() => undefined);
|
||||
}
|
||||
});
|
||||
|
||||
test("unarchiving a single archived agent keeps the chat mounted without a loading flash", async ({
|
||||
page,
|
||||
}) => {
|
||||
const seedClient = await connectSeedClient();
|
||||
const project = await openProjectViaDaemon(client, tempRepo.path);
|
||||
try {
|
||||
const agent1 = await createMockIdleAgent(seedClient, {
|
||||
cwd: project.workspaceDirectory,
|
||||
workspaceId: project.workspaceId,
|
||||
title: "Single unarchive agent",
|
||||
});
|
||||
await createMockIdleAgent(seedClient, {
|
||||
cwd: project.workspaceDirectory,
|
||||
workspaceId: project.workspaceId,
|
||||
title: "Sibling active agent",
|
||||
});
|
||||
for (let i = 0; i < 6; i += 1) {
|
||||
await seedClient.sendAgentMessage(
|
||||
agent1.id,
|
||||
`single-unarchive-turn-${i}: emit 1 coalesced agent stream updates`,
|
||||
);
|
||||
await seedClient.waitForFinish(agent1.id, 15_000);
|
||||
}
|
||||
await seedClient.archiveAgent(agent1.id);
|
||||
await expect.poll(() => fetchAgentArchivedAt(seedClient, agent1.id)).not.toBeNull();
|
||||
|
||||
// Delay `refresh_agent_request` briefly so the UI renders its busy state on the Unarchive button.
|
||||
await delayRefreshAgentRequests(page, 250);
|
||||
|
||||
await gotoAppShell(page);
|
||||
await waitForSidebarHydration(page);
|
||||
await openSessions(page);
|
||||
await page.getByTestId(`agent-row-${getServerId()}-${agent1.id}`).click();
|
||||
const unarchiveBtn = page.getByRole("button", { name: "Unarchive", exact: true });
|
||||
await expect(unarchiveBtn).toBeVisible({ timeout: 30_000 });
|
||||
await expect(
|
||||
page.getByText("single-unarchive-turn-5", { exact: false }).first(),
|
||||
).toBeVisible();
|
||||
|
||||
const idleCalloutBox = await page.getByTestId("agent-archived-callout").boundingBox();
|
||||
if (!idleCalloutBox) throw new Error("Archived callout is not laid out");
|
||||
|
||||
await page.evaluate(() => {
|
||||
const win = window as unknown as Record<string, unknown>;
|
||||
const state = {
|
||||
sawAgentLoading: false,
|
||||
sawUnarchivingCallout: false,
|
||||
unarchivingCalloutHeights: [] as number[],
|
||||
minRowCount: Number.POSITIVE_INFINITY,
|
||||
minStreamOpacity: Number.POSITIVE_INFINITY,
|
||||
};
|
||||
let running = true;
|
||||
const isVisible = (el: Element | null) => {
|
||||
if (!el || !(el instanceof HTMLElement)) return false;
|
||||
const rect = el.getBoundingClientRect();
|
||||
if (rect.width === 0 || rect.height === 0) return false;
|
||||
const style = getComputedStyle(el);
|
||||
return style.display !== "none" && style.visibility !== "hidden" && style.opacity !== "0";
|
||||
};
|
||||
const tick = () => {
|
||||
if (!running) return;
|
||||
if (
|
||||
Array.from(document.querySelectorAll('[data-testid="agent-loading"]')).some(isVisible)
|
||||
) {
|
||||
state.sawAgentLoading = true;
|
||||
}
|
||||
const stream =
|
||||
Array.from(document.querySelectorAll('[data-testid="agent-chat-scroll"]')).find(
|
||||
isVisible,
|
||||
) ?? null;
|
||||
if (stream instanceof HTMLElement) {
|
||||
const rowCount = stream.querySelectorAll("[data-history-row-id]").length;
|
||||
const opacity = Number.parseFloat(getComputedStyle(stream).opacity || "1");
|
||||
state.minRowCount = Math.min(state.minRowCount, rowCount);
|
||||
state.minStreamOpacity = Math.min(state.minStreamOpacity, opacity);
|
||||
} else {
|
||||
state.minRowCount = 0;
|
||||
state.minStreamOpacity = 0;
|
||||
}
|
||||
const unarchivingCallout = Array.from(
|
||||
document.querySelectorAll('[data-testid="agent-unarchiving-callout"]'),
|
||||
).find(isVisible);
|
||||
if (unarchivingCallout instanceof HTMLElement) {
|
||||
state.sawUnarchivingCallout = true;
|
||||
state.unarchivingCalloutHeights.push(
|
||||
Math.round(unarchivingCallout.getBoundingClientRect().height),
|
||||
);
|
||||
}
|
||||
requestAnimationFrame(tick);
|
||||
};
|
||||
win.__stopSingleUnarchiveCheck = () => {
|
||||
running = false;
|
||||
return state;
|
||||
};
|
||||
requestAnimationFrame(tick);
|
||||
});
|
||||
|
||||
await unarchiveBtn.click();
|
||||
await expect(page.getByRole("textbox", { name: "Message agent..." })).toBeEditable({
|
||||
timeout: 30_000,
|
||||
});
|
||||
const result = await page.evaluate(() => {
|
||||
const win = window as unknown as {
|
||||
__stopSingleUnarchiveCheck?: () => {
|
||||
sawAgentLoading: boolean;
|
||||
sawUnarchivingCallout: boolean;
|
||||
unarchivingCalloutHeights: number[];
|
||||
minRowCount: number;
|
||||
minStreamOpacity: number;
|
||||
};
|
||||
};
|
||||
return win.__stopSingleUnarchiveCheck?.();
|
||||
});
|
||||
expect(result?.sawAgentLoading).toBe(false);
|
||||
expect(result?.sawUnarchivingCallout).toBe(true);
|
||||
expect(result?.minRowCount).toBeGreaterThan(0);
|
||||
expect(result?.minStreamOpacity).toBe(1);
|
||||
for (const height of result?.unarchivingCalloutHeights ?? []) {
|
||||
expect(Math.abs(height - Math.round(idleCalloutBox.height))).toBeLessThanOrEqual(1);
|
||||
}
|
||||
} finally {
|
||||
await client.removeProject(project.projectKey).catch(() => undefined);
|
||||
await seedClient.close().catch(() => undefined);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -38,9 +38,6 @@ fill "id=\"direct-password-input\"" "${PASSWORD}"
|
||||
wait stable
|
||||
press "id=\"direct-host-submit\""
|
||||
wait stable
|
||||
open "${APP_ID}" "paseo://settings"
|
||||
wait "label=\"Connections\"" 10000
|
||||
press "label=\"Connections\""
|
||||
wait stable
|
||||
wait "id=\"host-page-connections-card\"" 30000
|
||||
open "${APP_ID}" "paseo://settings/hosts"
|
||||
wait "id=\"client-hosts-card\"" 15000
|
||||
screenshot "${OUT}/16-settings-connected.png"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Start on Settings > Host > Pair device with relay enabled in the Android app.
|
||||
// Start on Settings > Host > Devices with relay enabled in the Android app.
|
||||
// node packages/app/e2e/mobile/pair-device/android.mjs <agent-device-session>
|
||||
import assert from "node:assert/strict";
|
||||
import { execFileSync } from "node:child_process";
|
||||
@@ -13,11 +13,7 @@ function ad(...args) {
|
||||
});
|
||||
}
|
||||
|
||||
ad(
|
||||
"press",
|
||||
'label="Pair a device, Scan a QR code or copy a link to connect your phone to this host"',
|
||||
"--settle",
|
||||
);
|
||||
ad("press", 'label="Relay"', "--settle");
|
||||
ad("wait", "text", "Pairing QR code", "10000");
|
||||
const { data } = JSON.parse(ad("snapshot", "-i", "--json"));
|
||||
const sheet = data.nodes.find((node) => node.label === "Bottom Sheet");
|
||||
|
||||
@@ -257,6 +257,7 @@ export interface AgentProfileDraft {
|
||||
model?: string;
|
||||
thinking?: string;
|
||||
mode?: string;
|
||||
systemPrompt?: string;
|
||||
notes?: string;
|
||||
}
|
||||
|
||||
@@ -319,7 +320,12 @@ async function fillAgentProfileForm(page: Page, draft: AgentProfileDraft): Promi
|
||||
if (draft.name !== undefined) {
|
||||
await surface.getByRole("textbox", { name: "Name", exact: true }).fill(draft.name);
|
||||
}
|
||||
if (draft.thinking !== undefined || draft.mode !== undefined || draft.notes !== undefined) {
|
||||
if (
|
||||
draft.thinking !== undefined ||
|
||||
draft.mode !== undefined ||
|
||||
draft.systemPrompt !== undefined ||
|
||||
draft.notes !== undefined
|
||||
) {
|
||||
await ensureCustomizeExpanded(surface);
|
||||
}
|
||||
if (draft.mode !== undefined) {
|
||||
@@ -337,6 +343,11 @@ async function fillAgentProfileForm(page: Page, draft: AgentProfileDraft): Promi
|
||||
await chooseSelectFieldOption(page, { field: "thinking", option: draft.thinking });
|
||||
}
|
||||
}
|
||||
if (draft.systemPrompt !== undefined) {
|
||||
await surface
|
||||
.getByRole("textbox", { name: "System prompt", exact: true })
|
||||
.fill(draft.systemPrompt);
|
||||
}
|
||||
if (draft.notes !== undefined) {
|
||||
await surface.getByRole("textbox", { name: "When to use", exact: true }).fill(draft.notes);
|
||||
}
|
||||
@@ -518,12 +529,20 @@ export async function browserHistoryJumpWithConfirm(
|
||||
export async function expectAgentProfileForm(
|
||||
page: Page,
|
||||
name: string,
|
||||
expected: { provider?: string; model?: string; mode?: string; notes?: string },
|
||||
expected: {
|
||||
provider?: string;
|
||||
model?: string;
|
||||
mode?: string;
|
||||
systemPrompt?: string;
|
||||
notes?: string;
|
||||
},
|
||||
): Promise<void> {
|
||||
await agentProfileRow(page, name).click();
|
||||
const surface = editSurface(page);
|
||||
await expect(surface).toBeVisible({ timeout: 30_000 });
|
||||
await expect(surface.getByRole("textbox", { name: "Name", exact: true })).toHaveValue(name);
|
||||
const systemPromptHint = surface.getByTestId("agent-profile-system-prompt-field-hint");
|
||||
await expect(systemPromptHint).toHaveText("Applies to new agents only");
|
||||
const notesHint = surface.getByTestId("agent-profile-notes-field-hint");
|
||||
await expect(notesHint).toHaveText("Tells agents when to pick this profile");
|
||||
expect(await notesHint.evaluate((element) => getComputedStyle(element).webkitLineClamp)).not.toBe(
|
||||
@@ -542,6 +561,11 @@ export async function expectAgentProfileForm(
|
||||
if (expected.mode) {
|
||||
await expect(surface.getByTestId("agent-profile-mode-trigger")).toContainText(expected.mode);
|
||||
}
|
||||
if (expected.systemPrompt !== undefined) {
|
||||
await expect(surface.getByRole("textbox", { name: "System prompt", exact: true })).toHaveValue(
|
||||
expected.systemPrompt,
|
||||
);
|
||||
}
|
||||
if (expected.notes !== undefined) {
|
||||
await expect(surface.getByRole("textbox", { name: "When to use", exact: true })).toHaveValue(
|
||||
expected.notes,
|
||||
@@ -768,6 +792,44 @@ export async function selectModelRow(
|
||||
await modelRow(page, input).click();
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens a provider on a slow machine and clicks a model row before the list has
|
||||
* finished laying out, holding the button as long as a person does.
|
||||
*/
|
||||
export async function clickModelRowWhileProviderOpens(
|
||||
page: Page,
|
||||
input: { provider: string; modelLabel: string },
|
||||
): Promise<void> {
|
||||
const viewport = pickerViewport(page);
|
||||
await drillIntoProvider(page, input.provider);
|
||||
const rowBox = await viewport.getByText(input.modelLabel, { exact: true }).boundingBox();
|
||||
if (!rowBox) throw new Error(`Model row ${input.modelLabel} has no box`);
|
||||
await viewport.getByRole("button", { name: "Back", exact: true }).click();
|
||||
|
||||
const cdp = await page.context().newCDPSession(page);
|
||||
await cdp.send("Emulation.setCPUThrottlingRate", { rate: 10 });
|
||||
try {
|
||||
await drillIntoProvider(page, input.provider);
|
||||
await page.mouse.click(rowBox.x + rowBox.width / 2, rowBox.y + rowBox.height / 2, {
|
||||
delay: 150,
|
||||
});
|
||||
} finally {
|
||||
await cdp.send("Emulation.setCPUThrottlingRate", { rate: 1 });
|
||||
await cdp.detach();
|
||||
}
|
||||
}
|
||||
|
||||
/** Scrolling a provider's model list with the wheel leaves typing and Enter in the search field. */
|
||||
export async function expectModelListScrollKeepsSearchFocused(page: Page): Promise<void> {
|
||||
const search = pickerViewport(page).getByTestId("model-search-input");
|
||||
const list = pickerViewport(page).getByTestId("compact-model-list");
|
||||
await expect(search).toBeFocused();
|
||||
await list.hover();
|
||||
await page.mouse.wheel(0, 200);
|
||||
await expect.poll(() => list.evaluate((element) => element.scrollTop)).toBeGreaterThan(0);
|
||||
await expect(search).toBeFocused();
|
||||
}
|
||||
|
||||
// ─── Cross-provider model search ───────────────────────────────────────────
|
||||
|
||||
export async function searchAllModels(page: Page, query: string): Promise<void> {
|
||||
|
||||
@@ -134,9 +134,13 @@ export async function openAgentSkillsSettings(
|
||||
host: "127.0.0.1",
|
||||
port: sandbox.daemon.port,
|
||||
});
|
||||
if (options.compact) await goBackInSettings(page);
|
||||
if (options.compact) {
|
||||
// Adding a host opens its client host detail page; back once goes to Hosts, back again returns to the Settings root.
|
||||
await goBackInSettings(page);
|
||||
await goBackInSettings(page);
|
||||
}
|
||||
await selectSettingsHost(page, sandbox.daemon.serverId);
|
||||
await openHostSection(page, sandbox.daemon.serverId, "agents");
|
||||
await openHostSection(page, sandbox.daemon.serverId, "tools");
|
||||
await expect(page.getByTestId("host-agent-skills-card")).toBeVisible();
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ export async function openDaemonOverview(page: Page, daemon: IsolatedHostDaemon)
|
||||
await page.reload();
|
||||
await openSettings(page);
|
||||
await openSettingsHost(page, daemon.serverId);
|
||||
await openHostSection(page, daemon.serverId, "host");
|
||||
await openHostSection(page, daemon.serverId, "daemon");
|
||||
}
|
||||
|
||||
export async function restartDaemonInSettings(
|
||||
|
||||
@@ -2,7 +2,7 @@ import { expect, type Page } from "@playwright/test";
|
||||
import { identityForeground, type IdentityColorName } from "@/styles/identity-colors";
|
||||
import { openSettings } from "./app";
|
||||
import { buildSeededHost } from "./daemon-registry";
|
||||
import { clickSettingsBackToWorkspace, openHostSection, selectSettingsHost } from "./settings";
|
||||
import { clickSettingsBackToWorkspace, openClientHostSettings } from "./settings";
|
||||
|
||||
const REGISTRY_KEY = "@paseo:daemon-registry";
|
||||
const SEED_NONCE_KEY = "@paseo:e2e-seed-nonce";
|
||||
@@ -170,8 +170,7 @@ export async function selectAllHostsFilter(page: Page): Promise<void> {
|
||||
|
||||
export async function openHostAppearanceSettings(page: Page, serverId: string): Promise<void> {
|
||||
await openSettings(page);
|
||||
await selectSettingsHost(page, serverId);
|
||||
await openHostSection(page, serverId, "host");
|
||||
await openClientHostSettings(page, serverId);
|
||||
await expect(page.getByTestId("host-appearance-preview")).toBeVisible({ timeout: 15_000 });
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { promisify } from "node:util";
|
||||
import { once } from "node:events";
|
||||
import {
|
||||
spawn,
|
||||
execFile,
|
||||
@@ -11,6 +12,7 @@ import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
||||
import net from "node:net";
|
||||
import { tmpdir } from "node:os";
|
||||
import path from "node:path";
|
||||
import { WebSocket } from "ws";
|
||||
import { withDisabledE2ESpeechEnv } from "./speech-env";
|
||||
import { killProcessTree, spawnTsx } from "./spawn-node";
|
||||
|
||||
@@ -64,12 +66,14 @@ export async function getAvailableHostDaemonPort(): Promise<number> {
|
||||
* Resolves once this daemon answers on its port. An open TCP port is not
|
||||
* enough: the port is released before the daemon binds it, and whatever takes
|
||||
* it in between also accepts connections while the daemon exits with
|
||||
* EADDRINUSE. Only the daemon's own status reports its server id.
|
||||
* EADDRINUSE. Only the daemon's own status reports its server id. Published
|
||||
* daemons can serve status before they accept WebSocket upgrades.
|
||||
*/
|
||||
async function waitForServer(
|
||||
port: number,
|
||||
child: ChildProcess,
|
||||
identity: { serverId: string; paseoHome: string },
|
||||
published: boolean,
|
||||
): Promise<void> {
|
||||
const deadline = Date.now() + 90_000;
|
||||
let lastError: unknown = null;
|
||||
@@ -82,7 +86,10 @@ async function waitForServer(
|
||||
}
|
||||
try {
|
||||
const serverId = await readServerId(port, identity.paseoHome);
|
||||
if (serverId === identity.serverId) return;
|
||||
if (serverId === identity.serverId) {
|
||||
if (published) await checkWebSocketUpgrade(port);
|
||||
return;
|
||||
}
|
||||
lastError = new Error(`Port ${port} is served by ${serverId}, not ${identity.serverId}`);
|
||||
} catch (error) {
|
||||
lastError = error;
|
||||
@@ -97,6 +104,12 @@ async function waitForServer(
|
||||
);
|
||||
}
|
||||
|
||||
async function checkWebSocketUpgrade(port: number): Promise<void> {
|
||||
const socket = new WebSocket(`ws://127.0.0.1:${port}/ws`, { handshakeTimeout: 1_000 });
|
||||
await once(socket, "open");
|
||||
socket.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads the server id from the daemon's status route. The route needs a bearer
|
||||
* on a password-protected daemon; the daemon accepts the local credential it
|
||||
@@ -246,7 +259,7 @@ export async function startIsolatedHostDaemon(
|
||||
});
|
||||
|
||||
try {
|
||||
await waitForServer(port, spawned, { serverId, paseoHome });
|
||||
await waitForServer(port, spawned, { serverId, paseoHome }, Boolean(publishedPackageRoot));
|
||||
return spawned;
|
||||
} catch (error) {
|
||||
throw new Error(
|
||||
|
||||
@@ -739,6 +739,70 @@ export async function delayBrowserWorkspaceCreatedResponse(
|
||||
};
|
||||
}
|
||||
|
||||
export interface BranchSuggestionsControl {
|
||||
release(): void;
|
||||
waitForRequest(): Promise<void>;
|
||||
waitForResponse(): Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Intercepts `branch_suggestions_request` / `branch_suggestions_response` frames over the daemon
|
||||
* WebSocket. Pass `hold: true` to keep responses queued until `release()` is called, or `hold: false`
|
||||
* to observe prefetched responses without delaying them.
|
||||
*/
|
||||
export async function watchBrowserBranchSuggestions(
|
||||
page: Page,
|
||||
options: { hold: boolean },
|
||||
): Promise<BranchSuggestionsControl> {
|
||||
const frames = await loadSessionMessageReaders();
|
||||
const daemonPortPattern = daemonWsRoutePattern();
|
||||
const delayedForwards: Array<() => void> = [];
|
||||
let releaseRequested = !options.hold;
|
||||
let resolveRequest: (() => void) | null = null;
|
||||
let resolveResponse: (() => void) | null = null;
|
||||
const requestSeen = new Promise<void>((resolve) => {
|
||||
resolveRequest = resolve;
|
||||
});
|
||||
const responseSeen = new Promise<void>((resolve) => {
|
||||
resolveResponse = resolve;
|
||||
});
|
||||
|
||||
await page.routeWebSocket(daemonPortPattern, (ws) => {
|
||||
const server = ws.connectToServer();
|
||||
|
||||
ws.onMessage((message) => {
|
||||
const sessionMessage = frames.client(message);
|
||||
if (sessionMessage?.type === "branch_suggestions_request") {
|
||||
resolveRequest?.();
|
||||
}
|
||||
server.send(message);
|
||||
});
|
||||
|
||||
server.onMessage((message) => {
|
||||
const sessionMessage = frames.server(message);
|
||||
if (sessionMessage?.type === "branch_suggestions_response") {
|
||||
resolveResponse?.();
|
||||
if (!releaseRequested) {
|
||||
delayedForwards.push(() => ws.send(message));
|
||||
return;
|
||||
}
|
||||
}
|
||||
ws.send(message);
|
||||
});
|
||||
});
|
||||
|
||||
return {
|
||||
release() {
|
||||
releaseRequested = true;
|
||||
for (const forward of delayedForwards.splice(0)) {
|
||||
forward();
|
||||
}
|
||||
},
|
||||
waitForRequest: () => requestSeen,
|
||||
waitForResponse: () => responseSeen,
|
||||
};
|
||||
}
|
||||
|
||||
type WorkspaceEntry = Awaited<
|
||||
ReturnType<NewWorkspaceDaemonClient["fetchWorkspaces"]>
|
||||
>["entries"][number];
|
||||
|
||||
@@ -0,0 +1,269 @@
|
||||
import { expect, type Page } from "@playwright/test";
|
||||
import { openSettingsSection } from "./settings";
|
||||
|
||||
export interface RecordedBrowserNotification {
|
||||
title: string;
|
||||
body: string | null;
|
||||
data: Record<string, unknown> | null;
|
||||
}
|
||||
|
||||
type NotificationSwitchName =
|
||||
| "Enable notifications"
|
||||
| "Agent needs permission"
|
||||
| "Agent errored"
|
||||
| "Agent finished"
|
||||
| "Terminal needs input"
|
||||
| "Terminal finished"
|
||||
| "Plugin notifications";
|
||||
|
||||
export async function installBrowserNotificationRecorder(page: Page): Promise<void> {
|
||||
await page.addInitScript(() => {
|
||||
const recorded: RecordedBrowserNotification[] = [];
|
||||
const instances: Array<{ triggerClick: () => void }> = [];
|
||||
const win = window as unknown as {
|
||||
__paseoRecordedNotifications?: RecordedBrowserNotification[];
|
||||
__paseoNotificationInstances?: Array<{ triggerClick: () => void }>;
|
||||
};
|
||||
win.__paseoRecordedNotifications = recorded;
|
||||
win.__paseoNotificationInstances = instances;
|
||||
|
||||
class StubBrowserNotification {
|
||||
static permission: NotificationPermission = "granted";
|
||||
static async requestPermission(): Promise<NotificationPermission> {
|
||||
return "granted";
|
||||
}
|
||||
|
||||
title: string;
|
||||
body: string | null;
|
||||
data: Record<string, unknown> | null;
|
||||
private readonly clickListeners: Array<() => void> = [];
|
||||
|
||||
constructor(
|
||||
title: string,
|
||||
options?: { body?: string; data?: Record<string, unknown>; icon?: string },
|
||||
) {
|
||||
this.title = title;
|
||||
this.body = options?.body ?? null;
|
||||
this.data = options?.data ?? null;
|
||||
recorded.push({
|
||||
title: this.title,
|
||||
body: this.body,
|
||||
data: this.data,
|
||||
});
|
||||
instances.push({
|
||||
triggerClick: () => {
|
||||
for (const listener of this.clickListeners) {
|
||||
listener();
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
addEventListener(type: string, listener: () => void): void {
|
||||
if (type === "click" && typeof listener === "function") {
|
||||
this.clickListeners.push(listener);
|
||||
}
|
||||
}
|
||||
close(): void {}
|
||||
}
|
||||
|
||||
Object.defineProperty(window, "Notification", {
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: StubBrowserNotification,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export async function readRecordedBrowserNotifications(
|
||||
page: Page,
|
||||
): Promise<RecordedBrowserNotification[]> {
|
||||
return page.evaluate(() => {
|
||||
const win = window as unknown as {
|
||||
__paseoRecordedNotifications?: RecordedBrowserNotification[];
|
||||
};
|
||||
return [...(win.__paseoRecordedNotifications ?? [])];
|
||||
});
|
||||
}
|
||||
|
||||
export async function clearRecordedBrowserNotifications(page: Page): Promise<void> {
|
||||
await page.evaluate(() => {
|
||||
const win = window as unknown as {
|
||||
__paseoRecordedNotifications?: RecordedBrowserNotification[];
|
||||
__paseoNotificationInstances?: Array<{ triggerClick: () => void }>;
|
||||
};
|
||||
if (win.__paseoRecordedNotifications) {
|
||||
win.__paseoRecordedNotifications.length = 0;
|
||||
}
|
||||
if (win.__paseoNotificationInstances) {
|
||||
win.__paseoNotificationInstances.length = 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export async function clickRecordedBrowserNotification(page: Page, index = 0): Promise<void> {
|
||||
await page.evaluate((targetIndex) => {
|
||||
const win = window as unknown as {
|
||||
__paseoNotificationInstances?: Array<{ triggerClick: () => void }>;
|
||||
};
|
||||
const instance = win.__paseoNotificationInstances?.[targetIndex];
|
||||
if (!instance) {
|
||||
throw new Error(`No recorded browser notification at index ${targetIndex}`);
|
||||
}
|
||||
instance.triggerClick();
|
||||
}, index);
|
||||
}
|
||||
|
||||
export async function expectRecordedPluginNotifications(
|
||||
page: Page,
|
||||
expected: ReadonlyArray<{
|
||||
pluginId: string;
|
||||
title: string;
|
||||
body: string;
|
||||
notificationId?: string;
|
||||
}>,
|
||||
): Promise<void> {
|
||||
await expect
|
||||
.poll(async () => (await readRecordedBrowserNotifications(page)).length)
|
||||
.toBe(expected.length);
|
||||
|
||||
const notifications = await readRecordedBrowserNotifications(page);
|
||||
const includeId = expected.some((item) => item.notificationId !== undefined);
|
||||
expect(
|
||||
notifications.map((entry) =>
|
||||
includeId
|
||||
? {
|
||||
pluginId: entry.data?.pluginId,
|
||||
title: entry.title,
|
||||
body: entry.body,
|
||||
notificationId: entry.data?.notificationId,
|
||||
}
|
||||
: {
|
||||
pluginId: entry.data?.pluginId,
|
||||
title: entry.title,
|
||||
body: entry.body,
|
||||
},
|
||||
),
|
||||
).toEqual(expected);
|
||||
}
|
||||
|
||||
export async function setPluginNotificationSwitch(
|
||||
page: Page,
|
||||
pluginLabel: string,
|
||||
checked: boolean,
|
||||
): Promise<void> {
|
||||
const toggle = page.getByRole("switch", { name: pluginLabel, exact: true });
|
||||
await expect(toggle).toBeVisible();
|
||||
await expect(toggle).toBeEnabled();
|
||||
await expect(toggle).toHaveAttribute("aria-checked", String(!checked));
|
||||
await toggle.click();
|
||||
await expect(toggle).toHaveAttribute("aria-checked", String(checked));
|
||||
}
|
||||
|
||||
export async function expectRecordedAgentNotifications(
|
||||
page: Page,
|
||||
expected: ReadonlyArray<{ agentId: string; reason: string }>,
|
||||
): Promise<void> {
|
||||
await expect
|
||||
.poll(async () => (await readRecordedBrowserNotifications(page)).length)
|
||||
.toBe(expected.length);
|
||||
|
||||
const notifications = await readRecordedBrowserNotifications(page);
|
||||
expect(
|
||||
notifications.map((entry) => ({
|
||||
agentId: entry.data?.agentId,
|
||||
reason: entry.data?.reason,
|
||||
})),
|
||||
).toEqual(expected);
|
||||
}
|
||||
|
||||
export async function openNotificationSettings(page: Page): Promise<void> {
|
||||
await openSettingsSection(page, "notifications");
|
||||
await expect(
|
||||
page.getByRole("switch", { name: "Enable notifications", exact: true }),
|
||||
).toBeVisible();
|
||||
}
|
||||
|
||||
export function notificationSwitch(page: Page, name: NotificationSwitchName) {
|
||||
return page.getByRole("switch", { name, exact: true });
|
||||
}
|
||||
|
||||
export async function expectNotificationSwitchState(
|
||||
page: Page,
|
||||
name: NotificationSwitchName,
|
||||
expected: { checked: boolean; disabled?: boolean },
|
||||
): Promise<void> {
|
||||
const toggle = notificationSwitch(page, name);
|
||||
await expect(toggle).toBeVisible();
|
||||
await expect(toggle).toHaveAttribute("aria-checked", String(expected.checked));
|
||||
if (expected.disabled) {
|
||||
await expect(toggle).toBeDisabled();
|
||||
} else {
|
||||
await expect(toggle).toBeEnabled();
|
||||
}
|
||||
}
|
||||
|
||||
export async function expectDefaultNotificationSettings(page: Page): Promise<void> {
|
||||
await expectNotificationSwitchState(page, "Enable notifications", {
|
||||
checked: true,
|
||||
disabled: false,
|
||||
});
|
||||
await expectNotificationSwitchState(page, "Agent needs permission", {
|
||||
checked: true,
|
||||
disabled: false,
|
||||
});
|
||||
await expectNotificationSwitchState(page, "Agent errored", {
|
||||
checked: true,
|
||||
disabled: false,
|
||||
});
|
||||
await expectNotificationSwitchState(page, "Agent finished", {
|
||||
checked: false,
|
||||
disabled: false,
|
||||
});
|
||||
await expectNotificationSwitchState(page, "Terminal needs input", {
|
||||
checked: true,
|
||||
disabled: false,
|
||||
});
|
||||
await expectNotificationSwitchState(page, "Terminal finished", {
|
||||
checked: false,
|
||||
disabled: false,
|
||||
});
|
||||
await expectNotificationSwitchState(page, "Plugin notifications", {
|
||||
checked: true,
|
||||
disabled: false,
|
||||
});
|
||||
}
|
||||
|
||||
export async function setNotificationSwitch(
|
||||
page: Page,
|
||||
name: NotificationSwitchName,
|
||||
checked: boolean,
|
||||
): Promise<void> {
|
||||
const toggle = notificationSwitch(page, name);
|
||||
await expect(toggle).toBeEnabled();
|
||||
await expect(toggle).toHaveAttribute("aria-checked", String(!checked));
|
||||
await toggle.click();
|
||||
await expect(toggle).toHaveAttribute("aria-checked", String(checked));
|
||||
}
|
||||
|
||||
export async function expectNotificationSubControlsDisabled(
|
||||
page: Page,
|
||||
disabled: boolean,
|
||||
): Promise<void> {
|
||||
const subSwitches: NotificationSwitchName[] = [
|
||||
"Agent needs permission",
|
||||
"Agent errored",
|
||||
"Agent finished",
|
||||
"Terminal needs input",
|
||||
"Terminal finished",
|
||||
"Plugin notifications",
|
||||
];
|
||||
for (const name of subSwitches) {
|
||||
const toggle = notificationSwitch(page, name);
|
||||
if (disabled) {
|
||||
await expect(toggle).toBeDisabled();
|
||||
} else {
|
||||
await expect(toggle).toBeEnabled();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -161,7 +161,7 @@ export async function finishSetup(page: Page): Promise<void> {
|
||||
/** Opens the Phone step's Relay row: the pair device modal, over setup. */
|
||||
export async function openRelayPairingFromSetup(page: Page): Promise<Locator> {
|
||||
await setupModal(page).getByRole("button", { name: "Relay", exact: true }).click();
|
||||
const pairing = page.getByTestId("onboarding-pair-device-card");
|
||||
const pairing = page.getByTestId("devices-relay-pairing");
|
||||
await expect(pairing).toBeVisible();
|
||||
return pairing;
|
||||
}
|
||||
@@ -171,20 +171,9 @@ export async function closeRelayPairing(pairing: Locator): Promise<void> {
|
||||
await expect(pairing).toHaveCount(0);
|
||||
}
|
||||
|
||||
/** Clicks the Phone step's Tailscale row and returns the docs page it opened. */
|
||||
export async function openTailscaleDocsFromSetup(page: Page): Promise<string> {
|
||||
await page
|
||||
.context()
|
||||
.route("https://paseo.sh/**", (route) =>
|
||||
route.fulfill({ contentType: "text/html", body: "<title>Paseo docs</title>" }),
|
||||
);
|
||||
const popup = page.waitForEvent("popup");
|
||||
await setupModal(page).getByRole("link", { name: "Tailscale, Docs", exact: true }).click();
|
||||
const docs = await popup;
|
||||
await docs.waitForLoadState("domcontentloaded");
|
||||
const url = docs.url();
|
||||
await docs.close();
|
||||
return url;
|
||||
export async function expectTailscaleSwitchDisabled(page: Page): Promise<void> {
|
||||
const setup = setupModal(page);
|
||||
await expect(setup.getByRole("switch", { name: "Tailscale", exact: true })).toBeDisabled();
|
||||
}
|
||||
|
||||
export interface SetupHost {
|
||||
|
||||
@@ -9,6 +9,8 @@ import {
|
||||
selectSettingsHost,
|
||||
} from "./settings";
|
||||
import { expectAppRoute } from "./route-assertions";
|
||||
import { wsRoutePatternForPort } from "./daemon-port";
|
||||
import { goToSetupStep, showSetupAgainFromSettings } from "./onboarding";
|
||||
import { buildSettingsHostSectionRoute } from "@/utils/host-routes";
|
||||
|
||||
interface PairingHostInput {
|
||||
@@ -60,9 +62,33 @@ export async function prepareLocalPairingHost(
|
||||
await preparePairingHost(page, daemon, additionalHosts);
|
||||
}
|
||||
|
||||
type PairingHost =
|
||||
| Pick<IsolatedHostDaemon, "serverId" | "port">
|
||||
| Pick<OutdatedDaemon, "serverId" | "endpoint">;
|
||||
|
||||
export async function preparePairingHost(
|
||||
page: Page,
|
||||
daemon: IsolatedHostDaemon | OutdatedDaemon,
|
||||
daemon: PairingHost,
|
||||
additionalHosts: PairingHostInput[] = [],
|
||||
): Promise<void> {
|
||||
await openAppOnPairingHost(page, daemon, additionalHosts);
|
||||
await openSettings(page);
|
||||
await openSettingsHost(page, daemon.serverId);
|
||||
await expect(page.getByTestId("devices-relay")).toHaveCount(0);
|
||||
await openSettingsHostSection(page, daemon.serverId, "devices");
|
||||
await expect(page.getByTestId("devices-relay")).toBeVisible();
|
||||
}
|
||||
|
||||
/** Loads the app afresh with `daemon` as its first host, then opens the setup's Mobile step. */
|
||||
export async function openSetupMobileStep(page: Page, daemon: PairingHost): Promise<void> {
|
||||
await openAppOnPairingHost(page, daemon);
|
||||
await showSetupAgainFromSettings(page);
|
||||
await goToSetupStep(page, "Mobile");
|
||||
}
|
||||
|
||||
async function openAppOnPairingHost(
|
||||
page: Page,
|
||||
daemon: PairingHost,
|
||||
additionalHosts: PairingHostInput[] = [],
|
||||
): Promise<void> {
|
||||
await seedSavedSettingsHosts(page, [
|
||||
@@ -74,20 +100,372 @@ export async function preparePairingHost(
|
||||
...additionalHosts,
|
||||
]);
|
||||
await gotoAppShell(page);
|
||||
await openSettings(page);
|
||||
await openSettingsHost(page, daemon.serverId);
|
||||
await expect(page.getByTestId("host-page-pair-device-row")).toHaveCount(0);
|
||||
await openSettingsHostSection(page, daemon.serverId, "pair-device");
|
||||
await expect(page.getByTestId("host-page-pair-device-row")).toBeVisible();
|
||||
}
|
||||
|
||||
export async function enableTailscale(page: Page): Promise<void> {
|
||||
const toggle = page.getByRole("switch", { name: "Tailscale", exact: true });
|
||||
await expect(toggle).toBeEnabled();
|
||||
await expect(toggle).not.toBeChecked();
|
||||
await toggle.click();
|
||||
await expect(toggle).toBeChecked();
|
||||
await expect(toggle).toBeEnabled();
|
||||
}
|
||||
|
||||
export async function expectTailscaleAddress(page: Page, address: string): Promise<void> {
|
||||
const row = tailscaleAddressRow(page, address);
|
||||
await expect(row).toBeVisible();
|
||||
await expect(
|
||||
row.getByText("On a phone with Tailscale, add a host at this address"),
|
||||
).toBeVisible();
|
||||
await expect(row.getByRole("button", { name: "Copy", exact: true })).toBeVisible();
|
||||
const response = await fetch(`http://${address}/api/health`);
|
||||
expect(response.ok).toBe(true);
|
||||
}
|
||||
|
||||
/** The switch shows off as soon as it is tapped; the host stops listening when its answer lands. */
|
||||
async function expectHostUnreachableAt(address: string): Promise<void> {
|
||||
await expect
|
||||
.poll(() =>
|
||||
fetch(`http://${address}/api/health`).then(
|
||||
() => "reachable",
|
||||
() => "unreachable",
|
||||
),
|
||||
)
|
||||
.toBe("unreachable");
|
||||
}
|
||||
|
||||
function tailscaleAddressRow(page: Page, address: string) {
|
||||
return page.getByTestId("devices-tailscale-address").filter({ hasText: address });
|
||||
}
|
||||
|
||||
export async function disableTailscale(page: Page, address: string): Promise<void> {
|
||||
const toggle = page.getByRole("switch", { name: "Tailscale", exact: true });
|
||||
await expect(toggle).toBeEnabled();
|
||||
await toggle.click();
|
||||
await expect(toggle).not.toBeChecked();
|
||||
await expect(toggle).toBeEnabled();
|
||||
await expect(tailscaleAddressRow(page, address)).toHaveCount(0);
|
||||
await expectHostUnreachableAt(address);
|
||||
}
|
||||
|
||||
/** Reopens the host over its Tailscale address, as a phone on the tailnet would reach it. */
|
||||
export async function connectThroughTailscale(
|
||||
page: Page,
|
||||
daemon: { serverId: string; tailscaleAddress: string },
|
||||
): Promise<void> {
|
||||
await preparePairingHost(page, { serverId: daemon.serverId, endpoint: daemon.tailscaleAddress });
|
||||
await expectTailscaleAddress(page, daemon.tailscaleAddress);
|
||||
}
|
||||
|
||||
const TURN_OFF_QUESTION =
|
||||
"Turn off Tailscale?\n\nThis device is connected through Tailscale and will lose its connection to the host.";
|
||||
|
||||
/**
|
||||
* Taps the switch off over the Tailscale connection and cancels the question. Every state the row
|
||||
* commits from the tap to after Cancel must still show Tailscale on with its address: nothing
|
||||
* changes until the user confirms.
|
||||
*/
|
||||
export async function cancelTailscaleTurnOff(page: Page, address: string): Promise<void> {
|
||||
const row = await recordTailscaleRow(page);
|
||||
const question = answerNextDialog(page, "dismiss");
|
||||
await page.getByRole("switch", { name: "Tailscale", exact: true }).click();
|
||||
expect(await question).toBe(TURN_OFF_QUESTION);
|
||||
await page.waitForTimeout(500);
|
||||
expect(new Set((await row()).map((state) => `${state.value} ${state.address}`))).toEqual(
|
||||
new Set(["on true"]),
|
||||
);
|
||||
await expect(page.getByRole("switch", { name: "Tailscale", exact: true })).toBeChecked();
|
||||
await expect(tailscaleAddressRow(page, address)).toBeVisible();
|
||||
expect((await fetch(`http://${address}/api/health`)).ok).toBe(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Confirms turning Tailscale off over the Tailscale connection, which cuts this app off the host.
|
||||
* Without the host the row shows no value at all, on or off.
|
||||
*/
|
||||
export async function confirmTailscaleTurnOff(page: Page, address: string): Promise<void> {
|
||||
const question = answerNextDialog(page, "accept");
|
||||
await page.getByRole("switch", { name: "Tailscale", exact: true }).click();
|
||||
expect(await question).toBe(TURN_OFF_QUESTION);
|
||||
await expect(page.getByText("Host is not connected", { exact: true })).toBeVisible();
|
||||
await expect(page.getByRole("switch", { name: "Tailscale", exact: true })).toHaveCount(0);
|
||||
await expectHostUnreachableAt(address);
|
||||
}
|
||||
|
||||
function answerNextDialog(page: Page, answer: "accept" | "dismiss"): Promise<string> {
|
||||
return new Promise((resolve) => {
|
||||
page.once("dialog", async (dialog) => {
|
||||
resolve(dialog.message());
|
||||
await (answer === "accept" ? dialog.accept() : dialog.dismiss());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
interface TailscaleRowState {
|
||||
/** `none` while the row shows no value yet. */
|
||||
value: "on" | "off" | "none";
|
||||
address: boolean;
|
||||
hint: string;
|
||||
labelTop: number;
|
||||
hintTop: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Records every state the Tailscale row commits, painted or not: from now on in this page, and
|
||||
* from the first paint of every page load after it. Recording again starts a new record.
|
||||
*/
|
||||
async function recordTailscaleRow(page: Page): Promise<() => Promise<TailscaleRowState[]>> {
|
||||
const record = () => {
|
||||
const host = window as unknown as {
|
||||
tailscaleRow?: { states: unknown[]; last: string; sample(): void };
|
||||
};
|
||||
if (host.tailscaleRow) {
|
||||
host.tailscaleRow.states = [];
|
||||
host.tailscaleRow.last = "";
|
||||
host.tailscaleRow.sample();
|
||||
return;
|
||||
}
|
||||
const isVisibleText = (element: Element, text?: string) =>
|
||||
element.childElementCount === 0 &&
|
||||
(text === undefined
|
||||
? (element.textContent ?? "").trim() !== ""
|
||||
: element.textContent === text) &&
|
||||
element.getBoundingClientRect().height > 0;
|
||||
const readValue = (toggle: Element | null) => {
|
||||
if (!toggle) return "none";
|
||||
return toggle.getAttribute("aria-checked") === "true" ? "on" : "off";
|
||||
};
|
||||
const read = () => {
|
||||
const label = [...document.querySelectorAll("div, span")].find((element) =>
|
||||
isVisibleText(element, "Tailscale"),
|
||||
);
|
||||
if (!label) return null;
|
||||
let row: Element = label;
|
||||
while (row.parentElement && !(row as HTMLElement).innerText.includes("\n")) {
|
||||
row = row.parentElement;
|
||||
}
|
||||
const hint = [...row.querySelectorAll("div, span")].find(
|
||||
(element) => element !== label && isVisibleText(element),
|
||||
);
|
||||
const toggle = document.querySelector('[role="switch"][aria-label="Tailscale"]');
|
||||
return {
|
||||
value: readValue(toggle),
|
||||
address: document.querySelector('[data-testid="devices-tailscale-address"]') !== null,
|
||||
hint: hint?.textContent ?? "",
|
||||
labelTop: Math.round(label.getBoundingClientRect().top),
|
||||
hintTop: Math.round(hint?.getBoundingClientRect().top ?? -1),
|
||||
};
|
||||
};
|
||||
const recorder = {
|
||||
states: [] as unknown[],
|
||||
last: "",
|
||||
sample() {
|
||||
const state = read();
|
||||
const key = JSON.stringify(state);
|
||||
if (state && key !== recorder.last) recorder.states.push(state);
|
||||
recorder.last = key;
|
||||
},
|
||||
};
|
||||
host.tailscaleRow = recorder;
|
||||
new MutationObserver(() => recorder.sample()).observe(document, {
|
||||
subtree: true,
|
||||
childList: true,
|
||||
characterData: true,
|
||||
attributes: true,
|
||||
});
|
||||
};
|
||||
await page.addInitScript(record);
|
||||
await page.evaluate(record);
|
||||
return () =>
|
||||
page.evaluate(
|
||||
() =>
|
||||
(window as unknown as { tailscaleRow: { states: TailscaleRowState[] } }).tailscaleRow
|
||||
.states,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs `open`, which first shows the Tailscale row of a host with Tailscale on, and checks the row
|
||||
* from its first state to its last: it starts with no value, never shows Tailscale off, and its
|
||||
* label and hint keep their text and place until it settles on, with the address below.
|
||||
*/
|
||||
export async function expectTailscaleRowLoadsOn(
|
||||
page: Page,
|
||||
address: string,
|
||||
open: () => Promise<void>,
|
||||
): Promise<void> {
|
||||
const row = await recordTailscaleRow(page);
|
||||
await open();
|
||||
await expect(page.getByRole("switch", { name: "Tailscale", exact: true })).toBeChecked();
|
||||
await expect(tailscaleAddressRow(page, address)).toBeVisible();
|
||||
const states = await row();
|
||||
expect(states[0]?.value).toBe("none");
|
||||
expect(states.filter((state) => state.value === "off")).toEqual([]);
|
||||
expect(
|
||||
new Set(states.map(({ hint, labelTop, hintTop }) => `${hint} ${labelTop} ${hintTop}`)).size,
|
||||
).toBe(1);
|
||||
expect(states.at(-1)).toMatchObject({ value: "on", address: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds every message between the app and the host on `port` for `ms` in each direction, as on a
|
||||
* slow network. The returned function brings the connection back to full speed and flushes any
|
||||
* queued messages.
|
||||
*/
|
||||
export async function slowConnectionToHost(
|
||||
page: Page,
|
||||
port: number,
|
||||
ms: number,
|
||||
): Promise<() => void> {
|
||||
let delay = ms;
|
||||
const flushers = new Set<() => void>();
|
||||
await page.routeWebSocket(wsRoutePatternForPort(String(port)), (app) => {
|
||||
const host = app.connectToServer();
|
||||
const appToHost = deliverInOrderAfter(
|
||||
() => delay,
|
||||
(message) => host.send(message),
|
||||
);
|
||||
const hostToApp = deliverInOrderAfter(
|
||||
() => delay,
|
||||
(message) => app.send(message),
|
||||
);
|
||||
flushers.add(appToHost.flushNow);
|
||||
flushers.add(hostToApp.flushNow);
|
||||
app.onMessage(appToHost.enqueue);
|
||||
host.onMessage(hostToApp.enqueue);
|
||||
});
|
||||
return () => {
|
||||
delay = 0;
|
||||
for (const flushNow of flushers) flushNow();
|
||||
};
|
||||
}
|
||||
|
||||
function deliverInOrderAfter(delay: () => number, deliver: (message: string | Buffer) => void) {
|
||||
const queue: { at: number; message: string | Buffer }[] = [];
|
||||
let timer: ReturnType<typeof setTimeout> | null = null;
|
||||
const flush = () => {
|
||||
timer = null;
|
||||
while (queue[0] && queue[0].at <= Date.now()) deliver(queue.shift()!.message);
|
||||
if (queue[0]) timer = setTimeout(flush, queue[0].at - Date.now());
|
||||
};
|
||||
return {
|
||||
enqueue: (message: string | Buffer) => {
|
||||
queue.push({ at: Math.max(Date.now() + delay(), queue.at(-1)?.at ?? 0), message });
|
||||
if (!timer) flush();
|
||||
},
|
||||
flushNow: () => {
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
timer = null;
|
||||
}
|
||||
while (queue[0]) {
|
||||
const next = queue.shift()!;
|
||||
try {
|
||||
deliver(next.message);
|
||||
} catch {
|
||||
queue.length = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export async function expectTailscaleUpdateRequired(page: Page): Promise<void> {
|
||||
await expect(page.getByRole("switch", { name: "Tailscale", exact: true })).toBeDisabled();
|
||||
await expect(page.getByText("Update this host to use Tailscale", { exact: true })).toBeVisible();
|
||||
await expect(page.getByRole("link", { name: "How to update", exact: true })).toBeVisible();
|
||||
}
|
||||
|
||||
export async function expectTailscaleUnavailable(page: Page): Promise<void> {
|
||||
await expect(page.getByRole("switch", { name: "Tailscale", exact: true })).toBeDisabled();
|
||||
await expect(
|
||||
page.getByText("Tailscale is not running on this host", { exact: true }),
|
||||
).toBeVisible();
|
||||
await expect(page.getByRole("link", { name: "Get Tailscale", exact: true })).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "Refresh", exact: true })).toBeEnabled();
|
||||
}
|
||||
|
||||
export async function refreshTailscaleAvailability(page: Page): Promise<void> {
|
||||
await page.getByRole("button", { name: "Refresh", exact: true }).click();
|
||||
}
|
||||
|
||||
export async function expectTailscaleAvailable(
|
||||
page: Page,
|
||||
options?: { timeout?: number },
|
||||
): Promise<void> {
|
||||
await expect(page.getByRole("button", { name: "Refresh", exact: true })).toHaveCount(0, options);
|
||||
const toggle = page.getByRole("switch", { name: "Tailscale", exact: true });
|
||||
await expect(toggle).toBeEnabled(options);
|
||||
await expect(toggle).not.toBeChecked(options);
|
||||
await expect(
|
||||
page.getByText("Direct over your tailnet, enter an address", { exact: true }),
|
||||
).toBeVisible(options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tracks `daemon.get_status` frames on the host socket so Refresh tests can align right after a
|
||||
* 2-second poll and verify the button click itself sent a fresh status request.
|
||||
*/
|
||||
export function observeDaemonStatusPolling(page: Page, port: number) {
|
||||
let lastResponseAt = 0;
|
||||
let waitingForResponse: (() => void) | null = null;
|
||||
let waitingForRequest: (() => void) | null = null;
|
||||
page.on("websocket", (socket) => {
|
||||
if (!socket.url().includes(`:${port}`)) return;
|
||||
socket.on("framesent", ({ payload }) => {
|
||||
const message = typeof payload === "string" ? payload : payload.toString();
|
||||
if (message.includes('"type":"daemon.get_status.request"')) {
|
||||
waitingForRequest?.();
|
||||
waitingForRequest = null;
|
||||
}
|
||||
});
|
||||
socket.on("framereceived", ({ payload }) => {
|
||||
const message = typeof payload === "string" ? payload : payload.toString();
|
||||
if (message.includes('"type":"daemon.get_status.response"')) {
|
||||
lastResponseAt = Date.now();
|
||||
waitingForResponse?.();
|
||||
waitingForResponse = null;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return {
|
||||
async waitForFreshPollWindow(): Promise<void> {
|
||||
if (Date.now() - lastResponseAt < 250) return;
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
const timer = setTimeout(() => {
|
||||
waitingForResponse = null;
|
||||
reject(new Error("Timed out waiting for daemon status poll"));
|
||||
}, 5_000);
|
||||
waitingForResponse = () => {
|
||||
clearTimeout(timer);
|
||||
resolve();
|
||||
};
|
||||
});
|
||||
},
|
||||
waitForStatusRequest(timeoutMs = 1_000): Promise<void> {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
const timer = setTimeout(() => {
|
||||
waitingForRequest = null;
|
||||
reject(new Error("Refresh did not send daemon.get_status.request"));
|
||||
}, timeoutMs);
|
||||
waitingForRequest = () => {
|
||||
clearTimeout(timer);
|
||||
resolve();
|
||||
};
|
||||
});
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export async function openPairDeviceModal(page: Page): Promise<void> {
|
||||
await page.getByRole("button", { name: /Pair a device/ }).click();
|
||||
await expect(page.getByTestId("host-page-pair-device-card")).toBeVisible();
|
||||
await page.getByRole("button", { name: "Relay", exact: true }).click();
|
||||
await expect(page.getByTestId("devices-relay-pairing")).toBeVisible();
|
||||
}
|
||||
|
||||
export async function expectRelayConsent(page: Page): Promise<void> {
|
||||
const modal = page.getByTestId("host-page-pair-device-card");
|
||||
const modal = page.getByTestId("devices-relay-pairing");
|
||||
await expect(modal.getByText("Enable relay?", { exact: true })).toBeVisible();
|
||||
await expect(modal.getByText(/end-to-end encrypted/)).toBeVisible();
|
||||
await expect(modal.getByRole("link", { name: "Read how Paseo relay works" })).toBeVisible();
|
||||
@@ -99,7 +477,7 @@ export async function expectRelayConsent(page: Page): Promise<void> {
|
||||
|
||||
export async function declineRelay(page: Page): Promise<void> {
|
||||
await page.getByRole("button", { name: "Not now", exact: true }).click();
|
||||
await expect(page.getByTestId("host-page-pair-device-card")).toHaveCount(0);
|
||||
await expect(page.getByTestId("devices-relay-pairing")).toHaveCount(0);
|
||||
}
|
||||
|
||||
export async function enableRelayAndExpectOffer(page: Page): Promise<void> {
|
||||
@@ -124,10 +502,10 @@ export async function expectPairingOffer(page: Page): Promise<void> {
|
||||
|
||||
export async function closePairDeviceModal(page: Page): Promise<void> {
|
||||
await page
|
||||
.getByTestId("host-page-pair-device-card")
|
||||
.getByTestId("devices-relay-pairing")
|
||||
.getByRole("button", { name: "Close", exact: true })
|
||||
.click();
|
||||
await expect(page.getByTestId("host-page-pair-device-card")).toHaveCount(0);
|
||||
await expect(page.getByTestId("devices-relay-pairing")).toHaveCount(0);
|
||||
}
|
||||
|
||||
export async function reloadAndOpenPairDevice(page: Page): Promise<void> {
|
||||
@@ -145,7 +523,7 @@ export async function enableRelayAndExpectFailure(
|
||||
expectedError = "Relay is controlled by a daemon launch override",
|
||||
): Promise<void> {
|
||||
await page.getByRole("button", { name: "Enable relay", exact: true }).click();
|
||||
const modal = page.getByTestId("host-page-pair-device-card");
|
||||
const modal = page.getByTestId("devices-relay-pairing");
|
||||
await expect(modal.getByRole("alert")).toContainText(expectedError);
|
||||
await expect(modal.getByRole("button", { name: "Retry", exact: true })).toBeEnabled();
|
||||
await expect(modal.getByRole("textbox", { name: "Pairing link" })).toHaveCount(0);
|
||||
@@ -155,7 +533,7 @@ export async function retryRelayAndExpectFailure(
|
||||
page: Page,
|
||||
expectedError = "Relay is controlled by a daemon launch override",
|
||||
): Promise<void> {
|
||||
const modal = page.getByTestId("host-page-pair-device-card");
|
||||
const modal = page.getByTestId("devices-relay-pairing");
|
||||
await modal.getByRole("button", { name: "Retry", exact: true }).click();
|
||||
await expect(modal.getByRole("alert")).toContainText(expectedError);
|
||||
await expect(modal.getByRole("button", { name: "Retry", exact: true })).toBeEnabled();
|
||||
@@ -173,7 +551,7 @@ export async function openPairDeviceFromHome(page: Page): Promise<void> {
|
||||
}
|
||||
|
||||
export async function expectRelayUpdateRequired(page: Page): Promise<void> {
|
||||
const modal = page.getByTestId("host-page-pair-device-card");
|
||||
const modal = page.getByTestId("devices-relay-pairing");
|
||||
await expect(
|
||||
modal.getByText("Update the host to enable relay from Paseo Desktop."),
|
||||
).toBeVisible();
|
||||
@@ -195,15 +573,15 @@ export function observePairingOfferRequests(page: Page, daemon: OutdatedDaemon):
|
||||
}
|
||||
|
||||
export async function expectPairingDisconnected(page: Page): Promise<void> {
|
||||
const modal = page.getByTestId("host-page-pair-device-card");
|
||||
const modal = page.getByTestId("devices-relay-pairing");
|
||||
await expect(modal.getByRole("alert")).toContainText("Host is not connected");
|
||||
await expect(modal.getByRole("button", { name: "Retry", exact: true })).toBeVisible();
|
||||
}
|
||||
|
||||
export async function switchPairDeviceToHost(page: Page, serverId: string): Promise<void> {
|
||||
await selectSettingsHost(page, serverId);
|
||||
await expectAppRoute(page, buildSettingsHostSectionRoute(serverId, "pair-device"));
|
||||
await expect(page.getByTestId("host-page-pair-device-row")).toBeVisible();
|
||||
await expectAppRoute(page, buildSettingsHostSectionRoute(serverId, "devices"));
|
||||
await expect(page.getByTestId("devices-relay")).toBeVisible();
|
||||
}
|
||||
|
||||
export async function openRelaySecurityDocs(page: Page): Promise<void> {
|
||||
|
||||
@@ -32,6 +32,12 @@ export interface SeedDaemonClient {
|
||||
config: import("@getpaseo/protocol/messages").MutableDaemonConfigPatch,
|
||||
): Promise<{ config: import("@getpaseo/protocol/messages").MutableDaemonConfig }>;
|
||||
getDaemonConfig(): Promise<{ config: import("@getpaseo/protocol/messages").MutableDaemonConfig }>;
|
||||
installDirectoryPlugin(
|
||||
directoryPath: string,
|
||||
id?: string,
|
||||
): Promise<import("@getpaseo/protocol/messages").PluginListItem>;
|
||||
removePlugin(pluginId: string): Promise<void>;
|
||||
invokePluginRpc(pluginId: string, method: string, input: unknown): Promise<unknown>;
|
||||
connect(): Promise<void>;
|
||||
close(): Promise<void>;
|
||||
addProject(cwd: string): Promise<{
|
||||
|
||||
@@ -3,6 +3,7 @@ import { buildCreateAgentPreferences, buildSeededHost, TEST_HOST_LABEL } from ".
|
||||
import { getServerId } from "./server-id";
|
||||
import { expectAppRoute } from "./route-assertions";
|
||||
import {
|
||||
buildClientHostSettingsRoute,
|
||||
buildSettingsHostSectionRoute,
|
||||
buildSettingsRoute,
|
||||
buildSettingsSectionRoute,
|
||||
@@ -47,35 +48,29 @@ interface SavedSettingsHostInput {
|
||||
|
||||
const SECTION_LABELS = {
|
||||
general: "General",
|
||||
chat: "Chat",
|
||||
hosts: "Hosts",
|
||||
appearance: "Appearance",
|
||||
sidebar: "Sidebar",
|
||||
editor: "Editor",
|
||||
files: "Files",
|
||||
terminal: "Terminal",
|
||||
browser: "Browser",
|
||||
chat: "Chat & panes",
|
||||
shortcuts: "Shortcuts",
|
||||
integrations: "Integrations",
|
||||
permissions: "Permissions",
|
||||
diagnostics: "Diagnostics",
|
||||
notifications: "Notifications",
|
||||
about: "About",
|
||||
} as const;
|
||||
|
||||
export type SettingsSection = keyof typeof SECTION_LABELS;
|
||||
|
||||
type HostSection =
|
||||
| "projects"
|
||||
| "connections"
|
||||
| "pair-device"
|
||||
| "agents"
|
||||
| "metadata"
|
||||
| "voice"
|
||||
| "workspaces"
|
||||
| "providers"
|
||||
| "agent-profiles"
|
||||
| "tools"
|
||||
| "projects"
|
||||
| "workspaces"
|
||||
| "voice"
|
||||
| "usage"
|
||||
| "terminals"
|
||||
| "plugins"
|
||||
| "host";
|
||||
| "devices"
|
||||
| "daemon";
|
||||
|
||||
export async function openSettingsSection(page: Page, section: SettingsSection): Promise<void> {
|
||||
const sidebar = page.getByTestId("settings-sidebar");
|
||||
@@ -198,14 +193,19 @@ export async function expectSettingsDetailScrollOffset(page: Page, offset: numbe
|
||||
await expect.poll(() => scrollBody.evaluate((node) => node.scrollTop)).toBe(offset);
|
||||
}
|
||||
|
||||
export async function openSettingsHost(page: Page, serverId: string): Promise<void> {
|
||||
// Host sections are now flat top-level rows under the Host group. Navigate by
|
||||
// clicking the Connections section row; the picker only matters when >1 host.
|
||||
await page.getByTestId("settings-host-section-connections").click();
|
||||
await expectHostSettingsUrl(page, serverId);
|
||||
export async function openClientHostSettings(page: Page, serverId: string): Promise<void> {
|
||||
await openSettingsSection(page, "hosts");
|
||||
await page.getByTestId(`client-host-row-${serverId}`).click();
|
||||
await expectAppRoute(page, buildClientHostSettingsRoute(serverId));
|
||||
await expect(page.getByTestId("host-page-connections-card")).toBeVisible();
|
||||
}
|
||||
|
||||
export async function openSettingsHost(page: Page, serverId: string): Promise<void> {
|
||||
await page.getByTestId("settings-host-section-daemon").click();
|
||||
await expectHostSettingsUrl(page, serverId);
|
||||
await expect(page.getByTestId("host-page-identity")).toBeVisible();
|
||||
}
|
||||
|
||||
export async function openSettingsHostSection(
|
||||
page: Page,
|
||||
serverId: string,
|
||||
@@ -367,7 +367,7 @@ export async function removeCurrentHostFromSettings(page: Page): Promise<void> {
|
||||
await page.getByTestId("host-page-remove-host-button").click();
|
||||
await expect(page.getByTestId("remove-host-confirm-modal")).toBeVisible();
|
||||
await page.getByTestId("remove-host-confirm").click();
|
||||
await expectAppRoute(page, buildSettingsRoute());
|
||||
await expectAppRoute(page, buildSettingsSectionRoute("hosts"));
|
||||
}
|
||||
|
||||
export async function expectSettingsBackButton(page: Page): Promise<void> {
|
||||
@@ -379,7 +379,7 @@ export async function clickSettingsBackToWorkspace(page: Page): Promise<void> {
|
||||
}
|
||||
|
||||
export async function expectHostSettingsUrl(page: Page, serverId: string): Promise<void> {
|
||||
await expectAppRoute(page, buildSettingsHostSectionRoute(serverId, "connections"));
|
||||
await expectAppRoute(page, buildSettingsHostSectionRoute(serverId, "daemon"));
|
||||
}
|
||||
|
||||
export async function verifyLegacyHostSettingsRedirect(page: Page): Promise<void> {
|
||||
@@ -449,7 +449,7 @@ export async function expectAboutContent(page: Page): Promise<void> {
|
||||
}
|
||||
|
||||
export async function expectGeneralContent(page: Page): Promise<void> {
|
||||
await expect(page.getByText("Default send", { exact: true }).first()).toBeVisible();
|
||||
await expect(page.getByText("Language", { exact: true }).first()).toBeVisible();
|
||||
}
|
||||
|
||||
export async function expectAppearanceContent(page: Page): Promise<void> {
|
||||
@@ -474,14 +474,7 @@ export async function expectHostLabelEditMode(page: Page, expectedLabel: string)
|
||||
export async function expectHostConnectionsCard(page: Page, port: string): Promise<void> {
|
||||
const card = page.getByTestId("host-page-connections-card");
|
||||
await expect(card).toBeVisible();
|
||||
// "Connections" appears three times on this page: the sidebar section row, the
|
||||
// detail header title, and the SettingsSection heading above the card. Match
|
||||
// the first to keep the heading assertion without tripping Playwright strict
|
||||
// mode.
|
||||
await expect(page.getByText("Connections", { exact: true }).first()).toBeVisible();
|
||||
await expect(
|
||||
card.getByText(new RegExp(`TCP \\((localhost|127\\.0\\.0\\.1):${port}\\)`)),
|
||||
).toBeVisible();
|
||||
await expect(card.getByText(new RegExp(`(localhost|127\\.0\\.0\\.1):${port}`))).toBeVisible();
|
||||
}
|
||||
|
||||
export async function expectHostInjectMcpCard(page: Page): Promise<void> {
|
||||
@@ -518,11 +511,11 @@ export async function openHostSection(
|
||||
}
|
||||
|
||||
export async function expectHostActionCards(page: Page, serverId: string): Promise<void> {
|
||||
// Restart + remove cards live on the Host section; providers moved to its
|
||||
// own Providers section (asserted via expectHostProvidersCard).
|
||||
await openSettingsHostSection(page, serverId, "host");
|
||||
// Restart lives on Daemon; removing the saved host lives on This device -> Hosts.
|
||||
await openSettingsHostSection(page, serverId, "daemon");
|
||||
await expect(page.getByTestId("host-page-restart-card")).toBeVisible();
|
||||
await expect(page.getByTestId("host-page-restart-button")).toBeVisible();
|
||||
await openClientHostSettings(page, serverId);
|
||||
await expect(page.getByTestId("host-page-remove-host-card")).toBeVisible();
|
||||
await expect(page.getByTestId("host-page-remove-host-button")).toBeVisible();
|
||||
}
|
||||
@@ -641,27 +634,30 @@ export async function expectRetiredSidebarSectionsAbsent(page: Page): Promise<vo
|
||||
const sidebar = page.getByTestId("settings-sidebar");
|
||||
await expect(sidebar).toBeVisible();
|
||||
|
||||
// App group rows remain top-level.
|
||||
// App group ("This device") rows remain top-level.
|
||||
await expect(sidebar.getByRole("button", { name: "General", exact: true })).toBeVisible();
|
||||
await expect(sidebar.getByRole("button", { name: "Diagnostics", exact: true })).toBeVisible();
|
||||
await expect(sidebar.getByRole("button", { name: "Hosts", exact: true })).toBeVisible();
|
||||
await expect(sidebar.getByRole("button", { name: "About", exact: true })).toBeVisible();
|
||||
await expect(sidebar.getByRole("button", { name: "Daemon", exact: true })).toHaveCount(0);
|
||||
await expect(sidebar.getByRole("button", { name: "Diagnostics", exact: true })).toHaveCount(0);
|
||||
|
||||
// Host group rows are now flat top-level sections (no drill-in).
|
||||
await expect(sidebar.getByTestId("settings-host-section-connections")).toBeVisible();
|
||||
await expect(sidebar.getByTestId("settings-host-section-projects")).toBeVisible();
|
||||
await expect(sidebar.getByTestId("settings-host-section-agents")).toBeVisible();
|
||||
await expect(sidebar.getByTestId("settings-host-section-workspaces")).toBeVisible();
|
||||
// Host group rows are daemon-scoped flat top-level sections.
|
||||
await expect(sidebar.getByTestId("settings-host-section-providers")).toBeVisible();
|
||||
await expect(sidebar.getByTestId("settings-host-section-agent-profiles")).toBeVisible();
|
||||
await expect(sidebar.getByTestId("settings-host-section-tools")).toBeVisible();
|
||||
await expect(sidebar.getByTestId("settings-host-section-projects")).toBeVisible();
|
||||
await expect(sidebar.getByTestId("settings-host-section-workspaces")).toBeVisible();
|
||||
await expect(sidebar.getByTestId("settings-host-section-usage")).toBeVisible();
|
||||
await expect(sidebar.getByTestId("settings-host-section-host")).toBeVisible();
|
||||
await expect(sidebar.getByTestId("settings-host-section-daemon")).toBeVisible();
|
||||
|
||||
// The old per-host entry rows are replaced by the host picker.
|
||||
// Retired host rows and old per-host entry rows are absent.
|
||||
await expect(sidebar.getByTestId("settings-host-section-connections")).toHaveCount(0);
|
||||
await expect(sidebar.getByTestId("settings-host-section-agents")).toHaveCount(0);
|
||||
await expect(sidebar.getByTestId("settings-host-section-metadata")).toHaveCount(0);
|
||||
await expect(sidebar.locator('[data-testid^="settings-host-entry-"]')).toHaveCount(0);
|
||||
}
|
||||
|
||||
export async function expectHostPageVisible(page: Page, _serverId: string): Promise<void> {
|
||||
await expect(page.getByTestId("host-page-connections-card")).toBeVisible();
|
||||
await expect(page.getByTestId("host-page-identity")).toBeVisible();
|
||||
}
|
||||
|
||||
export async function expectLocalHostEntryFirst(page: Page, _serverId: string): Promise<void> {
|
||||
@@ -697,7 +693,7 @@ export async function expectNoHostPasswordControls(page: Page): Promise<void> {
|
||||
export async function removeHostFromHostPage(page: Page, serverId: string): Promise<void> {
|
||||
await page.getByTestId("host-page-remove-host-button").click();
|
||||
await page.getByTestId("remove-host-confirm").click();
|
||||
await expect(page).not.toHaveURL(new RegExp(`/settings/hosts/${serverId}`));
|
||||
await expect(page).not.toHaveURL(new RegExp(`/settings/(hosts|device-hosts)/${serverId}`));
|
||||
}
|
||||
|
||||
export async function expectHostOnlineWithoutError(page: Page): Promise<void> {
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
import { once } from "node:events";
|
||||
import path from "node:path";
|
||||
import { z } from "zod";
|
||||
import { killProcessTree, spawnTsx } from "./spawn-node";
|
||||
|
||||
const readySchema = z.object({ port: z.number(), serverId: z.string() });
|
||||
const ackSchema = z.object({ type: z.literal("tailscale-available-set"), available: z.boolean() });
|
||||
|
||||
export async function startTailscaleTestDaemon(
|
||||
origin: string,
|
||||
options?: { initialAvailable?: boolean },
|
||||
) {
|
||||
const entrypoint = path.resolve(
|
||||
__dirname,
|
||||
"../../../../server/src/server/test-utils/tailscale-daemon.ts",
|
||||
);
|
||||
const initialMode = options?.initialAvailable === false ? "unavailable" : "available";
|
||||
const child = spawnTsx(entrypoint, [origin, initialMode], {
|
||||
stdio: ["ignore", "inherit", "inherit", "ipc"],
|
||||
});
|
||||
const signal = AbortSignal.timeout(30_000);
|
||||
try {
|
||||
const ready = await Promise.race([
|
||||
once(child, "message", { signal }).then(([message]) => readySchema.parse(message)),
|
||||
once(child, "exit", { signal }).then(([code]) => {
|
||||
throw new Error(`Tailscale test daemon exited before startup with code ${code}`);
|
||||
}),
|
||||
]);
|
||||
return {
|
||||
...ready,
|
||||
tailscaleAddress: `127.0.0.2:${ready.port}`,
|
||||
async setTailscaleAvailable(available: boolean): Promise<void> {
|
||||
const ack = once(child, "message", { signal: AbortSignal.timeout(10_000) }).then(
|
||||
([message]) => ackSchema.parse(message),
|
||||
);
|
||||
child.send({ type: "set-tailscale-available", available });
|
||||
const result = await ack;
|
||||
if (result.available !== available) {
|
||||
throw new Error(`Expected tailscaleAvailable=${String(available)}`);
|
||||
}
|
||||
},
|
||||
close: () => killProcessTree(child),
|
||||
};
|
||||
} catch (error) {
|
||||
await killProcessTree(child);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
require "fileutils"
|
||||
require "tmpdir"
|
||||
require_relative "ios_review"
|
||||
|
||||
default_platform(:ios)
|
||||
|
||||
@@ -42,8 +43,20 @@ def stage_google_play_screenshots
|
||||
root
|
||||
end
|
||||
|
||||
def connect_ios_review_client
|
||||
client = IosReview::SpaceshipClient.new
|
||||
client.authenticate!(
|
||||
key_id: ENV.fetch("ASC_KEY_ID"),
|
||||
issuer_id: ENV.fetch("ASC_ISSUER_ID"),
|
||||
key_filepath: ENV.fetch("ASC_KEY_P8"),
|
||||
)
|
||||
app = client.find_app(APP_IDENTIFIER)
|
||||
UI.user_error!("Could not find app #{APP_IDENTIFIER} on App Store Connect") if app.nil?
|
||||
[client, app]
|
||||
end
|
||||
|
||||
platform :ios do
|
||||
desc "Submit the latest TestFlight build to App Store Review"
|
||||
desc "Submit the latest TestFlight build to App Store Review (non-destructive by default)"
|
||||
lane :submit_review do
|
||||
api_key = app_store_connect_api_key(
|
||||
key_id: ENV.fetch("ASC_KEY_ID"),
|
||||
@@ -51,89 +64,60 @@ platform :ios do
|
||||
key_filepath: ENV.fetch("ASC_KEY_P8"),
|
||||
)
|
||||
|
||||
require "spaceship"
|
||||
Spaceship::ConnectAPI.token = Spaceship::ConnectAPI::Token.create(
|
||||
key_id: ENV.fetch("ASC_KEY_ID"),
|
||||
issuer_id: ENV.fetch("ASC_ISSUER_ID"),
|
||||
filepath: ENV.fetch("ASC_KEY_P8"),
|
||||
client, app = connect_ios_review_client
|
||||
|
||||
IosReview.submit_review(
|
||||
client: client,
|
||||
app: app,
|
||||
ui: UI,
|
||||
target_version: ENV["APP_VERSION"],
|
||||
target_build: ENV["APP_BUILD_VERSION"],
|
||||
replace_in_review: IosReview.parse_bool(ENV["REPLACE_IN_REVIEW"]),
|
||||
deliver_runner: lambda do |app_version:, build_number:, reject_if_possible:|
|
||||
deliver(
|
||||
api_key: api_key,
|
||||
app_identifier: APP_IDENTIFIER,
|
||||
app_version: app_version,
|
||||
build_number: build_number.to_s,
|
||||
submit_for_review: true,
|
||||
automatic_release: true,
|
||||
reject_if_possible: reject_if_possible,
|
||||
release_notes: {
|
||||
"en-US" => "Bug fixes and improvements.",
|
||||
},
|
||||
force: true,
|
||||
skip_binary_upload: true,
|
||||
screenshots_path: stage_app_store_screenshots,
|
||||
overwrite_screenshots: true,
|
||||
precheck_include_in_app_purchases: false,
|
||||
submission_information: {
|
||||
add_id_info_uses_idfa: false,
|
||||
export_compliance_uses_encryption: false,
|
||||
},
|
||||
)
|
||||
end,
|
||||
)
|
||||
app = Spaceship::ConnectAPI::App.find(APP_IDENTIFIER)
|
||||
UI.user_error!("Could not find app #{APP_IDENTIFIER} on App Store Connect") if app.nil?
|
||||
end
|
||||
|
||||
# The release workflow forwards the marketing version and CFBundleVersion of
|
||||
# the binary it just built. Use them to identify the exact build, since
|
||||
# CFBundleVersion is not unique across marketing versions in this project
|
||||
# (the production profile resets it per app_version). The resubmit workflow
|
||||
# leaves these unset and falls back to "most recently uploaded iOS build".
|
||||
target_version = ENV["APP_VERSION"].to_s.strip
|
||||
target_build = ENV["APP_BUILD_VERSION"].to_s.strip
|
||||
target_version = nil if target_version.empty?
|
||||
target_build = nil if target_build.empty?
|
||||
|
||||
if target_version
|
||||
UI.message("Targeting App Store version #{target_version}#{target_build ? " build #{target_build}" : ""} from workflow input")
|
||||
else
|
||||
UI.message("No APP_VERSION provided; selecting the most recently uploaded iOS build")
|
||||
end
|
||||
|
||||
valid_build = nil
|
||||
deadline = Time.now + (30 * 60)
|
||||
loop do
|
||||
builds = Spaceship::ConnectAPI::Build.all(
|
||||
app_id: app.id,
|
||||
sort: "-uploadedDate",
|
||||
limit: 100,
|
||||
).select { |b| b.pre_release_version&.platform == "IOS" }
|
||||
builds = builds.select { |b| b.pre_release_version&.version == target_version } if target_version
|
||||
builds = builds.select { |b| b.version == target_build } if target_build
|
||||
|
||||
build = builds.first
|
||||
if build.nil?
|
||||
UI.user_error!("Timed out waiting for build to appear on App Store Connect.") if Time.now > deadline
|
||||
UI.message("No matching iOS build visible on App Store Connect yet; waiting...")
|
||||
sleep(30)
|
||||
next
|
||||
end
|
||||
|
||||
state = build.processing_state
|
||||
UI.message("Build #{build.pre_release_version.version} (#{build.version}) processing state: #{state || 'unknown'}")
|
||||
if state == "VALID"
|
||||
valid_build = build
|
||||
break
|
||||
end
|
||||
if state == "INVALID" || state == "FAILED"
|
||||
UI.user_error!("Build #{build.version} failed App Store processing (state: #{state}).")
|
||||
end
|
||||
if Time.now > deadline
|
||||
UI.user_error!("Timed out waiting for build #{build.version} to finish processing on App Store Connect.")
|
||||
end
|
||||
sleep(30)
|
||||
end
|
||||
|
||||
app_version = valid_build.pre_release_version.version
|
||||
build_number = valid_build.version
|
||||
UI.message("Submitting build #{build_number} as App Store version #{app_version} for review")
|
||||
|
||||
deliver(
|
||||
api_key: api_key,
|
||||
desc "Print live App Store version, active/pending versions, review submissions, and recent TestFlight builds"
|
||||
lane :review_status do
|
||||
client, app = connect_ios_review_client
|
||||
IosReview.review_status(
|
||||
client: client,
|
||||
app: app,
|
||||
ui: UI,
|
||||
app_identifier: APP_IDENTIFIER,
|
||||
app_version: app_version,
|
||||
build_number: build_number.to_s,
|
||||
submit_for_review: true,
|
||||
automatic_release: true,
|
||||
reject_if_possible: true,
|
||||
release_notes: {
|
||||
"en-US" => "Bug fixes and improvements.",
|
||||
},
|
||||
force: true,
|
||||
skip_binary_upload: true,
|
||||
screenshots_path: stage_app_store_screenshots,
|
||||
overwrite_screenshots: true,
|
||||
precheck_include_in_app_purchases: false,
|
||||
submission_information: {
|
||||
add_id_info_uses_idfa: false,
|
||||
export_compliance_uses_encryption: false,
|
||||
},
|
||||
)
|
||||
end
|
||||
|
||||
desc "Cancel the active in-flight iOS App Store review submission"
|
||||
lane :cancel_review do
|
||||
client, app = connect_ios_review_client
|
||||
IosReview.cancel_review(
|
||||
client: client,
|
||||
app: app,
|
||||
ui: UI,
|
||||
expected_version: ENV["EXPECTED_VERSION"],
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,635 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module IosReview
|
||||
PLATFORM_IOS = "IOS"
|
||||
|
||||
# Valid App Store Connect API v1 filter[appVersionState] values (fastlane 2.241.1
|
||||
# Spaceship::ConnectAPI::AppStoreVersion::AppVersionState) that block a new
|
||||
# App Store review submission.
|
||||
BLOCKING_API_VERSION_STATES = %w[
|
||||
WAITING_FOR_REVIEW
|
||||
IN_REVIEW
|
||||
PENDING_DEVELOPER_RELEASE
|
||||
PENDING_APPLE_RELEASE
|
||||
PROCESSING_FOR_DISTRIBUTION
|
||||
WAITING_FOR_EXPORT_COMPLIANCE
|
||||
ACCEPTED
|
||||
].freeze
|
||||
|
||||
# In-memory check also recognizes the deprecated AppStoreState alias
|
||||
# PROCESSING_FOR_APP_STORE (never sent in filter[appVersionState]).
|
||||
BLOCKING_VERSION_STATES = (BLOCKING_API_VERSION_STATES + %w[
|
||||
PROCESSING_FOR_APP_STORE
|
||||
]).freeze
|
||||
|
||||
# Valid filter[appVersionState] values shown in review_status under active/pending versions.
|
||||
ACTIVE_API_VERSION_STATES = (BLOCKING_API_VERSION_STATES + %w[
|
||||
PREPARE_FOR_SUBMISSION
|
||||
READY_FOR_REVIEW
|
||||
DEVELOPER_REJECTED
|
||||
REJECTED
|
||||
METADATA_REJECTED
|
||||
INVALID_BINARY
|
||||
]).freeze
|
||||
|
||||
# ReviewSubmission states representing an active submission already in Apple's queue
|
||||
# (or mid-cancellation). UNRESOLVED_ISSUES is intentionally excluded here so a
|
||||
# rejected version's free slot is not treated as an in-flight review; stale
|
||||
# UNRESOLVED_ISSUES submissions are cleared separately right before deliver runs.
|
||||
IN_FLIGHT_SUBMISSION_STATES = %w[
|
||||
WAITING_FOR_REVIEW
|
||||
IN_REVIEW
|
||||
CANCELING
|
||||
].freeze
|
||||
|
||||
UNRESOLVED_SUBMISSION_STATES = %w[
|
||||
UNRESOLVED_ISSUES
|
||||
].freeze
|
||||
|
||||
# ReviewSubmission states that can be cancelled via ReviewSubmission#cancel_submission
|
||||
# (or waited on if already CANCELING).
|
||||
CANCELLABLE_SUBMISSION_STATES = %w[
|
||||
WAITING_FOR_REVIEW
|
||||
IN_REVIEW
|
||||
UNRESOLVED_ISSUES
|
||||
CANCELING
|
||||
].freeze
|
||||
|
||||
STATUS_SUBMISSION_STATES = %w[
|
||||
WAITING_FOR_REVIEW
|
||||
IN_REVIEW
|
||||
UNRESOLVED_ISSUES
|
||||
CANCELING
|
||||
READY_FOR_REVIEW
|
||||
].freeze
|
||||
|
||||
DEFAULT_BUILD_TIMEOUT_SECONDS = 30 * 60
|
||||
DEFAULT_BUILD_POLL_INTERVAL = 30
|
||||
DEFAULT_CANCEL_TIMEOUT_SECONDS = 5 * 60
|
||||
DEFAULT_CANCEL_POLL_INTERVAL = 15
|
||||
|
||||
# Thin adapter around Spaceship::ConnectAPI (fastlane 2.241.1).
|
||||
# Injected into IosReview operations so all workflow logic is unit-testable
|
||||
# against in-memory fakes without requiring live ASC credentials.
|
||||
class SpaceshipClient
|
||||
def authenticate!(key_id:, issuer_id:, key_filepath:)
|
||||
require "spaceship"
|
||||
Spaceship::ConnectAPI.token = Spaceship::ConnectAPI::Token.create(
|
||||
key_id: key_id,
|
||||
issuer_id: issuer_id,
|
||||
filepath: key_filepath,
|
||||
)
|
||||
end
|
||||
|
||||
def find_app(bundle_id)
|
||||
Spaceship::ConnectAPI::App.find(bundle_id)
|
||||
end
|
||||
|
||||
def live_version(app)
|
||||
app.get_live_app_store_version(platform: PLATFORM_IOS, includes: "build")
|
||||
end
|
||||
|
||||
def ios_versions(app, states:)
|
||||
app.get_app_store_versions(
|
||||
filter: {
|
||||
platform: PLATFORM_IOS,
|
||||
appVersionState: states.join(","),
|
||||
},
|
||||
includes: "build",
|
||||
)
|
||||
end
|
||||
|
||||
def get_app_store_version(app_store_version_id)
|
||||
Spaceship::ConnectAPI::AppStoreVersion.get(
|
||||
app_store_version_id: app_store_version_id,
|
||||
includes: "build",
|
||||
)
|
||||
end
|
||||
|
||||
def review_submissions(app, states:)
|
||||
app.get_review_submissions(
|
||||
filter: {
|
||||
platform: PLATFORM_IOS,
|
||||
state: states.join(","),
|
||||
},
|
||||
includes: "appStoreVersionForReview",
|
||||
)
|
||||
end
|
||||
|
||||
def get_review_submission(review_submission_id)
|
||||
Spaceship::ConnectAPI::ReviewSubmission.get(
|
||||
review_submission_id: review_submission_id,
|
||||
includes: "appStoreVersionForReview",
|
||||
)
|
||||
end
|
||||
|
||||
def cancel_review_submission(submission)
|
||||
submission.cancel_submission
|
||||
end
|
||||
|
||||
def find_ios_builds(app, version: nil, build_number: nil)
|
||||
if version.nil? && build_number.nil?
|
||||
return recent_ios_builds(app, limit: 25)
|
||||
end
|
||||
|
||||
Spaceship::ConnectAPI::Build.all(
|
||||
app_id: app.id,
|
||||
version: version,
|
||||
build_number: build_number,
|
||||
platform: PLATFORM_IOS,
|
||||
sort: "-uploadedDate",
|
||||
limit: 100,
|
||||
)
|
||||
end
|
||||
|
||||
def recent_ios_builds(app, limit: 5)
|
||||
fetch_limit = [limit * 4, 25].max
|
||||
builds = Spaceship::ConnectAPI.get_builds(
|
||||
filter: { app: app.id },
|
||||
includes: "preReleaseVersion",
|
||||
sort: "-uploadedDate",
|
||||
limit: fetch_limit,
|
||||
).to_models
|
||||
builds.select { |b| b.pre_release_version&.platform == PLATFORM_IOS }.first(limit)
|
||||
end
|
||||
end
|
||||
|
||||
module_function
|
||||
|
||||
def parse_bool(value)
|
||||
value.to_s.strip.casecmp("true").zero?
|
||||
end
|
||||
|
||||
def normalize_optional_string(value)
|
||||
str = value.to_s.strip
|
||||
str.empty? ? nil : str
|
||||
end
|
||||
|
||||
def version_state(version)
|
||||
return nil if version.nil?
|
||||
|
||||
state = version.respond_to?(:app_version_state) ? version.app_version_state : nil
|
||||
state = nil if state.to_s.strip.empty?
|
||||
return state unless state.nil?
|
||||
|
||||
fallback = version.respond_to?(:app_store_state) ? version.app_store_state : nil
|
||||
fallback.to_s.strip.empty? ? nil : fallback
|
||||
end
|
||||
|
||||
def blocking_version_state?(state)
|
||||
BLOCKING_VERSION_STATES.include?(state.to_s)
|
||||
end
|
||||
|
||||
def sort_versions_descending(versions)
|
||||
versions.sort_by do |version|
|
||||
begin
|
||||
Gem::Version.new(version.version_string.to_s)
|
||||
rescue ArgumentError
|
||||
Gem::Version.new("0")
|
||||
end
|
||||
end.reverse
|
||||
end
|
||||
|
||||
def find_blocking_review(client:, app:)
|
||||
versions = client.ios_versions(app, states: BLOCKING_API_VERSION_STATES)
|
||||
.select { |v| blocking_version_state?(version_state(v)) }
|
||||
|
||||
if !versions.empty?
|
||||
version = sort_versions_descending(versions).first
|
||||
return {
|
||||
source: :app_store_version,
|
||||
version: version.version_string,
|
||||
state: version_state(version),
|
||||
build: version.respond_to?(:build) ? version.build&.version : nil,
|
||||
version_record: version,
|
||||
}
|
||||
end
|
||||
|
||||
submissions = client.review_submissions(app, states: IN_FLIGHT_SUBMISSION_STATES)
|
||||
.select { |s| IN_FLIGHT_SUBMISSION_STATES.include?(s.state.to_s) }
|
||||
|
||||
if !submissions.empty?
|
||||
submission = submissions.first
|
||||
assoc_version = submission.respond_to?(:app_store_version_for_review) ? submission.app_store_version_for_review : nil
|
||||
return {
|
||||
source: :review_submission,
|
||||
version: assoc_version&.version_string || "unknown",
|
||||
state: submission.state,
|
||||
build: assoc_version&.respond_to?(:build) ? assoc_version.build&.version : nil,
|
||||
submission: submission,
|
||||
version_record: assoc_version,
|
||||
}
|
||||
end
|
||||
|
||||
nil
|
||||
end
|
||||
|
||||
def wait_for_valid_build(
|
||||
client:,
|
||||
app:,
|
||||
target_version:,
|
||||
target_build:,
|
||||
ui:,
|
||||
timeout_seconds: DEFAULT_BUILD_TIMEOUT_SECONDS,
|
||||
poll_interval: DEFAULT_BUILD_POLL_INTERVAL,
|
||||
sleep_fn: Kernel.method(:sleep),
|
||||
clock: Time.method(:now)
|
||||
)
|
||||
if target_version
|
||||
ui.message("Targeting App Store version #{target_version}#{target_build ? " build #{target_build}" : ""} from workflow input")
|
||||
else
|
||||
ui.message("No APP_VERSION provided; selecting the most recently uploaded iOS build")
|
||||
end
|
||||
|
||||
deadline = clock.call + timeout_seconds
|
||||
loop do
|
||||
builds = client.find_ios_builds(app, version: target_version, build_number: target_build)
|
||||
.select { |b| b.pre_release_version&.platform == PLATFORM_IOS }
|
||||
builds = builds.select { |b| b.pre_release_version&.version == target_version } if target_version
|
||||
builds = builds.select { |b| b.version.to_s == target_build.to_s } if target_build
|
||||
|
||||
build = builds.first
|
||||
if build.nil?
|
||||
if clock.call >= deadline
|
||||
ui.user_error!("Timed out waiting for build to appear on App Store Connect.")
|
||||
end
|
||||
ui.message("No matching iOS build visible on App Store Connect yet; waiting...")
|
||||
sleep_fn.call(poll_interval)
|
||||
next
|
||||
end
|
||||
|
||||
state = build.processing_state
|
||||
ui.message("Build #{build.pre_release_version.version} (#{build.version}) processing state: #{state || 'unknown'}")
|
||||
return build if state == "VALID"
|
||||
|
||||
if state == "INVALID" || state == "FAILED"
|
||||
ui.user_error!("Build #{build.version} failed App Store processing (state: #{state}).")
|
||||
end
|
||||
|
||||
if clock.call >= deadline
|
||||
ui.user_error!("Timed out waiting for build #{build.version} to finish processing on App Store Connect.")
|
||||
end
|
||||
sleep_fn.call(poll_interval)
|
||||
end
|
||||
end
|
||||
|
||||
def resolve_waiting_build_summary(client:, app:, target_version:, target_build:)
|
||||
return [target_version, target_build] if target_version && target_build
|
||||
|
||||
builds = client.find_ios_builds(app, version: target_version, build_number: target_build)
|
||||
.select { |b| b.pre_release_version&.platform == PLATFORM_IOS }
|
||||
builds = builds.select { |b| b.pre_release_version&.version == target_version } if target_version
|
||||
builds = builds.select { |b| b.version.to_s == target_build.to_s } if target_build
|
||||
latest = builds.first
|
||||
|
||||
[
|
||||
target_version || latest&.pre_release_version&.version || "unknown",
|
||||
target_build || latest&.version&.to_s || "unknown",
|
||||
]
|
||||
end
|
||||
|
||||
def submit_review(
|
||||
client:,
|
||||
app:,
|
||||
ui:,
|
||||
deliver_runner:,
|
||||
target_version: nil,
|
||||
target_build: nil,
|
||||
replace_in_review: false,
|
||||
build_timeout_seconds: DEFAULT_BUILD_TIMEOUT_SECONDS,
|
||||
build_poll_interval: DEFAULT_BUILD_POLL_INTERVAL,
|
||||
cancel_timeout_seconds: DEFAULT_CANCEL_TIMEOUT_SECONDS,
|
||||
cancel_poll_interval: DEFAULT_CANCEL_POLL_INTERVAL,
|
||||
sleep_fn: Kernel.method(:sleep),
|
||||
clock: Time.method(:now)
|
||||
)
|
||||
target_version = normalize_optional_string(target_version)
|
||||
target_build = normalize_optional_string(target_build)
|
||||
|
||||
blocking = find_blocking_review(client: client, app: app)
|
||||
|
||||
if blocking && !replace_in_review
|
||||
return emit_skipped_result(
|
||||
client: client,
|
||||
app: app,
|
||||
ui: ui,
|
||||
blocking: blocking,
|
||||
target_version: target_version,
|
||||
target_build: target_build,
|
||||
)
|
||||
end
|
||||
|
||||
valid_build = wait_for_valid_build(
|
||||
client: client,
|
||||
app: app,
|
||||
target_version: target_version,
|
||||
target_build: target_build,
|
||||
ui: ui,
|
||||
timeout_seconds: build_timeout_seconds,
|
||||
poll_interval: build_poll_interval,
|
||||
sleep_fn: sleep_fn,
|
||||
clock: clock,
|
||||
)
|
||||
|
||||
app_version = valid_build.pre_release_version.version
|
||||
build_number = valid_build.version.to_s
|
||||
|
||||
if replace_in_review
|
||||
cancel_result = cancel_review(
|
||||
client: client,
|
||||
app: app,
|
||||
ui: ui,
|
||||
expected_version: nil,
|
||||
timeout_seconds: cancel_timeout_seconds,
|
||||
poll_interval: cancel_poll_interval,
|
||||
sleep_fn: sleep_fn,
|
||||
clock: clock,
|
||||
)
|
||||
if cancel_result[:status] == :canceled
|
||||
ui.message("Proceeding to submit replacement build #{build_number} as App Store version #{app_version}")
|
||||
end
|
||||
else
|
||||
# Re-check after waiting for TestFlight processing so a review submitted
|
||||
# in the meantime is never disturbed.
|
||||
post_wait_blocking = find_blocking_review(client: client, app: app)
|
||||
if post_wait_blocking
|
||||
return emit_skipped_result(
|
||||
client: client,
|
||||
app: app,
|
||||
ui: ui,
|
||||
blocking: post_wait_blocking,
|
||||
target_version: app_version,
|
||||
target_build: build_number,
|
||||
)
|
||||
end
|
||||
|
||||
# Fastlane's Deliver::SubmitForReview#create_review_submission fails if a
|
||||
# prior rejected ReviewSubmission remains in UNRESOLVED_ISSUES. Clear only
|
||||
# UNRESOLVED_ISSUES submissions here while keeping reject_if_possible: false
|
||||
# so an in-flight WAITING_FOR_REVIEW or IN_REVIEW submission is never cancelled.
|
||||
clear_unresolved_issues_submissions(
|
||||
client: client,
|
||||
app: app,
|
||||
ui: ui,
|
||||
timeout_seconds: cancel_timeout_seconds,
|
||||
poll_interval: cancel_poll_interval,
|
||||
sleep_fn: sleep_fn,
|
||||
clock: clock,
|
||||
)
|
||||
end
|
||||
|
||||
ui.message("Submitting build #{build_number} as App Store version #{app_version} for review (reject_if_possible=#{replace_in_review})")
|
||||
deliver_runner.call(
|
||||
app_version: app_version,
|
||||
build_number: build_number,
|
||||
reject_if_possible: replace_in_review,
|
||||
)
|
||||
|
||||
{
|
||||
status: :submitted,
|
||||
app_version: app_version,
|
||||
build_number: build_number,
|
||||
reject_if_possible: replace_in_review,
|
||||
}
|
||||
end
|
||||
|
||||
def emit_skipped_result(client:, app:, ui:, blocking:, target_version:, target_build:)
|
||||
waiting_version, waiting_build = resolve_waiting_build_summary(
|
||||
client: client,
|
||||
app: app,
|
||||
target_version: target_version,
|
||||
target_build: target_build,
|
||||
)
|
||||
summary = "IOS_REVIEW_SKIPPED in_review_version=#{blocking[:version]} in_review_state=#{blocking[:state]} waiting_version=#{waiting_version} waiting_build=#{waiting_build}"
|
||||
ui.important(summary)
|
||||
ui.message(
|
||||
"Leaving iOS App Store version #{blocking[:version]} (#{blocking[:state]}) untouched. " \
|
||||
"TestFlight build #{waiting_version} (#{waiting_build}) is ready to submit later via " \
|
||||
"resubmit-ios-review.yml (or with replace_in_review=true to replace the in-flight review).",
|
||||
)
|
||||
{
|
||||
status: :skipped,
|
||||
summary: summary,
|
||||
in_review_version: blocking[:version],
|
||||
in_review_state: blocking[:state],
|
||||
waiting_version: waiting_version,
|
||||
waiting_build: waiting_build,
|
||||
}
|
||||
end
|
||||
|
||||
def clear_unresolved_issues_submissions(
|
||||
client:,
|
||||
app:,
|
||||
ui:,
|
||||
timeout_seconds: DEFAULT_CANCEL_TIMEOUT_SECONDS,
|
||||
poll_interval: DEFAULT_CANCEL_POLL_INTERVAL,
|
||||
sleep_fn: Kernel.method(:sleep),
|
||||
clock: Time.method(:now)
|
||||
)
|
||||
stale_submissions = client.review_submissions(app, states: UNRESOLVED_SUBMISSION_STATES)
|
||||
.select { |s| UNRESOLVED_SUBMISSION_STATES.include?(s.state.to_s) }
|
||||
|
||||
stale_submissions.each do |submission|
|
||||
assoc_version = submission.respond_to?(:app_store_version_for_review) ? submission.app_store_version_for_review : nil
|
||||
ui.message(
|
||||
"Clearing stale rejected review submission #{submission.id} " \
|
||||
"(version #{assoc_version&.version_string || 'unknown'}, state: #{submission.state}) before submitting...",
|
||||
)
|
||||
client.cancel_review_submission(submission)
|
||||
wait_for_submission_cancellation(
|
||||
client: client,
|
||||
submission: submission,
|
||||
assoc_version: assoc_version,
|
||||
ui: ui,
|
||||
timeout_seconds: timeout_seconds,
|
||||
poll_interval: poll_interval,
|
||||
sleep_fn: sleep_fn,
|
||||
clock: clock,
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
def wait_for_submission_cancellation(
|
||||
client:,
|
||||
submission:,
|
||||
assoc_version:,
|
||||
ui:,
|
||||
timeout_seconds:,
|
||||
poll_interval:,
|
||||
sleep_fn:,
|
||||
clock:
|
||||
)
|
||||
deadline = clock.call + timeout_seconds
|
||||
final_submission_state = submission.state
|
||||
final_version_state = version_state(assoc_version)
|
||||
|
||||
loop do
|
||||
refreshed = client.get_review_submission(submission.id)
|
||||
final_submission_state = refreshed ? refreshed.state : "COMPLETE"
|
||||
submission_done = refreshed.nil? || !CANCELLABLE_SUBMISSION_STATES.include?(refreshed.state.to_s)
|
||||
|
||||
version_done = true
|
||||
if assoc_version&.id
|
||||
refreshed_version = client.get_app_store_version(assoc_version.id)
|
||||
final_version_state = version_state(refreshed_version) || final_version_state
|
||||
version_done = !%w[WAITING_FOR_REVIEW IN_REVIEW].include?(final_version_state.to_s)
|
||||
end
|
||||
|
||||
return [final_submission_state, final_version_state] if submission_done && version_done
|
||||
|
||||
if clock.call >= deadline
|
||||
ui.user_error!(
|
||||
"Timed out waiting for iOS review submission #{submission.id} cancellation to complete " \
|
||||
"(submission_state=#{final_submission_state}, version_state=#{final_version_state || 'unknown'}).",
|
||||
)
|
||||
end
|
||||
|
||||
ui.message("Waiting for cancellation to take effect (submission=#{final_submission_state}, version=#{final_version_state || 'unknown'})...")
|
||||
sleep_fn.call(poll_interval)
|
||||
end
|
||||
end
|
||||
|
||||
def cancel_review(
|
||||
client:,
|
||||
app:,
|
||||
ui:,
|
||||
expected_version: nil,
|
||||
timeout_seconds: DEFAULT_CANCEL_TIMEOUT_SECONDS,
|
||||
poll_interval: DEFAULT_CANCEL_POLL_INTERVAL,
|
||||
sleep_fn: Kernel.method(:sleep),
|
||||
clock: Time.method(:now)
|
||||
)
|
||||
expected_version = normalize_optional_string(expected_version)
|
||||
|
||||
submissions = client.review_submissions(app, states: CANCELLABLE_SUBMISSION_STATES)
|
||||
.select { |s| CANCELLABLE_SUBMISSION_STATES.include?(s.state.to_s) }
|
||||
blocking_versions = client.ios_versions(app, states: BLOCKING_API_VERSION_STATES)
|
||||
.select { |v| blocking_version_state?(version_state(v)) }
|
||||
|
||||
if submissions.empty?
|
||||
non_cancellable = sort_versions_descending(blocking_versions).first
|
||||
if non_cancellable
|
||||
state = version_state(non_cancellable)
|
||||
ui.user_error!(
|
||||
"Cannot cancel iOS App Store version #{non_cancellable.version_string} (state: #{state}): " \
|
||||
"no cancellable review submission is in progress on App Store Connect.",
|
||||
)
|
||||
end
|
||||
|
||||
suffix = expected_version ? " expected_version=#{expected_version}" : ""
|
||||
summary = "IOS_REVIEW_CANCEL_NOOP reason=no_active_review#{suffix}"
|
||||
ui.message(summary)
|
||||
ui.message("No iOS App Store review submission is currently in flight.")
|
||||
return { status: :noop, summary: summary }
|
||||
end
|
||||
|
||||
submission = submissions.first
|
||||
assoc_version = submission.respond_to?(:app_store_version_for_review) ? submission.app_store_version_for_review : nil
|
||||
if assoc_version.nil?
|
||||
assoc_version = sort_versions_descending(blocking_versions).find do |v|
|
||||
%w[WAITING_FOR_REVIEW IN_REVIEW].include?(version_state(v))
|
||||
end
|
||||
end
|
||||
|
||||
active_version = assoc_version&.version_string
|
||||
if expected_version && active_version != expected_version
|
||||
ui.user_error!(
|
||||
"Refusing to cancel iOS review: expected version #{expected_version}, " \
|
||||
"but active review submission #{submission.id} is for version #{active_version || 'unknown'} (state: #{submission.state}).",
|
||||
)
|
||||
end
|
||||
|
||||
if submission.state == "CANCELING"
|
||||
ui.message("Review submission #{submission.id} (version #{active_version || 'unknown'}) is already CANCELING; waiting for completion...")
|
||||
else
|
||||
ui.message("Cancelling iOS review submission #{submission.id} for version #{active_version || 'unknown'} (state: #{submission.state})...")
|
||||
client.cancel_review_submission(submission)
|
||||
end
|
||||
|
||||
final_submission_state, final_version_state = wait_for_submission_cancellation(
|
||||
client: client,
|
||||
submission: submission,
|
||||
assoc_version: assoc_version,
|
||||
ui: ui,
|
||||
timeout_seconds: timeout_seconds,
|
||||
poll_interval: poll_interval,
|
||||
sleep_fn: sleep_fn,
|
||||
clock: clock,
|
||||
)
|
||||
|
||||
summary = "IOS_REVIEW_CANCELED version=#{active_version || 'unknown'} submission_id=#{submission.id} submission_state=#{final_submission_state} version_state=#{final_version_state || 'unknown'}"
|
||||
ui.success(summary)
|
||||
|
||||
{
|
||||
status: :canceled,
|
||||
summary: summary,
|
||||
version: active_version,
|
||||
submission_id: submission.id,
|
||||
submission_state: final_submission_state,
|
||||
version_state: final_version_state,
|
||||
}
|
||||
end
|
||||
|
||||
def review_status(client:, app:, ui:, app_identifier: "sh.paseo", recent_build_limit: 5)
|
||||
live = client.live_version(app)
|
||||
active_versions = sort_versions_descending(
|
||||
client.ios_versions(app, states: ACTIVE_API_VERSION_STATES),
|
||||
)
|
||||
active_submissions = client.review_submissions(app, states: STATUS_SUBMISSION_STATES)
|
||||
recent_builds = client.recent_ios_builds(app, limit: recent_build_limit)
|
||||
|
||||
lines = ["=== iOS App Store Review Status (#{app_identifier}) ==="]
|
||||
|
||||
lines << "Live App Store version:"
|
||||
if live
|
||||
lines << format_version_line(live)
|
||||
else
|
||||
lines << " (none)"
|
||||
end
|
||||
|
||||
lines << "Active / pending App Store versions:"
|
||||
if active_versions.empty?
|
||||
lines << " (none)"
|
||||
else
|
||||
active_versions.each { |v| lines << format_version_line(v) }
|
||||
end
|
||||
|
||||
lines << "Active review submissions:"
|
||||
if active_submissions.empty?
|
||||
lines << " (none)"
|
||||
else
|
||||
active_submissions.each do |s|
|
||||
assoc = s.respond_to?(:app_store_version_for_review) ? s.app_store_version_for_review : nil
|
||||
submitted = s.respond_to?(:submitted_date) && s.submitted_date ? s.submitted_date : "none"
|
||||
lines << " id=#{s.id} | version=#{assoc&.version_string || 'unknown'} | state=#{s.state} | submitted_date=#{submitted}"
|
||||
end
|
||||
end
|
||||
|
||||
lines << "Recent iOS TestFlight builds (top #{recent_build_limit}):"
|
||||
if recent_builds.empty?
|
||||
lines << " (none)"
|
||||
else
|
||||
recent_builds.each_with_index do |b, idx|
|
||||
ver = b.pre_release_version&.version || "unknown"
|
||||
lines << " #{idx + 1}. version=#{ver} | build=#{b.version} | processing_state=#{b.processing_state || 'unknown'} | uploaded_date=#{b.uploaded_date || 'unknown'}"
|
||||
end
|
||||
end
|
||||
|
||||
report = lines.join("\n")
|
||||
ui.message(report)
|
||||
|
||||
{
|
||||
live_version: live,
|
||||
active_versions: active_versions,
|
||||
active_submissions: active_submissions,
|
||||
recent_builds: recent_builds,
|
||||
report: report,
|
||||
}
|
||||
end
|
||||
|
||||
def format_version_line(version)
|
||||
state = version_state(version) || "unknown"
|
||||
build_number = version.respond_to?(:build) ? version.build&.version : nil
|
||||
" version=#{version.version_string} | state=#{state} | build=#{build_number || 'none'}"
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,595 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "minitest/autorun"
|
||||
require_relative "ios_review"
|
||||
|
||||
class IosReviewTest < Minitest::Test
|
||||
FakeApp = Struct.new(:id, :bundle_id, keyword_init: true)
|
||||
FakePreReleaseVersion = Struct.new(:version, :platform, keyword_init: true)
|
||||
FakeBuild = Struct.new(:version, :processing_state, :uploaded_date, :pre_release_version, keyword_init: true)
|
||||
FakeAppStoreVersion = Struct.new(:id, :version_string, :app_version_state, :app_store_state, :build, keyword_init: true)
|
||||
FakeReviewSubmission = Struct.new(:id, :state, :submitted_date, :app_store_version_for_review, keyword_init: true)
|
||||
|
||||
class FakeUserError < StandardError; end
|
||||
|
||||
class FakeUI
|
||||
attr_reader :messages, :importants, :successes
|
||||
|
||||
def initialize
|
||||
@messages = []
|
||||
@importants = []
|
||||
@successes = []
|
||||
end
|
||||
|
||||
def message(text)
|
||||
@messages << text
|
||||
end
|
||||
|
||||
def important(text)
|
||||
@importants << text
|
||||
end
|
||||
|
||||
def success(text)
|
||||
@successes << text
|
||||
end
|
||||
|
||||
def user_error!(text)
|
||||
raise FakeUserError, text
|
||||
end
|
||||
end
|
||||
|
||||
class FakeClock
|
||||
attr_reader :now
|
||||
|
||||
def initialize(start = 1_000)
|
||||
@now = start
|
||||
end
|
||||
|
||||
def call
|
||||
@now
|
||||
end
|
||||
|
||||
def advance(seconds)
|
||||
@now += seconds
|
||||
end
|
||||
end
|
||||
|
||||
# In-memory fake matching the SpaceshipClient surface.
|
||||
class FakeClient
|
||||
attr_accessor :live_version_record, :versions, :submissions, :builds
|
||||
attr_reader :canceled_submission_ids, :queried_version_state_filters, :queried_submission_state_filters
|
||||
|
||||
def initialize(
|
||||
live_version_record: nil,
|
||||
versions: [],
|
||||
submissions: [],
|
||||
builds: [],
|
||||
submission_poll_states: nil,
|
||||
version_poll_states: nil
|
||||
)
|
||||
@live_version_record = live_version_record
|
||||
@versions = versions
|
||||
@submissions = submissions
|
||||
@builds = builds
|
||||
@submission_poll_states = submission_poll_states || {}
|
||||
@version_poll_states = version_poll_states || {}
|
||||
@canceled_submission_ids = []
|
||||
@queried_version_state_filters = []
|
||||
@queried_submission_state_filters = []
|
||||
end
|
||||
|
||||
def live_version(_app)
|
||||
@live_version_record
|
||||
end
|
||||
|
||||
def ios_versions(_app, states:)
|
||||
@queried_version_state_filters << states
|
||||
@versions.select do |v|
|
||||
state = IosReview.version_state(v)
|
||||
states.include?(state) || (state == "PROCESSING_FOR_APP_STORE" && states.include?("PROCESSING_FOR_DISTRIBUTION"))
|
||||
end
|
||||
end
|
||||
|
||||
def get_app_store_version(app_store_version_id)
|
||||
version = @versions.find { |v| v.id == app_store_version_id }
|
||||
return nil if version.nil?
|
||||
|
||||
queue = @version_poll_states[app_store_version_id]
|
||||
if queue && !queue.empty?
|
||||
next_state = queue.shift
|
||||
version.app_version_state = next_state
|
||||
end
|
||||
version
|
||||
end
|
||||
|
||||
def review_submissions(_app, states:)
|
||||
@queried_submission_state_filters << states
|
||||
@submissions.select { |s| states.include?(s.state) }
|
||||
end
|
||||
|
||||
def get_review_submission(review_submission_id)
|
||||
submission = @submissions.find { |s| s.id == review_submission_id }
|
||||
return nil if submission.nil?
|
||||
|
||||
queue = @submission_poll_states[review_submission_id]
|
||||
if queue && !queue.empty?
|
||||
submission.state = queue.shift
|
||||
end
|
||||
submission
|
||||
end
|
||||
|
||||
def cancel_review_submission(submission)
|
||||
@canceled_submission_ids << submission.id
|
||||
submission.state = "CANCELING"
|
||||
submission
|
||||
end
|
||||
|
||||
def find_ios_builds(_app, version: nil, build_number: nil)
|
||||
result = @builds.select { |b| b.pre_release_version&.platform == "IOS" }
|
||||
result = result.select { |b| b.pre_release_version&.version == version } if version
|
||||
result = result.select { |b| b.version.to_s == build_number.to_s } if build_number
|
||||
result
|
||||
end
|
||||
|
||||
def recent_ios_builds(_app, limit: 5)
|
||||
@builds.select { |b| b.pre_release_version&.platform == "IOS" }.first(limit)
|
||||
end
|
||||
end
|
||||
|
||||
def setup
|
||||
@app = FakeApp.new(id: "app-1", bundle_id: "sh.paseo")
|
||||
@ui = FakeUI.new
|
||||
@clock = FakeClock.new
|
||||
@sleep_fn = lambda { |seconds| @clock.advance(seconds) }
|
||||
end
|
||||
|
||||
def make_build(version, build_number, processing_state: "VALID", uploaded_date: "2026-11-27T10:00:00Z", platform: "IOS")
|
||||
FakeBuild.new(
|
||||
version: build_number,
|
||||
processing_state: processing_state,
|
||||
uploaded_date: uploaded_date,
|
||||
pre_release_version: FakePreReleaseVersion.new(version: version, platform: platform),
|
||||
)
|
||||
end
|
||||
|
||||
def test_submit_review_skips_when_blocking_version_is_in_flight_by_default
|
||||
blocking_states = %w[
|
||||
WAITING_FOR_REVIEW
|
||||
IN_REVIEW
|
||||
PENDING_DEVELOPER_RELEASE
|
||||
PENDING_APPLE_RELEASE
|
||||
PROCESSING_FOR_DISTRIBUTION
|
||||
PROCESSING_FOR_APP_STORE
|
||||
WAITING_FOR_EXPORT_COMPLIANCE
|
||||
ACCEPTED
|
||||
]
|
||||
|
||||
blocking_states.each do |state|
|
||||
ui = FakeUI.new
|
||||
in_flight = if state == "PROCESSING_FOR_APP_STORE"
|
||||
FakeAppStoreVersion.new(id: "v-1", version_string: "0.18.0", app_version_state: nil, app_store_state: state)
|
||||
else
|
||||
FakeAppStoreVersion.new(id: "v-1", version_string: "0.18.0", app_version_state: state)
|
||||
end
|
||||
|
||||
client = FakeClient.new(
|
||||
versions: [in_flight],
|
||||
builds: [make_build("0.18.1", "18001999")],
|
||||
)
|
||||
deliver_calls = []
|
||||
|
||||
result = IosReview.submit_review(
|
||||
client: client,
|
||||
app: @app,
|
||||
ui: ui,
|
||||
target_version: "0.18.1",
|
||||
target_build: "18001999",
|
||||
replace_in_review: false,
|
||||
deliver_runner: ->(args) { deliver_calls << args },
|
||||
sleep_fn: @sleep_fn,
|
||||
clock: @clock,
|
||||
)
|
||||
|
||||
assert_equal :skipped, result[:status], "Expected skip for blocking state #{state}"
|
||||
assert_equal "0.18.0", result[:in_review_version]
|
||||
assert_equal state, result[:in_review_state]
|
||||
assert_equal "0.18.1", result[:waiting_version]
|
||||
assert_equal "18001999", result[:waiting_build]
|
||||
assert_empty client.canceled_submission_ids, "Must never cancel when replace_in_review is false (#{state})"
|
||||
assert_empty deliver_calls, "Must not invoke deliver when skipping (#{state})"
|
||||
assert_includes ui.importants.first, "IOS_REVIEW_SKIPPED in_review_version=0.18.0 in_review_state=#{state} waiting_version=0.18.1 waiting_build=18001999"
|
||||
end
|
||||
end
|
||||
|
||||
def test_submit_review_never_sends_deprecated_app_store_state_in_api_filter
|
||||
client = FakeClient.new(
|
||||
versions: [FakeAppStoreVersion.new(id: "v-1", version_string: "0.18.0", app_version_state: "READY_FOR_DISTRIBUTION")],
|
||||
builds: [make_build("0.18.1", "18001999")],
|
||||
)
|
||||
|
||||
IosReview.submit_review(
|
||||
client: client,
|
||||
app: @app,
|
||||
ui: @ui,
|
||||
target_version: "0.18.1",
|
||||
target_build: "18001999",
|
||||
replace_in_review: false,
|
||||
deliver_runner: ->(_args) {},
|
||||
sleep_fn: @sleep_fn,
|
||||
clock: @clock,
|
||||
)
|
||||
|
||||
client.queried_version_state_filters.each do |states|
|
||||
refute_includes states, "PROCESSING_FOR_APP_STORE"
|
||||
refute_includes states, "READY_FOR_SALE"
|
||||
end
|
||||
end
|
||||
|
||||
def test_submit_review_skips_and_resolves_latest_testflight_build_when_inputs_unset
|
||||
in_flight = FakeAppStoreVersion.new(id: "v-1", version_string: "0.18.0", app_version_state: "IN_REVIEW")
|
||||
client = FakeClient.new(
|
||||
versions: [in_flight],
|
||||
builds: [make_build("0.18.2", "18002999")],
|
||||
)
|
||||
deliver_calls = []
|
||||
|
||||
result = IosReview.submit_review(
|
||||
client: client,
|
||||
app: @app,
|
||||
ui: @ui,
|
||||
target_version: "",
|
||||
target_build: "",
|
||||
replace_in_review: false,
|
||||
deliver_runner: ->(args) { deliver_calls << args },
|
||||
sleep_fn: @sleep_fn,
|
||||
clock: @clock,
|
||||
)
|
||||
|
||||
assert_equal :skipped, result[:status]
|
||||
assert_equal "0.18.2", result[:waiting_version]
|
||||
assert_equal "18002999", result[:waiting_build]
|
||||
assert_empty client.canceled_submission_ids
|
||||
assert_empty deliver_calls
|
||||
assert_includes @ui.importants.first, "IOS_REVIEW_SKIPPED in_review_version=0.18.0 in_review_state=IN_REVIEW waiting_version=0.18.2 waiting_build=18002999"
|
||||
end
|
||||
|
||||
def test_submit_review_auto_submits_when_slot_is_free
|
||||
free_states = %w[
|
||||
READY_FOR_DISTRIBUTION
|
||||
READY_FOR_SALE
|
||||
PREPARE_FOR_SUBMISSION
|
||||
DEVELOPER_REJECTED
|
||||
REJECTED
|
||||
METADATA_REJECTED
|
||||
]
|
||||
|
||||
free_states.each do |state|
|
||||
ui = FakeUI.new
|
||||
existing = FakeAppStoreVersion.new(
|
||||
id: "v-1",
|
||||
version_string: "0.18.0",
|
||||
app_version_state: state == "READY_FOR_SALE" ? nil : state,
|
||||
app_store_state: state == "READY_FOR_SALE" ? state : nil,
|
||||
)
|
||||
client = FakeClient.new(
|
||||
versions: [existing],
|
||||
builds: [make_build("0.18.1", "18001999")],
|
||||
)
|
||||
deliver_calls = []
|
||||
|
||||
result = IosReview.submit_review(
|
||||
client: client,
|
||||
app: @app,
|
||||
ui: ui,
|
||||
target_version: "0.18.1",
|
||||
target_build: "18001999",
|
||||
replace_in_review: false,
|
||||
deliver_runner: ->(args) { deliver_calls << args },
|
||||
sleep_fn: @sleep_fn,
|
||||
clock: @clock,
|
||||
)
|
||||
|
||||
assert_equal :submitted, result[:status], "Expected auto-submit when state is #{state}"
|
||||
assert_equal false, result[:reject_if_possible]
|
||||
assert_empty client.canceled_submission_ids
|
||||
assert_equal [{ app_version: "0.18.1", build_number: "18001999", reject_if_possible: false }], deliver_calls
|
||||
end
|
||||
end
|
||||
|
||||
def test_submit_review_clears_stale_unresolved_issues_submission_on_rejected_version_by_default
|
||||
rejected = FakeAppStoreVersion.new(id: "v-1", version_string: "0.18.0", app_version_state: "REJECTED")
|
||||
stale_submission = FakeReviewSubmission.new(
|
||||
id: "sub-rejected",
|
||||
state: "UNRESOLVED_ISSUES",
|
||||
app_store_version_for_review: rejected,
|
||||
)
|
||||
client = FakeClient.new(
|
||||
versions: [rejected],
|
||||
submissions: [stale_submission],
|
||||
builds: [make_build("0.18.1", "18001999")],
|
||||
submission_poll_states: { "sub-rejected" => %w[CANCELING COMPLETE] },
|
||||
version_poll_states: { "v-1" => %w[REJECTED DEVELOPER_REJECTED] },
|
||||
)
|
||||
deliver_calls = []
|
||||
|
||||
result = IosReview.submit_review(
|
||||
client: client,
|
||||
app: @app,
|
||||
ui: @ui,
|
||||
target_version: "0.18.1",
|
||||
target_build: "18001999",
|
||||
replace_in_review: false,
|
||||
deliver_runner: ->(args) { deliver_calls << args },
|
||||
sleep_fn: @sleep_fn,
|
||||
clock: @clock,
|
||||
)
|
||||
|
||||
assert_equal :submitted, result[:status]
|
||||
assert_equal false, result[:reject_if_possible]
|
||||
assert_equal ["sub-rejected"], client.canceled_submission_ids
|
||||
assert_equal "COMPLETE", stale_submission.state
|
||||
assert_equal [{ app_version: "0.18.1", build_number: "18001999", reject_if_possible: false }], deliver_calls
|
||||
end
|
||||
|
||||
def test_submit_review_skips_if_review_starts_while_waiting_for_build_processing
|
||||
processing_build = make_build("0.18.1", "18001999", processing_state: "PROCESSING")
|
||||
client = FakeClient.new(versions: [], submissions: [], builds: [processing_build])
|
||||
deliver_calls = []
|
||||
|
||||
sleep_and_start_review = lambda do |seconds|
|
||||
@clock.advance(seconds)
|
||||
processing_build.processing_state = "VALID"
|
||||
client.versions << FakeAppStoreVersion.new(id: "v-race", version_string: "0.18.0", app_version_state: "WAITING_FOR_REVIEW")
|
||||
end
|
||||
|
||||
result = IosReview.submit_review(
|
||||
client: client,
|
||||
app: @app,
|
||||
ui: @ui,
|
||||
target_version: "0.18.1",
|
||||
target_build: "18001999",
|
||||
replace_in_review: false,
|
||||
deliver_runner: ->(args) { deliver_calls << args },
|
||||
sleep_fn: sleep_and_start_review,
|
||||
clock: @clock,
|
||||
)
|
||||
|
||||
assert_equal :skipped, result[:status]
|
||||
assert_equal "0.18.0", result[:in_review_version]
|
||||
assert_equal "WAITING_FOR_REVIEW", result[:in_review_state]
|
||||
assert_empty client.canceled_submission_ids
|
||||
assert_empty deliver_calls
|
||||
assert_includes @ui.importants.first, "IOS_REVIEW_SKIPPED in_review_version=0.18.0 in_review_state=WAITING_FOR_REVIEW waiting_version=0.18.1 waiting_build=18001999"
|
||||
end
|
||||
|
||||
def test_submit_review_with_replace_in_review_cancels_after_validating_build_and_passes_reject_if_possible
|
||||
in_flight_version = FakeAppStoreVersion.new(id: "v-1", version_string: "0.18.0", app_version_state: "IN_REVIEW")
|
||||
submission = FakeReviewSubmission.new(id: "sub-1", state: "IN_REVIEW", app_store_version_for_review: in_flight_version)
|
||||
|
||||
client = FakeClient.new(
|
||||
versions: [in_flight_version],
|
||||
submissions: [submission],
|
||||
builds: [make_build("0.18.1", "18001999", processing_state: "VALID")],
|
||||
submission_poll_states: { "sub-1" => %w[CANCELING COMPLETE] },
|
||||
version_poll_states: { "v-1" => %w[IN_REVIEW DEVELOPER_REJECTED] },
|
||||
)
|
||||
deliver_calls = []
|
||||
|
||||
result = IosReview.submit_review(
|
||||
client: client,
|
||||
app: @app,
|
||||
ui: @ui,
|
||||
target_version: "0.18.1",
|
||||
target_build: "18001999",
|
||||
replace_in_review: true,
|
||||
deliver_runner: ->(args) { deliver_calls << args },
|
||||
sleep_fn: @sleep_fn,
|
||||
clock: @clock,
|
||||
)
|
||||
|
||||
assert_equal :submitted, result[:status]
|
||||
assert_equal true, result[:reject_if_possible]
|
||||
assert_equal ["sub-1"], client.canceled_submission_ids
|
||||
assert_equal "DEVELOPER_REJECTED", in_flight_version.app_version_state
|
||||
assert_equal [{ app_version: "0.18.1", build_number: "18001999", reject_if_possible: true }], deliver_calls
|
||||
end
|
||||
|
||||
def test_submit_review_with_replace_in_review_does_not_cancel_if_replacement_build_is_invalid
|
||||
in_flight_version = FakeAppStoreVersion.new(id: "v-1", version_string: "0.18.0", app_version_state: "WAITING_FOR_REVIEW")
|
||||
submission = FakeReviewSubmission.new(id: "sub-1", state: "WAITING_FOR_REVIEW", app_store_version_for_review: in_flight_version)
|
||||
|
||||
client = FakeClient.new(
|
||||
versions: [in_flight_version],
|
||||
submissions: [submission],
|
||||
builds: [make_build("0.18.1", "18001999", processing_state: "INVALID")],
|
||||
)
|
||||
deliver_calls = []
|
||||
|
||||
error = assert_raises(FakeUserError) do
|
||||
IosReview.submit_review(
|
||||
client: client,
|
||||
app: @app,
|
||||
ui: @ui,
|
||||
target_version: "0.18.1",
|
||||
target_build: "18001999",
|
||||
replace_in_review: true,
|
||||
deliver_runner: ->(args) { deliver_calls << args },
|
||||
sleep_fn: @sleep_fn,
|
||||
clock: @clock,
|
||||
)
|
||||
end
|
||||
|
||||
assert_match(/failed App Store processing/, error.message)
|
||||
assert_empty client.canceled_submission_ids, "Must not cancel active review if replacement build is INVALID"
|
||||
assert_empty deliver_calls
|
||||
end
|
||||
|
||||
def test_cancel_review_cancels_active_submission_and_logs_resulting_state
|
||||
in_flight_version = FakeAppStoreVersion.new(id: "v-1", version_string: "0.18.0", app_version_state: "WAITING_FOR_REVIEW")
|
||||
submission = FakeReviewSubmission.new(id: "sub-99", state: "WAITING_FOR_REVIEW", app_store_version_for_review: in_flight_version)
|
||||
|
||||
client = FakeClient.new(
|
||||
versions: [in_flight_version],
|
||||
submissions: [submission],
|
||||
submission_poll_states: { "sub-99" => %w[CANCELING COMPLETE] },
|
||||
version_poll_states: { "v-1" => %w[WAITING_FOR_REVIEW DEVELOPER_REJECTED] },
|
||||
)
|
||||
|
||||
result = IosReview.cancel_review(
|
||||
client: client,
|
||||
app: @app,
|
||||
ui: @ui,
|
||||
expected_version: "0.18.0",
|
||||
sleep_fn: @sleep_fn,
|
||||
clock: @clock,
|
||||
)
|
||||
|
||||
assert_equal :canceled, result[:status]
|
||||
assert_equal "0.18.0", result[:version]
|
||||
assert_equal "sub-99", result[:submission_id]
|
||||
assert_equal "COMPLETE", result[:submission_state]
|
||||
assert_equal "DEVELOPER_REJECTED", result[:version_state]
|
||||
assert_equal ["sub-99"], client.canceled_submission_ids
|
||||
assert_includes @ui.successes.last, "IOS_REVIEW_CANCELED version=0.18.0 submission_id=sub-99 submission_state=COMPLETE version_state=DEVELOPER_REJECTED"
|
||||
end
|
||||
|
||||
def test_cancel_review_refuses_on_expected_version_mismatch
|
||||
in_flight_version = FakeAppStoreVersion.new(id: "v-1", version_string: "0.18.1", app_version_state: "IN_REVIEW")
|
||||
submission = FakeReviewSubmission.new(id: "sub-99", state: "IN_REVIEW", app_store_version_for_review: in_flight_version)
|
||||
|
||||
client = FakeClient.new(
|
||||
versions: [in_flight_version],
|
||||
submissions: [submission],
|
||||
)
|
||||
|
||||
error = assert_raises(FakeUserError) do
|
||||
IosReview.cancel_review(
|
||||
client: client,
|
||||
app: @app,
|
||||
ui: @ui,
|
||||
expected_version: "0.18.0",
|
||||
sleep_fn: @sleep_fn,
|
||||
clock: @clock,
|
||||
)
|
||||
end
|
||||
|
||||
assert_match(/expected version 0\.18\.0.*version 0\.18\.1/i, error.message)
|
||||
assert_empty client.canceled_submission_ids
|
||||
end
|
||||
|
||||
def test_cancel_review_exits_cleanly_when_no_review_is_in_flight
|
||||
client = FakeClient.new(versions: [], submissions: [])
|
||||
|
||||
result = IosReview.cancel_review(
|
||||
client: client,
|
||||
app: @app,
|
||||
ui: @ui,
|
||||
expected_version: "0.18.0",
|
||||
sleep_fn: @sleep_fn,
|
||||
clock: @clock,
|
||||
)
|
||||
|
||||
assert_equal :noop, result[:status]
|
||||
assert_empty client.canceled_submission_ids
|
||||
assert_includes @ui.messages.first, "IOS_REVIEW_CANCEL_NOOP reason=no_active_review expected_version=0.18.0"
|
||||
end
|
||||
|
||||
def test_cancel_review_errors_clearly_when_version_is_already_pending_release
|
||||
pending = FakeAppStoreVersion.new(id: "v-1", version_string: "0.18.0", app_version_state: "PENDING_APPLE_RELEASE")
|
||||
client = FakeClient.new(versions: [pending], submissions: [])
|
||||
|
||||
error = assert_raises(FakeUserError) do
|
||||
IosReview.cancel_review(
|
||||
client: client,
|
||||
app: @app,
|
||||
ui: @ui,
|
||||
expected_version: "0.18.0",
|
||||
sleep_fn: @sleep_fn,
|
||||
clock: @clock,
|
||||
)
|
||||
end
|
||||
|
||||
assert_match(/Cannot cancel iOS App Store version 0\.18\.0 \(state: PENDING_APPLE_RELEASE\)/, error.message)
|
||||
assert_empty client.canceled_submission_ids
|
||||
end
|
||||
|
||||
def test_cancel_review_waits_without_duplicate_cancel_when_already_canceling
|
||||
in_flight_version = FakeAppStoreVersion.new(id: "v-1", version_string: "0.18.0", app_version_state: "WAITING_FOR_REVIEW")
|
||||
submission = FakeReviewSubmission.new(id: "sub-5", state: "CANCELING", app_store_version_for_review: in_flight_version)
|
||||
|
||||
client = FakeClient.new(
|
||||
versions: [in_flight_version],
|
||||
submissions: [submission],
|
||||
submission_poll_states: { "sub-5" => %w[COMPLETE] },
|
||||
version_poll_states: { "v-1" => %w[DEVELOPER_REJECTED] },
|
||||
)
|
||||
|
||||
result = IosReview.cancel_review(
|
||||
client: client,
|
||||
app: @app,
|
||||
ui: @ui,
|
||||
sleep_fn: @sleep_fn,
|
||||
clock: @clock,
|
||||
)
|
||||
|
||||
assert_equal :canceled, result[:status]
|
||||
assert_empty client.canceled_submission_ids
|
||||
assert_equal "DEVELOPER_REJECTED", result[:version_state]
|
||||
end
|
||||
|
||||
def test_review_status_formats_live_active_submissions_and_top_five_testflight_builds
|
||||
live = FakeAppStoreVersion.new(
|
||||
id: "v-live",
|
||||
version_string: "0.17.1",
|
||||
app_version_state: "READY_FOR_DISTRIBUTION",
|
||||
build: FakeBuild.new(version: "17001999"),
|
||||
)
|
||||
active = FakeAppStoreVersion.new(
|
||||
id: "v-active",
|
||||
version_string: "0.18.0",
|
||||
app_version_state: "WAITING_FOR_REVIEW",
|
||||
build: FakeBuild.new(version: "18000999"),
|
||||
)
|
||||
submission = FakeReviewSubmission.new(
|
||||
id: "sub-10",
|
||||
state: "WAITING_FOR_REVIEW",
|
||||
submitted_date: "2026-11-26T12:00:00Z",
|
||||
app_store_version_for_review: active,
|
||||
)
|
||||
builds = [
|
||||
make_build("0.18.2", "18002999", processing_state: "PROCESSING", uploaded_date: "2026-11-27T11:00:00Z"),
|
||||
make_build("0.18.1", "18001999", processing_state: "VALID", uploaded_date: "2026-11-27T09:00:00Z"),
|
||||
make_build("0.18.0", "18000999", processing_state: "VALID", uploaded_date: "2026-11-26T11:30:00Z"),
|
||||
make_build("0.18.0", "18000001", processing_state: "VALID", uploaded_date: "2026-11-25T10:00:00Z"),
|
||||
make_build("0.17.1", "17001999", processing_state: "VALID", uploaded_date: "2026-11-20T08:00:00Z"),
|
||||
make_build("0.17.0", "17000999", processing_state: "VALID", uploaded_date: "2026-11-15T08:00:00Z"),
|
||||
]
|
||||
|
||||
client = FakeClient.new(
|
||||
live_version_record: live,
|
||||
versions: [live, active],
|
||||
submissions: [submission],
|
||||
builds: builds,
|
||||
)
|
||||
|
||||
result = IosReview.review_status(client: client, app: @app, ui: @ui)
|
||||
report = result[:report]
|
||||
|
||||
assert_equal 5, result[:recent_builds].length
|
||||
assert_includes report, "=== iOS App Store Review Status (sh.paseo) ==="
|
||||
assert_includes report, "version=0.17.1 | state=READY_FOR_DISTRIBUTION | build=17001999"
|
||||
assert_includes report, "version=0.18.0 | state=WAITING_FOR_REVIEW | build=18000999"
|
||||
assert_includes report, "id=sub-10 | version=0.18.0 | state=WAITING_FOR_REVIEW | submitted_date=2026-11-26T12:00:00Z"
|
||||
assert_includes report, "1. version=0.18.2 | build=18002999 | processing_state=PROCESSING | uploaded_date=2026-11-27T11:00:00Z"
|
||||
assert_includes report, "5. version=0.17.1 | build=17001999 | processing_state=VALID | uploaded_date=2026-11-20T08:00:00Z"
|
||||
refute_includes report, "0.17.0"
|
||||
end
|
||||
|
||||
def test_review_status_formats_empty_sections_cleanly
|
||||
client = FakeClient.new
|
||||
result = IosReview.review_status(client: client, app: @app, ui: @ui)
|
||||
report = result[:report]
|
||||
|
||||
assert_equal 4, report.scan(" (none)").length
|
||||
end
|
||||
end
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/app",
|
||||
"version": "0.17.4",
|
||||
"version": "0.18.1",
|
||||
"private": true,
|
||||
"main": "index.ts",
|
||||
"scripts": {
|
||||
@@ -40,7 +40,7 @@
|
||||
"dev:ios": "npm --prefix ../.. run build:client && cross-env APP_VARIANT=development expo run:ios",
|
||||
"build:apk": "npm --prefix ../.. run build:apk",
|
||||
"build:apk:arm64": "npm --prefix ../.. run build:apk:arm64",
|
||||
"test:android": "expo prebuild --platform android --no-install && cd android && ./gradlew :paseo-native-trace:testReleaseUnitTest :paseo-hardware-keyboard:testReleaseUnitTest :react-native-enriched-markdown:testReleaseUnitTest --tests '*InlineCodeFormattingTest' --tests '*ListRenderingTest' --tests '*TaskListInteractionTest' --tests '*ListBlockquoteMeasurementTest' --tests '*BlockquoteCopyTest' --tests '*LongPressSelectionInterceptTest' --no-daemon --max-workers=2 -Dorg.gradle.parallel=false"
|
||||
"test:android": "expo prebuild --platform android --no-install && cd android && ./gradlew :paseo-native-trace:testReleaseUnitTest :paseo-hardware-keyboard:testReleaseUnitTest :react-native-enriched-markdown:testReleaseUnitTest --tests '*InlineCodeFormattingTest' --tests '*ListRenderingTest' --tests '*TaskListInteractionTest' --tests '*ListBlockquoteMeasurementTest' --tests '*BlockquoteCopyTest' --tests '*CodeBlockCopyButtonConstructionTest' --tests '*LongPressSelectionInterceptTest' --no-daemon --max-workers=2 -Dorg.gradle.parallel=false"
|
||||
},
|
||||
"dependencies": {
|
||||
"@codemirror/commands": "6.10.4",
|
||||
|
||||
@@ -24,6 +24,7 @@ describe("materializeAgentProfile", () => {
|
||||
modeId: "plan",
|
||||
thinkingOptionId: "think-hard",
|
||||
options: { web_search: true },
|
||||
systemPrompt: " Focus on UI tokens. ",
|
||||
}),
|
||||
),
|
||||
).toEqual({
|
||||
@@ -32,16 +33,20 @@ describe("materializeAgentProfile", () => {
|
||||
modeId: "plan",
|
||||
thinkingOptionId: "think-hard",
|
||||
options: { web_search: true },
|
||||
systemPrompt: "Focus on UI tokens.",
|
||||
});
|
||||
});
|
||||
|
||||
it("treats omitted and blank fields the same", () => {
|
||||
expect(materializeAgentProfile(profile({ model: " ", modeId: "" }))).toEqual({
|
||||
expect(
|
||||
materializeAgentProfile(profile({ model: " ", modeId: "", systemPrompt: " " })),
|
||||
).toEqual({
|
||||
provider: "claude",
|
||||
modelId: "",
|
||||
modeId: "",
|
||||
thinkingOptionId: "",
|
||||
options: {},
|
||||
systemPrompt: "",
|
||||
});
|
||||
});
|
||||
|
||||
@@ -85,10 +90,14 @@ describe("toAgentConfigApply", () => {
|
||||
).not.toHaveProperty("options");
|
||||
});
|
||||
|
||||
it("never carries a provider, which a running agent cannot change", () => {
|
||||
expect(
|
||||
toAgentConfigApply(materializeAgentProfile(profile({ model: "claude-opus-5" }))),
|
||||
).not.toHaveProperty("provider");
|
||||
it("never carries provider or systemPrompt, which a running agent cannot change", () => {
|
||||
const applied = toAgentConfigApply(
|
||||
materializeAgentProfile(
|
||||
profile({ model: "claude-opus-5", systemPrompt: "Focus on UI tokens." }),
|
||||
),
|
||||
);
|
||||
expect(applied).not.toHaveProperty("provider");
|
||||
expect(applied).not.toHaveProperty("systemPrompt");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ export interface MaterializedAgentProfile {
|
||||
modeId: string;
|
||||
thinkingOptionId: string;
|
||||
options: Record<string, unknown>;
|
||||
/** Creation-only; empty when unset. Ignored when applying to a running agent. */
|
||||
systemPrompt: string;
|
||||
}
|
||||
|
||||
function trimmed(value: string | undefined): string {
|
||||
@@ -26,6 +28,7 @@ export function materializeAgentProfile(profile: AgentProfile): MaterializedAgen
|
||||
modeId: trimmed(profile.modeId),
|
||||
thinkingOptionId: trimmed(profile.thinkingOptionId),
|
||||
options: profile.options ?? {},
|
||||
systemPrompt: trimmed(profile.systemPrompt),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -44,8 +47,8 @@ export function reconcileMaterializedProfileMode(
|
||||
|
||||
/**
|
||||
* The payload for a running agent. Omitted fields are left alone by the daemon,
|
||||
* so a profile that names no mode does not reset the agent's mode. Provider is
|
||||
* absent because a running agent cannot change the process it is.
|
||||
* so a profile that names no mode does not reset the agent's mode. Provider and
|
||||
* systemPrompt are absent because a running agent cannot change either.
|
||||
*/
|
||||
export function toAgentConfigApply(profile: MaterializedAgentProfile): AgentConfigApply {
|
||||
return {
|
||||
|
||||
@@ -170,19 +170,46 @@ describe("openAgentProfileForm", () => {
|
||||
const model = openWithCatalog({ mode: "create" });
|
||||
model.setName(" Cheap grunt ");
|
||||
model.setProvider("codex", { label: "Codex" });
|
||||
model.setSystemPrompt(" ");
|
||||
model.setNotes(" ");
|
||||
|
||||
// Codex declares no thinking options, so that key is genuinely absent —
|
||||
// model and mode are seeded, never left for the host to decide.
|
||||
// `options` and `systemPrompt` stay present when empty so the daemon can
|
||||
// distinguish an intentional clear from an older app that predates them.
|
||||
expect(model.getState().submitValue).toEqual({
|
||||
name: "Cheap grunt",
|
||||
provider: "codex",
|
||||
model: "gpt-5.2-codex",
|
||||
modeId: "read-only",
|
||||
options: {},
|
||||
systemPrompt: "",
|
||||
});
|
||||
});
|
||||
|
||||
it("seeds, tracks dirty state, preserves across provider switches, and submits systemPrompt", () => {
|
||||
const model = openWithCatalog({
|
||||
mode: "edit",
|
||||
profile: {
|
||||
id: "p1",
|
||||
name: "UI work",
|
||||
provider: "claude",
|
||||
model: "claude-opus-5",
|
||||
systemPrompt: "Focus on layout.",
|
||||
},
|
||||
});
|
||||
expect(model.getState().systemPrompt).toBe("Focus on layout.");
|
||||
expect(model.getState().isDirty).toBe(false);
|
||||
|
||||
model.setSystemPrompt(" Focus on layout and tokens. ");
|
||||
expect(model.getState().isDirty).toBe(true);
|
||||
expect(model.getState().submitValue?.systemPrompt).toBe("Focus on layout and tokens.");
|
||||
|
||||
model.setProvider("codex", { label: "Codex" });
|
||||
expect(model.getState().systemPrompt).toBe(" Focus on layout and tokens. ");
|
||||
expect(model.getState().submitValue?.systemPrompt).toBe("Focus on layout and tokens.");
|
||||
});
|
||||
|
||||
it("seeds edit mode from the stored profile before the catalog lands", () => {
|
||||
const model = openAgentProfileForm({
|
||||
mode: "edit",
|
||||
|
||||
@@ -98,6 +98,7 @@ export interface AgentProfileFormState {
|
||||
name: string;
|
||||
icon: string;
|
||||
color: string;
|
||||
systemPrompt: string;
|
||||
notes: string;
|
||||
provider: string;
|
||||
modelId: string;
|
||||
@@ -157,6 +158,7 @@ export interface AgentProfileFormModel {
|
||||
applyControlsUnavailable: (requestKey: string) => void;
|
||||
setName: (value: string) => void;
|
||||
setAppearance: (value: { icon: string; color: string }) => void;
|
||||
setSystemPrompt: (value: string) => void;
|
||||
setNotes: (value: string) => void;
|
||||
setProvider: (providerId: string, display: AgentProfileFormDisplay) => void;
|
||||
setProviderModel: (
|
||||
@@ -471,6 +473,7 @@ function formDraftFingerprint(state: AgentProfileFormState): string {
|
||||
state.modelId,
|
||||
state.modeId,
|
||||
state.thinkingOptionId,
|
||||
state.systemPrompt.trim(),
|
||||
state.notes.trim(),
|
||||
stableOptionsKey(ownOptionsOf(state)),
|
||||
]);
|
||||
@@ -478,6 +481,7 @@ function formDraftFingerprint(state: AgentProfileFormState): string {
|
||||
|
||||
function buildSubmitValue(state: AgentProfileFormState): AgentProfileValue | null {
|
||||
const name = state.name.trim();
|
||||
const systemPrompt = state.systemPrompt.trim();
|
||||
const notes = state.notes.trim();
|
||||
if (!name || !state.provider) {
|
||||
return null;
|
||||
@@ -493,6 +497,10 @@ function buildSubmitValue(state: AgentProfileFormState): AgentProfileValue | nul
|
||||
// Always sent, empty included: the daemon reads a write without `options` as one from an
|
||||
// app that predates them and keeps the profile's stored options.
|
||||
options: ownOptionsOf(state),
|
||||
// COMPAT(agentProfileSystemPrompt): added in v0.17.6, remove after 2027-06-01.
|
||||
// Always sent, empty included: the daemon treats an omitted `systemPrompt` as a write from
|
||||
// an older app and preserves the stored prompt; `""` explicitly clears it.
|
||||
systemPrompt,
|
||||
...(notes ? { notes } : {}),
|
||||
};
|
||||
}
|
||||
@@ -529,6 +537,7 @@ function buildInitialState(snapshot: AgentProfileFormSnapshot): AgentProfileForm
|
||||
name,
|
||||
icon: profile.icon ?? "",
|
||||
color: profile.color ?? "",
|
||||
systemPrompt: profile.systemPrompt ?? "",
|
||||
notes: profile.notes ?? "",
|
||||
provider,
|
||||
modelId,
|
||||
@@ -854,6 +863,8 @@ export function openAgentProfileForm(snapshot: AgentProfileFormSnapshot): AgentP
|
||||
publish((current) => ({ ...current, icon: value.icon, color: value.color }), {
|
||||
userEdit: true,
|
||||
}),
|
||||
setSystemPrompt: (value) =>
|
||||
publish((current) => ({ ...current, systemPrompt: value }), { userEdit: true }),
|
||||
setNotes: (value) => publish((current) => ({ ...current, notes: value }), { userEdit: true }),
|
||||
setProvider: (providerId, display) =>
|
||||
publish(
|
||||
|
||||
@@ -63,6 +63,25 @@ describe("buildAgentProfileRosterSummary", () => {
|
||||
expect(summary.runtimeDetails).toEqual(["OpenCode", "Build", "High", "1 option"]);
|
||||
});
|
||||
|
||||
it("includes a system prompt tag when configured", () => {
|
||||
const profile: AgentProfile = {
|
||||
id: "p3",
|
||||
name: "UI specialist",
|
||||
provider: "opencode",
|
||||
model: "openrouter/moonshotai/kimi-k3.1-pro",
|
||||
systemPrompt: "Focus on layout and tokens.",
|
||||
};
|
||||
|
||||
const summary = buildAgentProfileRosterSummary({
|
||||
profile,
|
||||
entries,
|
||||
formatFeatureCount,
|
||||
systemPromptLabel: "System prompt",
|
||||
});
|
||||
|
||||
expect(summary.runtimeDetails).toEqual(["OpenCode", "System prompt"]);
|
||||
});
|
||||
|
||||
it("falls back to stored provider id when catalog is unavailable", () => {
|
||||
const profile: AgentProfile = {
|
||||
id: "p2",
|
||||
|
||||
@@ -40,6 +40,7 @@ export function buildAgentProfileRosterSummary(input: {
|
||||
profile: AgentProfile;
|
||||
entries: readonly ProviderSnapshotEntry[] | undefined;
|
||||
formatFeatureCount: (count: number) => string;
|
||||
systemPromptLabel?: string;
|
||||
}): AgentProfileRosterSummary {
|
||||
const allTags = buildAgentProfileTags(input);
|
||||
const providerLabel =
|
||||
@@ -63,6 +64,26 @@ function findEntry(
|
||||
return entries.find((entry) => entry.provider === provider) ?? null;
|
||||
}
|
||||
|
||||
function resolveModelTag(
|
||||
profile: AgentProfile,
|
||||
entry: ProviderSnapshotEntry | null,
|
||||
): AgentProfileTag | null {
|
||||
const modelId = profile.model?.trim();
|
||||
if (!modelId) return null;
|
||||
const model = entry?.models?.find((candidate) => candidate.id === modelId);
|
||||
return { id: "model", label: model?.label ?? modelId };
|
||||
}
|
||||
|
||||
function resolveModeTag(
|
||||
profile: AgentProfile,
|
||||
entry: ProviderSnapshotEntry | null,
|
||||
): AgentProfileTag | null {
|
||||
const modeId = profile.modeId?.trim();
|
||||
if (!modeId) return null;
|
||||
const mode = entry?.modes?.find((candidate) => candidate.id === modeId);
|
||||
return { id: "mode", label: mode ? formatAgentModeLabel(mode) : modeId };
|
||||
}
|
||||
|
||||
/**
|
||||
* The one-line résumé of a profile in the settings list. Every label falls back
|
||||
* to the stored id: a row must stay readable on a host whose provider catalog
|
||||
@@ -72,24 +93,16 @@ export function buildAgentProfileTags(input: {
|
||||
profile: AgentProfile;
|
||||
entries: readonly ProviderSnapshotEntry[] | undefined;
|
||||
formatFeatureCount: (count: number) => string;
|
||||
systemPromptLabel?: string;
|
||||
}): AgentProfileTag[] {
|
||||
const entries = input.entries ?? [];
|
||||
const entry = findEntry(entries, input.profile.provider);
|
||||
const entry = findEntry(input.entries ?? [], input.profile.provider);
|
||||
const tags: AgentProfileTag[] = [
|
||||
{ id: "provider", label: entry?.label ?? input.profile.provider },
|
||||
];
|
||||
|
||||
const modelId = input.profile.model?.trim();
|
||||
if (modelId) {
|
||||
const model = entry?.models?.find((candidate) => candidate.id === modelId);
|
||||
tags.push({ id: "model", label: model?.label ?? modelId });
|
||||
}
|
||||
|
||||
const modeId = input.profile.modeId?.trim();
|
||||
if (modeId) {
|
||||
const mode = entry?.modes?.find((candidate) => candidate.id === modeId);
|
||||
tags.push({ id: "mode", label: mode ? formatAgentModeLabel(mode) : modeId });
|
||||
}
|
||||
const modelTag = resolveModelTag(input.profile, entry);
|
||||
if (modelTag) tags.push(modelTag);
|
||||
const modeTag = resolveModeTag(input.profile, entry);
|
||||
if (modeTag) tags.push(modeTag);
|
||||
|
||||
const thinkingOptionId = input.profile.thinkingOptionId?.trim();
|
||||
if (thinkingOptionId) {
|
||||
@@ -101,5 +114,9 @@ export function buildAgentProfileTags(input: {
|
||||
tags.push({ id: "features", label: input.formatFeatureCount(featureCount) });
|
||||
}
|
||||
|
||||
if (input.profile.systemPrompt?.trim() && input.systemPromptLabel) {
|
||||
tags.push({ id: "systemPrompt", label: input.systemPromptLabel });
|
||||
}
|
||||
|
||||
return tags;
|
||||
}
|
||||
|
||||
@@ -92,6 +92,8 @@ export function useAgentProfilePicker(
|
||||
[t],
|
||||
);
|
||||
|
||||
const systemPromptLabel = t("settings.host.agentProfiles.systemPromptLabel");
|
||||
|
||||
const rows = useMemo<AgentProfilePickerRow[]>(
|
||||
() =>
|
||||
applicableProfiles.map((profile) => ({
|
||||
@@ -101,11 +103,16 @@ export function useAgentProfilePicker(
|
||||
icon: profile.icon ?? "",
|
||||
color: profile.color ?? "",
|
||||
name: profile.name,
|
||||
summary: buildAgentProfileTags({ profile, entries, formatFeatureCount })
|
||||
summary: buildAgentProfileTags({
|
||||
profile,
|
||||
entries,
|
||||
formatFeatureCount,
|
||||
systemPromptLabel,
|
||||
})
|
||||
.map((tag) => tag.label)
|
||||
.join(" · "),
|
||||
})),
|
||||
[applicableProfiles, entries, formatFeatureCount],
|
||||
[applicableProfiles, entries, formatFeatureCount, systemPromptLabel],
|
||||
);
|
||||
|
||||
const persistSelection = useCallback(
|
||||
|
||||
@@ -246,6 +246,25 @@ function AgentProfileAdvancedFields({
|
||||
onSegmentChange={onThinkingSegmentChange}
|
||||
/>
|
||||
|
||||
<Field
|
||||
label={t("settings.host.agentProfiles.systemPromptLabel")}
|
||||
hint={t("settings.host.agentProfiles.systemPromptHint")}
|
||||
testID="agent-profile-system-prompt-field"
|
||||
>
|
||||
<FormTextInput
|
||||
initialValue={state.systemPrompt}
|
||||
onChangeText={model.setSystemPrompt}
|
||||
placeholder={t("settings.host.agentProfiles.systemPromptPlaceholder")}
|
||||
multiline
|
||||
numberOfLines={3}
|
||||
style={styles.multilineInput}
|
||||
editable={!state.isSubmitting}
|
||||
size={controlSize}
|
||||
accessibilityLabel={t("settings.host.agentProfiles.systemPromptLabel")}
|
||||
testID="agent-profile-system-prompt-input"
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<Field
|
||||
label={t("settings.host.agentProfiles.notesLabel")}
|
||||
hint={t("settings.host.agentProfiles.notesHint")}
|
||||
@@ -257,7 +276,7 @@ function AgentProfileAdvancedFields({
|
||||
placeholder={t("settings.host.agentProfiles.notesPlaceholder")}
|
||||
multiline
|
||||
numberOfLines={3}
|
||||
style={styles.notesInput}
|
||||
style={styles.multilineInput}
|
||||
editable={!state.isSubmitting}
|
||||
size={controlSize}
|
||||
accessibilityLabel={t("settings.host.agentProfiles.notesLabel")}
|
||||
@@ -435,7 +454,10 @@ export function AgentProfileFormFields({
|
||||
: t("settings.host.agentProfiles.featureCount", { count: state.controls.length }),
|
||||
);
|
||||
}
|
||||
if (!state.notes.trim() && hasRuntimeDefaults) {
|
||||
if (state.systemPrompt.trim()) {
|
||||
parts.push(t("settings.host.agentProfiles.systemPromptLabel"));
|
||||
}
|
||||
if (!state.notes.trim() && !state.systemPrompt.trim() && hasRuntimeDefaults) {
|
||||
parts.push(t("settings.host.agentProfiles.addRoutingNoteShort"));
|
||||
}
|
||||
return parts.join(" · ");
|
||||
@@ -444,13 +466,12 @@ export function AgentProfileFormFields({
|
||||
state.controls.length,
|
||||
state.modeDisplay?.label,
|
||||
state.notes,
|
||||
state.systemPrompt,
|
||||
state.thinkingDisplay?.label,
|
||||
t,
|
||||
]);
|
||||
|
||||
const collapsibleLabel = hasRuntimeDefaults
|
||||
? t("settings.host.agentProfiles.customizeSettings")
|
||||
: t("settings.host.agentProfiles.addRoutingNoteShort");
|
||||
const collapsibleLabel = t("settings.host.agentProfiles.customizeSettings");
|
||||
|
||||
const advancedFields = (
|
||||
<AgentProfileAdvancedFields
|
||||
@@ -556,7 +577,7 @@ const styles = StyleSheet.create((theme) => ({
|
||||
featureCardPending: {
|
||||
opacity: theme.opacity[50],
|
||||
},
|
||||
notesInput: {
|
||||
multilineInput: {
|
||||
minHeight: theme.spacing[20],
|
||||
textAlignVertical: "top",
|
||||
},
|
||||
|
||||
@@ -349,9 +349,17 @@ export function AgentProfileRow({
|
||||
[t],
|
||||
);
|
||||
|
||||
const systemPromptLabel = t("settings.host.agentProfiles.systemPromptLabel");
|
||||
|
||||
const rosterSummary = useMemo(
|
||||
() => buildAgentProfileRosterSummary({ profile, entries, formatFeatureCount }),
|
||||
[entries, formatFeatureCount, profile],
|
||||
() =>
|
||||
buildAgentProfileRosterSummary({
|
||||
profile,
|
||||
entries,
|
||||
formatFeatureCount,
|
||||
systemPromptLabel,
|
||||
}),
|
||||
[entries, formatFeatureCount, profile, systemPromptLabel],
|
||||
);
|
||||
const fullSummary = useMemo(
|
||||
() => rosterSummary.allTags.map((tag) => tag.label).join(" · "),
|
||||
|
||||
@@ -72,16 +72,23 @@ function matchesProfileQuery(
|
||||
normalizedQuery: string,
|
||||
entries: readonly ProviderSnapshotEntry[] | undefined,
|
||||
formatFeatureCount: (count: number) => string,
|
||||
systemPromptLabel: string,
|
||||
): boolean {
|
||||
if (
|
||||
profile.name.toLowerCase().includes(normalizedQuery) ||
|
||||
profile.systemPrompt?.toLowerCase().includes(normalizedQuery) ||
|
||||
profile.notes?.toLowerCase().includes(normalizedQuery) ||
|
||||
profile.model?.toLowerCase().includes(normalizedQuery) ||
|
||||
profile.provider.toLowerCase().includes(normalizedQuery)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
const tags = buildAgentProfileTags({ profile, entries, formatFeatureCount });
|
||||
const tags = buildAgentProfileTags({
|
||||
profile,
|
||||
entries,
|
||||
formatFeatureCount,
|
||||
systemPromptLabel,
|
||||
});
|
||||
return tags.some((tag) => tag.label.toLowerCase().includes(normalizedQuery));
|
||||
}
|
||||
|
||||
@@ -857,6 +864,7 @@ export function AgentProfilesPage({
|
||||
[t],
|
||||
);
|
||||
|
||||
const systemPromptLabel = t("settings.host.agentProfiles.systemPromptLabel");
|
||||
const normalizedQuery = searchQuery.trim().toLowerCase();
|
||||
const isFiltering = normalizedQuery.length > 0;
|
||||
|
||||
@@ -868,9 +876,9 @@ export function AgentProfilesPage({
|
||||
return profiles;
|
||||
}
|
||||
return profiles.filter((profile) =>
|
||||
matchesProfileQuery(profile, normalizedQuery, entries, formatFeatureCount),
|
||||
matchesProfileQuery(profile, normalizedQuery, entries, formatFeatureCount, systemPromptLabel),
|
||||
);
|
||||
}, [entries, formatFeatureCount, normalizedQuery, profiles]);
|
||||
}, [entries, formatFeatureCount, normalizedQuery, profiles, systemPromptLabel]);
|
||||
|
||||
const totalCount = profiles?.length ?? 0;
|
||||
const selectedProfileId = activeProfile?.id ?? null;
|
||||
@@ -940,10 +948,12 @@ export function AgentProfilesPage({
|
||||
<View style={styles.rosterPane}>
|
||||
<PageLayout
|
||||
title={t("settings.host.agentProfiles.sectionTitle")}
|
||||
description={t("settings.host.agentProfiles.sectionDescription")}
|
||||
onBack={onBack}
|
||||
actions={headerActions}
|
||||
width="wide"
|
||||
titleTestID="settings-detail-header-title"
|
||||
descriptionTestID="agent-profiles-description"
|
||||
testID="settings-detail-scroll-body"
|
||||
>
|
||||
<RosterBody
|
||||
|
||||
@@ -230,19 +230,22 @@ function NativeStreamViewport(props: StreamRenderInput & { strategy: StreamStrat
|
||||
const hasMeasuredViewport =
|
||||
metrics.viewportMeasuredForKey === metrics.containerKey &&
|
||||
metrics.contentMeasuredForKey === metrics.containerKey;
|
||||
const geometry = nativeHistoryStartGeometry({
|
||||
contentHeight: metrics.contentHeight,
|
||||
viewportHeight: metrics.viewportHeight,
|
||||
offsetY: metrics.offsetY,
|
||||
topOverlayInset,
|
||||
});
|
||||
return {
|
||||
...nativeHistoryStartGeometry({
|
||||
contentHeight: metrics.contentHeight,
|
||||
viewportHeight: metrics.viewportHeight,
|
||||
offsetY: metrics.offsetY,
|
||||
topOverlayInset,
|
||||
}),
|
||||
...geometry,
|
||||
hasOlderHistory,
|
||||
isLoadingOlderHistory,
|
||||
// Reveal an already-filled measured viewport immediately; keep waiting on
|
||||
// rAF before auto-fetching older pages on underfilled views.
|
||||
isReady:
|
||||
isActive &&
|
||||
isAuthoritativeHistoryReady &&
|
||||
historyStartReadyRef.current &&
|
||||
(historyStartReadyRef.current || !geometry.isUnderfilled) &&
|
||||
hasMeasuredViewport,
|
||||
progressKey: olderHistoryProgressKey,
|
||||
};
|
||||
|
||||
@@ -503,18 +503,21 @@ function WebStreamViewport(props: StreamRenderInput & { isMobileBreakpoint: bool
|
||||
}
|
||||
const bottomAnchorSettled =
|
||||
!followOutputRef.current || isScrollContainerNearBottom(scrollContainer);
|
||||
const isUnderfilled =
|
||||
(rowsHostRef.current?.getBoundingClientRect().height ?? 0) +
|
||||
(auxiliaryRef.current?.getBoundingClientRect().height ?? 0) <
|
||||
scrollContainer.clientHeight;
|
||||
return {
|
||||
distanceFromHistoryStart: scrollContainer.scrollTop,
|
||||
isUnderfilled:
|
||||
(rowsHostRef.current?.getBoundingClientRect().height ?? 0) +
|
||||
(auxiliaryRef.current?.getBoundingClientRect().height ?? 0) <
|
||||
scrollContainer.clientHeight,
|
||||
isUnderfilled,
|
||||
hasOlderHistory,
|
||||
isLoadingOlderHistory,
|
||||
// An explicit jump owns the landing position. Revealing another local
|
||||
// page here changes the virtual index before the target has mounted.
|
||||
// Reveal an already-filled viewport during initial layout before paint;
|
||||
// still wait for rAF before auto-fetching older pages on underfilled views.
|
||||
isReady:
|
||||
historyStartReadyRef.current &&
|
||||
(historyStartReadyRef.current || !isUnderfilled) &&
|
||||
isAuthoritativeHistoryReady &&
|
||||
bottomAnchorSettled &&
|
||||
!isJumpSettling(),
|
||||
|
||||
@@ -925,12 +925,14 @@ function RootStack() {
|
||||
<Stack.Screen name="welcome" />
|
||||
<Stack.Screen name="settings/index" />
|
||||
<Stack.Screen name="settings/[section]" />
|
||||
<Stack.Screen name="settings/hosts/index" />
|
||||
<Stack.Screen name="new" />
|
||||
<Stack.Screen name="open-project" />
|
||||
<Stack.Screen name="sessions" />
|
||||
<Stack.Screen name="schedules" />
|
||||
</Stack.Protected>
|
||||
<Stack.Screen name="h/[serverId]" />
|
||||
<Stack.Screen name="settings/device-hosts/[serverId]" />
|
||||
<Stack.Screen name="settings/hosts/[serverId]/index" />
|
||||
<Stack.Screen name="settings/hosts/[serverId]/[hostSection]" />
|
||||
<Stack.Screen name="settings/hosts/[serverId]/plugins/[pluginId]/index" />
|
||||
|
||||
@@ -9,7 +9,9 @@ import { StartupSplashScreen } from "@/screens/startup-splash-screen";
|
||||
import {
|
||||
buildSettingsHostSectionRoute,
|
||||
buildSettingsRoute,
|
||||
buildSettingsSectionRoute,
|
||||
isSettingsSectionSlug,
|
||||
normalizeSettingsSectionSlug,
|
||||
type SettingsSectionSlug,
|
||||
} from "@/utils/host-routes";
|
||||
|
||||
@@ -28,7 +30,7 @@ function SettingsDaemonRedirect() {
|
||||
localDaemon.serverId !== null &&
|
||||
hosts.some((host) => host.serverId === localDaemon.serverId)
|
||||
) {
|
||||
return <Redirect href={buildSettingsHostSectionRoute(localDaemon.serverId, "host")} />;
|
||||
return <Redirect href={buildSettingsHostSectionRoute(localDaemon.serverId, "daemon")} />;
|
||||
}
|
||||
|
||||
return <Redirect href={buildSettingsRoute()} />;
|
||||
@@ -37,7 +39,8 @@ function SettingsDaemonRedirect() {
|
||||
export default function SettingsSectionRoute() {
|
||||
const params = useLocalSearchParams<{ section?: string }>();
|
||||
const rawSection = typeof params.section === "string" ? params.section : "";
|
||||
const section: SettingsSectionSlug = isSettingsSectionSlug(rawSection) ? rawSection : "general";
|
||||
const normalized = normalizeSettingsSectionSlug(rawSection);
|
||||
const section: SettingsSectionSlug = normalized ?? "general";
|
||||
const view = useMemo(() => ({ kind: "section" as const, section }), [section]);
|
||||
|
||||
// COMPAT(settingsDaemonRedirect): added 2026-07-08, remove after 2027-01-08.
|
||||
@@ -49,5 +52,9 @@ export default function SettingsSectionRoute() {
|
||||
);
|
||||
}
|
||||
|
||||
if (normalized && !isSettingsSectionSlug(rawSection)) {
|
||||
return <Redirect href={buildSettingsSectionRoute(normalized)} />;
|
||||
}
|
||||
|
||||
return <SettingsScreen view={view} />;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Redirect, useLocalSearchParams } from "expo-router";
|
||||
import { useMemo } from "react";
|
||||
import { HostRouteBootstrapBoundary } from "@/components/host-route-bootstrap-boundary";
|
||||
import SettingsScreen from "@/screens/settings-screen";
|
||||
import { buildSettingsSectionRoute } from "@/utils/host-routes";
|
||||
|
||||
export default function SettingsDeviceHostDetailRoute() {
|
||||
const params = useLocalSearchParams<{ serverId?: string }>();
|
||||
const serverId = typeof params.serverId === "string" ? params.serverId.trim() : "";
|
||||
const view = useMemo(() => ({ kind: "clientHost" as const, serverId }), [serverId]);
|
||||
|
||||
if (!serverId) {
|
||||
return <Redirect href={buildSettingsSectionRoute("hosts")} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<HostRouteBootstrapBoundary>
|
||||
<SettingsScreen view={view} />
|
||||
</HostRouteBootstrapBoundary>
|
||||
);
|
||||
}
|
||||
@@ -1,16 +1,30 @@
|
||||
import { useLocalSearchParams } from "expo-router";
|
||||
import { Redirect, useLocalSearchParams } from "expo-router";
|
||||
import { useMemo } from "react";
|
||||
import { HostRouteBootstrapBoundary } from "@/components/host-route-bootstrap-boundary";
|
||||
import SettingsScreen from "@/screens/settings-screen";
|
||||
import { normalizeHostSectionSlug } from "@/utils/host-routes";
|
||||
import {
|
||||
buildClientHostSettingsRoute,
|
||||
buildSettingsHostSectionRoute,
|
||||
isHostSectionSlug,
|
||||
normalizeHostSectionSlug,
|
||||
} from "@/utils/host-routes";
|
||||
|
||||
export default function SettingsHostSectionRoute() {
|
||||
const params = useLocalSearchParams<{ serverId?: string; hostSection?: string }>();
|
||||
const serverId = typeof params.serverId === "string" ? params.serverId.trim() : "";
|
||||
const rawSection = typeof params.hostSection === "string" ? params.hostSection : "";
|
||||
const section = normalizeHostSectionSlug(rawSection) ?? "connections";
|
||||
const normalized = normalizeHostSectionSlug(rawSection);
|
||||
const section = normalized ?? "daemon";
|
||||
const view = useMemo(() => ({ kind: "host" as const, serverId, section }), [serverId, section]);
|
||||
|
||||
if (rawSection === "connections" && serverId) {
|
||||
return <Redirect href={buildClientHostSettingsRoute(serverId)} />;
|
||||
}
|
||||
|
||||
if (normalized && !isHostSectionSlug(rawSection) && serverId) {
|
||||
return <Redirect href={buildSettingsHostSectionRoute(serverId, normalized)} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<HostRouteBootstrapBoundary>
|
||||
<SettingsScreen view={view} />
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user