File tree Expand file tree Collapse file tree 3 files changed +3
-29
lines changed
apps/code/src/renderer/features
packages/agent/src/adapters/claude/session Expand file tree Collapse file tree 3 files changed +3
-29
lines changed Original file line number Diff line number Diff line change 11import type { AvailableCommand } from "@agentclientprotocol/sdk" ;
2- import { getSessionService } from "@features/sessions/service/service" ;
32import { ANALYTICS_EVENTS , type FeedbackType } from "@shared/types/analytics" ;
43import { track } from "@utils/analytics" ;
54import { 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
6956export const CODE_COMMANDS : AvailableCommand [ ] = commands . map ( ( cmd ) => ( {
Original file line number Diff line number Diff 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 /**
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import type { AvailableCommand } from "@agentclientprotocol/sdk";
22import type { SlashCommand } from "@anthropic-ai/claude-agent-sdk" ;
33
44const UNSUPPORTED_COMMANDS = [
5- "clear" ,
65 "context" ,
76 "cost" ,
87 "keybindings-help" ,
You can’t perform that action at this time.
0 commit comments