fix: keep generation progress out of chat history

This commit is contained in:
2026-04-26 22:44:44 +08:00
parent ea550de6a1
commit b7a507044f
8 changed files with 74 additions and 67 deletions

View File

@@ -102,3 +102,29 @@ test('puzzle workspace hides keyword fill before two turns', () => {
expect(screen.queryByRole('button', { name: '补充剩余设定' })).toBeNull();
});
test('puzzle workspace does not render progress action messages as chat bubbles', () => {
render(
<PuzzleAgentWorkspace
session={{
...baseSession,
messages: [
...baseSession.messages,
{
id: 'message-action-result-1',
role: 'assistant',
kind: 'action_result',
text: '拼图结果页草稿已生成。',
createdAt: '2026-04-24T10:01:00.000Z',
},
],
}}
onBack={() => {}}
onSubmitMessage={() => {}}
onExecuteAction={() => {}}
/>,
);
expect(screen.getByText('画面主体已经清楚,继续收束剩余关键词。')).toBeTruthy();
expect(screen.queryByText('拼图结果页草稿已生成。')).toBeNull();
});