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: validate loops input, case-insensitive Mac detection, bulk override cleanup

Adam Eivy2faf481ead03
diff --git a/client/src/utils/platform.js b/client/src/utils/platform.js
index 0f59a597da..911c4d8d69 100644
--- a/client/src/utils/platform.js
+++ b/client/src/utils/platform.js
@@ -1,5 +1,5 @@
/** Platform detection — provides isMac flag and modifier key label for keyboard shortcuts */
export const isMac = typeof navigator !== 'undefined' &&
- (/Mac|iPhone|iPad|iPod/.test(navigator.userAgentData?.platform ?? navigator.platform ?? ''));
+ (/mac|iphone|ipad|ipod/i.test(navigator.userAgentData?.platform ?? navigator.platform ?? ''));
export const modKey = isMac ? '⌘' : 'Ctrl';
diff --git a/server/routes/loops.js b/server/routes/loops.js
index 5b952ce427..7b5ef92911 100644
--- a/server/routes/loops.js
+++ b/server/routes/loops.js
@@ -26,8 +26,14 @@ router.get('/:id', asyncHandler(async (req, res) => {
// POST /api/loops
router.post('/', asyncHandler(async (req, res) => {
const { prompt, interval, name, cwd, providerId, timeout, runImmediately } = req.body;
- if (!prompt) throw new ServerError('Prompt is required', { status: 400, code: 'VALIDATION_ERROR' });
+ if (!prompt || typeof prompt !== 'string') throw new ServerError('Prompt is required', { status: 400, code: 'VALIDATION_ERROR' });
if (!interval) throw new ServerError('Interval is required', { status: 400, code: 'VALIDATION_ERROR' });
+ if (typeof interval !== 'string' && typeof interval !== 'number') {
+ throw new ServerError('Interval must be a string (e.g. "30s", "5m") or number of milliseconds', { status: 400, code: 'VALIDATION_ERROR' });
+ }
+ if (timeout !== undefined && typeof timeout !== 'number') {
+ throw new ServerError('Timeout must be a number of milliseconds', { status: 400, code: 'VALIDATION_ERROR' });
+ }
const loop = await loopsService.createLoop({
prompt, interval, name, cwd, providerId, timeout,
diff --git a/server/services/apps.js b/server/services/apps.js
index 84370ef01c..6c4982e901 100644
--- a/server/services/apps.js
+++ b/server/services/apps.js
@@ -377,7 +377,7 @@ export async function bulkUpdateAppTaskTypeOverride(taskType, { enabled } = {})
const existing = overrides[taskType] || {};
const updated = { ...existing, enabled };
- if (!updated.enabled && !updated.interval && !updated.taskMetadata) {
+ if (updated.enabled === undefined && !updated.interval && !updated.taskMetadata) {
delete overrides[taskType];
} else {
overrides[taskType] = updated;