Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: enforce per-task enabled checks at all spawn paths

Adam Eivy000395ead938
diff --git a/server/services/cos.js b/server/services/cos.js
index 12c50f8ea8..80134739fd 100644
--- a/server/services/cos.js
+++ b/server/services/cos.js
@@ -2251,6 +2251,7 @@ async function dequeueNextTask() {
// Priority 0: On-demand task requests
const taskScheduleMod = await import('./taskSchedule.js');
+ const taskSchedule = await taskScheduleMod.loadSchedule();
const onDemandRequests = await taskScheduleMod.getOnDemandRequests();
for (const request of onDemandRequests) {
@@ -2264,6 +2265,13 @@ async function dequeueNextTask() {
continue;
}
+ // Skip if the task type was disabled after queuing
+ if (!taskSchedule.tasks[request.taskType]?.enabled) {
+ emitLog('info', `On-demand request skipped — task type '${request.taskType}' is disabled`, { requestId: request.id });
+ await taskScheduleMod.clearOnDemandRequest(request.id);
+ continue;
+ }
+
let task = null;
const apps = await getActiveApps().catch(() => []);
let targetApp = null;
@@ -2325,6 +2333,12 @@ async function dequeueNextTask() {
for (const task of autoApproved) {
if (spawned >= availableSlots) break;
if (await blockIfExceedsMaxSpawns(task, 'internal')) continue;
+ // Skip improvement tasks whose type was disabled after queuing
+ const analysisType = task.metadata?.analysisType || task.metadata?.selfImprovementType;
+ if (analysisType && !taskSchedule.tasks[analysisType]?.enabled) {
+ emitLog('info', `System task skipped — task type '${analysisType}' is disabled`, { taskId: task.id });
+ continue;
+ }
const appId = task.metadata?.app;
if (appId) {
const onCooldown = await isAppOnCooldown(appId, state.config.appReviewCooldownMs);
diff --git a/server/services/taskSchedule.js b/server/services/taskSchedule.js
index cd93056fcd..b4b0faea25 100644
--- a/server/services/taskSchedule.js
+++ b/server/services/taskSchedule.js
@@ -1822,6 +1822,12 @@ export async function deleteTemplateTask(templateId) {
export async function triggerOnDemandTask(taskType, appId = null) {
const schedule = await loadSchedule();
+ // Reject if the task type is disabled
+ const interval = schedule.tasks[taskType];
+ if (interval && !interval.enabled) {
+ return { error: `Task type '${taskType}' is disabled` };
+ }
+
if (!schedule.onDemandRequests) {
schedule.onDemandRequests = [];
}