Skip to content

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

test: cover retired worktree controls and rpc methods

Steven Enamakelfc44ee131136
diff --git a/app/src/features/conversations/aui/SubagentActivityCard.test.tsx b/app/src/features/conversations/aui/SubagentActivityCard.test.tsx
index 634e85ab29..c85bff63ec 100644
--- a/app/src/features/conversations/aui/SubagentActivityCard.test.tsx
+++ b/app/src/features/conversations/aui/SubagentActivityCard.test.tsx
@@ -93,6 +93,27 @@ describe('SubagentActivityCard', () => {
expect(screen.getByText('Delegated to Researcher')).toBeInTheDocument();
});
+ it('keeps the completed result while omitting retired worktree controls', () => {
+ render(
+ <SubagentActivityCard
+ activity={{
+ taskId: 't',
+ agentId: 'researcher',
+ status: 'success',
+ output: 'Research is complete.',
+ worktreePath: '/repo/.claude/worktrees/worker',
+ changedFiles: ['notes.md'],
+ isDirty: true,
+ toolCalls: [],
+ }}
+ />
+ );
+
+ expect(screen.getByText('Research is complete.')).toBeInTheDocument();
+ expect(screen.queryByTestId('worktree-actions')).toBeNull();
+ expect(screen.queryByText(/worker/)).toBeNull();
+ });
+
it('renders child tool calls (from `toolCalls`) inside the nested transcript once opened', () => {
render(
<SubagentActivityCard
diff --git a/app/src/features/conversations/aui/SubagentTaskCard.test.tsx b/app/src/features/conversations/aui/SubagentTaskCard.test.tsx
index e20404650f..f63218b756 100644
--- a/app/src/features/conversations/aui/SubagentTaskCard.test.tsx
+++ b/app/src/features/conversations/aui/SubagentTaskCard.test.tsx
@@ -84,6 +84,27 @@ describe('SubagentTaskCard', () => {
);
});
+ it('keeps a completed task result while omitting retired worktree controls', () => {
+ render(
+ <SubagentTaskCard
+ type="tool-call"
+ toolName="task"
+ toolCallId="sub-1"
+ args={{ progress: { ...activity, status: 'success', worktreePath: '/repo/.claude/worktrees/worker', changedFiles: ['notes.md'], isDirty: true } } as never}
+ argsText="{}"
+ result={undefined}
+ status={{ type: 'complete' }}
+ addResult={() => {}}
+ resume={() => {}}
+ respondToApproval={async () => {}}
+ />
+ );
+
+ expect(screen.getByTestId('assistant-ui-subagent-call')).toHaveAttribute('data-status', 'success');
+ expect(screen.queryByTestId('worktree-actions')).toBeNull();
+ expect(screen.queryByText(/worker/)).toBeNull();
+ });
+
it('renders the awaiting-user reply box and lets the answer through the composer path', async () => {
render(
<SubagentTaskCard
diff --git a/tests/json_rpc_e2e.rs b/tests/json_rpc_e2e.rs
index 6134a05160..4d72515243 100644
--- a/tests/json_rpc_e2e.rs
+++ b/tests/json_rpc_e2e.rs
@@ -1750,6 +1750,38 @@ async fn json_rpc_removed_harness_provisioning_is_unavailable() {
rpc_join.abort();
}
+#[tokio::test]
+async fn json_rpc_worktree_methods_are_unavailable() {
+ let _env_lock = json_rpc_e2e_env_lock_async().await;
+ let (rpc_addr, rpc_join) = serve_on_ephemeral(build_core_http_router(false)).await;
+ let rpc_base = format!("http://{rpc_addr}");
+
+ for (id, method, params) in [
+ (44_721, "openhuman.worktree_list", json!({})),
+ (
+ 44_722,
+ "openhuman.worktree_status",
+ json!({ "path": "/repo/.claude/worktrees/worker" }),
+ ),
+ (
+ 44_723,
+ "openhuman.worktree_diff",
+ json!({ "path": "/repo/.claude/worktrees/worker" }),
+ ),
+ (
+ 44_724,
+ "openhuman.worktree_remove",
+ json!({ "path": "/repo/.claude/worktrees/worker" }),
+ ),
+ ] {
+ let response = post_json_rpc(&rpc_base, id, method, params).await;
+ assert_unknown_method(&response, method);
+ assert!(response.get("result").is_none(), "{response}");
+ }
+
+ rpc_join.abort();
+}
+
#[tokio::test]
async fn json_rpc_agent_registry_manages_defaults_and_custom_agents() {
let _env_lock = json_rpc_e2e_env_lock_async().await;