Overview
PipelineResult is returned by run_pipeline() and contains all information about what happened during the run: agent output, PR URL, CI status, and overall outcome.
Defined in crates/magpie-core/src/pipeline.rs:70-78.
Struct Definition
Fields
The last output from the pipeline’s execution. Typically the final agent response or test/lint output from the last CI round.Usage: Display this to the user or log it for debugging.
GitHub pull request URL if one was successfully created.Returns
None if:dry_runis enabled- No changes were made (empty diff)
- Git/PR operations failed
"https://github.com/anomalyco/magpie/pull/42"Plane.so issue ID if Plane integration is configured and the issue was created.Returns
None if:planeconfig is not set- Issue creation failed (logged as warning, not an error)
"MAGP-123"Whether CI checks (lint + test) passed.Behavior:
true— Tests and linter both exited with code 0false— At least one CI check failed after all retry roundstrue(special case) — No code changes detected, CI skipped (docs-only)
Number of CI rounds executed. For TDD/Diagnostic blueprints, if tests pass inside the blueprint, this is still
1 even though the external CI loop was skipped.Range: 1 to max_ci_rounds (from config)High-level outcome classification. See PipelineStatus enum below.
PipelineStatus
Defined incrates/magpie-core/src/pipeline.rs:81-87.
Variants
Pipeline completed successfully:
- Agent finished without errors
- CI passed (
ci_passed == true) - PR was created (or would have been in non-dry-run)
Agent completed and opened a PR, but CI failed:
- Agent made code changes
- PR was created (
pr_url.is_some()) - CI failed after all retry rounds (
ci_passed == false)
Agent execution failed:
- Blueprint runner returned an error (e.g. agent crashed, command failed with
continue_on_error: false) - No PR was created
Pre-agent setup failed:
- Repo parsing/cloning failed (multi-repo mode)
- Org validation failed
- Git branch creation failed
- Sandbox creation failed (Daytona mode)
Status Decision Logic
Fromcrates/magpie-core/src/pipeline.rs:1224-1230:
SetupFailed is returned early (before reaching this logic) when pre-flight checks fail.
Usage Example
Discord Bot Handler
CLI Reporting
Serialization
PipelineResult derives Serialize and Deserialize (serde), so it can be:
- Logged as JSON for telemetry
- Returned from HTTP APIs
- Stored in a database
Notes
- Partial Success is Not Failure:
PartialSuccessmeans the agent did its job and created a PR. The CI failure might be a flaky test or an edge case the agent didn’t handle. Review the PR. - Empty Diffs: If the agent makes no changes (empty git diff), no commit/PR is created, and
pr_urlisNone. This is usuallyAgentFailedstatus. - Docs-Only Changes: If all changed files are markdown/docs (detected by
needs_ci()), CI is skipped andci_passedis set totrueautomatically.
See Also
- PipelineConfig — Input configuration for the pipeline
- TaskComplexity — Classification that affects which blueprint runs
- Blueprint — The orchestration structure executed during the pipeline