mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-12 17:22:38 +02:00
Indent tool cards under an active delegating task span.
This commit is contained in:
parent
39084b3075
commit
e7c5204b02
4 changed files with 106 additions and 52 deletions
19
surfsense_web/lib/chat/delegation-span-indent.ts
Normal file
19
surfsense_web/lib/chat/delegation-span-indent.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* Indent tool-call cards that belong to an open delegating ``task`` episode.
|
||||
*
|
||||
* The backend only stamps ``metadata.spanId`` on tool SSE / persisted parts
|
||||
* while a ``task`` is active (see ``AgentEventRelayState.tool_activity_metadata``),
|
||||
* so its presence is sufficient. The opening ``task`` row itself carries the
|
||||
* same span id but stays flush — it is the header of the delegation.
|
||||
*/
|
||||
|
||||
export function shouldIndentToolCallForDelegationSpan(
|
||||
toolName: string,
|
||||
metadata: Record<string, unknown> | undefined
|
||||
): boolean {
|
||||
if (toolName === "task") return false;
|
||||
const v = metadata?.spanId;
|
||||
return typeof v === "string" && v.trim().length > 0;
|
||||
}
|
||||
|
||||
export const DELEGATION_SPAN_INDENT_CLASS = "pl-3 sm:ml-4";
|
||||
Loading…
Add table
Add a link
Reference in a new issue