refactor: remove threads layer, use sessions directly for ACP (#9078)

Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
Douwe Osinga
2026-05-08 16:10:55 -04:00
committed by GitHub
parent a999f52056
commit ea5802c380
32 changed files with 525 additions and 1922 deletions
+10 -5
View File
@@ -8,11 +8,16 @@ async function clickNewChatInProject(
name: projectName,
exact: true,
});
await projectButton.hover();
await projectButton
.locator("xpath=..")
.getByTitle("New chat in project")
.click();
// The "New chat" button uses group-hover:visible and is invisible by default.
// Headless Playwright on Linux doesn't reliably trigger CSS :hover,
// so we force the button visible via JS before clicking.
const row = projectButton.locator("xpath=..");
const newChatBtn = row.getByTitle("New chat in project");
await newChatBtn.evaluate((el) => {
el.style.visibility = "visible";
el.style.opacity = "1";
});
await newChatBtn.click();
}
test.describe("Draft persistence", () => {
+27 -1
View File
@@ -124,6 +124,27 @@ export function buildInitScript(options?: {
supportingFiles: [],
});
const projectToSourceEntry = (p) => ({
type: "project",
name: p.id ?? p.name?.toLowerCase(),
description: p.description ?? "",
content: p.prompt ?? "",
path: "/mock/.agents/projects/" + (p.id ?? p.name?.toLowerCase()),
global: true,
supportingFiles: [],
properties: {
title: p.name,
icon: p.icon ?? "",
color: p.color ?? "",
preferredProvider: p.preferredProvider ?? null,
preferredModel: p.preferredModel ?? null,
workingDirs: p.workingDirs ?? [],
useWorktrees: p.useWorktrees ?? false,
order: p.order ?? 0,
archivedAt: null,
},
});
function nowIso() {
return new Date().toISOString();
}
@@ -240,8 +261,13 @@ export function buildInitScript(options?: {
case "_goose/working_dir/update":
case "goose/working_dir/update":
return jsonRpcResult(message.id, {});
case "_goose/sources/list":
case "_goose/sources/list": {
const sourceType = message.params?.type;
if (sourceType === "project") {
return jsonRpcResult(message.id, { sources: PROJECTS.map(projectToSourceEntry) });
}
return jsonRpcResult(message.id, { sources: SKILLS.map(skillToSourceEntry) });
}
case "_goose/sources/create":
return jsonRpcResult(message.id, {
source: {
+6 -2
View File
@@ -52,8 +52,12 @@ test.describe("Skills view", () => {
await page.getByPlaceholder("Search skills").fill("review");
await expect(page.getByText("code-review")).toBeVisible();
await expect(page.getByText("test-writer")).not.toBeVisible();
await expect(
page.getByRole("button", { name: "Open code-review details" }),
).toBeVisible();
await expect(
page.getByRole("button", { name: "Open test-writer details" }),
).not.toBeVisible();
});
test("project filtering isolates project skills", async ({