Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4bdca9a
feat(chat): pdev subagents as steerable child sessions, and one drawe…
harshithmullapudi Oct 20, 2026
19da9ff
fix(chat): review fixes for subagent sessions
harshithmullapudi Oct 20, 2026
81a56e8
fix(host-service): keep a subagent's message out of the chat reply pr…
harshithmullapudi Oct 20, 2026
db9eb69
fix(chat-runtime): rewind forks at the main agent's message, not a su…
harshithmullapudi Oct 20, 2026
ee67edc
fix(chat-runtime): keep subagent approvals in step with their run and…
harshithmullapudi Oct 20, 2026
f2c73f0
test(chat-runtime): fake the clock in the subagent steer timeout test
harshithmullapudi Oct 20, 2026
84abd61
fix(chat): send a subagent's own items only to clients that nest them
harshithmullapudi Oct 20, 2026
00c6c35
fix(desktop): flag a drawer row when a subagent folded into it asks f…
harshithmullapudi Oct 20, 2026
026918c
fix(desktop): pluralize the drawer's approval count as one message
harshithmullapudi Oct 20, 2026
e23ec82
refactor(desktop): move ChildItem into its own component folder
harshithmullapudi Oct 20, 2026
9d4e930
fix(mobile): keep the strict missing-procedure check on mobile
harshithmullapudi Oct 20, 2026
168cc77
fix(chat-runtime): wrap hidden parts before steering a subagent
harshithmullapudi Oct 20, 2026
7c7a296
fix(i18n): correct subagent strings flagged in review
harshithmullapudi Oct 20, 2026
ee168f6
feat(desktop): show a message sent to a subagent as queued until it t…
harshithmullapudi Oct 21, 2026
793fe3a
fix(desktop): one subagent echo clears every queued message it carries
harshithmullapudi Oct 21, 2026
7eecf94
fix(chat-runtime): a nested subagent spawn flushes only its parent's …
harshithmullapudi Oct 21, 2026
50d452d
fix(chat): unknown subagent status or sender parses as unset
harshithmullapudi Oct 21, 2026
85367fb
test(chat-ui): recall the previous prompt with a discrete editor update
harshithmullapudi Oct 21, 2026
ce3e701
fix(chat-runtime): a pdev message shows the model that ran, never the…
harshithmullapudi Oct 21, 2026
e3d00b0
fix(desktop): hide "Worked for 0s" on a finished turn with no measure…
harshithmullapudi Oct 21, 2026
d2b6851
fix(desktop): show the reply footer at the end of its turn
harshithmullapudi Oct 21, 2026
8bc36e3
fix(chat-runtime): keep pdev notifications out of the transcript
harshithmullapudi Oct 21, 2026
f98bf46
feat(desktop): a running turn's collapsed tool run shows its last thr…
harshithmullapudi Oct 21, 2026
8c351fe
fix(chat-runtime): accept a v2 permission with null description or su…
harshithmullapudi Oct 21, 2026
a2f4a6d
fix(chat-runtime): drop a closed session's cached subagent tree
harshithmullapudi Oct 21, 2026
5fc109d
chore(desktop): bundle pdev 0.2.1
harshithmullapudi Oct 21, 2026
e0dcd1b
feat(sandbox): ship pdev 0.2.1 in cloud workspaces
harshithmullapudi Oct 21, 2026
8133a0f
fix(sandbox): publish an uncached asset from its row's source
harshithmullapudi Oct 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions apps/desktop/scripts/build-bundled-pdev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ import { tmpdir } from "node:os";
import { basename, dirname, join, resolve } from "node:path";
import { config } from "dotenv";

export const PDEV_VERSION = "0.1.5";
export const PDEV_VERSION = "0.2.1";
const PDEV_DOWNLOAD_URL = `https://github.com/superset-sh/pdev/releases/download/v${PDEV_VERSION}`;
export const PDEV_SHA256: Record<string, string> = {
"pdev-0.1.5-darwin-arm64.tar.gz":
"eae20d553bfcef8c60f567a6f516fde76b88daf452c8e8ce8989be9a407db7ce",
"pdev-0.1.5-darwin-x64.tar.gz":
"9923a0a28f541bdca19a78ad5aa0d78cf28a004fa9b6b79f9c54023c8e173208",
"pdev-0.1.5-linux-arm64.tar.gz":
"0b5fbe5d41149ba976549c33925c49a9f02d4012d937bdbc4365498e8782a6af",
"pdev-0.1.5-linux-x64.tar.gz":
"c2b35ead56fa0f9ba4c7dc0aa10a25feb08c58645d6b656d92882b9d76cbff9d",
"pdev-0.2.1-darwin-arm64.tar.gz":
"27cc0f2f5fedd98b4945eea8a4cd2d169c2f91c9e02d99e6a8f5a04004a67a01",
"pdev-0.2.1-darwin-x64.tar.gz":
"75873740ec6d01767ad6b002c07b3b1ed36db12d0201bad32c5cb31e014ad4e2",
"pdev-0.2.1-linux-arm64.tar.gz":
"ae3f3a037b8003a5ebf22f07d0191b65aa421725828ee7652de35dc3a5821908",
"pdev-0.2.1-linux-x64.tar.gz":
"fbe6e23ace106f981d0652c081bec3973ca3ed843e318f05fdaa6dc04af1cdec",
};
const BUNDLED_FROM_FILE = ".bundled-from";

Expand Down
14 changes: 10 additions & 4 deletions apps/desktop/src/renderer/hooks/useNow/useNow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@ import { useEffect, useState } from "react";
* A Date that re-renders on a cadence so `formatDistance`-style displays
* keep ticking. Defaults to 1s so fresh rows never show a stale delta.
*/
export function useNow(intervalMs = 1000): Date {
const [now, setNow] = useState(() => new Date());
export function useNow(
intervalMs = 1000,
enabled = true,
read: () => number = Date.now,
): Date {
const [now, setNow] = useState(() => new Date(read()));
useEffect(() => {
const id = setInterval(() => setNow(new Date()), intervalMs);
if (!enabled) return;
setNow(new Date(read()));
const id = setInterval(() => setNow(new Date(read())), intervalMs);
return () => clearInterval(id);
}, [intervalMs]);
}, [intervalMs, enabled, read]);
return now;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { errorMessage, rawErrorMessage } from "@superset/i18n/errors";
import { isMissingProcedureError } from "renderer/lib/isMissingProcedureError";
import { isMissingProcedureError } from "@superset/shared/missing-procedure-error";

export function combinePullRequestReadErrors(
hostError: unknown,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { toast } from "@superset/ui/sonner";
import { Tooltip, TooltipContent, TooltipTrigger } from "@superset/ui/tooltip";
import { cn } from "@superset/ui/utils";
import { workspaceTrpc } from "@superset/workspace-client";
import { ArrowLeft, GitCompareArrows, ListTree, Square } from "lucide-react";
import { ArrowLeft, GitCompareArrows, ListTree } from "lucide-react";
import {
type MouseEvent,
type ReactNode,
Expand All @@ -17,7 +17,6 @@ import {
useSyncExternalStore,
} from "react";
import { env } from "renderer/env.renderer";
import { useTerminalAgentBindings } from "renderer/hooks/host-service/useTerminalAgentBindings";
import { useWorkspaceEvent } from "renderer/hooks/host-service/useWorkspaceEvent";
import { useDebouncedValue } from "renderer/hooks/useDebouncedValue";
import { usePagePolicy } from "renderer/lib/clickPolicy";
Expand All @@ -30,16 +29,11 @@ import { pagesListInput } from "renderer/routes/_authenticated/_dashboard/utils/
import { useWorkspace } from "renderer/routes/_authenticated/_dashboard/v2-workspace/providers/WorkspaceProvider";
import type { StoreApi } from "zustand/vanilla";
import type { CreateNewAgentSession } from "../../hooks/useAgentSessionLauncher";
import { useChatWiring } from "../../hooks/usePaneRegistry/components/ChatSession/hooks/useSessionClient";
import { usePRFlowState } from "../../hooks/usePRFlowState";
import { useShipActions } from "../../hooks/useShipActions";
import { useRightPaneLinkTarget } from "../../providers/RightPaneLinkTargetProvider";
import { useWorkspaceGitStatus } from "../../providers/WorkspaceGitStatusProvider";
import type {
PagePaneData,
PaneViewerData,
SubagentPaneData,
} from "../../types";
import type { PagePaneData, PaneViewerData } from "../../types";
import {
BACKGROUND_TERMINAL_ATTACHMENT_DEBOUNCE_MS,
getAttachedTerminalIdsKey,
Expand Down Expand Up @@ -82,7 +76,6 @@ interface WorkspaceActivityMenuProps {
linkedStores: readonly StoreApi<WorkspaceStore<PaneViewerData>>[];
isLayoutReady: boolean;
onOpenPage: (page: PagePaneData, placement: "split" | "tab") => void;
onOpenSubagent: (data: SubagentPaneData) => void;
onCreateNewAgentSession: CreateNewAgentSession;
onFocusAgentTerminal: (terminalId: string) => void;
changes?: { isOpen: boolean; onToggle: () => void };
Expand All @@ -94,7 +87,6 @@ export function WorkspaceActivityMenu({
linkedStores,
isLayoutReady,
onOpenPage,
onOpenSubagent,
onCreateNewAgentSession,
onFocusAgentTerminal,
changes,
Expand Down Expand Up @@ -144,9 +136,7 @@ export function WorkspaceActivityMenu({
const [composing, setComposing] = useState(false);
const [now, setNow] = useState(() => Date.now());
const [stopping, setStopping] = useState<ReadonlySet<string>>(new Set());
const chatWiring = useChatWiring();

const bindings = useTerminalAgentBindings(workspaceId);
const terminalUtils = workspaceTrpc.useUtils();
const killTerminal = workspaceTrpc.terminal.killSession.useMutation();
const subscribeAttachedStores = useCallback(
Expand Down Expand Up @@ -200,54 +190,18 @@ export function WorkspaceActivityMenu({
settledAttachedTerminalIdsKey,
],
);
const { processes, subagents } = useMemo(
() => collectBackgroundWork(bindings.values(), detachedTerminals),
[bindings, detachedTerminals],
const processes = useMemo(
() => collectBackgroundWork(detachedTerminals),
[detachedTerminals],
);
const getSourceLabelsSnapshot = useCallback(
() =>
JSON.stringify(
[store, ...linkedStores]
.flatMap((paneStore) => paneStore.getState().tabs)
.flatMap((tab) =>
Object.values(tab.panes).flatMap((pane) => {
const data = pane.data as {
terminalId?: string;
chatTitle?: string;
};
const label =
tab.titleOverride ?? pane.titleOverride ?? data.chatTitle;
return data.terminalId && label ? [[data.terminalId, label]] : [];
}),
),
),
[store, linkedStores],
);
const sourceLabelsKey = useSyncExternalStore(
subscribeAttachedStores,
getSourceLabelsSnapshot,
getSourceLabelsSnapshot,
);
const sourceLabels = useMemo(
() => new Map<string, string>(JSON.parse(sourceLabelsKey)),
[sourceLabelsKey],
);
const workSourceCount = new Set(
[...processes, ...subagents].map((work) => work.terminalId),
).size;
const stoppableAgentTasks = processes.filter(
(work) => work.stop?.type === "chat",
);
const runningCount =
processes.filter((work) => !work.detachedTerminal).length +
subagents.length;
const runningCount = processes.length;

useEffect(() => {
if (!open || processes.length + subagents.length === 0) return;
if (!open || processes.length === 0) return;
setNow(Date.now());
const timer = setInterval(() => setNow(Date.now()), CLOCK_TICK_MS);
return () => clearInterval(timer);
}, [open, processes.length, subagents.length]);
}, [open, processes.length]);

// This menu orders by publish time, not creation time, so it takes one
// large batch rather than the grid's scroll-sized one. Built once because
Expand Down Expand Up @@ -338,75 +292,37 @@ export function WorkspaceActivityMenu({

const handleOpenWork = (work: BackgroundWork) => {
handleOpenChange(false);
if (work.detachedTerminal) {
clearTerminalBackgroundMarker(workspaceId, work.terminalId);
focusOrAddTerminalPane(store, work.terminalId);
void terminalUtils.terminal.list.invalidate({ workspaceId });
return;
}
if (work.subagent) {
onOpenSubagent({
terminalId: work.terminalId,
subagentId: work.subagent.id,
agentId: work.subagent.agentId,
...(work.subagent.agentType
? { agentType: work.subagent.agentType }
: {}),
});
return;
}
onFocusAgentTerminal(work.terminalId);
clearTerminalBackgroundMarker(workspaceId, work.terminalId);
focusOrAddTerminalPane(store, work.terminalId);
void terminalUtils.terminal.list.invalidate({ workspaceId });
};

const handleStopWork = (work: BackgroundWork) => {
const target = work.stop;
if (!target) return;
setStopping((current) => new Set(current).add(work.key));
const release = () =>
setStopping((current) => {
const next = new Set(current);
next.delete(work.key);
return next;
});
const stopped =
target.type === "terminal"
? killTerminal
.mutateAsync({ terminalId: work.terminalId, workspaceId })
.then(() => {
clearTerminalBackgroundMarker(workspaceId, work.terminalId);
void terminalUtils.terminal.list.invalidate({ workspaceId });
})
: chatWiring.transport
.stopBackgroundTask({
commandId: crypto.randomUUID(),
sessionId: target.chatSessionId,
taskId: target.taskId,
})
.then((done) => {
if (!done) throw new Error("the agent did not stop the task");
});
void stopped
void killTerminal
.mutateAsync({ terminalId: work.terminalId, workspaceId })
.then(() => {
clearTerminalBackgroundMarker(workspaceId, work.terminalId);
void terminalUtils.terminal.list.invalidate({ workspaceId });
})
.catch((error: unknown) => {
console.warn("[WorkspaceActivityMenu] could not stop task", error);
toast.error(t({ message: "Couldn't stop the background task" }));
})
.finally(release);
};

const stopAll = () => {
for (const work of stoppableAgentTasks) {
if (!stopping.has(work.key)) handleStopWork(work);
}
};

const workRows = (items: BackgroundWork[]) =>
items.map((work) => (
<BackgroundWorkRow
key={work.key}
work={work}
source={
workSourceCount > 1 ? sourceLabels.get(work.terminalId) : undefined
}
now={now}
stopping={stopping.has(work.key)}
onOpen={handleOpenWork}
Expand Down Expand Up @@ -473,7 +389,7 @@ export function WorkspaceActivityMenu({
</PopoverTrigger>
</TooltipTrigger>
<TooltipContent side="bottom">
<Trans>Background work and pages</Trans>
<Trans>Workspace activity</Trans>
</TooltipContent>
</Tooltip>
<PopoverContent
Expand Down Expand Up @@ -576,30 +492,7 @@ export function WorkspaceActivityMenu({
/>
</section>
)}
<MenuGroup
title={<Trans>Background processes</Trans>}
actions={
stoppableAgentTasks.length > 0 && (
<Tooltip>
<TooltipTrigger asChild>
<button
type="button"
aria-label={t({
message: "Stop all agent background processes",
})}
onClick={stopAll}
className="flex size-6 items-center justify-center rounded-sm text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent"
>
<Square className="size-2.5 fill-current" />
</button>
</TooltipTrigger>
<TooltipContent side="top">
<Trans>Stop all agent background processes</Trans>
</TooltipContent>
</Tooltip>
)
}
>
<MenuGroup title={<Trans>Background processes</Trans>}>
<div className="max-h-48 overflow-y-auto">
{processes.length > 0
? workRows(processes)
Expand All @@ -608,13 +501,6 @@ export function WorkspaceActivityMenu({
: emptyRow(<Trans>Nothing running</Trans>)}
</div>
</MenuGroup>
{subagents.length > 0 && (
<MenuGroup title={<Trans>Subagents</Trans>}>
<div className="max-h-48 overflow-y-auto">
{workRows(subagents)}
</div>
</MenuGroup>
)}
<MenuGroup
title={<Trans>Pages</Trans>}
addLabel={t({ message: "New page" })}
Expand Down
Loading
Loading