Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(workflow-copilot): wrap transcript in subagent drawer host

Steven Enamakelfe597c1cddb1
diff --git a/app/src/components/flows/WorkflowCopilotPanel.tsx b/app/src/components/flows/WorkflowCopilotPanel.tsx
index 8794ae694e..b79ea3f5d3 100644
--- a/app/src/components/flows/WorkflowCopilotPanel.tsx
+++ b/app/src/components/flows/WorkflowCopilotPanel.tsx
@@ -33,6 +33,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { AgentRunningStatus } from '../../features/conversations/aui/AgentRunningStatus';
import { ChatSources } from '../../features/conversations/components/aui/ChatSources';
+import { SubagentDrawerHost } from '../../features/conversations/components/aui/subagentDrawerHost';
import { TranscriptOverlays } from '../../features/conversations/components/aui/TranscriptOverlays';
import { ChatToolFallback } from '../../features/conversations/components/ChatToolParts';
import { useChatSurfaceRegistration } from '../../features/conversations/hooks/useChatSurfaceRegistration';
@@ -509,6 +510,12 @@ export default function WorkflowCopilotPanel({
? (state.chatRuntime.processingByThread?.[threadId] ?? EMPTY_TRANSCRIPT)
: EMPTY_TRANSCRIPT
);
+ const [openSubagentTaskId, setOpenSubagentTaskId] = useState<string | null>(null);
+ const canOpenSubagent = useCallback(
+ (taskId: string) => toolTimeline.some(entry => entry.subagent?.taskId === taskId),
+ [toolTimeline]
+ );
+
// The copilot's authoring footer: error line, proposal preview, capped card
// and the builder composer. Parked approvals are NOT repeated here — the
// assistant-ui transcript renders them inline on the gated tool call (see
@@ -703,9 +710,13 @@ export default function WorkflowCopilotPanel({
The home chat's starter prompts are off: a click sends the prompt,
and they are not builder requests. */}
<AssistantUiRuntimeProvider threadId={threadId} welcomeSuggestions={false}>
- <div className="min-h-0 flex-1" data-testid="workflow-copilot-transcript">
- <Thread components={components} />
- </div>
+ <SubagentDrawerHost
+ onOpenSubagent={setOpenSubagentTaskId}
+ canOpenSubagent={canOpenSubagent}>
+ <div className="min-h-0 flex-1" data-testid="workflow-copilot-transcript">
+ <Thread components={components} />
+ </div>
+ </SubagentDrawerHost>
</AssistantUiRuntimeProvider>
<TranscriptOverlays
threadId={threadId}
@@ -714,6 +725,8 @@ export default function WorkflowCopilotPanel({
backgroundProcesses={NO_BACKGROUND_PROCESSES}
showBackgroundProcesses={false}
onCloseBackgroundProcesses={noop}
+ openSubagentTaskId={openSubagentTaskId}
+ onOpenSubagent={setOpenSubagentTaskId}
showProcessSource={false}
onCloseProcessSource={noop}
/>