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

rUv9a90ef64cb00
diff --git a/.claude/helpers/context-persistence-hook.mjs b/.claude/helpers/context-persistence-hook.mjs
index 1139fbebd6..742af94b1f 100644
--- a/.claude/helpers/context-persistence-hook.mjs
+++ b/.claude/helpers/context-persistence-hook.mjs
@@ -1498,15 +1498,30 @@ async function doPreCompact() {
const instructions = buildCompactInstructions(chunks, sessionId, archiveResult);
process.stdout.write(instructions);
- // Context Autopilot: ALWAYS block compaction β€” we manage context ourselves
+ // Context Autopilot: block AUTO compaction, allow MANUAL (/compact)
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);
+
+ if (trigger === 'manual') {
+ // Manual /compact: allow it β€” user explicitly requested compression
+ process.stderr.write(
+ `[ContextAutopilot] ${bar} ${(pct * 100).toFixed(1)}% | MANUAL compact allowed β€” ${chunks.length} turns archived before compression.\n`
+ );
+ // Reset autopilot state for post-compaction fresh start
+ state.lastTokenEstimate = 0;
+ state.lastPercentage = 0;
+ state.warningIssued = false;
+ saveAutopilotState(state);
+ // Exit 0 = proceed with compaction
+ } else {
+ // Auto compaction: BLOCK β€” autopilot manages context
+ process.stderr.write(
+ `[ContextAutopilot] ${bar} ${(pct * 100).toFixed(1)}% | BLOCKING auto-compaction β€” all ${chunks.length} turns archived safely. Use /compact to manually compress.\n`
+ );
+ process.exit(2);
+ }
}
// Legacy: exit code 2 blocks compaction (opt-in via env var)