feat(subagent): add session-owned task messaging and cancellation (#5985)

let's go!
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-05 05:16:33 +08:00
1 parent f75470e72f
commit 6ff96f2a8f
93 files changed
+5632 -1156

No files matched your search

+9 -1
View File
@@ -15,6 +15,7 @@ import { SessionHandleLabel } from "@/components/SessionHandleLabel";
import { PromptNavigator } from "@/components/thread/PromptNavigator";
import { ModelFallbackNotice } from "@/components/thread/ModelFallbackNotice";
import { RecoveryNotice } from "@/components/thread/RecoveryNotice";
import { SubagentTasksProvider } from "@/components/thread/SubagentTasks";
import { SessionInfoPopover } from "@/components/thread/SessionInfoPopover";
import type { ComposerDraftStore } from "@/lib/composer-draft";
import { ThreadComposer } from "@/components/thread/ThreadComposer";
@@ -696,7 +697,7 @@ export function ThreadShell({
version: historyVersion,
forkBoundaryMessageCount,
} = useSessionHistory(historyKey);
const { client, getToken, ingressLimits, modelName, token } = useClient();
const { client, getToken, ingressLimits, modelName, token, webuiCapabilities } = useClient();
const pickWorkspaceFolder = useCallback(async (): Promise<string | null> => {
const response = await client.requestMutation<{ path: unknown }>(
"workspace.pick_folder",
@@ -1879,6 +1880,12 @@ export function ThreadShell({
) : null;
return (
<SubagentTasksProvider client={client} token={token}
sessionKey={session?.key ?? null}
liveEvents={webuiCapabilities.includes("webui.subagents.events.v1")}
historyEnabled={webuiCapabilities.includes("webui.subagents.history.v1")}
active={composerActive}
enabled={!temporary && !!session?.key.startsWith("websocket:") && webuiCapabilities.includes("webui.subagents.v1")}>
<section ref={shellRef} data-preview-open={previewOpen || undefined} className="thread-preview-layout relative flex min-h-0 flex-1 overflow-hidden">
<div className={cn(
"thread-conversation relative flex min-w-0 flex-1 flex-col overflow-hidden",
@@ -1977,5 +1984,6 @@ export function ThreadShell({
</FileActionsProvider>
) : null}
</section>
</SubagentTasksProvider>
);
}