feat(HAI-002): add maxWorktrees setting to limit total git worktrees
- Add maxWorktrees field to Settings interface with default of 4 - Enforce worktree limit in Scheduler.schedule() alongside maxConcurrent - Wire setting through dashboard startup from persisted settings - Include maxWorktrees in /api/config response - Add Max Worktrees input to Settings Modal UI - Backward compatible: existing configs without maxWorktrees use default
This commit is contained in:
@@ -10,9 +10,12 @@ export function createApiRoutes(store: TaskStore, options?: ServerOptions): Rout
|
||||
router.get("/config", async (_req, res) => {
|
||||
try {
|
||||
const settings = await store.getSettings();
|
||||
res.json({ maxConcurrent: settings.maxConcurrent ?? options?.maxConcurrent ?? 2 });
|
||||
res.json({
|
||||
maxConcurrent: settings.maxConcurrent ?? options?.maxConcurrent ?? 2,
|
||||
maxWorktrees: settings.maxWorktrees ?? 4,
|
||||
});
|
||||
} catch {
|
||||
res.json({ maxConcurrent: options?.maxConcurrent ?? 2 });
|
||||
res.json({ maxConcurrent: options?.maxConcurrent ?? 2, maxWorktrees: 4 });
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user