fix: await owned desktop batch before checking rendered completion

This commit is contained in:
Agent Workbench Dev
2026-11-02 06:50:45 +08:00
parent 324b7ab36d
commit 12d1c7f9cb
61 changed files with 256161 additions and 1 deletions
+8 -1
View File
@@ -51,7 +51,14 @@ export async function desktopProjectQa({ store, provider, runtime, sample, kind
const confirm = dialog.getByRole('button', { name: '确认应用全部 ' + ids.length + ' 项', exact: true }); await confirm.waitFor();
const matching = [...store.core.change_set.values()].filter(value => value.sessionId === session.id && value.status !== 'completed' && JSON.stringify(value.files.map(file => file.changeId).sort()) === JSON.stringify(ids.slice().sort()));
assert.equal(matching.length, 1); const set = matching[0];
await confirm.click(); await expect(dialog).toContainText('全部应用完成'); await page.keyboard.press('Escape');
const response = page.waitForResponse(value => new URL(value.url()).pathname === '/api/sessions/' + session.id + '/change-sets/' + set.id + '/apply'
&& value.request().method() === 'POST', { timeout: 120000 });
await confirm.click(); const applied = await response;
assert.equal(applied.status(), 200, 'Original desktop apply request was rejected');
const operation = runtime.changeSetManager().active.get(set.id);
if (operation) await operation.promise;
assert.equal(set.status, 'completed', JSON.stringify({ status: set.status, summary: set.summary, requiresVerification: set.requiresVerification }));
await expect(dialog).toContainText('全部应用完成', { timeout: 20000 }); await page.keyboard.press('Escape');
assert.equal(set.status, 'completed'); events.push({ action: 'actual-desktop-file-review', taskId: session.taskId, changeSetId: set.id, fingerprint: set.fingerprint, paths: set.files.map(value => value.path) }); return set;
}
async function approve(session, approval) {