fix: keep split-pane controls readable and await sealed run evidence

This commit is contained in:
Agent Workbench Dev
2026-11-01 13:21:37 +08:00
parent 441785a8b7
commit 3f1c026195
2 changed files with 7 additions and 1 deletions
+5 -1
View File
@@ -44,7 +44,10 @@ const connection = hub.upsert({ name: '本地协议验收连接', model: 'owned-
hub.select({ type: 'connection', id: connection.id }); f.store.close();
const state = () => host.api('/sessions/' + sessionId);
const panel = () => page.getByLabel('任务记录', { exact: true });
const waitStatus = status => expect.poll(async () => (await state()).status, { timeout: 20000 }).toBe(status);
const waitStatus = async status => {
await expect.poll(async () => (await state()).status, { timeout: 20000 }).toBe(status);
if (['completed', 'paused', 'failed', 'needs_review'].includes(status)) await expect.poll(async () => (await state()).execution.run.finishedAt, { timeout: 10000 }).toBeTruthy();
};
async function newTask(content) {
if (!await page.getByRole('button', { name: '新建任务', exact: true }).isVisible()) await page.getByRole('button', { name: '展开项目栏' }).click();
await page.getByRole('button', { name: '新建任务', exact: true }).click();
@@ -82,6 +85,7 @@ try {
assert.equal(paused.execution.checks[0].status, 'failed'); assert.deepEqual(fs.readFileSync(path.join(f.projectRoot, 'wrong.test.mjs')), originalSource);
const taskId = paused.taskId, checkId = paused.execution.checks[0].id;
await page.getByRole('button', { name: '查看任务记录', exact: true }).click(); await expect(panel()).toContainText('原工程检查有失败记录'); await capture('checks-desktop');
assert.ok((await page.getByRole('button', { name: '继续任务', exact: true }).boundingBox()).height < 42, 'continuation action must remain a readable single line in the split pane');
mark('one approved real failing check is reused across new plans and the no-progress task pauses');
mode = 'diagnostic'; stage = 0;
await page.getByLabel('任务内容').fill('前面的错误是怎么回事?'); await page.getByRole('button', { name: '发送任务', exact: true }).click();