mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 05:37:41 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -39,15 +39,21 @@ export async function runMemoryFlushIfNeeded(params: {
|
||||
isHeartbeat: boolean;
|
||||
}): Promise<SessionEntry | undefined> {
|
||||
const memoryFlushSettings = resolveMemoryFlushSettings(params.cfg);
|
||||
if (!memoryFlushSettings) return params.sessionEntry;
|
||||
if (!memoryFlushSettings) {
|
||||
return params.sessionEntry;
|
||||
}
|
||||
|
||||
const memoryFlushWritable = (() => {
|
||||
if (!params.sessionKey) return true;
|
||||
if (!params.sessionKey) {
|
||||
return true;
|
||||
}
|
||||
const runtime = resolveSandboxRuntimeStatus({
|
||||
cfg: params.cfg,
|
||||
sessionKey: params.sessionKey,
|
||||
});
|
||||
if (!runtime.sandboxed) return true;
|
||||
if (!runtime.sandboxed) {
|
||||
return true;
|
||||
}
|
||||
const sandboxCfg = resolveSandboxConfigForAgent(params.cfg, runtime.agentId);
|
||||
return sandboxCfg.workspaceAccess === "rw";
|
||||
})();
|
||||
@@ -69,7 +75,9 @@ export async function runMemoryFlushIfNeeded(params: {
|
||||
softThresholdTokens: memoryFlushSettings.softThresholdTokens,
|
||||
});
|
||||
|
||||
if (!shouldFlushMemory) return params.sessionEntry;
|
||||
if (!shouldFlushMemory) {
|
||||
return params.sessionEntry;
|
||||
}
|
||||
|
||||
let activeSessionEntry = params.sessionEntry;
|
||||
const activeSessionStore = params.sessionStore;
|
||||
|
||||
Reference in New Issue
Block a user