fix: Append memFS system prompt based on CLI flags (#840)

This commit is contained in:
Devansh Jain
2026-02-05 17:20:38 -08:00
committed by GitHub
parent e882323b0a
commit bbe02e90e8
2 changed files with 25 additions and 0 deletions

View File

@@ -669,6 +669,20 @@ export async function handleHeadlessCommand(
settingsManager.setMemfsEnabled(agent.id, true);
}
// Ensure agent's system prompt includes/excludes memfs section to match setting
if (
memfsFlag ||
noMemfsFlag ||
(isNewlyCreatedAgent && !isSubagent) ||
(specifiedAgentId && !isSubagent)
) {
const { updateAgentSystemPromptMemfs } = await import("./agent/modify");
await updateAgentSystemPromptMemfs(
agent.id,
settingsManager.isMemfsEnabled(agent.id),
);
}
// Sync filesystem-backed memory before creating conversations (only if memfs is enabled)
if (settingsManager.isMemfsEnabled(agent.id)) {
try {