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
6 changes: 5 additions & 1 deletion apps/desktop/e2e/workhub-reconstruction.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import { COMPOSER_INPUT, ensureSidebarExpanded, expect, test } from './fixtures';

test('WorkHub rebuilds Session conversation after navigating away and back', async ({
test('WorkHub rebuilds delegated execution feedback after navigating away and back', async ({
window: page,
}) => {
const initialPrompt = '检查支付回调重复投递时的幂等性';
Expand Down Expand Up @@ -64,6 +64,10 @@ test('WorkHub rebuilds Session conversation after navigating away and back', asy
hasText: routedPrompt,
}),
).toBeVisible();
await expect(
page.locator('.workhub-projected-turn', { hasText: routedPrompt })
.locator('.workhub-submitted-state'),
).toHaveText('进行中');
});

test('WorkHub defers destructive correction until linked delegation exists', async ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,45 @@ test('returns Host-owned cancellation proof to the renderer', async () => {
);
});

test('returns Host-owned Message execution resolutions to the renderer', async () => {
const ipc = ipcHarness();
registerExecutionIpc(
{
client: executionClient({
queryMessageExecutions: async (input) => ({
resolutions: input.messageIds.map((messageId) => messageId === 'message-cancelled'
? { messageId, state: 'cancelled' as const }
: {
messageId,
state: 'owned' as const,
turnId: 'successor-turn',
runId: 'successor-run',
}),
}),
}),
},
ipc,
);

assert.deepEqual(
await ipc.invoke('sessions:queryMessageExecutions', 'session-1', [
'message-delegated',
'message-cancelled',
]),
{
resolutions: [
{
messageId: 'message-delegated',
state: 'owned',
turnId: 'successor-turn',
runId: 'successor-run',
},
{ messageId: 'message-cancelled', state: 'cancelled' },
],
},
);
});

test('submits a slash Skill message and reports the Host Skill outcome', async () => {
const submits: unknown[] = [];
const ipc = ipcHarness();
Expand Down Expand Up @@ -1502,6 +1541,7 @@ function executionClient(overrides: Partial<ExecutionClient>): ExecutionClient {
interruptTurn: unavailable,
listSessionTurnLandmarks: unavailable,
listSessionTurns: unavailable,
queryMessageExecutions: unavailable,
queryMessages: unavailable,
queryTurnResume: unavailable,
readExecutionBoundary: unavailable,
Expand Down
Loading