mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
Revert: session transcript permission follow-up
This commit is contained in:
@@ -43,7 +43,7 @@ export async function prepareSessionManagerForRun(params: {
|
||||
|
||||
if (params.hadSessionFile && header && !hasAssistant) {
|
||||
// Reset file so the first assistant flush includes header+user+assistant in order.
|
||||
await fs.writeFile(params.sessionFile, "", { encoding: "utf-8", mode: 0o600 });
|
||||
await fs.writeFile(params.sessionFile, "", "utf-8");
|
||||
sm.fileEntries = [header];
|
||||
sm.byId?.clear?.();
|
||||
sm.labelsById?.clear?.();
|
||||
|
||||
@@ -89,10 +89,7 @@ function forkSessionFromParent(params: {
|
||||
cwd: manager.getCwd(),
|
||||
parentSession: parentSessionFile,
|
||||
};
|
||||
fs.writeFileSync(sessionFile, `${JSON.stringify(header)}\n`, {
|
||||
encoding: "utf-8",
|
||||
mode: 0o600,
|
||||
});
|
||||
fs.writeFileSync(sessionFile, `${JSON.stringify(header)}\n`, "utf-8");
|
||||
return { sessionId, sessionFile };
|
||||
} catch {
|
||||
return null;
|
||||
|
||||
@@ -471,10 +471,7 @@ export const sessionsHandlers: GatewayRequestHandlers = {
|
||||
|
||||
const archived = archiveFileOnDisk(filePath, "bak");
|
||||
const keptLines = lines.slice(-maxLines);
|
||||
fs.writeFileSync(filePath, `${keptLines.join("\n")}\n`, {
|
||||
encoding: "utf-8",
|
||||
mode: 0o600,
|
||||
});
|
||||
fs.writeFileSync(filePath, `${keptLines.join("\n")}\n`, "utf-8");
|
||||
|
||||
await updateSessionStore(storePath, (store) => {
|
||||
const entryKey = compactTarget.primaryKey;
|
||||
|
||||
Reference in New Issue
Block a user