Creating and Updating Pull Requests in Bosun Workflows
Bosun workflows automate pull request (PR) creation and updates so larger changes stay visible, reviewable, and versioned without manual intervention.
Pull Request Visibility in the App
Pull requests created from a task surface directly inside the run view. Bosun shows a dedicated card with the PR title, number, state (including draft status), and a quick summary of additions, deletions, and changed files. The card links straight to GitHub so reviewers can jump from the automation run to the live branch.
If a workflow updates the same pull request multiple times, the card refreshes automatically so everyone sees the latest status without scrolling through agent output.
Live diff preview while editing
The session log now includes a live diff panel that tracks every edit the coding agent makes against the default branch. While a step is running you see a "Live changes" entry that refreshes whenever the agent mutates files. When the step finishes, Bosun records a diff snapshot so you can scroll back through the run and inspect exactly what changed without opening a pull request.
- Live updates are throttled so only meaningful modifications replace the current view.
- Snapshots appear in timestamp order with shortstats, file counts, and byte size so you can tell how far along each step progressed.
- Large patches are truncated in-line, but you can expand files or open the diff review overlay for the full patch.
Click the diff icon that floats in the top-right of the log to open the overlay. It surfaces every live update and snapshot in a timeline, lets you navigate between steps, and pairs the diff stream with the active pull request card. This makes it easy to review a run before the PR agent pushes commits, or to compare multiple snapshots when debugging in-progress work.
Coding agents automatically commit changes they make. Your own steps or custom agents do not commit changes unless you explicitly run Git commands or use the pull request agent.
The Built-in Pull Request Agent
Bosun ships with a dedicated pull_request agent. It comes with an opinionated system prompt that:
- Reviews recent changes and diffs before drafting the PR body.
- Uses a neutral, professional tone with scoped summaries and follow-up notes.
- Automatically stages files, creates a commit (allowing empty commits when needed), pushes the branch, and finally opens or updates the GitHub pull request.
- Defaults to creating draft pull requests unless told otherwise and always returns the PR URL.
- Emits a Markdown-native pull request body with headings, bullet lists, code fences, and reviewer checklists so the rendered PR reads cleanly in GitHub.
Because the agent already knows how to summarise changes, you can often omit detailed instructions. Provide short guidance when you want to highlight context or direct the agent toward specific call-outs.
Syncing commits and pushes to the primary repository
Bosun auto commits and pushes changes after every agent run by default. This is only done on the primary repository.
Confining the hook to the primary repository keeps multi-repo workspaces predictable: additional repositories can still be mounted for context, but automated commits never leak into them. What this means in practice:
Example: Create a Draft Pull Request
Use the built-in agent early in a workflow to announce that work has started:
- name: Create a draft pull request
agent:
extends: pull_request
instructions: "Open a draft PR summarising the work completed so far."
If the branch does not yet contain committed changes, the agent creates an empty commit so the pull request still opens successfully.
Creating the draft pull request at the beginning of a workflow signals progress to teammates and provides a stable place to collect automated updates. Subsequent steps can keep editing the same PR by reusing the pull_request agent.
:::warn Multi-repo pull requests For multi-repo workflows, ensure you set the working directory of the agent to the repository you want the pull request opened against. The agent only creates pull requests in the repository where it runs. :::
Example: Finalise and Mark Ready for Review
When your workflow finishes its changes, you can re-run the agent with different tool settings to flip the PR out of draft:
- name: Finalise the pull request
agent:
extends: pull_request
instructions: "Update the existing pull request and mark it ready for review."
tools:
- name: finalize_pull_request
extends: create_or_update_pull_request
with:
draft: false
Only the tool configuration changes here: setting draft: false tells the agent to mark the pull request as ready after updating the summary.
Customising Behaviour
- Tone or structure: Override
instructionsor add constraints when you need a specific format (e.g., include testing notes, deployment steps, or risk callouts). - Skipping drafts: If your process never uses draft PRs, set
draft: falseon the tool definition in every pull request step.