Compare commits

..
Author SHA1 Message Date
Mohamed Boudra b2ca56ee73 chore(release): cut 0.17.2 2026-11-22 12:46:24 +01:00
Mohamed Boudra 59f19e4e5e docs(changelog): add 0.17.2 release notes 2026-11-22 12:38:49 +01:00
45 changed files with 150 additions and 931 deletions
-8
View File
@@ -1,13 +1,5 @@
# Changelog
## 0.17.3 - 2026-11-22
### Fixed
- Fixed iPhone sheets such as Workspace tabs ignoring body swipes to expand, scroll, or collapse ([#10525](https://github.com/getpaseo/paseo/pull/10525))
- Fixed Antigravity applying the default model's thinking levels to every model, which blocked Orchestrator chats from opening ([#10524](https://github.com/getpaseo/paseo/pull/10524))
- Fixed `/` and `@` pickers disappearing until reload after returning to a workspace through window history ([#8954](https://github.com/getpaseo/paseo/pull/8954) by [@viking1201](https://github.com/viking1201))
## 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))
-8
View File
@@ -1,13 +1,5 @@
# Changelog
## 0.17.3 - 2026-11-22
### 修复
- 修复 iPhone 上“Workspace 标签”等弹窗忽略主体滑动、无法展开、滚动或收起的问题 ([#10525](https://github.com/getpaseo/paseo/pull/10525))
- 修复 Antigravity 将默认模型的思考级别套用到所有模型,导致无法打开 Orchestrator 对话的问题 ([#10524](https://github.com/getpaseo/paseo/pull/10524))
- 修复通过窗口历史记录返回工作区后,`/` 和 `@` 选择器在刷新前一直消失的问题 ([#8954](https://github.com/getpaseo/paseo/pull/8954),贡献者:[@viking1201](https://github.com/viking1201))
## 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))
@@ -1,6 +0,0 @@
Fixed
- Fixed iPhone sheets such as Workspace tabs ignoring body swipes to expand, scroll, or collapse
- Fixed Antigravity applying the default model's thinking levels to every model, which blocked Orchestrator chats from opening
- Fixed / and @ pickers disappearing until reload after returning to a workspace through window history
Full notes: https://paseo.sh/changelog
@@ -1,6 +0,0 @@
Fixed
- Fixed iPhone sheets such as Workspace tabs ignoring body swipes to expand, scroll, or collapse
- Fixed Antigravity applying the default model's thinking levels to every model, which blocked Orchestrator chats from opening
- Fixed / and @ pickers disappearing until reload after returning to a workspace through window history
Full notes: https://paseo.sh/changelog
@@ -1,6 +0,0 @@
Fixed
- Fixed iPhone sheets such as Workspace tabs ignoring body swipes to expand, scroll, or collapse
- Fixed Antigravity applying the default model's thinking levels to every model, which blocked Orchestrator chats from opening
- Fixed / and @ pickers disappearing until reload after returning to a workspace through window history
Full notes: https://paseo.sh/changelog
@@ -1,6 +0,0 @@
Fixed
- Fixed iPhone sheets such as Workspace tabs ignoring body swipes to expand, scroll, or collapse
- Fixed Antigravity applying the default model's thinking levels to every model, which blocked Orchestrator chats from opening
- Fixed / and @ pickers disappearing until reload after returning to a workspace through window history
Full notes: https://paseo.sh/changelog
+1 -1
View File
@@ -1 +1 @@
sha256-f2/UslxzI8mmz0rl9c1bQ0P2H6zbq96u5NEuao5u1fI=
sha256-vtzoUMnKaAdBFd/hhnk9p2WwHGgL70RXh26vkkyRIH0=
+28 -28
View File
@@ -1,12 +1,12 @@
{
"name": "paseo",
"version": "0.17.3",
"version": "0.17.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "paseo",
"version": "0.17.3",
"version": "0.17.2",
"hasInstallScript": true,
"license": "Apache-2.0",
"workspaces": [
@@ -37477,7 +37477,7 @@
},
"packages/app": {
"name": "@getpaseo/app",
"version": "0.17.3",
"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.3",
"version": "0.17.2",
"license": "Apache-2.0",
"dependencies": {
"@clack/prompts": "^1.0.0",
"@getpaseo/client": "0.17.3",
"@getpaseo/protocol": "0.17.3",
"@getpaseo/server": "0.17.3",
"@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.3",
"version": "0.17.2",
"license": "Apache-2.0",
"dependencies": {
"@getpaseo/protocol": "0.17.3",
"@getpaseo/relay": "0.17.3",
"@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.3",
"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.3",
"version": "0.17.2",
"license": "MIT",
"devDependencies": {
"@types/jest": "^29.5.14",
@@ -40205,7 +40205,7 @@
},
"packages/highlight": {
"name": "@getpaseo/highlight",
"version": "0.17.3",
"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.3",
"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.3",
"@getpaseo/protocol": "0.17.3",
"@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.3",
"@getpaseo/protocol": "0.17.3",
"@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.3",
"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.3",
"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.3",
"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.3",
"@getpaseo/highlight": "0.17.3",
"@getpaseo/plugin": "0.17.3",
"@getpaseo/protocol": "0.17.3",
"@getpaseo/relay": "0.17.3",
"@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.3",
"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.3",
"version": "0.17.2",
"dependencies": {
"@getpaseo/plugin": "*",
"zod": "^4.4.3"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "paseo",
"version": "0.17.3",
"version": "0.17.2",
"private": true,
"description": "Paseo: voice-controlled development environment for local AI coding agents",
"keywords": [
@@ -1,14 +0,0 @@
# 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'
```
@@ -1,20 +0,0 @@
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 paseoScrollContentView].subviews;
NSArray<UIView *> *children = [self contentView].subviews;
NSUInteger first = props.maintainVisibleContentPosition.value().minIndexForVisible;
for (NSUInteger index = first; index < children.count; ++index) {
UIView *child = children[index];
@@ -149,11 +149,7 @@ using namespace facebook::react;
[((RCTViewComponentView *)view).nativeId isEqualToString:@"paseo-end-pin"];
}
// 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
- (UIView *)contentView
{
for (UIView *child in self.containerView.subviews) {
if (![child conformsToProtocol:@protocol(RCTCustomPullToRefreshViewProtocol)]) {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/app",
"version": "0.17.3",
"version": "0.17.2",
"private": true,
"main": "index.ts",
"scripts": {
@@ -1,65 +0,0 @@
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();
});
});
@@ -1,57 +0,0 @@
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 };
}
@@ -1,40 +0,0 @@
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,21 +8,32 @@ 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);
const portalHosts = createFloatingPanelHosts<View>();
interface Rect {
x: number;
y: number;
width: number;
height: number;
}
export function measureFloatingPanelPortalHost(
name: string,
): Promise<FloatingPanelHostRect | null> {
return portalHosts.measure(name);
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 FloatingPanelPortalHostNameProvider({
@@ -53,7 +64,12 @@ export function FloatingPanelPortalHost({
useEffect(() => {
const host = hostRef.current;
if (!host) return undefined;
return portalHosts.register(name, host);
portalHostElements.set(name, host);
return () => {
if (portalHostElements.get(name) === host) {
portalHostElements.delete(name);
}
};
}, [name]);
return (
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/cli",
"version": "0.17.3",
"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.3",
"@getpaseo/protocol": "0.17.3",
"@getpaseo/server": "0.17.3",
"@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",
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/client",
"version": "0.17.3",
"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.3",
"@getpaseo/relay": "0.17.3",
"@getpaseo/protocol": "0.17.2",
"@getpaseo/relay": "0.17.2",
"ws": "^8.20.0",
"zod": "^4.4.3"
},
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/desktop",
"version": "0.17.3",
"version": "0.17.2",
"private": true,
"description": "Paseo desktop app (Electron wrapper)",
"homepage": "https://paseo.sh",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/expo-two-way-audio",
"version": "0.17.3",
"version": "0.17.2",
"description": "Native module for two way audio streaming",
"keywords": [
"ExpoTwoWayAudio",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/highlight",
"version": "0.17.3",
"version": "0.17.2",
"license": "Apache-2.0",
"files": [
"dist",
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/plugin",
"version": "0.17.3",
"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.3",
"@getpaseo/protocol": "0.17.3",
"@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.3",
"@getpaseo/protocol": "0.17.3",
"@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,7 +46,6 @@ import {
type ProviderEvent,
type ProviderInput,
type ProviderLaunch,
type ProviderModel,
type ProviderPermissionResponse,
type ProviderPersistence,
type ProviderSessionConfig,
@@ -695,10 +694,7 @@ class AcpRuntime {
this.nativeSessionId = response.sessionId;
this.modes = response.modes ?? null;
this.configOptions = response.configOptions ?? [];
let catalog = toProviderCatalog(this.modes, this.configOptions);
if (this.options.options.acpOptions?.perModelThinkingOptions) {
catalog = { ...catalog, models: await this.modelsWithOwnThinkingOptions(catalog) };
}
const catalog = toProviderCatalog(this.modes, this.configOptions);
const autoAcceptMode = this.options.options.acpOptions?.autoAcceptMode;
if (!autoAcceptMode) return catalog;
return {
@@ -708,33 +704,6 @@ 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");
-82
View File
@@ -65,24 +65,6 @@ 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 {
@@ -2015,70 +1997,6 @@ 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 });
-5
View File
@@ -49,11 +49,6 @@ 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 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/protocol",
"version": "0.17.3",
"version": "0.17.2",
"description": "Paseo shared protocol schemas and wire types",
"license": "Apache-2.0",
"files": [
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/relay",
"version": "0.17.3",
"version": "0.17.2",
"description": "Paseo relay for bridging daemon and client connections",
"license": "Apache-2.0",
"files": [
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/server",
"version": "0.17.3",
"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.3",
"@getpaseo/highlight": "0.17.3",
"@getpaseo/plugin": "0.17.3",
"@getpaseo/protocol": "0.17.3",
"@getpaseo/relay": "0.17.3",
"@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,24 +60,6 @@ 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;
}
@@ -2149,48 +2131,6 @@ 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,21 +2092,14 @@ function mapModel(
catalogThinkingOptions: Extract<ProviderEvent, { type: "catalog" }>["catalog"]["thinkingOptions"],
catalogDefaultThinkingOption: string | undefined,
): AgentModelDefinition {
// 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,
};
const thinkingOptions = model.thinkingOptions ?? catalogThinkingOptions;
return {
...model,
provider,
isDefault: model.isDefault ?? model.id === defaultModel,
metadata: model.metadata ? { ...model.metadata } : undefined,
thinkingOptions: thinking.options?.map((option) => Object.assign({}, option)),
defaultThinkingOptionId: thinking.defaultId,
thinkingOptions: thinkingOptions?.map((option) => Object.assign({}, option)),
defaultThinkingOptionId: model.defaultThinkingOptionId ?? catalogDefaultThinkingOption,
};
}
@@ -23,8 +23,8 @@ export async function registerSharedBridge(context) {
...(body === undefined ? {} : { body: JSON.stringify(body) }),
});
if (allowMissing && response.status === 404) return null;
const payload = await response.json().catch(() => null);
if (!response.ok) {
const payload = await response.json().catch(() => null);
const detail = formatErrorDetail(payload?.issues ?? payload?.details);
const message = payload?.error ?? `Paseo tool bridge returned HTTP ${response.status}`;
const error = new Error(detail ? `${message}: ${detail}` : message);
@@ -32,7 +32,7 @@ export async function registerSharedBridge(context) {
if (detail) error.details = detail;
throw error;
}
return await response.json();
return payload;
}
async function find(sessionID) {
const seen = new Set();
@@ -44,56 +44,24 @@ export async function registerSharedBridge(context) {
}
return null;
}
async function readBoundContext(sessionID, binding, query = "") {
try {
return await request(
binding,
`/sessions/${encodeURIComponent(sessionID)}/context${query}`,
undefined,
true,
);
} catch (error) {
// A refusal or rejected credentials means this bridge no longer serves the binding.
if (error?.status !== 401 && !isRefused(error)) throw error;
return null;
}
}
async function install(binding) {
const manifest = await request(
binding,
`/tools?sessionID=${encodeURIComponent(binding.sessionID)}`,
);
const conflicts = manifest.tools.filter((tool) => {
const registered = definitions.get(tool.name);
return registered && JSON.stringify(registered) !== JSON.stringify(tool);
});
if (conflicts.length > 0) await retireUnusedDefinitions(conflicts);
for (const definition of manifest.tools) await installDefinition(definition);
}
async function retireUnusedDefinitions(conflicts) {
// A tool name is registered once per location. Another session can still
// use that definition, even when the session being rebound no longer does.
const contexts = await Promise.all(
[...bindings].map(async ([sessionID, binding]) => [
sessionID,
await readBoundContext(sessionID, binding, "?tools"),
]),
);
const inUse = new Set(contexts.flatMap(([, scope]) => (scope ? scope.tools : [])));
for (const { name } of conflicts) {
if (inUse.has(name)) throw new Error(`Conflicting Paseo tool definition: ${name}`);
}
for (const [sessionID, scope] of contexts) {
if (!scope) bindings.delete(sessionID);
}
for (const { name } of conflicts) {
await registrations.get(name)?.dispose();
registrations.delete(name);
definitions.delete(name);
}
}
async function installDefinition(definition) {
if (registrations.has(definition.name)) return;
const signature = JSON.stringify(definition);
const known = definitions.get(definition.name);
if (known && JSON.stringify(known) !== signature)
throw new Error(`Conflicting Paseo tool definition: ${definition.name}`);
const old = registrations.get(definition.name);
if (old) {
if (old.signature !== signature)
throw new Error(`Conflicting Paseo tool definition: ${definition.name}`);
return;
}
const registration = await context.tool.transform((editor) => {
editor.add({
name: `paseo_${definition.name}`,
@@ -117,12 +85,14 @@ export async function registerSharedBridge(context) {
},
});
});
registrations.set(definition.name, registration);
registrations.set(definition.name, { signature, registration });
definitions.set(definition.name, definition);
}
async function clearUnusedDefinitions() {
if (bindings.size) return;
await Promise.all([...registrations.values()].map((registration) => registration.dispose()));
await Promise.all(
[...registrations.values()].map(({ registration }) => registration.dispose()),
);
registrations.clear();
definitions.clear();
}
@@ -156,7 +126,19 @@ export async function registerSharedBridge(context) {
previous &&
(previous.baseUrl !== input.baseUrl || previous.token !== input.token)
) {
const active = await readBoundContext(input.sessionID, previous);
let active;
try {
active = await request(
previous,
`/sessions/${encodeURIComponent(input.sessionID)}/context`,
undefined,
true,
);
} catch (error) {
// Refusal or rejected credentials mean this endpoint no longer
// serves the previous binding. Other failures are inconclusive.
if (error?.status !== 401 && !isRefused(error)) throw error;
}
if (active)
return { error: "OpenCode session is already bound to another Paseo bridge" };
bindings.delete(input.sessionID);
@@ -207,7 +189,9 @@ export async function registerSharedBridge(context) {
return async () => {
await filter.dispose();
await rpc.dispose();
await Promise.all([...registrations.values()].map((registration) => registration.dispose()));
await Promise.all(
[...registrations.values()].map(({ registration }) => registration.dispose()),
);
};
}
@@ -18,11 +18,6 @@ interface TestTool {
name: string;
execute(input: { value: string }, call: { sessionID: string }): Promise<unknown>;
}
interface ToolDefinition {
name: string;
description: string;
}
interface TestContext {
sessionID: string;
tools: Record<string, unknown>;
@@ -237,147 +232,6 @@ test("a shared plugin rebinds a session after the previous bridge stops listenin
}
});
function addSession(
bridge: OpenCodeBridge,
sessionId: string,
descriptions: Record<string, string>,
) {
const tools = new Map(
Object.entries(descriptions).map(([name, description]) => [
name,
{ name, description, inputSchema: { value: z.string() } },
]),
);
return bridge.bindSession({
sessionId,
env: {},
tools: {
tools,
getTool: (name) => tools.get(name),
executeTool: async () => ({ content: [] }),
},
});
}
async function registerAtLocation(bridge: OpenCodeBridge, home: string) {
const pluginPath = fileURLToPath(await bridge.materializeV2Plugin());
const plugin = await import(pathToFileURL(path.join(pluginPath, "server.js")).href);
const tools: Record<string, ToolDefinition> = {};
const hooks: Array<(context: TestContext) => Promise<void>> = [];
let rpc: Record<string, (input: Binding) => Promise<unknown>> = {};
const dispose = await plugin.default.setup({
options: {},
location: { directory: home },
rpc: {
register: async (_definition: unknown, handlers: typeof rpc) => {
rpc = handlers;
return { dispose: async () => {} };
},
},
tool: {
transform: async (apply: (editor: { add(item: ToolDefinition): void }) => void) => {
const added: string[] = [];
apply({
add: (item) => {
added.push(item.name);
tools[item.name] = item;
},
});
return {
dispose: async () => {
for (const name of added) delete tools[name];
},
};
},
},
session: {
context: async () => [],
get: async () => ({ parentID: "" }),
hook: async (event: string, handler: (context: TestContext) => Promise<void>) => {
if (event === "context") hooks.push(handler);
return { dispose: async () => {} };
},
},
});
return {
bind: (owner: OpenCodeBridge, sessionID: string) =>
rpc.bind!({ sessionID, ...owner.sharedV2Connection() }),
visible: async (sessionID: string) => {
const context = { sessionID, tools: { ...tools }, system: [] };
for (const hook of hooks) await hook(context);
return context.tools;
},
dispose,
};
}
test.each([false, true])(
"rebinds an existing session after an owner stops and its definition changes (second retained session: %s)",
async (second) => {
const home = await mkdtemp(path.join(tmpdir(), "paseo-upgrade-repro-"));
const old = new OpenCodeBridge({ paseoHome: home, logger: createTestLogger() });
const peer = new OpenCodeBridge({ paseoHome: home, logger: createTestLogger() });
const next = new OpenCodeBridge({ paseoHome: home, logger: createTestLogger() });
let location: Awaited<ReturnType<typeof registerAtLocation>> | undefined;
try {
await old.start();
addSession(old, "first", { echo: "echo v1" });
location = await registerAtLocation(old, home);
await location.bind(old, "first");
expect(await location.visible("first")).toHaveProperty("paseo_echo.description", "echo v1");
if (second) {
addSession(old, "second", { echo: "echo v1" });
await location.bind(old, "second");
}
await peer.start();
addSession(peer, "peer", { extra: "extra" });
await location.bind(peer, "peer");
// The OpenCode location survives, while the old daemon's HTTP service stops.
await old.close();
await next.start();
addSession(next, "first", { echo: "echo v2" });
await expect(location.bind(next, "first")).resolves.toEqual({});
expect(await location.visible("first")).toHaveProperty("paseo_echo.description", "echo v2");
expect(await location.visible("peer")).toHaveProperty("paseo_extra");
} finally {
await location?.dispose();
await old.close();
await next.close();
await peer.close();
await rm(home, { recursive: true, force: true });
}
},
);
test("binding another session at the same location preserves the first session's tools", async () => {
const home = await mkdtemp(path.join(tmpdir(), "paseo-upgrade-scope-repro-"));
const bridge = new OpenCodeBridge({ paseoHome: home, logger: createTestLogger() });
let location: Awaited<ReturnType<typeof registerAtLocation>> | undefined;
try {
await bridge.start();
addSession(bridge, "first", { echo: "echo", extra: "extra" });
addSession(bridge, "second", { echo: "echo" });
location = await registerAtLocation(bridge, home);
await location.bind(bridge, "first");
expect(await location.visible("first")).toHaveProperty("paseo_extra");
await location.bind(bridge, "second");
expect(await location.visible("second")).not.toHaveProperty("paseo_extra");
expect(await location.visible("first")).toHaveProperty("paseo_extra");
addSession(bridge, "conflict", { echo: "echo different" });
await expect(location.bind(bridge, "conflict")).rejects.toThrow(
"Conflicting Paseo tool definition: echo",
);
expect(await location.visible("first")).toHaveProperty("paseo_echo.description", "echo");
} finally {
await location?.dispose();
await bridge.close();
await rm(home, { recursive: true, force: true });
}
});
test("a refused connection is the only probe failure that clears a binding", async () => {
const source = new URL("./shared-bridge-plugin.mjs", import.meta.url).href;
const { isRefused } = (await import(source)) as { isRefused: (error: unknown) => boolean };
@@ -1325,6 +1325,7 @@ export class PiRpcAgentSession implements AgentSession {
if (this.closed) throw new Error("Pi session is closed");
if (this.activeTurnId !== turnId) return { turnId };
this.activeNoTurnPromptText = payload.text;
const shouldProbeForNoTurnPrompt = this.parseSlashCommandInput(payload.text) !== null;
void (async () => {
try {
@@ -1350,11 +1351,7 @@ export class PiRpcAgentSession implements AgentSession {
await this.completeNoTurnPrompt(turnId);
return;
}
// Pi can acknowledge a prompt as handled even when the extension starts a run.
if (
agentInvoked === undefined &&
(ack.handledByExtension || this.parseSlashCommandInput(payload.text) !== null)
) {
if (agentInvoked === undefined && shouldProbeForNoTurnPrompt) {
await this.completePromptIfHandledWithoutTurn(turnId);
}
} catch (error) {
@@ -3,11 +3,9 @@ import path from "node:path";
import type { ChildProcessWithoutNullStreams } from "node:child_process";
import { EventEmitter } from "node:events";
import { PassThrough } from "node:stream";
import { setImmediate as waitForImmediate } from "node:timers/promises";
import pino from "pino";
import { describe, expect, onTestFinished, test, vi } from "vitest";
import { describe, expect, test, vi } from "vitest";
import { PiRpcAgentClient } from "./agent.js";
import { PiCliRuntime } from "./cli-runtime.js";
import type { PiRuntimeLaunch } from "./runtime.js";
@@ -419,97 +417,6 @@ describe("PiCliRuntime", () => {
expect(command.images).toBeUndefined();
});
test.each([
{ disposition: "started", agentInvoked: true },
{ disposition: "queued", agentInvoked: true },
])(
"maps a $disposition prompt disposition to agentInvoked $agentInvoked",
async ({ disposition, agentInvoked }) => {
const child = createPiChild();
replyToCommands(child, (command) => (command.type === "prompt" ? { disposition } : {}));
const session = await createRuntime(child).startSession({ cwd: "/workspace/project" });
await expect(session.prompt("summarize README.md")).resolves.toMatchObject({ agentInvoked });
},
);
test("preserves an explicit agentInvoked result in a prompt response", async () => {
const child = createPiChild();
replyToCommands(child, () => ({ disposition: "started", agentInvoked: false }));
const session = await createRuntime(child).startSession({ cwd: "/workspace/project" });
await expect(session.prompt("hello")).resolves.toEqual({
requestId: expect.any(String),
agentInvoked: false,
});
});
test("completes when an input extension handles a prompt without a model run", async () => {
const child = createPiChild();
replyToCommands(child, (command) => {
if (command.type === "prompt") {
const notification = {
type: "extension_ui_request",
id: "handled",
method: "notify",
message: "Handled by extension",
};
child.stdout.write(`${JSON.stringify(notification)}\n`);
return { disposition: "handled" };
}
return { sessionId: "pi-session-1", isStreaming: false };
});
const client = new PiRpcAgentClient({
logger: pino({ level: "silent" }),
runtime: createRuntime(child),
});
const session = await client.createSession({ provider: "pi", cwd: "/workspace/project" });
onTestFinished(() => session.close());
await expect(session.run("hello")).resolves.toMatchObject({
timeline: expect.arrayContaining([
expect.objectContaining({ type: "notification", message: "Handled by extension" }),
]),
});
});
test("waits for the reply when a handled slash command starts a model run", async () => {
const child = createPiChild();
let isStreaming = false;
replyToCommands(child, (command) => {
if (command.type === "prompt") {
isStreaming = true;
return { disposition: "handled" };
}
return { sessionId: "pi-session-1", isStreaming };
});
const client = new PiRpcAgentClient({
logger: pino({ level: "silent" }),
runtime: createRuntime(child),
});
const session = await client.createSession({ provider: "pi", cwd: "/workspace/project" });
onTestFinished(() => session.close());
const reply = session.run("/ask hello");
// Pi acknowledges the command while its model run is starting, before agent_start.
await waitForImmediate();
await waitForImmediate();
child.stdout.write(`${JSON.stringify({ type: "agent_start" })}\n`);
const message = { role: "assistant", content: [{ type: "text", text: "Hello" }] };
const update = {
type: "message_update",
message,
assistantMessageEvent: { type: "text_delta", delta: "Hello" },
};
child.stdout.write(`${JSON.stringify(update)}\n`);
child.stdout.write(
`${JSON.stringify({ type: "agent_end", messages: [message], willRetry: false })}\n`,
);
child.stdout.write(`${JSON.stringify({ type: "agent_settled" })}\n`);
await expect(reply).resolves.toMatchObject({ finalText: "Hello" });
});
test("sends the clear_queue RPC frame", async () => {
const child = createPiChild();
replyToCommands(child, () => ({}));
@@ -130,16 +130,10 @@ class PiCliRuntimeSession implements PiRuntimeSession {
});
const data = await promise;
if (typeof data === "object" && data !== null && !Array.isArray(data)) {
const { agentInvoked, disposition } = data as Record<string, unknown>;
const { agentInvoked } = data as Record<string, unknown>;
if (typeof agentInvoked === "boolean") {
return { requestId, agentInvoked };
}
if (disposition === "handled") {
return { requestId, handledByExtension: true };
}
if (disposition === "started" || disposition === "queued") {
return { requestId, agentInvoked: true };
}
}
return { requestId };
}
@@ -5,10 +5,13 @@ export interface PiImageContent {
data: string;
mimeType: string;
}
export interface PiPromptAck {
agentInvoked?: boolean;
}
export interface PiPromptAck {
requestId?: string;
agentInvoked?: boolean;
handledByExtension?: true;
}
export interface PiTextContent {
@@ -1123,10 +1123,12 @@ 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 type { ProviderRegistration } from "@getpaseo/plugin/server/provider";
const closeReleased = Promise.withResolvers<void>();
`import { readFile, writeFile } from "node:fs/promises";
import type { ProviderRegistration } from "@getpaseo/plugin/server/provider";
const provider: ProviderRegistration = {
id: "delayed",
label: "Delayed",
@@ -1138,7 +1140,10 @@ const provider: ProviderRegistration = {
onEvent() { return () => undefined; },
async close() {
console.log("provider close started");
await closeReleased.promise;
while (true) {
try { await readFile(${JSON.stringify(releaseFile)}); break; }
catch { await new Promise((resolve) => setTimeout(resolve, 10)); }
}
console.log("provider close completed");
},
};
@@ -1146,11 +1151,7 @@ const provider: ProviderRegistration = {
};
export default function contribute(server: { registerProvider(provider: ProviderRegistration): void }) {
server.registerProvider(provider);
return () => {
console.log("plugin cleanup started");
// Let shutdown reach the pending close before releasing it.
setImmediate(closeReleased.resolve);
};
return () => console.log("plugin cleanup started");
}`,
);
const closedReports: unknown[] = [];
@@ -1173,14 +1174,20 @@ export default function contribute(server: { registerProvider(provider: Provider
await expect(connection.send({ type: "catalog", requestId: "during-close" })).rejects.toThrow(
"Provider connection is closing",
);
await Promise.all([closing, runtime.stopPluginById("closing-provider")]);
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]);
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 });
}
});
@@ -606,16 +606,12 @@ export default function contribute(server) {
const pending = client.createWorkspace({
source: { kind: "worktree", cwd: repository, branchName: "concurrent" },
});
// Cleanup closes the client if the marker never arrives.
void pending.catch(() => undefined);
await expect
.poll(
() =>
stat(path.join(root, "manager-started")).then(
() => true,
() => false,
),
{ timeout: 10_000 },
.poll(() =>
stat(path.join(root, "manager-started")).then(
() => true,
() => false,
),
)
.toBe(true);
const concurrent = path.join(root, "concurrent-manual");
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/website",
"version": "0.17.3",
"version": "0.17.2",
"private": true,
"type": "module",
"scripts": {
@@ -517,112 +517,6 @@ 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,8 +109,6 @@ 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 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@getpaseo/builtin-plugins",
"version": "0.17.3",
"version": "0.17.2",
"private": true,
"type": "module",
"scripts": {
-4
View File
@@ -711,10 +711,6 @@ 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:
-2
View File
@@ -573,8 +573,6 @@ export const vendorEdits: AcpTransformer = {
};
```
如果 Agent 只为当前选中的模型列出 `thought_level` 选项,请设置 `acpOptions.perModelThinkingOptions`。目录发现会依次选中每个模型,并为它记录 Agent 列出的思考选项。没有 `thought_level` 选项的模型不会显示思考选择器。
## 测试与发布 {#test-and-publish}
用真实的 Agent 测试 Provider,而不只是模拟的数据帧: