Skip to content

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

refactor(conversations): remove worktree tracking from subagent activities

Steven Enamakel6c7cce153cf1
diff --git a/app/src/features/conversations/aui/SubagentActivityCard.tsx b/app/src/features/conversations/aui/SubagentActivityCard.tsx
index f6fa328e8c..ea0c0b196a 100644
--- a/app/src/features/conversations/aui/SubagentActivityCard.tsx
+++ b/app/src/features/conversations/aui/SubagentActivityCard.tsx
@@ -34,8 +34,6 @@
*/
import { TaskCard, type TaskCardState } from '../../../components/assistant-ui/elements/task-card';
import { formatElapsed } from '../../../components/assistant-ui/utils/task';
-import Badge from '../../../components/ui/Badge';
-import WorktreeActions from '../../../components/worktree/WorktreeActions';
import { useT } from '../../../lib/i18n/I18nContext';
import {
isActiveTimelineStatus,
@@ -43,7 +41,6 @@ import {
type SubagentToolCallEntry,
type SubagentTranscriptItem,
} from '../../../store/chatRuntimeSlice';
-import { basename } from '../../../utils/pathUtils';
import { stripToolCallEnvelopes } from '../../../utils/toolTimelineFormatting';
import { BubbleMarkdown } from '../components/AgentMessageBubble';
import { AssistantUiToolCallCard } from '../components/AssistantUiToolCall';
@@ -86,27 +83,6 @@ function stateOf(activity: SubagentActivity): TaskCardState {
return 'done';
}
-function WorktreeRow({ activity }: { activity: SubagentActivity }) {
- const { t } = useT();
- if (!activity.worktreePath) return null;
- return (
- <div className="flex flex-col gap-1.5">
- <div className="flex flex-wrap items-center gap-1.5">
- <span className="font-medium text-content-secondary">{t('worktree.label')}</span>
- <span
- className="truncate font-mono text-[12px] text-content-muted"
- title={activity.worktreePath}>
- {basename(activity.worktreePath)}
- </span>
- <Badge variant={activity.isDirty ? 'warning' : 'success'}>
- {activity.isDirty ? t('worktree.dirty') : t('worktree.clean')}
- </Badge>
- </div>
- <WorktreeActions path={activity.worktreePath} isDirty={activity.isDirty} compact />
- </div>
- );
-}
-
/** The nested activity: the child's interleaved transcript, or its flat `toolCalls` list. */
function ActivityTranscript({ activity }: { activity: SubagentActivity }) {
const transcript = activity.transcript ?? [];
@@ -145,7 +121,7 @@ export function SubagentActivityCard({ activity }: { activity: SubagentActivity
const hasTranscript = (activity.transcript?.length ?? 0) > 0 || activity.toolCalls.length > 0;
const actions =
- awaiting || incomplete || activity.worktreePath ? (
+ awaiting || incomplete ? (
<div className="flex flex-col gap-2.5">
{incomplete ? (
<p
@@ -169,7 +145,6 @@ export function SubagentActivityCard({ activity }: { activity: SubagentActivity
) : null}
</div>
) : null}
- <WorktreeRow activity={activity} />
</div>
) : undefined;
diff --git a/app/src/features/conversations/aui/SubagentTaskCard.tsx b/app/src/features/conversations/aui/SubagentTaskCard.tsx
index 6f8e536657..f99391aa53 100644
--- a/app/src/features/conversations/aui/SubagentTaskCard.tsx
+++ b/app/src/features/conversations/aui/SubagentTaskCard.tsx
@@ -27,14 +27,11 @@ import { TaskTranscript } from '../../../components/assistant-ui/elements/task-c
import { useDisclosure } from '../../../components/assistant-ui/lib/useDisclosure';
import { formatElapsed } from '../../../components/assistant-ui/utils/task';
import { Button } from '../../../components/ui';
-import Badge from '../../../components/ui/Badge';
-import WorktreeActions from '../../../components/worktree/WorktreeActions';
import { useT } from '../../../lib/i18n/I18nContext';
import { subagentMessages } from '../../../providers/assistantUiMessages';
import { subagentApi } from '../../../services/api/subagentApi';
import { type SubagentActivity, subagentCancelResolved } from '../../../store/chatRuntimeSlice';
import { useAppDispatch } from '../../../store/hooks';
-import { basename } from '../../../utils/pathUtils';
import { useSubagentElapsed } from './useSubagentElapsed';
function asSubagentActivity(value: unknown): SubagentActivity | undefined {
@@ -197,27 +194,6 @@ function CancelTaskAction({ taskId }: { taskId: string }) {
);
}
-function WorktreeRow({ activity }: { activity: SubagentActivity }) {
- const { t } = useT();
- if (!activity.worktreePath) return null;
- return (
- <div className="flex flex-col gap-1.5">
- <div className="flex flex-wrap items-center gap-1.5">
- <span className="font-medium text-content-secondary">{t('worktree.label')}</span>
- <span
- className="truncate font-mono text-[12px] text-content-muted"
- title={activity.worktreePath}>
- {basename(activity.worktreePath)}
- </span>
- <Badge variant={activity.isDirty ? 'warning' : 'success'}>
- {activity.isDirty ? t('worktree.dirty') : t('worktree.clean')}
- </Badge>
- </div>
- <WorktreeActions path={activity.worktreePath} isDirty={activity.isDirty} compact />
- </div>
- );
-}
-
/** Adapt an assistant-ui `task` part onto {@link TaskCard} for a sub-agent delegation. */
export const SubagentTaskCard: ToolCallMessagePartComponent = ({
args,
@@ -262,10 +238,9 @@ export const SubagentTaskCard: ToolCallMessagePartComponent = ({
const cancellable = running && resolved.taskId !== 'pending-subagent';
const actions =
- awaiting || resolved.worktreePath || cancellable ? (
+ awaiting || cancellable ? (
<div className="flex flex-col gap-2.5">
{awaiting ? <AwaitingUserActions activity={resolved} /> : null}
- <WorktreeRow activity={resolved} />
{cancellable ? <CancelTaskAction taskId={resolved.taskId} /> : null}
</div>
) : undefined;
diff --git a/app/src/providers/ChatRuntimeProvider.tsx b/app/src/providers/ChatRuntimeProvider.tsx
index 799dc423df..f42f9935c3 100644
--- a/app/src/providers/ChatRuntimeProvider.tsx
+++ b/app/src/providers/ChatRuntimeProvider.tsx
@@ -1013,9 +1013,6 @@ const ChatRuntimeProvider = ({ children }: { children: React.ReactNode }) => {
);
},
onSubagentDone: (event: ChatSubagentDoneEvent) => {
- // Worktree isolation metadata (#3376) — present only for workers that ran
- // with `isolation = "worktree"`; drives the inline worktree row's
- // open/diff/remove affordances. Undefined fields leave the row untouched.
dispatch(
subagentDone({
threadId: event.thread_id,
@@ -1026,9 +1023,6 @@ const ChatRuntimeProvider = ({ children }: { children: React.ReactNode }) => {
elapsedMs: event.subagent?.elapsed_ms,
outputChars: event.subagent?.output_chars,
output: event.subagent?.output,
- worktreePath: event.subagent?.worktree_path,
- changedFiles: event.subagent?.changed_files,
- isDirty: event.subagent?.dirty_status,
})
);
diff --git a/app/src/services/chatService.ts b/app/src/services/chatService.ts
index 0afd016229..1a358bf24b 100644
--- a/app/src/services/chatService.ts
+++ b/app/src/services/chatService.ts
@@ -666,16 +666,6 @@ export interface SubagentProgressDetail {
worker_thread_id?: string;
/** Human-readable display name from the agent registry. */
display_name?: string;
- /**
- * Absolute path to the worker's isolated `git worktree` checkout (on
- * `subagent_completed`, when the worker ran with `isolation = "worktree"`).
- * Drives the inline worktree row's open/diff/remove actions (#3376).
- */
- worktree_path?: string;
- /** Files (relative to the worktree root) the worker changed (on `subagent_completed`). */
- changed_files?: string[];
- /** Whether the worker's worktree had uncommitted changes (on `subagent_completed`). */
- dirty_status?: boolean;
/**
* This child's own spend (on `subagent_completed`) — present **only when it
* is not already inside the parent turn's totals**.
diff --git a/app/src/store/chatRuntimeSlice.ts b/app/src/store/chatRuntimeSlice.ts
index dcf385a32b..254149e16c 100644
--- a/app/src/store/chatRuntimeSlice.ts
+++ b/app/src/store/chatRuntimeSlice.ts
@@ -203,25 +203,6 @@ export interface SubagentActivity {
* tool sequence. Absent on legacy/test rows that predate streaming.
*/
transcript?: SubagentTranscriptItem[];
- /**
- * Absolute path to this worker's isolated `git worktree` checkout, when it
- * ran with `isolation = "worktree"` (#3376). `undefined` for non-isolated
- * (read-only or shared-workspace) workers. Scaffold-only: the open/diff/
- * remove action buttons that consume this land in a follow-up PR.
- */
- worktreePath?: string;
- /**
- * Files (relative to the worktree root) this worker changed, collected from
- * `git status` after the run. Drives the future diff/overlap UI. Absent or
- * empty for non-isolated workers and clean worktrees.
- */
- changedFiles?: string[];
- /**
- * `true` when the worker's worktree had uncommitted changes after the run.
- * A dirty worktree must not be auto-removed — the cleanup UI will require an
- * explicit user choice. `undefined` for non-isolated workers.
- */
- isDirty?: boolean;
}
/**
@@ -2171,9 +2152,6 @@ const chatRuntimeSlice = createSlice({
outputChars?: number;
/** The sub-agent's final assistant text; see {@link SubagentActivity.output}. */
output?: string;
- worktreePath?: string;
- changedFiles?: string[];
- isDirty?: boolean;
}>
) => {
const {
@@ -2185,9 +2163,6 @@ const chatRuntimeSlice = createSlice({
elapsedMs,
outputChars,
output,
- worktreePath,
- changedFiles,
- isDirty,
} = action.payload;
// Settle a still-in-flight row: `running`, or `awaiting_user` (a subagent
// paused for input that then completes must not stay stuck at
@@ -2228,9 +2203,6 @@ const chatRuntimeSlice = createSlice({
if (elapsedMs !== undefined) s.elapsedMs = elapsedMs;
if (outputChars !== undefined) s.outputChars = outputChars;
if (output !== undefined) s.output = output;
- if (worktreePath !== undefined) s.worktreePath = worktreePath;
- if (changedFiles !== undefined) s.changedFiles = changedFiles;
- if (isDirty !== undefined) s.isDirty = isDirty;
}
},
/**