fix(extension): make tool cancellation cooperative (#89)

Tool cancellation is now cooperative end-to-end: the queue stays busy until compensation completes, cancellation is checked cooperatively across the pipeline, the fallback window is compensated too, and cleanup_failed is surfaced explicitly. Includes a gated delayed-compensation E2E test.
This commit is contained in:
NianJiu
2026-08-13 17:31:23 +08:00
committed by GitHub
parent 37fbaacc94
commit 4549ed0892
20 changed files with 904 additions and 214 deletions
+3
View File
@@ -47,7 +47,9 @@ export async function handleWindowResize(
manager: SessionManager,
params: WindowResizeParams,
api: WindowResizeApi = chromeWindowResizeApi,
signal?: AbortSignal,
): Promise<WindowResizeResult | RpcError> {
if (signal?.aborted) return { code: "cancelled", message: "window_resize aborted" };
const ctxOrErr = lookupSession(manager, params, "window_resize");
if (isRpcError(ctxOrErr)) return ctxOrErr;
const ctx = ctxOrErr;
@@ -64,6 +66,7 @@ export async function handleWindowResize(
}
try {
if (signal?.aborted) return { code: "cancelled", message: "window_resize aborted" };
await api.update(ctx.agentWindowId, {
width: sizeOrErr.width,
height: sizeOrErr.height,