mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-08 00:19:42 +02:00
COD-52 fix: wire maxTodos + todoExpirationMinutes through ralph-config to the tracker
The Ralph settings modal sent maxTodos/todoExpirationMinutes but RalphConfigSchema (zod) stripped them and the ralph-config route never applied them, so the inputs were silent no-ops. Fix: add both as optional positive-int fields to RalphConfigSchema; destructure and apply them in the ralph-config route (matching the maxIterations pattern). RalphTracker had no setters (the values were module constants) — added per-instance _maxTodos/_todoExpiryMs (defaulting to the same constants, behavior unchanged), switched the eviction + expiry sites to read them, and added setMaxTodos/setTodoExpirationMinutes (minutes→ms) + getters. Test: route test POSTs the two fields and asserts the route applies them to the tracker. Verified RED (setters not called — fields stripped) → GREEN. 34/34 ralph-routes tests pass; tsc + eslint(src) + prettier + build clean. Frontend already sent the fields (no change).
This commit is contained in:
@@ -497,6 +497,8 @@ export const RalphConfigSchema = z.object({
|
||||
enabled: z.boolean().optional(),
|
||||
completionPhrase: z.string().max(500).optional(),
|
||||
maxIterations: z.number().int().min(0).max(10000).optional(),
|
||||
maxTodos: z.number().int().positive().max(10000).optional(),
|
||||
todoExpirationMinutes: z.number().int().positive().max(525600).optional(),
|
||||
reset: z.union([z.boolean(), z.literal('full')]).optional(),
|
||||
disableAutoEnable: z.boolean().optional(),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user