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

rUvabe64295044c
diff --git a/.claude/helpers/context-persistence-hook.mjs b/.claude/helpers/context-persistence-hook.mjs
index bc1e99081f..39f50499ff 100644
--- a/.claude/helpers/context-persistence-hook.mjs
+++ b/.claude/helpers/context-persistence-hook.mjs
@@ -1454,9 +1454,18 @@ async function doPreCompact() {
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
+ // Context Autopilot: ALWAYS block compaction — we manage context ourselves
+ if (AUTOPILOT_ENABLED) {
+ const state = loadAutopilotState();
+ const pct = state.lastPercentage || 0;
+ const bar = buildProgressBar(pct);
+ process.stderr.write(
+ `[ContextAutopilot] ${bar} ${(pct * 100).toFixed(1)}% | BLOCKING compaction — all ${chunks.length} turns archived safely. Context managed by autopilot.\n`
+ );
+ process.exit(2);
+ }
+
+ // Legacy: exit code 2 blocks compaction (opt-in via env var)
if (BLOCK_COMPACTION && trigger === 'auto') {
process.stderr.write(
`[ContextPersistence] BLOCKING auto-compaction (CLAUDE_FLOW_BLOCK_COMPACTION=true). All ${chunks.length} turns archived.\n`