Task Summary
agent-service/src/agent/tools/workflow-execution-tools.ts (codecov ~7.5% — the service's single biggest gap, ~484 uncovered lines) has executeOperatorAndFormat(...): it validates a logical plan, runs it via executeWorkflowHttp, and formats the target operator's result. Unit-testable with bun test by mocking the HTTP call (executeWorkflowHttp / the execution-api module) to return canned SyncExecutionResults — no live backend; getBackendConfig and the workflow mutex can be stubbed.
Behavior to cover
- empty
logicalPlan.operators -> createErrorResult("Cannot execute: workflow has no operators.")
- pre-exec validation fails with target-operator errors -> error listing them
executeWorkflowHttp returns result.success === false -> error with the returned error text
- target operator info missing from the result -> error
- target
opInfo.error present -> error via formatExecutionError
opInfo.result missing / not an array -> "(no result data)"
- result string exceeds the char limit -> truncated output
- success path -> formatted operator result;
options.onResult callback invoked when provided
Task Type
Task Summary
agent-service/src/agent/tools/workflow-execution-tools.ts(codecov ~7.5% — the service's single biggest gap, ~484 uncovered lines) hasexecuteOperatorAndFormat(...): it validates a logical plan, runs it viaexecuteWorkflowHttp, and formats the target operator's result. Unit-testable withbun testby mocking the HTTP call (executeWorkflowHttp/ theexecution-apimodule) to return cannedSyncExecutionResults — no live backend;getBackendConfigand the workflow mutex can be stubbed.Behavior to cover
logicalPlan.operators->createErrorResult("Cannot execute: workflow has no operators.")executeWorkflowHttpreturnsresult.success === false-> error with the returned error textopInfo.errorpresent -> error viaformatExecutionErroropInfo.resultmissing / not an array ->"(no result data)"options.onResultcallback invoked when providedTask Type