mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-22 16:25:39 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec22b82659 | ||
|
|
02e7b10648 | ||
|
|
3e4f67d88f | ||
|
|
e886aebff3 | ||
|
|
f596e3f7aa |
@@ -1,5 +1,29 @@
|
||||
# Changelog
|
||||
|
||||
## 0.17.2 - 2026-11-22
|
||||
|
||||
- **Turn and session stats:** View per-turn and session timing, token, cache, and cost metrics for Claude, OpenCode v2, Pi, Oh My Pi, and plugin providers. ([#10496](https://github.com/getpaseo/paseo/pull/10496), [#10510](https://github.com/getpaseo/paseo/pull/10510))
|
||||
- **Automatic model list refresh:** Enabled providers refresh their model lists in the background every 30 minutes. ([#10481](https://github.com/getpaseo/paseo/pull/10481))
|
||||
- **Sidebar usage by default:** The sidebar usage summary is enabled by default, sources for inactive providers start hidden, and source toggles move to a Sources list. ([#10491](https://github.com/getpaseo/paseo/pull/10491))
|
||||
- **Agents can steer turns:** Agents can steer another agent's running turn alongside queueing or interrupting it, and receive delivery guidance in the response. ([#10483](https://github.com/getpaseo/paseo/pull/10483))
|
||||
|
||||
### Added
|
||||
|
||||
- Added Archive workspace to the mobile workspace actions menu ([#10507](https://github.com/getpaseo/paseo/pull/10507))
|
||||
- Added provider docs links, fuller diagnostic reports, and a scrollable Models list with inline refresh to provider settings ([#10487](https://github.com/getpaseo/paseo/pull/10487))
|
||||
|
||||
### Changed
|
||||
|
||||
- Removed the "This chat uses OpenCode v2." info row from OpenCode v2 chats ([#10490](https://github.com/getpaseo/paseo/pull/10490))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed pressing Tab or Enter in the slash menu running a stale `/exit` choice and archiving the agent ([#10484](https://github.com/getpaseo/paseo/pull/10484) by [@3ae3ae](https://github.com/3ae3ae))
|
||||
- Fixed busy host connections dropping to reconnect when multiple connections are saved ([#10395](https://github.com/getpaseo/paseo/pull/10395))
|
||||
- Fixed retrying an edited New workspace form hitting a conflict error after a failed start, and unified composer error alerts ([#10482](https://github.com/getpaseo/paseo/pull/10482))
|
||||
- Fixed Antigravity turns staying running after creating a recurring schedule ([#10469](https://github.com/getpaseo/paseo/pull/10469))
|
||||
- Fixed daemon startup and plugin reloads leaving zombie child processes for local directory plugins ([#10470](https://github.com/getpaseo/paseo/pull/10470))
|
||||
|
||||
## 0.17.1 - 2026-11-21
|
||||
|
||||
- **Antigravity approvals and history:** Choose a permission mode, answer tool approvals, and import or reopen sessions. Requires [Antigravity CLI 1.5.0 or later](https://paseo.sh/docs/supported-providers/antigravity). ([#10193](https://github.com/getpaseo/paseo/pull/10193))
|
||||
|
||||
@@ -1,5 +1,29 @@
|
||||
# Changelog
|
||||
|
||||
## 0.17.2 - 2026-11-22
|
||||
|
||||
- **回合和会话统计**:查看 Claude、OpenCode v2、Pi、Oh My Pi 和插件 Provider 的单轮及会话耗时、token、缓存和费用指标。([#10496](https://github.com/getpaseo/paseo/pull/10496), [#10510](https://github.com/getpaseo/paseo/pull/10510))
|
||||
- **自动刷新模型列表**:已启用的 Provider 每 30 分钟在后台刷新一次模型列表。([#10481](https://github.com/getpaseo/paseo/pull/10481))
|
||||
- **默认显示侧边栏用量**:侧边栏用量摘要现在默认开启,未启用 Provider 的用量来源默认隐藏,来源开关移至“来源”列表。([#10491](https://github.com/getpaseo/paseo/pull/10491))
|
||||
- **Agent 可引导进行中的轮次**:Agent 除了排队或中断外,现在可以引导另一个 Agent 正在运行的轮次,并在响应中收到投递指引。([#10483](https://github.com/getpaseo/paseo/pull/10483))
|
||||
|
||||
### 新增
|
||||
|
||||
- 在移动端工作区操作菜单中新增“归档工作区” ([#10507](https://github.com/getpaseo/paseo/pull/10507))
|
||||
- 在 Provider 设置中新增文档链接、更完整的诊断报告,以及带内联刷新按钮的可滚动 Models 列表 ([#10487](https://github.com/getpaseo/paseo/pull/10487))
|
||||
|
||||
### 变更
|
||||
|
||||
- 移除 OpenCode v2 对话中的“This chat uses OpenCode v2.”提示行 ([#10490](https://github.com/getpaseo/paseo/pull/10490))
|
||||
|
||||
### 修复
|
||||
|
||||
- 修复在斜杠菜单中按 Tab 或 Enter 时误触发过期的 `/exit` 选项并归档 Agent 的问题 ([#10484](https://github.com/getpaseo/paseo/pull/10484),贡献者:[@3ae3ae](https://github.com/3ae3ae))
|
||||
- 修复保存了多个主机连接时,繁忙的正常连接会断开重连的问题 ([#10395](https://github.com/getpaseo/paseo/pull/10395))
|
||||
- 修复新建工作区启动失败后,修改表单再重试时出现冲突错误的问题,并统一了 Composer 错误提示 ([#10482](https://github.com/getpaseo/paseo/pull/10482))
|
||||
- 修复 Antigravity 创建循环定时任务后轮次一直停留在运行状态的问题 ([#10469](https://github.com/getpaseo/paseo/pull/10469))
|
||||
- 修复启动 daemon 和重载本地目录插件后遗留僵尸子进程的问题 ([#10470](https://github.com/getpaseo/paseo/pull/10470))
|
||||
|
||||
## 0.17.1 - 2026-11-21
|
||||
|
||||
- **Antigravity 审批和历史记录**:选择权限模式、回复工具审批,以及导入或重新打开会话。需要 [Antigravity CLI 1.5.0 或更高版本](https://paseo.sh/zh-CN/docs/supported-providers/antigravity)。([#10193](https://github.com/getpaseo/paseo/pull/10193))
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
- Turn and session stats: View per-turn and session timing, token, cache, and cost metrics for Claude, OpenCode v2, Pi, Oh My Pi, and plugin providers.
|
||||
- Automatic model list refresh: Enabled providers refresh their model lists in the background every 30 minutes.
|
||||
- Sidebar usage by default: The sidebar usage summary is enabled by default, sources for inactive providers start hidden, and source toggles move to a Sources list.
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,5 @@
|
||||
- Turn and session stats: View per-turn and session timing, token, cache, and cost metrics for Claude, OpenCode v2, Pi, Oh My Pi, and plugin providers.
|
||||
- Automatic model list refresh: Enabled providers refresh their model lists in the background every 30 minutes.
|
||||
- Sidebar usage by default: The sidebar usage summary is enabled by default, sources for inactive providers start hidden, and source toggles move to a Sources list.
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,5 @@
|
||||
- Turn and session stats: View per-turn and session timing, token, cache, and cost metrics for Claude, OpenCode v2, Pi, Oh My Pi, and plugin providers.
|
||||
- Automatic model list refresh: Enabled providers refresh their model lists in the background every 30 minutes.
|
||||
- Sidebar usage by default: The sidebar usage summary is enabled by default, sources for inactive providers start hidden, and source toggles move to a Sources list.
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
@@ -0,0 +1,5 @@
|
||||
- Turn and session stats: View per-turn and session timing, token, cache, and cost metrics for Claude, OpenCode v2, Pi, Oh My Pi, and plugin providers.
|
||||
- Automatic model list refresh: Enabled providers refresh their model lists in the background every 30 minutes.
|
||||
- Sidebar usage by default: The sidebar usage summary is enabled by default, sources for inactive providers start hidden, and source toggles move to a Sources list.
|
||||
|
||||
Full notes: https://paseo.sh/changelog
|
||||
+1
-1
@@ -1 +1 @@
|
||||
sha256-qZCOSeT264mXP2RcV+eD7lEkc3WAH1re6NjTtbQOHqY=
|
||||
sha256-vtzoUMnKaAdBFd/hhnk9p2WwHGgL70RXh26vkkyRIH0=
|
||||
|
||||
Generated
+28
-28
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "paseo",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "paseo",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
"workspaces": [
|
||||
@@ -37477,7 +37477,7 @@
|
||||
},
|
||||
"packages/app": {
|
||||
"name": "@getpaseo/app",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"dependencies": {
|
||||
"@codemirror/commands": "6.10.4",
|
||||
"@codemirror/language": "6.12.4",
|
||||
@@ -39647,13 +39647,13 @@
|
||||
},
|
||||
"packages/cli": {
|
||||
"name": "@getpaseo/cli",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@clack/prompts": "^1.0.0",
|
||||
"@getpaseo/client": "0.17.1",
|
||||
"@getpaseo/protocol": "0.17.1",
|
||||
"@getpaseo/server": "0.17.1",
|
||||
"@getpaseo/client": "0.17.2",
|
||||
"@getpaseo/protocol": "0.17.2",
|
||||
"@getpaseo/server": "0.17.2",
|
||||
"chalk": "^5.3.0",
|
||||
"commander": "^12.0.0",
|
||||
"mime-types": "^2.1.35",
|
||||
@@ -39900,11 +39900,11 @@
|
||||
},
|
||||
"packages/client": {
|
||||
"name": "@getpaseo/client",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@getpaseo/protocol": "0.17.1",
|
||||
"@getpaseo/relay": "0.17.1",
|
||||
"@getpaseo/protocol": "0.17.2",
|
||||
"@getpaseo/relay": "0.17.2",
|
||||
"ws": "^8.20.0",
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
@@ -39916,7 +39916,7 @@
|
||||
},
|
||||
"packages/desktop": {
|
||||
"name": "@getpaseo/desktop",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@getpaseo/cli": "*",
|
||||
@@ -40159,7 +40159,7 @@
|
||||
},
|
||||
"packages/expo-two-way-audio": {
|
||||
"name": "@getpaseo/expo-two-way-audio",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.14",
|
||||
@@ -40205,7 +40205,7 @@
|
||||
},
|
||||
"packages/highlight": {
|
||||
"name": "@getpaseo/highlight",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@codemirror/language": "6.12.4",
|
||||
@@ -40235,7 +40235,7 @@
|
||||
},
|
||||
"packages/plugin": {
|
||||
"name": "@getpaseo/plugin",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "^1.4.0",
|
||||
@@ -40243,8 +40243,8 @@
|
||||
"use-sync-external-store": "^1.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@getpaseo/client": "0.17.1",
|
||||
"@getpaseo/protocol": "0.17.1",
|
||||
"@getpaseo/client": "0.17.2",
|
||||
"@getpaseo/protocol": "0.17.2",
|
||||
"@types/node": "^20.9.0",
|
||||
"@types/react": "~19.2.0",
|
||||
"react": "19.2.3",
|
||||
@@ -40254,8 +40254,8 @@
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@getpaseo/client": "0.17.1",
|
||||
"@getpaseo/protocol": "0.17.1",
|
||||
"@getpaseo/client": "0.17.2",
|
||||
"@getpaseo/protocol": "0.17.2",
|
||||
"react": ">=19.1.0 <20",
|
||||
"react-native": ">=0.81.5",
|
||||
"zod": "^4.4.3"
|
||||
@@ -40277,7 +40277,7 @@
|
||||
},
|
||||
"packages/protocol": {
|
||||
"name": "@getpaseo/protocol",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"semver": "^7.8.5",
|
||||
@@ -40305,7 +40305,7 @@
|
||||
},
|
||||
"packages/relay": {
|
||||
"name": "@getpaseo/relay",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@noble/ciphers": "^2.4.0",
|
||||
@@ -40527,17 +40527,17 @@
|
||||
},
|
||||
"packages/server": {
|
||||
"name": "@getpaseo/server",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "^0.17.1",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.326",
|
||||
"@anthropic-ai/sdk": "^0.104.2",
|
||||
"@getpaseo/client": "0.17.1",
|
||||
"@getpaseo/highlight": "0.17.1",
|
||||
"@getpaseo/plugin": "0.17.1",
|
||||
"@getpaseo/protocol": "0.17.1",
|
||||
"@getpaseo/relay": "0.17.1",
|
||||
"@getpaseo/client": "0.17.2",
|
||||
"@getpaseo/highlight": "0.17.2",
|
||||
"@getpaseo/plugin": "0.17.2",
|
||||
"@getpaseo/protocol": "0.17.2",
|
||||
"@getpaseo/relay": "0.17.2",
|
||||
"@isaacs/ttlcache": "^2.1.4",
|
||||
"@modelcontextprotocol/sdk": "1.29.0",
|
||||
"@opencode-ai/sdk": "1.14.46",
|
||||
@@ -41484,7 +41484,7 @@
|
||||
},
|
||||
"packages/website": {
|
||||
"name": "@getpaseo/website",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"dependencies": {
|
||||
"@cloudflare/vite-plugin": "^1.29.1",
|
||||
"@cloudflare/workers-types": "^4.20260317.1",
|
||||
@@ -43095,7 +43095,7 @@
|
||||
},
|
||||
"plugins": {
|
||||
"name": "@getpaseo/builtin-plugins",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"dependencies": {
|
||||
"@getpaseo/plugin": "*",
|
||||
"zod": "^4.4.3"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "paseo",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"private": true,
|
||||
"description": "Paseo: voice-controlled development environment for local AI coding agents",
|
||||
"keywords": [
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
# Tab switcher sheet drag on iPhone
|
||||
|
||||
Run on a task-owned iPhone 17 simulator (402×874 points, portrait) with the development bundle loaded and a connected isolated host. Select a workspace whose first tab is an agent and whose next 11 tabs are terminals, and select the agent tab. Dismiss the notification entitlement toast.
|
||||
|
||||
The sheet exposes its rows to XCUITest as one "Bottom Sheet" element, so the flow taps fixed points and asserts which tab opens. The sheet opens at 60%, where its handle is at y=350, and expands to 90%, where its handle is at y=87.
|
||||
|
||||
1. A swipe up on the list must expand the sheet. The tap at y=300 then lands on the fourth row and opens a terminal. Without the expansion it lands on the backdrop, and no terminal opens.
|
||||
2. A swipe down on the list at 90% must collapse the sheet. The tap at y=424 then lands on the first row and opens the agent. Without the collapse it lands on the sixth row, which is a terminal.
|
||||
|
||||
The flow ends on the agent tab, so you can replay it. Replay it on the Namespace Mac with an explicit device:
|
||||
|
||||
```sh
|
||||
agent-device replay packages/app/e2e/mobile/agent-device/native-tab-switcher-sheet-drag.ios.ad --platform ios --device 'iPhone 17'
|
||||
```
|
||||
@@ -0,0 +1,20 @@
|
||||
context platform=ios timeout=60000 retries=0
|
||||
env APP_ID=sh.paseo.debug
|
||||
|
||||
open "${APP_ID}"
|
||||
wait "id=\"agent-chat-scroll\"" 20000
|
||||
press "id=\"workspace-tab-switcher-trigger\""
|
||||
wait "label=\"Bottom Sheet\"" 10000
|
||||
gesture pan 200 650 0 -300 500
|
||||
wait 1000
|
||||
press 200 300
|
||||
wait "id=\"terminal-surface\"" 10000
|
||||
press "id=\"workspace-tab-switcher-trigger\""
|
||||
wait "label=\"Bottom Sheet\"" 10000
|
||||
gesture pan 200 650 0 -300 500
|
||||
wait 1000
|
||||
gesture pan 200 400 0 300 500
|
||||
wait 1000
|
||||
press 200 424
|
||||
wait "id=\"agent-chat-scroll\"" 10000
|
||||
close
|
||||
@@ -132,7 +132,7 @@ using namespace facebook::react;
|
||||
if (!props.maintainVisibleContentPosition || scrollView.contentSize.width > self.frame.size.width) {
|
||||
return nil;
|
||||
}
|
||||
NSArray<UIView *> *children = [self contentView].subviews;
|
||||
NSArray<UIView *> *children = [self paseoScrollContentView].subviews;
|
||||
NSUInteger first = props.maintainVisibleContentPosition.value().minIndexForVisible;
|
||||
for (NSUInteger index = first; index < children.count; ++index) {
|
||||
UIView *child = children[index];
|
||||
@@ -149,7 +149,11 @@ using namespace facebook::react;
|
||||
[((RCTViewComponentView *)view).nativeId isEqualToString:@"paseo-end-pin"];
|
||||
}
|
||||
|
||||
- (UIView *)contentView
|
||||
// Not `contentView`: that name would override RCTViewComponentView's getter, which
|
||||
// react-native-gesture-handler reads to pick the view a gesture binds to. Bound to the content
|
||||
// child, a bottom sheet's scroll gesture loses its pairing with the scroll view, so body drags
|
||||
// neither expand the sheet nor scroll the list until the sheet is at its top detent.
|
||||
- (UIView *)paseoScrollContentView
|
||||
{
|
||||
for (UIView *child in self.containerView.subviews) {
|
||||
if (![child conformsToProtocol:@protocol(RCTCustomPullToRefreshViewProtocol)]) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/app",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"private": true,
|
||||
"main": "index.ts",
|
||||
"scripts": {
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
createFloatingPanelHosts,
|
||||
type FloatingPanelHostRect,
|
||||
type MeasurableFloatingPanelHost,
|
||||
} from "./floating-panel-hosts";
|
||||
|
||||
function createHost(rect: FloatingPanelHostRect): MeasurableFloatingPanelHost {
|
||||
return {
|
||||
measureInWindow: (callback) => callback(rect.x, rect.y, rect.width, rect.height),
|
||||
};
|
||||
}
|
||||
|
||||
const WORKSPACE_RECT: FloatingPanelHostRect = { x: 10, y: 20, width: 800, height: 600 };
|
||||
const RETAINED_VIEWPORT: FloatingPanelHostRect = { x: 0, y: 0, width: 1200, height: 900 };
|
||||
|
||||
describe("floating panel hosts", () => {
|
||||
it("measures the newest host registered under the name", async () => {
|
||||
const hosts = createFloatingPanelHosts();
|
||||
hosts.register("workspace", createHost(WORKSPACE_RECT));
|
||||
hosts.register("workspace", createHost(RETAINED_VIEWPORT));
|
||||
|
||||
expect(await hosts.measure("workspace")).toEqual(RETAINED_VIEWPORT);
|
||||
});
|
||||
|
||||
it("keeps measuring a survivor after the newest host unregisters", async () => {
|
||||
const hosts = createFloatingPanelHosts();
|
||||
const unregisterSurvivor = hosts.register("workspace", createHost(WORKSPACE_RECT));
|
||||
const unregisterNewest = hosts.register("workspace", createHost(RETAINED_VIEWPORT));
|
||||
|
||||
unregisterNewest();
|
||||
|
||||
expect(await hosts.measure("workspace")).toEqual(WORKSPACE_RECT);
|
||||
unregisterSurvivor();
|
||||
});
|
||||
|
||||
it("returns null once every host under the name is gone", async () => {
|
||||
const hosts = createFloatingPanelHosts();
|
||||
const unregisterFirst = hosts.register("workspace", createHost(WORKSPACE_RECT));
|
||||
const unregisterSecond = hosts.register("workspace", createHost(RETAINED_VIEWPORT));
|
||||
|
||||
unregisterFirst();
|
||||
unregisterSecond();
|
||||
|
||||
expect(await hosts.measure("workspace")).toBeNull();
|
||||
});
|
||||
|
||||
it("skips hosts that are not laid out", async () => {
|
||||
const hosts = createFloatingPanelHosts();
|
||||
hosts.register("workspace", createHost(WORKSPACE_RECT));
|
||||
hosts.register("workspace", createHost({ x: 0, y: 0, width: 0, height: 0 }));
|
||||
|
||||
expect(await hosts.measure("workspace")).toEqual(WORKSPACE_RECT);
|
||||
});
|
||||
|
||||
it("ignores a repeated unregister of the same host", async () => {
|
||||
const hosts = createFloatingPanelHosts();
|
||||
const unregister = hosts.register("workspace", createHost(WORKSPACE_RECT));
|
||||
|
||||
unregister();
|
||||
unregister();
|
||||
|
||||
expect(await hosts.measure("workspace")).toBeNull();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,57 @@
|
||||
export interface FloatingPanelHostRect {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
|
||||
export interface MeasurableFloatingPanelHost {
|
||||
measureInWindow(callback: (x: number, y: number, width: number, height: number) => void): void;
|
||||
}
|
||||
|
||||
export interface FloatingPanelHosts<T extends MeasurableFloatingPanelHost> {
|
||||
register(name: string, host: T): () => void;
|
||||
measure(name: string): Promise<FloatingPanelHostRect | null>;
|
||||
}
|
||||
|
||||
function measureHost(host: MeasurableFloatingPanelHost): Promise<FloatingPanelHostRect> {
|
||||
return new Promise((resolve) => {
|
||||
host.measureInWindow((x, y, width, height) => resolve({ x, y, width, height }));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Hosts are addressed by name, and one name can have several live hosts: a workspace
|
||||
* screen mounts its own host while retained copies of that screen stay mounted. Track
|
||||
* every host so unmounting one leaves the others measurable.
|
||||
*/
|
||||
export function createFloatingPanelHosts<
|
||||
T extends MeasurableFloatingPanelHost,
|
||||
>(): FloatingPanelHosts<T> {
|
||||
const hostsByName = new Map<string, T[]>();
|
||||
|
||||
function register(name: string, host: T): () => void {
|
||||
const hosts = hostsByName.get(name) ?? [];
|
||||
hostsByName.set(name, hosts);
|
||||
hosts.push(host);
|
||||
|
||||
return () => {
|
||||
const index = hosts.indexOf(host);
|
||||
if (index === -1) return;
|
||||
hosts.splice(index, 1);
|
||||
if (hosts.length === 0 && hostsByName.get(name) === hosts) {
|
||||
hostsByName.delete(name);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
async function measure(name: string): Promise<FloatingPanelHostRect | null> {
|
||||
const hosts = hostsByName.get(name);
|
||||
if (!hosts || hosts.length === 0) return null;
|
||||
|
||||
const rects = await Promise.all(hosts.toReversed().map(measureHost));
|
||||
return rects.find((rect) => rect.width > 0 && rect.height > 0) ?? rects[0];
|
||||
}
|
||||
|
||||
return { register, measure };
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import React, { act } from "react";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import { describe, expect, test } from "vitest";
|
||||
import { Portal, PortalProvider } from "@gorhom/portal";
|
||||
import { FloatingPanelPortalHost, measureFloatingPanelPortalHost } from "./floating-panel-portal";
|
||||
|
||||
describe("Floating panel host lifetime", () => {
|
||||
test("removing the newest host preserves the surviving host measurement", async () => {
|
||||
const container = document.createElement("div");
|
||||
container.style.cssText = "position:relative;width:800px;height:600px";
|
||||
document.body.appendChild(container);
|
||||
const root = createRoot(container);
|
||||
function Content({ overlap }: { overlap: boolean }) {
|
||||
return (
|
||||
<PortalProvider shouldAddRootHost={false}>
|
||||
<FloatingPanelPortalHost name="workspace" />
|
||||
{overlap && <FloatingPanelPortalHost name="workspace" />}
|
||||
<Portal hostName="workspace" name="picker">
|
||||
<div data-testid="picker">Commands</div>
|
||||
</Portal>
|
||||
</PortalProvider>
|
||||
);
|
||||
}
|
||||
try {
|
||||
await act(async () => root.render(<Content overlap={true} />));
|
||||
expect(await measureFloatingPanelPortalHost("workspace")).toMatchObject({
|
||||
width: 800,
|
||||
height: 600,
|
||||
});
|
||||
await act(async () => root.render(<Content overlap={false} />));
|
||||
expect(await measureFloatingPanelPortalHost("workspace")).toMatchObject({
|
||||
width: 800,
|
||||
height: 600,
|
||||
});
|
||||
} finally {
|
||||
await act(async () => root.unmount());
|
||||
container.remove();
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -8,32 +8,21 @@ import {
|
||||
} from "react";
|
||||
import { StyleSheet, View } from "react-native";
|
||||
import { PortalHost } from "@gorhom/portal";
|
||||
import {
|
||||
createFloatingPanelHosts,
|
||||
type FloatingPanelHostRect,
|
||||
} from "@/components/ui/floating-panel-hosts";
|
||||
|
||||
export const DEFAULT_FLOATING_PANEL_PORTAL_HOST = "content-floating-panels";
|
||||
|
||||
const FloatingPanelPortalHostNameContext = createContext(DEFAULT_FLOATING_PANEL_PORTAL_HOST);
|
||||
|
||||
interface Rect {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
const portalHosts = createFloatingPanelHosts<View>();
|
||||
|
||||
const portalHostElements = new Map<string, View>();
|
||||
|
||||
function measureElement(element: View): Promise<Rect> {
|
||||
return new Promise((resolve) => {
|
||||
element.measureInWindow((x, y, width, height) => {
|
||||
resolve({ x, y, width, height });
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export function measureFloatingPanelPortalHost(name: string): Promise<Rect | null> {
|
||||
const element = portalHostElements.get(name);
|
||||
if (!element) return Promise.resolve(null);
|
||||
return measureElement(element);
|
||||
export function measureFloatingPanelPortalHost(
|
||||
name: string,
|
||||
): Promise<FloatingPanelHostRect | null> {
|
||||
return portalHosts.measure(name);
|
||||
}
|
||||
|
||||
export function FloatingPanelPortalHostNameProvider({
|
||||
@@ -64,12 +53,7 @@ export function FloatingPanelPortalHost({
|
||||
useEffect(() => {
|
||||
const host = hostRef.current;
|
||||
if (!host) return undefined;
|
||||
portalHostElements.set(name, host);
|
||||
return () => {
|
||||
if (portalHostElements.get(name) === host) {
|
||||
portalHostElements.delete(name);
|
||||
}
|
||||
};
|
||||
return portalHosts.register(name, host);
|
||||
}, [name]);
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/cli",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"description": "Paseo CLI - control your AI coding agents from the command line",
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
@@ -29,9 +29,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@clack/prompts": "^1.0.0",
|
||||
"@getpaseo/client": "0.17.1",
|
||||
"@getpaseo/protocol": "0.17.1",
|
||||
"@getpaseo/server": "0.17.1",
|
||||
"@getpaseo/client": "0.17.2",
|
||||
"@getpaseo/protocol": "0.17.2",
|
||||
"@getpaseo/server": "0.17.2",
|
||||
"chalk": "^5.3.0",
|
||||
"commander": "^12.0.0",
|
||||
"mime-types": "^2.1.35",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/client",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"description": "Paseo client SDK package",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
@@ -49,8 +49,8 @@
|
||||
"measure:diff-materialization": "tsx scripts/measure-diff-materialization.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@getpaseo/protocol": "0.17.1",
|
||||
"@getpaseo/relay": "0.17.1",
|
||||
"@getpaseo/protocol": "0.17.2",
|
||||
"@getpaseo/relay": "0.17.2",
|
||||
"ws": "^8.20.0",
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/desktop",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"private": true,
|
||||
"description": "Paseo desktop app (Electron wrapper)",
|
||||
"homepage": "https://paseo.sh",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/expo-two-way-audio",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"description": "Native module for two way audio streaming",
|
||||
"keywords": [
|
||||
"ExpoTwoWayAudio",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/highlight",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
"dist",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/plugin",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"description": "Paseo plugin SDK package",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
@@ -78,8 +78,8 @@
|
||||
"use-sync-external-store": "^1.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@getpaseo/client": "0.17.1",
|
||||
"@getpaseo/protocol": "0.17.1",
|
||||
"@getpaseo/client": "0.17.2",
|
||||
"@getpaseo/protocol": "0.17.2",
|
||||
"@types/node": "^20.9.0",
|
||||
"@types/react": "~19.2.0",
|
||||
"react": "19.2.3",
|
||||
@@ -89,8 +89,8 @@
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@getpaseo/client": "0.17.1",
|
||||
"@getpaseo/protocol": "0.17.1",
|
||||
"@getpaseo/client": "0.17.2",
|
||||
"@getpaseo/protocol": "0.17.2",
|
||||
"react": ">=19.1.0 <20",
|
||||
"react-native": ">=0.81.5",
|
||||
"zod": "^4.4.3"
|
||||
|
||||
@@ -46,6 +46,7 @@ import {
|
||||
type ProviderEvent,
|
||||
type ProviderInput,
|
||||
type ProviderLaunch,
|
||||
type ProviderModel,
|
||||
type ProviderPermissionResponse,
|
||||
type ProviderPersistence,
|
||||
type ProviderSessionConfig,
|
||||
@@ -694,7 +695,10 @@ class AcpRuntime {
|
||||
this.nativeSessionId = response.sessionId;
|
||||
this.modes = response.modes ?? null;
|
||||
this.configOptions = response.configOptions ?? [];
|
||||
const catalog = toProviderCatalog(this.modes, this.configOptions);
|
||||
let catalog = toProviderCatalog(this.modes, this.configOptions);
|
||||
if (this.options.options.acpOptions?.perModelThinkingOptions) {
|
||||
catalog = { ...catalog, models: await this.modelsWithOwnThinkingOptions(catalog) };
|
||||
}
|
||||
const autoAcceptMode = this.options.options.acpOptions?.autoAcceptMode;
|
||||
if (!autoAcceptMode) return catalog;
|
||||
return {
|
||||
@@ -704,6 +708,33 @@ class AcpRuntime {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Selects each model in the discovery session to read the thinking options the agent lists for
|
||||
* it, then selects the opening model again for the transformers that run after discovery.
|
||||
*/
|
||||
private async modelsWithOwnThinkingOptions(catalog: ProviderCatalog): Promise<ProviderModel[]> {
|
||||
const models: ProviderModel[] = [];
|
||||
for (const model of catalog.models) {
|
||||
await this.selectModel(model.id);
|
||||
const { thinkingOptions, thinkingOption } = toProviderConfigState(
|
||||
this.modes,
|
||||
this.configOptions,
|
||||
);
|
||||
models.push({
|
||||
...model,
|
||||
thinkingOptions: [...thinkingOptions],
|
||||
defaultThinkingOptionId: thinkingOption,
|
||||
});
|
||||
}
|
||||
if (catalog.defaultModel) await this.selectModel(catalog.defaultModel);
|
||||
return models;
|
||||
}
|
||||
|
||||
private async selectModel(model: string): Promise<void> {
|
||||
if (selectedValue(modelOption(this.configOptions)) === model) return;
|
||||
await this.applyNativeConfigChange({ target: "model", value: model });
|
||||
}
|
||||
|
||||
async prompt(input: Extract<ProviderInput, { type: "session.prompt" }>): Promise<void> {
|
||||
if (this.closing || this.processFailed || this.deferredRetirement) {
|
||||
throw new Error("ACP session is closed");
|
||||
|
||||
@@ -65,6 +65,24 @@ async function waitForEvent(
|
||||
return events.find(predicate)!;
|
||||
}
|
||||
|
||||
interface ModelThinking {
|
||||
id: string;
|
||||
thinkingOptions?: readonly { id: string }[];
|
||||
defaultThinkingOptionId?: string;
|
||||
}
|
||||
|
||||
function modelThinking(model: ModelThinking) {
|
||||
return {
|
||||
id: model.id,
|
||||
thinkingOptions: model.thinkingOptions?.map(optionId),
|
||||
defaultThinkingOptionId: model.defaultThinkingOptionId,
|
||||
};
|
||||
}
|
||||
|
||||
function optionId(option: { id: string }): string {
|
||||
return option.id;
|
||||
}
|
||||
|
||||
type AcpRequestMessage = Extract<AcpStreamMessage, { id: string | number | null; method: string }>;
|
||||
|
||||
interface ConnectorInstance {
|
||||
@@ -1997,6 +2015,70 @@ lines.on("line", (line) => {
|
||||
},
|
||||
);
|
||||
|
||||
it("discovers each model's own thinking options when the agent describes only the selected model", async () => {
|
||||
const executable = await fakeAcp(`const readline = require("node:readline");
|
||||
const lines = readline.createInterface({ input: process.stdin });
|
||||
const send = (message) => process.stdout.write(JSON.stringify(message) + "\\n");
|
||||
const levels = (values) => values.map((value) => ({ name: value[0].toUpperCase() + value.slice(1), value }));
|
||||
const thinking = {
|
||||
neon: { currentValue: "high", options: levels(["low", "high", "xhigh"]) },
|
||||
carbon: { currentValue: "medium", options: levels(["low", "medium", "high"]) },
|
||||
};
|
||||
let model = "neon";
|
||||
const options = () => [
|
||||
{ id: "model", name: "Model", category: "model", type: "select", currentValue: model, options: [{ name: "Neon", value: "neon" }, { name: "Carbon", value: "carbon" }, { name: "Orchestrator", value: "orchestrator" }] },
|
||||
...(thinking[model] ? [{ id: "thought_level", name: "Thinking", category: "thought_level", type: "select", ...thinking[model] }] : []),
|
||||
];
|
||||
lines.on("line", (line) => {
|
||||
const message = JSON.parse(line);
|
||||
if (message.method === "initialize") send({ jsonrpc: "2.0", id: message.id, result: { protocolVersion: message.params.protocolVersion, agentCapabilities: {} } });
|
||||
else if (message.method === "session/new") send({ jsonrpc: "2.0", id: message.id, result: { sessionId: "native-1", modes: null, configOptions: options() } });
|
||||
else if (message.method === "session/set_config_option") {
|
||||
if (message.params.configId === "model") model = message.params.value;
|
||||
send({ jsonrpc: "2.0", id: message.id, result: { configOptions: options() } });
|
||||
}
|
||||
});`);
|
||||
let modelSeenByTransformer: unknown;
|
||||
const registration = runAcpProvider({
|
||||
id: "test-acp",
|
||||
label: "Test ACP",
|
||||
command: [process.execPath, executable],
|
||||
acpOptions: { perModelThinkingOptions: true },
|
||||
transformers: [
|
||||
{
|
||||
async discover(catalog, { config }) {
|
||||
modelSeenByTransformer = (await config.read()).model;
|
||||
return catalog;
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
const connection = await registration.connect({ versions: [1], capabilities: [] });
|
||||
const events: ProviderEvent[] = [];
|
||||
connection.onEvent((event) => events.push(event));
|
||||
try {
|
||||
await connection.send({ type: "catalog", requestId: "catalog-1", cwd: process.cwd() });
|
||||
const event = await waitForEvent(
|
||||
events,
|
||||
(candidate) => candidate.type === "catalog" || candidate.type === "request.failed",
|
||||
);
|
||||
if (event.type !== "catalog") throw new Error(`Expected catalog, got ${event.type}`);
|
||||
expect(event.catalog.defaultModel).toBe("neon");
|
||||
expect(event.catalog.models.map(modelThinking)).toEqual([
|
||||
{ id: "neon", thinkingOptions: ["low", "high", "xhigh"], defaultThinkingOptionId: "high" },
|
||||
{
|
||||
id: "carbon",
|
||||
thinkingOptions: ["low", "medium", "high"],
|
||||
defaultThinkingOptionId: "medium",
|
||||
},
|
||||
{ id: "orchestrator", thinkingOptions: [], defaultThinkingOptionId: undefined },
|
||||
]);
|
||||
expect(modelSeenByTransformer).toBe("neon");
|
||||
} finally {
|
||||
await connection.close();
|
||||
}
|
||||
});
|
||||
|
||||
it("selects the model control when an agent files several controls under the model category", async () => {
|
||||
const executable = await fakeAcp(`const readline = require("node:readline");
|
||||
const lines = readline.createInterface({ input: process.stdin });
|
||||
|
||||
@@ -49,6 +49,11 @@ export interface AcpOptions {
|
||||
startupTimeoutMs?: number;
|
||||
/** Global discovery initializes ACP but returns an empty catalog without opening a session. */
|
||||
workspaceOnlyCatalog?: boolean;
|
||||
/**
|
||||
* For an agent that lists thinking options only for the selected model: discovery selects each
|
||||
* model in turn and records the thinking options the agent lists for it, or none.
|
||||
*/
|
||||
perModelThinkingOptions?: boolean;
|
||||
waitForInitialCommands?: boolean;
|
||||
initialCommandsTimeoutMs?: number;
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/protocol",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"description": "Paseo shared protocol schemas and wire types",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/relay",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"description": "Paseo relay for bridging daemon and client connections",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/server",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"description": "Paseo backend server",
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
@@ -109,11 +109,11 @@
|
||||
"@agentclientprotocol/sdk": "^0.17.1",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.3.326",
|
||||
"@anthropic-ai/sdk": "^0.104.2",
|
||||
"@getpaseo/client": "0.17.1",
|
||||
"@getpaseo/highlight": "0.17.1",
|
||||
"@getpaseo/plugin": "0.17.1",
|
||||
"@getpaseo/protocol": "0.17.1",
|
||||
"@getpaseo/relay": "0.17.1",
|
||||
"@getpaseo/client": "0.17.2",
|
||||
"@getpaseo/highlight": "0.17.2",
|
||||
"@getpaseo/plugin": "0.17.2",
|
||||
"@getpaseo/protocol": "0.17.2",
|
||||
"@getpaseo/relay": "0.17.2",
|
||||
"@isaacs/ttlcache": "^2.1.4",
|
||||
"@modelcontextprotocol/sdk": "1.29.0",
|
||||
"@opencode-ai/sdk": "1.14.46",
|
||||
|
||||
@@ -60,6 +60,24 @@ interface ProviderHarnessOptions {
|
||||
handleInput?: (input: ProviderInput, emit: (event: ProviderEvent) => void) => Promise<boolean>;
|
||||
}
|
||||
|
||||
interface ModelThinking {
|
||||
id: string;
|
||||
thinkingOptions?: readonly { id: string }[];
|
||||
defaultThinkingOptionId?: string;
|
||||
}
|
||||
|
||||
function modelThinking(model: ModelThinking) {
|
||||
return {
|
||||
id: model.id,
|
||||
thinkingOptions: model.thinkingOptions?.map(optionId),
|
||||
defaultThinkingOptionId: model.defaultThinkingOptionId,
|
||||
};
|
||||
}
|
||||
|
||||
function optionId(option: { id: string }): string {
|
||||
return option.id;
|
||||
}
|
||||
|
||||
function controlKey(control: { key: string }): string {
|
||||
return control.key;
|
||||
}
|
||||
@@ -2131,6 +2149,48 @@ describe("PluginAgentClientRegistry", () => {
|
||||
}
|
||||
});
|
||||
|
||||
test("keeps a model's own thinking options and default instead of the catalog's", async () => {
|
||||
const harness = createProviderHarness({
|
||||
async handleInput(input, emit) {
|
||||
if (input.type !== "catalog") return false;
|
||||
emit({
|
||||
type: "catalog",
|
||||
requestId: input.requestId,
|
||||
catalog: {
|
||||
models: [
|
||||
{ id: "shared", label: "Shared" },
|
||||
{
|
||||
id: "fast",
|
||||
label: "Fast",
|
||||
thinkingOptions: [{ id: "light", label: "Light" }],
|
||||
defaultThinkingOptionId: "light",
|
||||
},
|
||||
{ id: "planner", label: "Planner", thinkingOptions: [] },
|
||||
],
|
||||
modes: [],
|
||||
thinkingOptions: [{ id: "deep", label: "Deep" }],
|
||||
defaultModel: "shared",
|
||||
defaultThinkingOption: "deep",
|
||||
},
|
||||
});
|
||||
return true;
|
||||
},
|
||||
});
|
||||
const registry = new PluginAgentClientRegistry(createTestLogger());
|
||||
registry.replace([harness.registration]);
|
||||
try {
|
||||
const client = registry.clients()[harness.registration.id]!;
|
||||
const catalog = await client.fetchCatalog({ scope: "global", force: false });
|
||||
expect(catalog.models.map(modelThinking)).toEqual([
|
||||
{ id: "shared", thinkingOptions: ["deep"], defaultThinkingOptionId: "deep" },
|
||||
{ id: "fast", thinkingOptions: ["light"], defaultThinkingOptionId: "light" },
|
||||
{ id: "planner", thinkingOptions: [], defaultThinkingOptionId: undefined },
|
||||
]);
|
||||
} finally {
|
||||
await registry.shutdown();
|
||||
}
|
||||
});
|
||||
|
||||
test("adapts callback providers into the existing AgentClient and AgentSession path", async () => {
|
||||
const harness = createProviderHarness();
|
||||
const registry = new PluginAgentClientRegistry(createTestLogger());
|
||||
|
||||
@@ -2092,14 +2092,21 @@ function mapModel(
|
||||
catalogThinkingOptions: Extract<ProviderEvent, { type: "catalog" }>["catalog"]["thinkingOptions"],
|
||||
catalogDefaultThinkingOption: string | undefined,
|
||||
): AgentModelDefinition {
|
||||
const thinkingOptions = model.thinkingOptions ?? catalogThinkingOptions;
|
||||
// A default belongs to the options it was chosen from, so a model with its own options never
|
||||
// takes the catalog's default.
|
||||
const thinking = model.thinkingOptions
|
||||
? { options: model.thinkingOptions, defaultId: model.defaultThinkingOptionId }
|
||||
: {
|
||||
options: catalogThinkingOptions,
|
||||
defaultId: model.defaultThinkingOptionId ?? catalogDefaultThinkingOption,
|
||||
};
|
||||
return {
|
||||
...model,
|
||||
provider,
|
||||
isDefault: model.isDefault ?? model.id === defaultModel,
|
||||
metadata: model.metadata ? { ...model.metadata } : undefined,
|
||||
thinkingOptions: thinkingOptions?.map((option) => Object.assign({}, option)),
|
||||
defaultThinkingOptionId: model.defaultThinkingOptionId ?? catalogDefaultThinkingOption,
|
||||
thinkingOptions: thinking.options?.map((option) => Object.assign({}, option)),
|
||||
defaultThinkingOptionId: thinking.defaultId,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1123,12 +1123,10 @@ export default function contribute(plugin: unknown) {
|
||||
});
|
||||
|
||||
it("rejects provider input while a connection is closing", async () => {
|
||||
const releaseDirectory = await mkdtemp(path.join(tmpdir(), "paseo-provider-close-"));
|
||||
const releaseFile = path.join(releaseDirectory, "release");
|
||||
const directory = await createPlugin(
|
||||
"closing-provider",
|
||||
`import { readFile, writeFile } from "node:fs/promises";
|
||||
import type { ProviderRegistration } from "@getpaseo/plugin/server/provider";
|
||||
`import type { ProviderRegistration } from "@getpaseo/plugin/server/provider";
|
||||
const closeReleased = Promise.withResolvers<void>();
|
||||
const provider: ProviderRegistration = {
|
||||
id: "delayed",
|
||||
label: "Delayed",
|
||||
@@ -1140,10 +1138,7 @@ const provider: ProviderRegistration = {
|
||||
onEvent() { return () => undefined; },
|
||||
async close() {
|
||||
console.log("provider close started");
|
||||
while (true) {
|
||||
try { await readFile(${JSON.stringify(releaseFile)}); break; }
|
||||
catch { await new Promise((resolve) => setTimeout(resolve, 10)); }
|
||||
}
|
||||
await closeReleased.promise;
|
||||
console.log("provider close completed");
|
||||
},
|
||||
};
|
||||
@@ -1151,7 +1146,11 @@ const provider: ProviderRegistration = {
|
||||
};
|
||||
export default function contribute(server: { registerProvider(provider: ProviderRegistration): void }) {
|
||||
server.registerProvider(provider);
|
||||
return () => console.log("plugin cleanup started");
|
||||
return () => {
|
||||
console.log("plugin cleanup started");
|
||||
// Let shutdown reach the pending close before releasing it.
|
||||
setImmediate(closeReleased.resolve);
|
||||
};
|
||||
}`,
|
||||
);
|
||||
const closedReports: unknown[] = [];
|
||||
@@ -1174,20 +1173,14 @@ export default function contribute(server: { registerProvider(provider: Provider
|
||||
await expect(connection.send({ type: "catalog", requestId: "during-close" })).rejects.toThrow(
|
||||
"Provider connection is closing",
|
||||
);
|
||||
const stopping = runtime.stopPluginById("closing-provider");
|
||||
await expect
|
||||
.poll(() => pluginMessages(runtime, "closing-provider"))
|
||||
.toContain("plugin cleanup started");
|
||||
await writeFile(releaseFile, "release");
|
||||
await Promise.all([closing, stopping]);
|
||||
await Promise.all([closing, runtime.stopPluginById("closing-provider")]);
|
||||
const messages = pluginMessages(runtime, "closing-provider");
|
||||
expect(messages).toContain("plugin cleanup started");
|
||||
expect(messages).toContain("provider close completed");
|
||||
expect(messages).not.toContain("provider accepted input");
|
||||
expect(closedReports).toHaveLength(1);
|
||||
} finally {
|
||||
await writeFile(releaseFile, "release");
|
||||
await runtime.stopAll();
|
||||
await rm(releaseDirectory, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/website",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -517,6 +517,112 @@ it.each(["live", "replay"] as const)(
|
||||
},
|
||||
);
|
||||
|
||||
// agy 1.5.14 lists `thought_level` only for the selected model and omits it for Orchestrator.
|
||||
it("offers each model its own thinking options and opens Orchestrator with its default", async () => {
|
||||
const { directory, launch } = await launchAgent(`
|
||||
const { createInterface } = require("node:readline");
|
||||
const levels = (...values) => values.map((value) => ({ value, name: value }));
|
||||
const thinking = {
|
||||
"gemini-4-neon": { currentValue: "high", options: levels("low", "medium", "high", "xhigh") },
|
||||
"gemini-4-carbon": { currentValue: "high", options: levels("low", "medium", "high") },
|
||||
"claude-opus-5-5": { currentValue: "medium", options: levels("low", "medium", "high") },
|
||||
};
|
||||
let model = "gemini-4-neon";
|
||||
const configOptions = () => [
|
||||
{ id: "model", name: "Model", category: "model", type: "select", currentValue: model, options: [
|
||||
{ value: "gemini-4-neon", name: "Gemini 4 Neon" },
|
||||
{ value: "gemini-4-carbon", name: "Gemini 4 Carbon" },
|
||||
{ value: "gemini-pro-orchestrator-neon", name: "Orchestrator (Neon)" },
|
||||
{ value: "claude-opus-5-5", name: "Claude Opus 5.5" },
|
||||
] },
|
||||
...(thinking[model] ? [{ id: "thought_level", name: "Thinking", category: "thought_level", type: "select", ...thinking[model] }] : []),
|
||||
{ id: "mode", name: "Mode", category: "mode", type: "select", currentValue: "default",
|
||||
options: [{ value: "default", name: "Default" }, { value: "plan", name: "Plan" }] },
|
||||
];
|
||||
const send = (message) => process.stdout.write(JSON.stringify({ jsonrpc: "2.0", ...message }) + "\\n");
|
||||
createInterface({ input: process.stdin }).on("line", (line) => {
|
||||
const { id, method, params } = JSON.parse(line);
|
||||
if (method === "initialize") send({ id, result: { protocolVersion: 1, agentCapabilities: {} } });
|
||||
if (method === "session/new") {
|
||||
model = "gemini-4-neon";
|
||||
send({ id, result: { sessionId: "native", configOptions: configOptions() } });
|
||||
}
|
||||
if (method === "session/set_config_option") {
|
||||
if (params.configId === "thought_level" && !thinking[model]) {
|
||||
send({ id, error: { code: -32602, message: "unknown config option" } });
|
||||
return;
|
||||
}
|
||||
if (params.configId === "model") model = params.value;
|
||||
else if (params.configId === "thought_level") thinking[model].currentValue = params.value;
|
||||
send({ id, result: { configOptions: configOptions() } });
|
||||
}
|
||||
if (method === "session/close") send({ id, result: {} });
|
||||
});
|
||||
`);
|
||||
const connection = await createAntigravityProvider().connect({
|
||||
launch,
|
||||
versions: [1],
|
||||
capabilities: ["session.configure"],
|
||||
});
|
||||
const events: ProviderEvent[] = [];
|
||||
connection.onEvent((event) => events.push(event));
|
||||
try {
|
||||
await connection.send({ type: "catalog", requestId: "catalog", cwd: directory });
|
||||
await expect
|
||||
.poll(() =>
|
||||
events.find((event) => event.type === "catalog" || event.type === "request.failed"),
|
||||
)
|
||||
.toMatchObject({ type: "catalog" });
|
||||
const catalog = events.find((event) => event.type === "catalog");
|
||||
if (catalog?.type !== "catalog") throw new Error("Expected a catalog");
|
||||
const thinkingByModel = Object.fromEntries(
|
||||
catalog.catalog.models.map((model) => [
|
||||
model.id,
|
||||
{
|
||||
options: model.thinkingOptions?.map((option) => option.id),
|
||||
default: model.defaultThinkingOptionId,
|
||||
},
|
||||
]),
|
||||
);
|
||||
expect(thinkingByModel).toEqual({
|
||||
"gemini-4-neon": { options: ["low", "medium", "high", "xhigh"], default: "high" },
|
||||
"gemini-4-carbon": { options: ["low", "medium", "high"], default: "high" },
|
||||
"gemini-pro-orchestrator-neon": { options: [], default: undefined },
|
||||
"claude-opus-5-5": { options: ["low", "medium", "high"], default: "medium" },
|
||||
});
|
||||
|
||||
await connection.send({
|
||||
type: "session.open",
|
||||
requestId: "open",
|
||||
sessionId: "orchestrator",
|
||||
history: "skip",
|
||||
config: {
|
||||
cwd: directory,
|
||||
model: "gemini-pro-orchestrator-neon",
|
||||
mode: "full-access",
|
||||
thinkingOption: thinkingByModel["gemini-pro-orchestrator-neon"]!.default,
|
||||
env: {},
|
||||
mcpServers: {},
|
||||
settings: {},
|
||||
persist: true,
|
||||
},
|
||||
});
|
||||
await expect
|
||||
.poll(
|
||||
() =>
|
||||
events.find(
|
||||
(event) =>
|
||||
(event.type === "session.ready" && event.sessionId === "orchestrator") ||
|
||||
(event.type === "request.failed" && event.requestId === "open"),
|
||||
),
|
||||
{ timeout: 3_000 },
|
||||
)
|
||||
.toMatchObject({ type: "session.ready" });
|
||||
} finally {
|
||||
await connection.close();
|
||||
}
|
||||
});
|
||||
|
||||
describe("installation", () => {
|
||||
const signal = new AbortController().signal;
|
||||
|
||||
|
||||
@@ -109,6 +109,8 @@ export function createAntigravityProvider(): ProviderRegistration {
|
||||
icon: "icon.svg",
|
||||
command: ["agy", "acp", "--disable-telemetry"],
|
||||
acpOptions: {
|
||||
// agy 1.5.14 lists thinking options for the selected model only, and none for Orchestrator.
|
||||
perModelThinkingOptions: true,
|
||||
waitForInitialCommands: true,
|
||||
loadReplayQuietPeriodMs: 200,
|
||||
// COMPAT(antigravityAcpV1DeferredTurn): added in v0.18.0, remove once Antigravity CLI supports ACP v2 state_update.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@getpaseo/builtin-plugins",
|
||||
"version": "0.17.1",
|
||||
"version": "0.17.2",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -711,6 +711,10 @@ The adapter selects an unambiguous ACP `allow_once` action without opening a Pas
|
||||
Set `default: true` to make this the default for new sessions. The adapter requires an idle
|
||||
session without pending approvals before it switches to or from this mode.
|
||||
|
||||
Set `acpOptions.perModelThinkingOptions` for an agent that lists `thought_level` choices only for
|
||||
the selected model. Catalog discovery selects each model in turn and gives it the thinking options
|
||||
the agent lists for it. A model without a `thought_level` option gets no thinking picker.
|
||||
|
||||
## Test and publish
|
||||
|
||||
Test the provider against the real agent, not only mocked frames:
|
||||
|
||||
@@ -573,6 +573,8 @@ export const vendorEdits: AcpTransformer = {
|
||||
};
|
||||
```
|
||||
|
||||
如果 Agent 只为当前选中的模型列出 `thought_level` 选项,请设置 `acpOptions.perModelThinkingOptions`。目录发现会依次选中每个模型,并为它记录 Agent 列出的思考选项。没有 `thought_level` 选项的模型不会显示思考选择器。
|
||||
|
||||
## 测试与发布 {#test-and-publish}
|
||||
|
||||
用真实的 Agent 测试 Provider,而不只是模拟的数据帧:
|
||||
|
||||
Reference in New Issue
Block a user