Revert: session transcript permission follow-up

This commit is contained in:
Sebastian
2026-02-17 09:58:59 -05:00
parent 21978303a9
commit 9f925bdd5c
3 changed files with 3 additions and 9 deletions

View File

@@ -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?.();

View File

@@ -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;

View File

@@ -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;