Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

Checkpoint: File edits

rUvcaa8a4764c43
diff --git a/.claude/helpers/context-persistence-hook.mjs b/.claude/helpers/context-persistence-hook.mjs
index 4660bc2991..01481ee726 100644
--- a/.claude/helpers/context-persistence-hook.mjs
+++ b/.claude/helpers/context-persistence-hook.mjs
@@ -976,14 +976,29 @@ async function doPreCompact() {
const { backend, type } = await resolveBackend();
- const result = await storeChunks(backend, chunks, sessionId, trigger || 'auto');
+ const archiveResult = await storeChunks(backend, chunks, sessionId, trigger || 'auto');
const total = await backend.count(NAMESPACE);
await backend.shutdown();
process.stderr.write(
- `[ContextPersistence] Archived ${result.stored} turns (${result.deduped} deduped) via ${type}. Total: ${total}\n`
+ `[ContextPersistence] Archived ${archiveResult.stored} turns (${archiveResult.deduped} deduped) via ${type}. Total: ${total}\n`
);
+
+ // Exit code 0: stdout is appended as custom compact instructions
+ // This guides Claude on what to preserve in the compaction summary
+ const instructions = buildCompactInstructions(chunks, sessionId, archiveResult);
+ process.stdout.write(instructions);
+
+ // Exit code 2 blocks compaction entirely (opt-in via env var)
+ // Use case: when proactive archiving has already captured everything
+ // and the user prefers to manually trigger compaction
+ if (BLOCK_COMPACTION && trigger === 'auto') {
+ process.stderr.write(
+ `[ContextPersistence] BLOCKING auto-compaction (CLAUDE_FLOW_BLOCK_COMPACTION=true). All ${chunks.length} turns archived.\n`
+ );
+ process.exit(2);
+ }
}
async function doSessionStart() {