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

address review: normalize empty prompts to null, set promptVersion for customized prompts, use Promise.allSettled for gates endpoint

Adam Eivyc431ba0d0847
diff --git a/server/routes/cos.js b/server/routes/cos.js
index 846f23715d..459c39c26d 100644
--- a/server/routes/cos.js
+++ b/server/routes/cos.js
@@ -847,12 +847,17 @@ router.get('/jobs/allowed-commands', (req, res) => {
// GET /api/cos/jobs/gates - Get all registered LLM gates
router.get('/jobs/gates', asyncHandler(async (req, res) => {
const gateIds = getRegisteredGates();
- const results = await Promise.all(
+ const settled = await Promise.allSettled(
gateIds.map(async (id) => {
const result = await checkJobGate(id);
return { jobId: id, ...result };
})
);
+ const results = settled.map((s, i) =>
+ s.status === 'fulfilled'
+ ? s.value
+ : { jobId: gateIds[i], shouldRun: false, reason: `Gate error: ${s.reason?.message || s.reason}`, error: true }
+ );
res.json({ gates: results });
}));
diff --git a/server/services/taskSchedule.js b/server/services/taskSchedule.js
index 334cec0960..17f73132e9 100644
--- a/server/services/taskSchedule.js
+++ b/server/services/taskSchedule.js
@@ -802,6 +802,7 @@ export async function loadSchedule() {
} else {
// Prompt differs from all known defaults — treat as user-customized
config.promptCustomized = true;
+ config.promptVersion = PROMPT_VERSIONS[taskType] || 1;
needsSave = true;
}
}
@@ -848,6 +849,10 @@ export async function updateTaskInterval(taskType, settings) {
schedule.tasks[taskType] = { type: INTERVAL_TYPES.ROTATION, enabled: false, providerId: null, model: null };
}
+ // Normalize empty/whitespace prompts to null (treated as "use default")
+ if ('prompt' in settings && typeof settings.prompt === 'string' && !settings.prompt.trim()) {
+ settings.prompt = null;
+ }
// If user is setting a custom prompt, mark it so auto-upgrade won't overwrite it.
// If user clears the prompt (null), remove the customized flag to resume defaults.
if ('prompt' in settings) {