feat: refine business chat workflow

This commit is contained in:
inman
2026-05-13 23:52:11 +08:00
parent 043d0f0bfe
commit 6b503dcbe9
30 changed files with 4609 additions and 126 deletions

View File

@@ -120,9 +120,10 @@ describe('chat target routing', () => {
const sendCall = gatewayRpcMock.mock.calls.find(([method]) => method === 'chat.send');
expect(sendCall?.[1]).toMatchObject({
sessionKey: 'agent:research:desk',
message: 'Hello direct agent',
deliver: false,
});
expect((sendCall?.[1] as { message: string }).message).toContain('Hello direct agent');
expect((sendCall?.[1] as { message: string }).message).not.toContain('YINIAN_BUSINESS_RESPONSE_GUIDANCE');
expect(typeof (sendCall?.[1] as { idempotencyKey?: unknown })?.idempotencyKey).toBe('string');
});
@@ -182,7 +183,8 @@ describe('chat target routing', () => {
};
expect(payload.sessionKey).toBe('agent:research:desk');
expect(payload.message).toBe('Process the attached file(s).');
expect(payload.message).toContain('Process the attached file(s).');
expect(payload.message).not.toContain('YINIAN_BUSINESS_RESPONSE_GUIDANCE');
expect(payload.media[0]?.filePath).toBe('/tmp/design.png');
});
@@ -251,5 +253,6 @@ describe('chat target routing', () => {
expect((sendCall?.[1] as { message: string }).message).toContain('[知识库上下文]');
expect((sendCall?.[1] as { message: string }).message).toContain('handbook.docx');
expect((sendCall?.[1] as { message: string }).message).toContain('Refunds are available within 7 days.');
expect((sendCall?.[1] as { message: string }).message).not.toContain('YINIAN_BUSINESS_RESPONSE_GUIDANCE');
});
});