fix(browser): preserve operation-aware cancellation errors

This commit is contained in:
N0zoM1z0
2026-07-14 20:48:01 +00:00
parent 3743962071
commit 0aac8aaba5
12 changed files with 175 additions and 42 deletions
+22
View File
@@ -142,6 +142,28 @@ describe("CdpElectronProvider", () => {
).toBe(true);
});
it("maps cancelled Electron discovery to the Electron operation", async () => {
const root = await electronFixture();
const controller = new AbortController();
controller.abort();
const result = await new CdpElectronProvider().listTargets(
listElectronTargetsInputSchema.parse({
cdp_endpoint: "http://127.0.0.1:9222",
allowed_file_roots: [root],
approved: true,
}),
{ signal: controller.signal },
);
expect(result).toMatchObject({
ok: false,
error: {
_tag: "AnalysisCancelledError",
operation: "list_electron_targets",
},
});
});
it("captures Electron script source only after separate approval", async () => {
const root = await electronFixture();
const browser = await startFakeCdpBrowser({