feat: Enhance memory management and promotion rules for Mattermost context and user prompts
This commit is contained in:
@@ -26,6 +26,15 @@ async function resolveSyncCommand(directory) {
|
||||
}
|
||||
}
|
||||
|
||||
async function resolveSyncContent(directory, stdoutText) {
|
||||
const cleaned = (stdoutText || "").trim()
|
||||
if (cleaned) return cleaned
|
||||
|
||||
const generatedPath = path.join(directory, "scripts/mattermost/generated/mattermost_context.jsonl")
|
||||
const generated = await safeRead(generatedPath)
|
||||
return (generated || "").trim()
|
||||
}
|
||||
|
||||
export const MattermostInbox = async ({ $, directory, client }) => {
|
||||
let lastSyncAt = 0
|
||||
|
||||
@@ -54,7 +63,8 @@ export const MattermostInbox = async ({ $, directory, client }) => {
|
||||
|
||||
try {
|
||||
await mkdir(inboxDir, { recursive: true })
|
||||
const output = (await $`bash -lc ${command}`.text()).trim()
|
||||
const stdoutText = await $`bash -lc ${command}`.text()
|
||||
const output = await resolveSyncContent(directory, stdoutText)
|
||||
const previous = await safeRead(latestPath)
|
||||
|
||||
if (output) {
|
||||
|
||||
Reference in New Issue
Block a user