mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 08:02:17 +00:00
feat: add /clear command to reset context and start fresh session
This commit is contained in:
parent
59af0fd53a
commit
1b6a70ccb1
6 changed files with 131 additions and 54 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue