feat: add /clear command to reset context and start fresh session

This commit is contained in:
Mario Zechner 2025-11-21 20:59:00 +01:00
parent 59af0fd53a
commit 1b6a70ccb1
6 changed files with 131 additions and 54 deletions

View file

@ -97,6 +97,13 @@ export class SessionManager {
this.sessionFile = join(this.sessionDir, `${timestamp}_${this.sessionId}.jsonl`);
}
/** Reset to a fresh session. Clears pending messages and starts a new session file. */
reset(): void {
this.pendingMessages = [];
this.sessionInitialized = false;
this.initNewSession();
}
private findMostRecentlyModifiedSession(): string | null {
try {
const files = readdirSync(this.sessionDir)