feat(HAI-061): make scheduler and triage processor read settings dynamically
- Update Scheduler to read settings dynamically from the store instead of using static config - Make TriageProcessor poll interval dynamic so it responds to settings changes - Update dashboard.ts wiring to pass dynamic settings through to engine components - Add scheduler and triage processor tests for dynamic settings behavior - Remove unused InlineCreateCard and stale test files
This commit is contained in:
@@ -172,6 +172,49 @@ describe("TriageProcessor with semaphore", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("TriageProcessor dynamic poll interval", () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
it("refreshes poll interval when settings.pollIntervalMs changes", async () => {
|
||||
const store = createMockStore();
|
||||
store.getSettings.mockResolvedValue({
|
||||
maxConcurrent: 2,
|
||||
maxWorktrees: 4,
|
||||
pollIntervalMs: 10000,
|
||||
groupOverlappingFiles: false,
|
||||
autoMerge: false,
|
||||
});
|
||||
|
||||
const triage = new TriageProcessor(store, "/tmp/test");
|
||||
|
||||
// Simulate start state
|
||||
(triage as any).running = true;
|
||||
(triage as any).activePollMs = 10000;
|
||||
(triage as any).pollInterval = setInterval(() => {}, 10000);
|
||||
|
||||
// First poll — same interval, no change
|
||||
await (triage as any).poll();
|
||||
expect((triage as any).activePollMs).toBe(10000);
|
||||
|
||||
// Change pollIntervalMs in settings
|
||||
store.getSettings.mockResolvedValue({
|
||||
maxConcurrent: 2,
|
||||
maxWorktrees: 4,
|
||||
pollIntervalMs: 3000,
|
||||
groupOverlappingFiles: false,
|
||||
autoMerge: false,
|
||||
});
|
||||
|
||||
await (triage as any).poll();
|
||||
expect((triage as any).activePollMs).toBe(3000);
|
||||
|
||||
// Clean up
|
||||
triage.stop();
|
||||
});
|
||||
});
|
||||
|
||||
describe("buildSpecificationPrompt", () => {
|
||||
it("includes project commands when testCommand is set", () => {
|
||||
const task = createMockTaskDetail();
|
||||
|
||||
Reference in New Issue
Block a user