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:
Dustin Byrne
2026-03-26 00:04:50 -04:00
parent c2166723ee
commit afcd074caa
5 changed files with 275 additions and 21 deletions

View File

@@ -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();