test(agents): stabilize status checks and record UI integration

This commit is contained in:
2026-09-14 21:43:43 +08:00
parent 5a974cf784
commit f92753329c
5 changed files with 64 additions and 5 deletions

View File

@@ -63,8 +63,7 @@ it('keeps partial assistant output visible while surfacing a closed run failure
type: 'unexpected_error', message: 'Recursion limit of 40 reached',
} }, messages: [{ id: 1, role: 'assistant', content: 'PPT 只写入了一部分。' }] } : base(operation, input));
render(<CloudChannelConversations slug={session.agent_slug} />);
const status = await screen.findByTestId('wechat-run-status');
expect(status).toHaveTextContent('任务状态:失败');
await waitFor(() => expect(screen.getByTestId('wechat-run-status')).toHaveTextContent('任务状态:失败'));
expect(screen.getByRole('alert', { name: '微信任务错误' })).toHaveTextContent('unexpected_error · Recursion limit of 40 reached');
expect(screen.getByText('PPT 只写入了一部分。')).toBeVisible();
});
@@ -74,7 +73,7 @@ it('shows a queued request status before the authoritative run is exposed', asyn
api.call.mockImplementation(async (operation, input) => operation === 'channelConversation'
? { ...history, run: null, queued_requests: [{ request_id: 'queued-request', thread_id: session.thread_id, run_id: null, status: 'running', version: '1' }] } : base(operation, input));
render(<CloudChannelConversations slug={session.agent_slug} />);
expect(await screen.findByTestId('wechat-run-status')).toHaveTextContent('任务状态:运行中');
await waitFor(() => expect(screen.getByTestId('wechat-run-status')).toHaveTextContent('任务状态:运行中'));
});
it('retries an uncertain stop with the identical operation ID and keeps other controls disabled', async () => {