mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-06 07:29:42 +02:00
test: add 43 deep integration tests for OrchestratorLoop state machine
Covers full lifecycle: start → plan → approve → execute → verify → complete. Tests state transitions, event emissions, persistence/recovery, pause/resume, skip/retry, team phase execution, error handling, and edge cases. Also fixes bugs found during review: - Route context snapshot: use getter for orchestratorLoop (was null forever) - Event listener stacking: guard setupEventForwarding with boolean flag - Replan completion: create tracked TaskQueue task instead of raw sendInput - Pause cleanup: call cleanupTaskHandlers() on pause - Phase timeout: add phaseTimeoutTimer enforcement Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -38,7 +38,10 @@ export function registerOrchestratorRoutes(app: FastifyInstance, ctx: Orchestrat
|
||||
return loop;
|
||||
}
|
||||
|
||||
let eventForwardingAttached = false;
|
||||
function setupEventForwarding(loop: import('../../orchestrator-loop.js').OrchestratorLoop) {
|
||||
if (eventForwardingAttached) return;
|
||||
eventForwardingAttached = true;
|
||||
loop.on('stateChanged', (state, prevState) => {
|
||||
ctx.broadcast(SseEvent.OrchestratorStateChanged, { state, prevState });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user