Skip to content

Commit 6e06cc9

Browse files
authored
Revert "feat(code): add /clear command to reset conversation history" (#1379)
1 parent fefe98c commit 6e06cc9

File tree

3 files changed

+3
-29
lines changed

3 files changed

+3
-29
lines changed

apps/code/src/renderer/features/message-editor/commands.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { AvailableCommand } from "@agentclientprotocol/sdk";
2-
import { getSessionService } from "@features/sessions/service/service";
32
import { ANALYTICS_EVENTS, type FeedbackType } from "@shared/types/analytics";
43
import { track } from "@utils/analytics";
54
import { toast } from "@utils/toast";
@@ -52,18 +51,6 @@ const commands: CodeCommand[] = [
5251
makeFeedbackCommand("good", "good", "Positive"),
5352
makeFeedbackCommand("bad", "bad", "Negative"),
5453
makeFeedbackCommand("feedback", "general", "General"),
55-
{
56-
name: "clear",
57-
description: "Clear conversation history and start fresh",
58-
async execute(_args, ctx) {
59-
if (!ctx.repoPath || !ctx.taskId) {
60-
toast.error("Cannot clear: no active session");
61-
return;
62-
}
63-
await getSessionService().resetSession(ctx.taskId, ctx.repoPath);
64-
toast.success("Conversation cleared");
65-
},
66-
},
6754
];
6855

6956
export const CODE_COMMANDS: AvailableCommand[] = commands.map((cmd) => ({

apps/code/src/renderer/features/sessions/service/service.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,23 +1793,11 @@ export class SessionService {
17931793

17941794
/**
17951795
* Start a fresh session for a task, abandoning the old conversation.
1796-
* Tears down the current session and creates a new task run so that
1797-
* S3 logs start clean — old messages won't reappear on restart.
1796+
* Clears the backend sessionId so the next reconnect creates a new
1797+
* session instead of attempting to resume the stale one.
17981798
*/
17991799
async resetSession(taskId: string, repoPath: string): Promise<void> {
1800-
const session = sessionStoreSetters.getSessionByTaskId(taskId);
1801-
if (!session) return;
1802-
1803-
const { taskTitle } = session;
1804-
1805-
await this.teardownSession(session.taskRunId);
1806-
1807-
const auth = this.getAuthCredentials();
1808-
if (!auth) {
1809-
throw new Error("Unable to reach server. Please check your connection.");
1810-
}
1811-
1812-
await this.createNewLocalSession(taskId, taskTitle, repoPath, auth);
1800+
await this.reconnectInPlace(taskId, repoPath, null);
18131801
}
18141802

18151803
/**

packages/agent/src/adapters/claude/session/commands.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { AvailableCommand } from "@agentclientprotocol/sdk";
22
import type { SlashCommand } from "@anthropic-ai/claude-agent-sdk";
33

44
const UNSUPPORTED_COMMANDS = [
5-
"clear",
65
"context",
76
"cost",
87
"keybindings-help",

0 commit comments

Comments
 (0)