feat: wire quality review into orchestrator handleAgentStopped

When an agent stops, check whether a quality review should run before
auto-completing the task. If shouldRunQualityReview returns run:true,
delegate to runQualityReview (which transitions task to quality_review
and spawns a review agent) instead of calling completeTask directly.

Falls back to completeTask when agentRepository or agentManager are
not injected, or when the task lacks phaseId/initiativeId context.

- Add agentManager optional param to ExecutionOrchestrator constructor
- Extract tryQualityReview() private method to compute branch names and
  repo path before delegating to the quality-review service
- Pass agentManager to ExecutionOrchestrator in container.ts
- Add orchestrator integration tests for the agent:stopped quality hook

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lukas May
2026-03-06 22:05:42 +01:00
parent 9200891a5d
commit 4bc65bfe3d
3 changed files with 203 additions and 6 deletions

View File

@@ -251,6 +251,7 @@ export async function createContainer(options?: ContainerOptions): Promise<Conta
eventBus,
workspaceRoot,
repos.agentRepository,
agentManager,
);
executionOrchestrator.start();
log.info('execution orchestrator started');