fix: open an approval window while another one has focus (closes #290)
check / check (push) Failing after 2s
e2e / e2e-chrome (push) Failing after 2s
e2e / e2e-firefox (push) Failing after 2s

The background centred each approval window on the last focused window,
which could be an earlier approval window still open. Headless Chrome
reports one as 1280x720, so the position came out where the browser refused
to create the window ("Bounds must be at least 50% within visible screen
space"), and the request failed with -32603 and no window. It now centres on
the last focused browser window.

Under load a test in the Chrome suite raised its prompt while the previous
test's window was still closing, and either hit that refusal or took the
closing window for its own. The runner now closes every approval window
between tests.

Model: opus-5-5
This commit is contained in:
2026-10-05 03:37:47 +00:00
parent 90a9d5597f
commit d377b1f9fe
12 changed files with 129 additions and 24 deletions
+4 -3
View File
@@ -244,10 +244,11 @@ function windowsCreate(createData) {
}
/**
* @returns {Promise<Object>} the last focused window.
* @param {Object} queryOptions which windows count, e.g. `windowTypes`.
* @returns {Promise<Object>} the last focused of those windows.
*/
function windowsGetLastFocused() {
return invoke(windowsApi(), "getLastFocused");
function windowsGetLastFocused(queryOptions) {
return invoke(windowsApi(), "getLastFocused", queryOptions);
}
/**