mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-20 15:02:02 +00:00
* fix: resolve saved subagent display identity * fix: persist explicit subagent execution identity
19 lines
700 B
TypeScript
19 lines
700 B
TypeScript
import type { SubagentIdentity, SubagentUpdateEvent } from 'librechat-data-provider';
|
|
|
|
/** Retain execution identity beside the existing bounded child-content buffer. */
|
|
export function captureSubagentIdentity(
|
|
target: { subagentIdentity?: SubagentIdentity },
|
|
event: SubagentUpdateEvent,
|
|
): void {
|
|
if (event.subagentKind !== 'agent' && event.subagentKind !== 'graph') return;
|
|
if (!event.subagentAgentId) return;
|
|
if (
|
|
target.subagentIdentity?.subagentKind === event.subagentKind &&
|
|
target.subagentIdentity.subagentAgentId === event.subagentAgentId
|
|
)
|
|
return;
|
|
target.subagentIdentity = {
|
|
subagentKind: event.subagentKind,
|
|
subagentAgentId: event.subagentAgentId,
|
|
};
|
|
}
|