mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-17 05:20:55 +00:00
* feat: Return a Navigable Progress Tree When Checking a Running Subagent check_background_task on a running or finished-but-undelivered subagent now returns an activity digest: the child's turns, tool calls, and replies folded to one line each and addressed by stable positional paths. Callers expand one node or range with expand, and page with since against a settled-node cursor. The owning process folds the child's update stream into a bounded tree that keeps only tool names, the model-authored intent label, the tool-authored outcome label, statuses, timings, and sizes. Routed claims carry the tree to a poll on any replica, lists carry counts and the node in flight, and a finished child whose owner is gone is rebuilt from its durable public projection. The background-task card renders the digest as a foldable tree and links the existing subagent activity panel. * fix: Tighten Progress Digest Verdicts, Overflow Bounds, and Rebuilt Trees Failed reply steps and schema-rejected calls now record as errors, and an overflowed call is counted once without retaining it in the lookup maps. A tree rebuilt from the durable projection re-checks completed calls with the shared failure verdict, carries the projection's truncation, and tells the caller its paths are a reconstruction. The card localizes folded summaries instead of rendering the server's English tally. * fix: Measure Single-Part Message Deltas in the Progress Digest * fix: Scope Nested Progress Ownership by Run and Count Overflow Once Nested runs now attach to the call recorded by their own spawning run, since provider call ids repeat across runs. Only the step that announces a call can count it as overflow, so later sightings of an unretained or evicted call never re-count it or reopen history. A zero-valued since cursor is rejected, and the card labels MCP tools with the configured server names.
29 lines
1 KiB
TypeScript
29 lines
1 KiB
TypeScript
const TOOL_CALL_ERROR_PREFIX = /^Error:\s*(?:\[[^\]]*\]\s*)*tool call failed:\s*/i;
|
|
|
|
export function hasToolCallErrorPrefix(text: string): boolean {
|
|
return TOOL_CALL_ERROR_PREFIX.test(text);
|
|
}
|
|
|
|
/** Whether a tool output string is one the tool output renderers present as a failure. */
|
|
export function isToolErrorOutput(text: string): boolean {
|
|
return hasToolCallErrorPrefix(text) || text.startsWith('Error processing tool');
|
|
}
|
|
|
|
const VALIDATION_FEEDBACK = /^Error:[\s\S]*\n Please fix your mistakes\.$/i;
|
|
|
|
/**
|
|
* Whether a completed tool call failed. Agents SDK releases serialize tool failures
|
|
* into these host-authored prefixes, and schema-validation feedback into a plain
|
|
* `Error:` block, without carrying `ToolMessage.status` on the wire.
|
|
*/
|
|
export function isFailedToolOutput(text: string): boolean {
|
|
return (
|
|
hasToolCallErrorPrefix(text) ||
|
|
/^Error processing tool(?::|$)/i.test(text) ||
|
|
VALIDATION_FEEDBACK.test(text)
|
|
);
|
|
}
|
|
|
|
export function stripToolCallErrorPrefix(text: string): string {
|
|
return text.replace(TOOL_CALL_ERROR_PREFIX, '');
|
|
}
|