refactor(tasks): route acp through executor#57478
Conversation
Greptile SummaryThis PR introduces a Key points:
Confidence Score: 5/5Safe to merge — clean refactor with verified behavioral equivalence, no circular dependencies, and comprehensive new test coverage. All findings are P2 or lower. The logic refactoring is behaviorally equivalent, the intentional semantic constraints (dropping terminalOutcome from the failure path) are clearly designed, and the new executor/policy split is well-structured. No runtime regressions identified. No files require special attention.
|
| Filename | Overview |
|---|---|
| src/tasks/task-executor.ts | New facade layer over task-registry; correctly delegates to registry internals and enforces semantic constraints (e.g. failTaskRunByRunId deliberately excludes terminalOutcome to bind the 'blocked' outcome to succeeded tasks only). |
| src/tasks/task-executor-policy.ts | Extracted policy and formatting functions from task-registry; verified behaviorally equivalent to inlined versions. Imports only from task-registry.types.ts so no circular dependency is introduced. |
| src/tasks/task-registry.ts | Removed inlined policy/formatting helpers and replaced with imports from task-executor-policy. shouldSuppressDuplicateTerminalDelivery call site correctly pre-resolves the preferred task before calling the extracted function. Behavioral equivalence verified. |
| src/acp/control-plane/manager.core.ts | Routes ACP task lifecycle writes through the executor facade. The markBackgroundTaskTerminal split into completeTaskRunByRunId / failTaskRunByRunId correctly drops terminalOutcome from the failure branch — intentional semantic constraint. |
| src/agents/acp-spawn.ts | Replaced createTaskRecord (with explicit status: 'running') with createRunningTaskRun; status field removed from call sites since the executor wrapper now enforces it. Functionally equivalent. |
| src/agents/acp-spawn-parent-stream.ts | Three recordTaskProgressByRunId call sites mechanically renamed to recordTaskRunProgressByRunId from the executor facade. No behavioral change. |
Reviews (1): Last reviewed commit: "Merge branch 'main' into pr3/acp-executo..." | Re-trigger Greptile
* refactor(tasks): add executor facade * refactor(tasks): extract delivery policy * refactor(tasks): route acp through executor
* refactor(tasks): add executor facade * refactor(tasks): extract delivery policy * refactor(tasks): route acp through executor
* refactor(tasks): add executor facade * refactor(tasks): extract delivery policy * refactor(tasks): route acp through executor
* refactor(tasks): add executor facade * refactor(tasks): extract delivery policy * refactor(tasks): route acp through executor
* refactor(tasks): add executor facade * refactor(tasks): extract delivery policy * refactor(tasks): route acp through executor
* refactor(tasks): add executor facade * refactor(tasks): extract delivery policy * refactor(tasks): route acp through executor
* refactor(tasks): add executor facade * refactor(tasks): extract delivery policy * refactor(tasks): route acp through executor
* refactor(tasks): add executor facade * refactor(tasks): extract delivery policy * refactor(tasks): route acp through executor
* refactor(tasks): add executor facade * refactor(tasks): extract delivery policy * refactor(tasks): route acp through executor
* refactor(tasks): add executor facade * refactor(tasks): extract delivery policy * refactor(tasks): route acp through executor
Summary
Testing