| name | debug-pipeline |
| description | Diagnose and fix CI pipeline failures. Step-by-step debugging with sem-ai. |
| user-invocable | false |
Debugging CI Failures
Fast path — one command
sem-ai diagnose <workflow-id>
sem-ai diagnose
sem-ai diagnose --project my-app --branch main
Returns: pipeline result, failed blocks, failed jobs with log tails AND parsed test results (file:line:message).
Step-by-step
1. Find the workflow
sem-ai workflow list --branch feature-x
2. See pipeline structure
sem-ai pipeline show <pipeline-id>
3. Read logs
sem-ai job log <job-id>
sem-ai job log <job-id> --format table
4. Get parsed test results
sem-ai test summary --pipeline <id>
Example output:
{
"verdict": "failed",
"total": 11, "passed": 10, "failed": 1,
"failures": [{"job": "go test", "test": "Test_timeHandler_statusCode", "file": "main_test.go", "line": 243, "message": "expected status 201, got 200"}]
}
5. Server-side diagnostics
sem-ai troubleshoot workflow <id>
sem-ai troubleshoot pipeline <id>
sem-ai troubleshoot job <id>
6. Check if flaky
sem-ai test flaky --count 10
After fixing
sem-ai workflow rerun <id>
sem-ai rerun-failed <pipeline-id>
sem-ai watch <new-workflow-id>
sem-ai test summary --pipeline <id>
sem-ai watch <id> is for when you already hold the id from workflow rerun output. To re-find and watch the rerun for your exact commit (e.g. after pushing the fix), use the watch-after-push pattern: find the run by commit_sha, then sem-ai watch it.
Common patterns
| Log pattern | Cause | Next step |
|---|
exit_code: 1 on test command | Test failure | sem-ai test summary --pipeline <id> |
Pipeline stuck initializing | YAML error | sem-ai yaml validate --file .semaphore/semaphore.yml |
result_reason: "stuck" | No agent available | sem-ai agent types |
| All blocks empty | Compile failed | sem-ai troubleshoot pipeline <id> |
cache errors | Cache not configured | Environment issue, not code |