Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 37 additions & 5 deletions apps/desktop/e2e/workhub-reconstruction.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,34 @@ test('WorkHub rebuilds delegated execution feedback after navigating away and ba
await expect(
page.locator('.workhub-projected-turn', { hasText: routedPrompt })
.locator('.workhub-submitted-state'),
).toHaveText('已完成');
).toHaveText('关联有效 · 已完成');
});

test('WorkHub defers destructive correction until linked delegation exists', async ({
test('WorkHub explicitly announces a newly created work item', async ({ window: page }) => {
const composer = page.locator(COMPOSER_INPUT);
await composer.fill('检查支付回调重复投递时的幂等性');
await composer.press('Enter');
await expect(page.getByRole('button', { name: '重新生成' })).toHaveCount(1, {
timeout: 20_000,
});
await page.evaluate(async () => {
await window.maka.settings.updateClient({ workHub: { enabled: true } });
});
await waitForWorkHubReady(page, 1);

const prompt = '创建一个新的 Session,名为登录稳定性';
const workHubComposer = page.locator(
'.workhub-surface .maka-composer-editor [contenteditable="true"]',
);
await workHubComposer.fill(prompt);
await workHubComposer.press('Enter');

const createdTurn = page.locator('.workhub-turn', { hasText: prompt });
await expect(createdTurn.locator('.workhub-submitted')).toContainText('已创建新工作:');
await expect(createdTurn.locator('.workhub-submitted-session strong')).toHaveText('登录稳定性');
});

test('WorkHub replaces the exact linked delegation across Sessions', async ({
window: page,
}) => {
const sourceSessionName = '检查支付回调重复投递时的幂等性';
Expand Down Expand Up @@ -122,8 +146,16 @@ test('WorkHub defers destructive correction until linked delegation exists', asy
const correctionTurn = page.locator('.workhub-turn', {
hasText: '不是这个,换成登录稳定性,补充刷新令牌失败判定。',
});
await expect(correctionTurn.locator('.workhub-error')).toContainText(
'跨 Session 更正将在持久委托关联完成后开放',
await expect(
correctionTurn.locator('.workhub-submitted-session strong'),
).toHaveText('登录稳定性');
await expect(correctionTurn.locator('.workhub-error')).toHaveCount(0);
await expect(
continuedTurn.locator('.workhub-submitted-state'),
).toHaveText('已被更正');
await expect(
correctionTurn.locator('.workhub-submitted-state'),
).toContainText(
/^关联有效 · (?:已接收|进行中|等待你|已完成|失败|已中止|正在恢复)$/u,
);
await expect(correctionTurn.locator('.workhub-submitted')).toHaveCount(0);
});
2 changes: 1 addition & 1 deletion apps/desktop/renderer-architecture.json
Original file line number Diff line number Diff line change
Expand Up @@ -5351,7 +5351,7 @@
"unresolvedDependencies": 0,
"actionFactories": [],
"dependencyPaths": {
"./workhub-controller.js": 1
"./application/contracts/workhub-request-intent.js": 1
}
},
"src/renderer/workhub-send-lease.ts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,10 @@ test('projects durable WorkHub delegation targets into the Desktop host namespac
);

assert.equal(projected.type, 'workhub_coordination');
if (projected.type === 'workhub_coordination') {
if (
projected.type === 'workhub_coordination' &&
projected.kind === 'delegation_assigned'
) {
assert.equal(projected.targetSessionId, JSON.stringify(['remote-root', 'payments']));
}
});
Expand Down
Loading