Build: Agent Pipeline
The Build stage connects project management (Plan) to actual code generation. When an issue is assigned to a bot in OpenPR, the Build layer dispatches an AI coding agent, manages its execution, and feeds results back into the project.
Key Components
Section titled “Key Components”| Component | Role | Language |
|---|---|---|
| openpr-webhook | Receives OpenPR events, dispatches AI agents | Rust (Axum) |
| prx-memory | Persistent knowledge store for agents (MCP server) | Rust |
Data Flow
Section titled “Data Flow”OpenPR event (issue.created / issue.updated) │ ▼openpr-webhook (HMAC-SHA256 verified) │ ├── Filter: is this a bot task? │ ▼CLI Executor │ ├── Launch agent (codex, claude-code, opencode) ├── Inject prompt from template ├── Set working directory, timeout (900s) │ ▼AI Agent works │ ├── Reads code, makes changes, runs tests ├── Stores/recalls knowledge via prx-memory (MCP) │ ▼Callback (MCP / API) │ ├── Post results to OpenPR ├── State transition: in_progress → done │ ▼OpenPR updates issueHow It Fits in the Pipeline
Section titled “How It Fits in the Pipeline”The Build stage sits between Think (AI reasoning) and Ship (distribution):
- Plan creates a task and assigns it to a bot user
- Think provides model routing and sub-agent orchestration
- Build dispatches the coding agent and persists learned patterns
- Ship distributes the resulting artifacts
- Protect defends the deployed application
Agent Lifecycle
Section titled “Agent Lifecycle”A single agent session follows this lifecycle:
- Trigger — OpenPR fires a webhook event (e.g.,
issue.createdwith a bot assignee) - Dispatch — openpr-webhook matches the event to an agent configuration and launches the CLI executor
- Execution — The agent operates within a sandboxed working directory with a strict timeout
- Memory — During execution, the agent calls prx-memory MCP tools to recall past solutions and store new learnings
- Report — The agent posts its results (code changes, test outcomes, error logs) back to OpenPR
- Close — OpenPR transitions the issue state based on the result
Getting Started
Section titled “Getting Started”# Clone and build the webhook dispatchergit clone https://github.com/openprx/openpr-webhookcd openpr-webhook && cargo build --release
# Clone and run prx-memorygit clone https://github.com/openprx/prx-memorycd prx-memory && cargo run --release --features httpConfigure the webhook dispatcher with your OpenPR instance URL, webhook secret, and agent settings. See the individual component docs for configuration details.