test(web): align smoke fixtures with current processor UI

This commit is contained in:
dadachann
2026-09-11 04:50:26 +00:00
parent 3b047ab080
commit 4cf25be974
4 changed files with 81 additions and 39 deletions
+13 -3
View File
@@ -725,10 +725,12 @@ async function handleBackendApi(route: Route, state: LangBotApiMockState) {
return fulfillJson(route, { agents: state.pipelines });
}
const agentDebugMatch = path.match(/^\/api\/v1\/agents\/([^/]+)\/debug$/);
const agentDebugMatch = path.match(
/^\/api\/v1\/agents\/([^/]+)\/debug(?:\/stream)?$/,
);
if (agentDebugMatch) {
const payload = parseJsonBody(route);
return fulfillJson(route, {
const result = {
event_id: nextId(state, 'event'),
event_type: String(payload.event_type || 'message.received'),
conversation_id: String(payload.conversation_id || 'debug-session'),
@@ -740,7 +742,15 @@ async function handleBackendApi(route: Route, state: LangBotApiMockState) {
text: 'Mock Agent response',
},
],
});
};
if (path.endsWith('/stream')) {
return route.fulfill({
status: 200,
contentType: 'application/x-ndjson',
body: JSON.stringify({ kind: 'completed', data: result }) + '\n',
});
}
return fulfillJson(route, result);
}
const agentMatch = path.match(/^\/api\/v1\/agents\/([^/]+)$/);