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(scheduler): app-improve task IDs not updating in COS-TASKS.md after agent completion

Adam Eivye9f10285a5fb
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 879a498baa..0399380aa2 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -6,4 +6,7 @@
## Fixed
+- `app-improve-` task IDs were getting `task-` prefix added by `taskParser.js`, causing `updateTask` lookups to fail — tasks were never marked in_progress or completed after agent runs
+- Recovered `app-improve-` agents after server restart now correctly infer `taskType: 'internal'` instead of `'user'`
+
## Removed
diff --git a/server/lib/taskParser.js b/server/lib/taskParser.js
index b786daf01b..7d124a2845 100644
--- a/server/lib/taskParser.js
+++ b/server/lib/taskParser.js
@@ -56,7 +56,7 @@ function parseTaskLine(line) {
const statusKey = `[${statusChar}]`;
return {
- id: id.startsWith('task-') || id.startsWith('sys-') ? id : `task-${id}`,
+ id: id.startsWith('task-') || id.startsWith('sys-') || id.startsWith('app-improve-') ? id : `task-${id}`,
status: STATUS_MAP[statusKey] || 'pending',
priority: priority.toUpperCase(),
priorityValue: PRIORITY_VALUES[priority.toUpperCase()] || 2,
@@ -76,7 +76,7 @@ function parseTaskLine(line) {
const statusKey = `[${statusChar}]`;
return {
- id: id.startsWith('task-') || id.startsWith('sys-') ? id : `task-${id}`,
+ id: id.startsWith('task-') || id.startsWith('sys-') || id.startsWith('app-improve-') ? id : `task-${id}`,
status: STATUS_MAP[statusKey] || 'pending',
priority: priority.toUpperCase(),
priorityValue: PRIORITY_VALUES[priority.toUpperCase()] || 2,
diff --git a/server/services/agentLifecycle.js b/server/services/agentLifecycle.js
index b1cd152ef3..86dceeaf24 100644
--- a/server/services/agentLifecycle.js
+++ b/server/services/agentLifecycle.js
@@ -87,8 +87,8 @@ export async function syncRunnerAgents() {
if (!runnerAgents.has(agent.id)) {
const task = taskMap.get(agent.taskId);
- // Infer taskType for fallback: sys- prefix tasks are internal (CoS-generated)
- const inferredType = agent.taskId?.startsWith('sys-') ? 'internal' : 'user';
+ // Infer taskType for fallback: sys- and app-improve- prefix tasks are internal (CoS-generated)
+ const inferredType = (agent.taskId?.startsWith('sys-') || agent.taskId?.startsWith('app-improve-')) ? 'internal' : 'user';
runnerAgents.set(agent.id, {
taskId: agent.taskId,
task: task || { id: agent.taskId, taskType: inferredType, description: 'Recovered from runner' },