upgrade goose sdk and tui to be compatible with the latest agentclientprotocol/sdk package (#8667)

This commit is contained in:
Lifei Zhou
2026-04-22 12:25:13 +10:00
committed by GitHub
parent 469c74d8bc
commit a7ccdd780d
10 changed files with 69 additions and 97 deletions
+8 -18
View File
@@ -3,6 +3,7 @@ import type {
NewSessionResponse,
LoadSessionResponse,
PromptResponse,
SessionInfo,
} from "@agentclientprotocol/sdk";
import { getClient } from "./acpConnection";
import { perfLog } from "@/shared/lib/perfLog";
@@ -43,24 +44,13 @@ export async function listProviders(): Promise<AcpProvider[]> {
export async function listSessions(): Promise<AcpSessionInfo[]> {
const client = await getClient();
// GooseClient.unstable_listSessions doesn't work with SDK 0.19 (renamed to listSessions).
// Bypass GooseClient and call the connection directly. Fix when ui/acp is updated.
// biome-ignore lint/suspicious/noExplicitAny: SDK doesn't expose conn property
const conn = (client as any).conn;
const response = await conn.listSessions({});
return response.sessions.map(
(info: {
sessionId: string;
title?: string;
updatedAt?: string;
_meta?: Record<string, unknown>;
}) => ({
sessionId: info.sessionId,
title: info.title ?? null,
updatedAt: info.updatedAt ?? null,
messageCount: (info._meta?.messageCount as number) ?? 0,
}),
);
const response = await client.listSessions({});
return response.sessions.map((info: SessionInfo) => ({
sessionId: info.sessionId,
title: info.title ?? null,
updatedAt: info.updatedAt ?? null,
messageCount: (info._meta?.messageCount as number) ?? 0,
}));
}
export async function exportSession(sessionId: string): Promise<string> {
-5
View File
@@ -1,5 +0,0 @@
export class GooseClient {
closed = Promise.resolve();
async initialize(..._args: unknown[]): Promise<void> {}
}