Merge pull request #38 from PR0M3TH3AN/feat/scheduler-pause-config-12863176069734636551

Add scheduler pause configuration
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2026-02-14 01:05:15 -05:00
commit ae90caa39d
6 files changed
+39 -2

No files matched your search

+1
View File
@@ -51,6 +51,7 @@ Common settings:
- `dashboard.defaultCadenceView` — default dashboard view (`daily`, `weekly`, `all`).
- `dashboard.defaultStatusView` — default dashboard status filter (`active`, `all`).
- `scheduler.firstPromptByCadence.daily` / `.weekly` — first-run scheduler starting agent.
- `scheduler.paused.daily` / `.weekly` — array of agent names to exclude from scheduler rotation.
Default first-run daily scheduler prompt is `scheduler-update-agent`.
+10 -1
View File
@@ -259,15 +259,22 @@ async function cmdCheck(cadence) {
const relays = getRelays();
const namespace = getNamespace();
const dateStr = todayDateStr();
const config = loadTorchConfig();
const pausedAgents = (cadence === 'daily' ? config.scheduler.paused.daily : config.scheduler.paused.weekly) || [];
console.error(`Checking locks: namespace=${namespace}, cadence=${cadence}, date=${dateStr}`);
console.error(`Relays: ${relays.join(', ')}`);
if (pausedAgents.length > 0) {
console.error(`Paused agents: ${pausedAgents.join(', ')}`);
}
const locks = await queryLocks(relays, cadence, dateStr, namespace);
const lockedAgents = [...new Set(locks.map((l) => l.agent).filter(Boolean))];
const roster = getRoster(cadence);
const excludedAgents = [...new Set([...lockedAgents, ...pausedAgents])];
const unknownLockedAgents = lockedAgents.filter((agent) => !roster.includes(agent));
const available = roster.filter((a) => !lockedAgents.includes(a));
const available = roster.filter((a) => !excludedAgents.includes(a));
console.log(
JSON.stringify(
@@ -276,6 +283,8 @@ async function cmdCheck(cadence) {
cadence,
date: dateStr,
locked: lockedAgents.sort(),
paused: pausedAgents.sort(),
excluded: excludedAgents.sort(),
available: available.sort(),
lockCount: locks.length,
unknownLockedAgents: unknownLockedAgents.sort(),
+1 -1
View File
@@ -37,7 +37,7 @@ Use this document for all scheduler runs.
Selection algorithm (MUST be followed exactly):
- Roster source: `src/prompts/roster.json` and the key matching `<cadence>`.
- Let `roster` be that ordered array and `excluded` be the locked set from step 2.
- Let `roster` be that ordered array and `excluded` be the `excluded` set (including paused and locked agents) from the JSON output of step 2.
- Let `latest_file` be the lexicographically last filename in `<log_dir>`.
- Determine `previous_agent` from `latest_file` using this precedence:
1. Parse YAML frontmatter from `<log_dir>/<latest_file>` and use key `agent` when present and non-empty.
+5
View File
@@ -45,6 +45,7 @@ export function loadTorchConfig() {
const dashboard = raw.dashboard || {};
const scheduler = raw.scheduler || {};
const firstPromptByCadence = scheduler.firstPromptByCadence || {};
const paused = scheduler.paused || {};
cachedConfig = {
configPath,
@@ -77,6 +78,10 @@ export function loadTorchConfig() {
daily: typeof firstPromptByCadence.daily === 'string' ? firstPromptByCadence.daily.trim() : null,
weekly: typeof firstPromptByCadence.weekly === 'string' ? firstPromptByCadence.weekly.trim() : null,
},
paused: {
daily: parseRoster(paused.daily) || [],
weekly: parseRoster(paused.weekly) || [],
},
},
};