mirror of
https://github.com/getpaseo/paseo.git
synced 2026-08-15 04:42:45 +00:00
Detach subagents without archiving them (#1612)
* Add detach action for subagents * Translate detached subagent connection error * Address subagent detach review feedback * Fix subagent integration test import * Focus detached subagents as tabs
This commit is contained in:
@@ -2,6 +2,8 @@ import { describe, expect, test } from "vitest";
|
||||
import {
|
||||
FileExplorerRequestSchema,
|
||||
PaseoWorktreeArchiveRequestSchema,
|
||||
parseServerInfoStatusPayload,
|
||||
SessionInboundMessageSchema,
|
||||
SessionOutboundMessageSchema,
|
||||
} from "./messages.js";
|
||||
|
||||
@@ -131,6 +133,51 @@ describe("workspace descriptor message compatibility", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("agent detach RPC", () => {
|
||||
test("parses the namespaced detach request", () => {
|
||||
const parsed = SessionInboundMessageSchema.parse({
|
||||
type: "agent.detach.request",
|
||||
agentId: "child-agent",
|
||||
requestId: "req-detach",
|
||||
});
|
||||
|
||||
expect(parsed).toEqual({
|
||||
type: "agent.detach.request",
|
||||
agentId: "child-agent",
|
||||
requestId: "req-detach",
|
||||
});
|
||||
});
|
||||
|
||||
test("parses the namespaced detach response", () => {
|
||||
const parsed = SessionOutboundMessageSchema.parse({
|
||||
type: "agent.detach.response",
|
||||
payload: {
|
||||
requestId: "req-detach",
|
||||
agentId: "child-agent",
|
||||
accepted: true,
|
||||
error: null,
|
||||
},
|
||||
});
|
||||
|
||||
expect(parsed.type).toBe("agent.detach.response");
|
||||
});
|
||||
|
||||
test("parses the agentDetach server feature gate", () => {
|
||||
const parsed = parseServerInfoStatusPayload({
|
||||
status: "server_info",
|
||||
serverId: "srv-test",
|
||||
features: {
|
||||
agentDetach: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (!parsed) {
|
||||
throw new Error("Expected server info payload to parse");
|
||||
}
|
||||
expect(parsed.features?.agentDetach).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("file explorer request compatibility", () => {
|
||||
test("acceptBinary is optional for old clients and accepted for new clients", () => {
|
||||
expect(
|
||||
|
||||
Reference in New Issue
Block a user