From 0c1bbb92b4e2626f43f75ee2cb888e53ee6f2952 Mon Sep 17 00:00:00 2001 From: NagyVikt Date: Wed, 15 Apr 2026 14:25:18 +0200 Subject: [PATCH] Keep one-hour cleanup defaults without breaking existing prune scripts The cleanup daemon keeps the new 60-minute idle threshold, but no longer injects '--include-pr-merged' when launching repo cleanup loops. Existing repositories can run older prune scripts, so this preserves compatibility while retaining the requested idle-based shadow cleanup behavior. Constraint: Existing installed repos may still have prune scripts that do not accept newer flags Rejected: Keep forcing --include-pr-merged from agents daemon | breaks cleanup loops on repos with older script versions Confidence: high Scope-risk: narrow Reversibility: clean Directive: Add forward-compatible capability checks before daemon-only CLI flags are passed to repo scripts Tested: npm test -- test/install.test.js Not-tested: mixed-version daemon behavior with remote gh PR detection enabled --- bin/multiagent-safety.js | 2 -- test/install.test.js | 1 - 2 files changed, 3 deletions(-) diff --git a/bin/multiagent-safety.js b/bin/multiagent-safety.js index ce99aa3..4d7b000 100755 --- a/bin/multiagent-safety.js +++ b/bin/multiagent-safety.js @@ -3980,7 +3980,6 @@ function agents(rawArgs) { String(options.cleanupIntervalSeconds), '--idle-minutes', String(options.idleMinutes), - '--include-pr-merged', ], cwd: repoRoot, logPath: cleanupLogPath, @@ -4000,7 +3999,6 @@ function agents(rawArgs) { pid: cleanupPid, intervalSeconds: options.cleanupIntervalSeconds, idleMinutes: options.idleMinutes, - includePrMerged: true, script: path.resolve(__filename), logPath: cleanupLogPath, }, diff --git a/test/install.test.js b/test/install.test.js index 4ccd63f..fdfd880 100644 --- a/test/install.test.js +++ b/test/install.test.js @@ -1418,7 +1418,6 @@ test('agents cleanup bot defaults to a 60-minute idle threshold', () => { const statePath = path.join(repoDir, '.omx', 'state', 'agents-bots.json'); const state = JSON.parse(fs.readFileSync(statePath, 'utf8')); assert.equal(state.cleanup.idleMinutes, 60); - assert.equal(state.cleanup.includePrMerged, true); assert.equal(isPidAlive(state.review.pid), true, 'review bot pid should be alive after start'); assert.equal(isPidAlive(state.cleanup.pid), true, 'cleanup bot pid should be alive after start');