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 optional fields in loops POST route

Adam Eivyba739bb31685
diff --git a/server/routes/loops.js b/server/routes/loops.js
index 7b5ef92911..18ea13d6a3 100644
--- a/server/routes/loops.js
+++ b/server/routes/loops.js
@@ -34,6 +34,15 @@ router.post('/', asyncHandler(async (req, res) => {
if (timeout !== undefined && typeof timeout !== 'number') {
throw new ServerError('Timeout must be a number of milliseconds', { status: 400, code: 'VALIDATION_ERROR' });
}
+ if (name !== undefined && typeof name !== 'string') {
+ throw new ServerError('Name must be a string', { status: 400, code: 'VALIDATION_ERROR' });
+ }
+ if (cwd !== undefined && typeof cwd !== 'string') {
+ throw new ServerError('cwd must be a string', { status: 400, code: 'VALIDATION_ERROR' });
+ }
+ if (providerId !== undefined && typeof providerId !== 'string') {
+ throw new ServerError('providerId must be a string', { status: 400, code: 'VALIDATION_ERROR' });
+ }
const loop = await loopsService.createLoop({
prompt, interval, name, cwd, providerId, timeout,