mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 23:01:30 +00:00
Fix --session flag to use provided filename
When --session path was provided for a non-existent file, _initNewSession() was overwriting the path with an auto-generated one. Now it only generates a filename if sessionFile wasn't already set.
This commit is contained in:
parent
9478a3c1f5
commit
77595b97f9
1 changed files with 5 additions and 2 deletions
|
|
@ -411,8 +411,11 @@ export class SessionManager {
|
|||
this.byId.clear();
|
||||
this.leafId = "";
|
||||
this.flushed = false;
|
||||
const fileTimestamp = timestamp.replace(/[:.]/g, "-");
|
||||
this.sessionFile = join(this.getSessionDir(), `${fileTimestamp}_${this.sessionId}.jsonl`);
|
||||
// Only generate filename if not already set (e.g., via --session flag)
|
||||
if (!this.sessionFile) {
|
||||
const fileTimestamp = timestamp.replace(/[:.]/g, "-");
|
||||
this.sessionFile = join(this.getSessionDir(), `${fileTimestamp}_${this.sessionId}.jsonl`);
|
||||
}
|
||||
}
|
||||
|
||||
private _migrateToV2(): void {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue