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

feat: "Process Now" button on pending task cards to force-spawn tasks

Adam Eivy13c423a63650
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 901f13dd24..a8fc194f64 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -13,3 +13,4 @@
### Added
- Toggle to enable/disable all automations for an app on the Automation tab
+- "Process Now" button on pending task cards to force-spawn a specific task, bypassing cooldowns and evaluation intervals
diff --git a/client/src/components/cos/tabs/TaskItem.jsx b/client/src/components/cos/tabs/TaskItem.jsx
index b1a963c1f0..c2a9a525f0 100644
--- a/client/src/components/cos/tabs/TaskItem.jsx
+++ b/client/src/components/cos/tabs/TaskItem.jsx
@@ -14,7 +14,8 @@ import {
FileText,
ExternalLink,
AlertCircle,
- TrendingUp
+ TrendingUp,
+ Play
} from 'lucide-react';
import toast from 'react-hot-toast';
import * as api from '../../../services/api';
@@ -384,7 +385,20 @@ export default function TaskItem({ task, isSystem, awaitingApproval, onRefresh,
<div className="flex items-center gap-1 md:opacity-0 md:group-hover:opacity-100 transition-opacity">
{!editing && (
<>
- {/* Mark as Blocked button - only show for non-blocked, non-completed tasks */}
+ {task.status === 'pending' && (
+ <button
+ onClick={async () => {
+ const result = await api.forceSpawnTask(task.id).catch(err => { toast.error(err.message); return null; });
+ if (result?.success) toast.success(`Spawning ${task.id}`);
+ if (onRefresh) onRefresh();
+ }}
+ className="p-1 text-gray-500 hover:text-port-success transition-colors"
+ title="Process now"
+ aria-label="Process task now"
+ >
+ <Play size={14} aria-hidden="true" />
+ </button>
+ )}
{task.status !== 'blocked' && task.status !== 'completed' && (
<button
onClick={handleMarkBlocked}
diff --git a/client/src/services/api.js b/client/src/services/api.js
index 64dbb84634..61a7f9adc3 100644
--- a/client/src/services/api.js
+++ b/client/src/services/api.js
@@ -680,6 +680,7 @@ export const reorderCosTasks = (taskIds) => request('/cos/tasks/reorder', {
});
export const approveCosTask = (id) => request(`/cos/tasks/${id}/approve`, { method: 'POST' });
export const forceCosEvaluate = () => request('/cos/evaluate', { method: 'POST' });
+export const forceSpawnTask = (taskId) => request(`/cos/tasks/${taskId}/spawn`, { method: 'POST' });
export const getCosHealth = () => request('/cos/health');
export const forceHealthCheck = () => request('/cos/health/check', { method: 'POST' });
export const getCosAgents = () => request('/cos/agents');
diff --git a/server/routes/cos.js b/server/routes/cos.js
index 5c911ae00b..323bff012a 100644
--- a/server/routes/cos.js
+++ b/server/routes/cos.js
@@ -277,6 +277,15 @@ router.post('/evaluate', asyncHandler(async (req, res) => {
res.json({ success: true, message: 'Evaluation triggered' });
}));
+// POST /api/cos/tasks/:id/spawn - Force-spawn a pending task
+router.post('/tasks/:id/spawn', asyncHandler(async (req, res) => {
+ const result = await cos.forceSpawnTask(req.params.id);
+ if (result.error) {
+ throw new ServerError(result.error, { status: 400, code: 'SPAWN_FAILED' });
+ }
+ res.json(result);
+}));
+
// GET /api/cos/health - Get health status
router.get('/health', asyncHandler(async (req, res) => {
const health = await cos.getHealthStatus();
diff --git a/server/services/cos.js b/server/services/cos.js
index 72e8fd2a0d..530eb1b9e6 100644
--- a/server/services/cos.js
+++ b/server/services/cos.js
@@ -822,6 +822,24 @@ export async function getTaskById(taskId) {
return null;
}
+/**
+ * Force-spawn a pending task by ID, bypassing cooldowns and evaluation intervals.
+ */
+export async function forceSpawnTask(taskId) {
+ const task = await getTaskById(taskId);
+ if (!task) return { error: 'Task not found' };
+ if (task.status !== 'pending') return { error: `Task is ${task.status}, not pending` };
+
+ const state = await loadState();
+ const runningAgents = Object.values(state.agents).filter(a => a.status === 'running').length;
+ if (runningAgents >= state.config.maxConcurrentAgents) {
+ return { error: `No available agent slots (${runningAgents}/${state.config.maxConcurrentAgents})` };
+ }
+
+ cosEvents.emit('task:ready', { ...task, taskType: task.taskType || 'internal' });
+ return { success: true, taskId };
+}
+
/**
* Reset orphaned in_progress tasks back to pending
* (tasks marked in_progress but no running agent)