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(cos): manual job trigger now queues immediately instead of pending approval

Adam Eivyca4fca5a55d2
diff --git a/client/src/components/cos/tabs/TaskItem.jsx b/client/src/components/cos/tabs/TaskItem.jsx
index c33fa23808..92260bce04 100644
--- a/client/src/components/cos/tabs/TaskItem.jsx
+++ b/client/src/components/cos/tabs/TaskItem.jsx
@@ -183,7 +183,11 @@ export default function TaskItem({ task, isSystem, awaitingApproval, onRefresh,
};
const handleApprove = async () => {
- await api.approveCosTask(task.id).catch(err => toast.error(err.message));
+ const result = await api.approveCosTask(task.id).catch(err => {
+ toast.error(err.message);
+ return null;
+ });
+ if (!result) return;
toast.success('Task approved');
onRefresh();
};
diff --git a/server/routes/cos.js b/server/routes/cos.js
index d214538b77..022c274ad4 100644
--- a/server/routes/cos.js
+++ b/server/routes/cos.js
@@ -803,12 +803,13 @@ router.post('/jobs/:id/trigger', asyncHandler(async (req, res) => {
// Generate task and add to CoS internal task queue
// Job execution is recorded via the job:spawned event when the agent actually starts
+ // Manual triggers always bypass approval — the user explicitly requested execution
const task = await autonomousJobs.generateTaskFromJob(job);
const result = await cos.addTask({
description: task.description,
priority: task.priority,
context: `Manually triggered autonomous job: ${job.name}`,
- approvalRequired: !task.autoApprove
+ approvalRequired: false
}, 'internal');
res.json({ success: true, task: result });
diff --git a/server/services/cos.js b/server/services/cos.js
index 24516392d1..3d61a878ad 100644
--- a/server/services/cos.js
+++ b/server/services/cos.js
@@ -3182,6 +3182,10 @@ export async function approveTask(taskId) {
await writeFile(filePath, markdown);
cosEvents.emit('tasks:changed', { type: 'internal', action: 'approved', task: tasks[taskIndex] });
+
+ // Immediately attempt to spawn the newly approved task
+ setImmediate(() => dequeueNextTask());
+
return tasks[taskIndex];
}