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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user