LibreChat/client/test/subagents.ts
Marco Beretta 528820d81c
📡 refactor: Attach the Subagent Activity Feed Through the Chat Transport (#17526)
* refactor: Move Subagent Progress State and Content Folding Into @librechat/chat

* refactor: Attach the Subagent Activity Feed Through the Chat Transport

* test: Tag the Subagent Activity Panel E2E Specs With Scenarios

* test: Pin Replay, Ready and Live Steer Ordering Across an Activity Reconnect

* fix: Stop the Subagent Activity Feed on Refusals and Bound Idle Reconnects

* fix: Keep Attaching the Subagent Feed While the Child Thread Is Still Reserved

* test: Read Steer Order the Same While the Child Turn Streams and Once It Settles
2026-10-29 20:38:39 +01:00

27 lines
1,019 B
TypeScript

import type { SubagentUpdateEvent } from 'librechat-data-provider';
import type { SubagentContentPart, SubagentTickerLine } from '@librechat/chat';
import {
foldSubagentEvent,
initSubagentTickerState,
foldSubagentEventIntoTicker,
initSubagentAggregatorState,
} from '@librechat/chat';
/** Folds a whole event stream through the incremental aggregator the live UI uses. */
export function aggregateSubagentContent(events: SubagentUpdateEvent[]): SubagentContentPart[] {
let parts: SubagentContentPart[] = [];
let state = initSubagentAggregatorState();
for (const event of events) {
({ parts, state } = foldSubagentEvent(parts, state, event));
}
return parts;
}
/** Folds a whole event stream through the incremental ticker the live UI uses. */
export function buildSubagentTickerLines(events: SubagentUpdateEvent[]): SubagentTickerLine[] {
let state = initSubagentTickerState();
for (const event of events) {
state = foldSubagentEventIntoTicker(state, event);
}
return state.lines;
}