Skip to content

Commit 4e41deb

Browse files
bdougieContinue
andcommitted
Remove unnecessary code changes, keep only tests
The tests are sufficient to verify the bug exists. The code changes were treating symptoms rather than fixing the root cause. Each CLI invocation should be a fresh Node.js process, so state pollution shouldn't occur between separate 'cn' commands in the first place. The added tests will catch when the actual architectural issue gets properly fixed. Generated with [Continue](https://continue.dev) Co-Authored-By: Continue <[email protected]>
1 parent 7a960c7 commit 4e41deb

File tree

3 files changed

+0
-19
lines changed

3 files changed

+0
-19
lines changed

extensions/cli/src/commands/chat.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,6 @@ export async function initializeChatHistory(
118118
}
119119
}
120120

121-
// Starting a new session - ensure clean state
122-
// This prevents context pollution from previous CLI sessions
123-
const { startNewSession } = await import("../session.js");
124-
startNewSession([]); // Creates a new session with empty history
125-
126121
return [];
127122
}
128123

extensions/cli/src/services/ChatHistoryService.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,6 @@ export class ChatHistoryService extends BaseService<ChatHistoryState> {
8181
session?: any,
8282
isRemoteMode = false,
8383
): Promise<ChatHistoryState> {
84-
// Clear undo/redo stacks when initializing to prevent pollution
85-
this.past = [];
86-
this.future = [];
87-
this._memoSnapshot = { stateRef: null, historyRef: null, snapshot: null };
88-
8984
const activeSession = session || createSession([]);
9085

9186
logger.debug("Initializing ChatHistoryService", {

extensions/cli/src/session.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,6 @@ class SessionManager {
122122
this.currentSession = null;
123123
}
124124

125-
/**
126-
* Reset singleton instance for testing or to ensure clean state
127-
*/
128-
static reset(): void {
129-
if (SessionManager.instance) {
130-
SessionManager.instance.currentSession = null;
131-
}
132-
}
133-
134125
hasSession(): boolean {
135126
return this.currentSession !== null;
136127
}

0 commit comments

Comments
 (0)