test(app): verify the Chat destination in the real app flow
This commit is contained in:
@@ -324,6 +324,15 @@ export async function startFixture({ root }) {
|
||||
const cancelRequests = [];
|
||||
let decisionAccepted = false;
|
||||
const decisionRequests = [];
|
||||
let chatSubscribed = 0;
|
||||
let chatHistory = 0;
|
||||
const CHAT_SESSION = {
|
||||
id: 'ses_probechat',
|
||||
title: 'Probe conversation',
|
||||
kind: 'operator',
|
||||
directory: '/srv/probe',
|
||||
updated_at: '2026-10-21T12:00:00Z',
|
||||
};
|
||||
|
||||
const dropConnections = () => {
|
||||
for (const connection of connections) connection.close();
|
||||
@@ -372,6 +381,8 @@ export async function startFixture({ root }) {
|
||||
getRun,
|
||||
cancelRequests,
|
||||
decisionRequests,
|
||||
chatSubscribed,
|
||||
chatHistory,
|
||||
}));
|
||||
return;
|
||||
}
|
||||
@@ -463,6 +474,32 @@ export async function startFixture({ root }) {
|
||||
client.send({ id: request.id, type: 'run', run_detail: humanDetail(true) });
|
||||
return;
|
||||
}
|
||||
if (request.type === 'chat_sessions') {
|
||||
client.send({ id: request.id, type: 'chat_sessions',
|
||||
chat_sessions: [CHAT_SESSION] });
|
||||
return;
|
||||
}
|
||||
if (request.type === 'chat_subscribe') {
|
||||
chatSubscribed++;
|
||||
client.send({ id: request.id, type: 'chat_subscribe' });
|
||||
return;
|
||||
}
|
||||
if (request.type === 'chat_messages') {
|
||||
chatHistory++;
|
||||
client.send({
|
||||
id: request.id, type: 'chat_history',
|
||||
chat_history: {
|
||||
messages: [
|
||||
{ id: 'm1', session_id: CHAT_SESSION.id, role: 'user',
|
||||
parts: [{ type: 'text', text: 'Read-only probe question.' }] },
|
||||
{ id: 'm2', session_id: CHAT_SESSION.id, role: 'assistant',
|
||||
parts: [{ type: 'text', text: 'Stored probe answer.' }] },
|
||||
],
|
||||
next_cursor: '', has_more: false,
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
client.send({
|
||||
id: request.id,
|
||||
type: 'error',
|
||||
|
||||
Reference in New Issue
Block a user