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 {

View File

@@ -1649,6 +1649,17 @@ async function main(): Promise<void> {
settingsManager.setMemfsEnabled(agent.id, true);
}
// Ensure agent's system prompt includes/excludes memfs section to match setting
if (memfsFlag || noMemfsFlag || (isNewlyCreatedAgent && !isSubagent)) {
const { updateAgentSystemPromptMemfs } = await import(
"./agent/modify"
);
await updateAgentSystemPromptMemfs(
agent.id,
settingsManager.isMemfsEnabled(agent.id),
);
}
// Fire-and-forget: Initialize loaded skills flag (LET-7101)
// Don't await - this is just for the skill unload reminder
initializeLoadedSkillsFlag().catch(() => {