Configuration
Outcomes
When an agent finishes, it reports a named outcome. ub-agents checks the result on GitHub, removes the agent's trigger labels and applies the labels you declared.
outcomes:
approved: {add: [ready-to-merge]}
changes-requested: {add: [needs-changes], max-rounds: 3}
Limit rounds
max-rounds caps how often an agent can report an outcome on the same item. With the example above, the first three changes-requested reports add needs-changes. The fourth adds needs-human instead, with an Action needed comment. Approval still adds ready-to-merge at any round.
To allow one more round, swap needs-human for needs-review by hand. To start the count over, run ub-agents retry N --agent reviewer --reason TEXT. The count lives on GitHub, so restarts and other launchers don't reset it; each new pull request starts at zero.
Add labels
Labels to add. When the agent hands off a pull request, they go on that pull request.
handed-off: {add: [needs-review]}
Remove labels
Extra labels to take off. The agent's own trigger labels are always removed.
handed-off: {add: [needs-review], remove: [in-progress]}
End of the workflow
An empty mapping changes nothing else.
merged: {}
Ask the launcher to merge
A pr agent can report its merge decision and exit. The launcher waits for checks and performs the merge:
integrator:
kind: pr
# Other required agent settings omitted.
on-conflict: changes-requested
outcomes:
merged: {merge: squash}
changes-requested: {add: [needs-changes]}
merge accepts squash, merge or rebase. The outcome cannot add a stop label, declare sub-issues, or be the agent's on-conflict outcome. The agent keeps policy, review, changelog and base-merge decisions, then reports instead of running gh pr merge.
The reported candidate_sha is the merge target; no new report option is needed. The launcher checks that head against the assigned candidate or its base merge, rereads stop labels, and waits for every check run and commit status on that exact head. Skipped and neutral checks pass. Pending or absent checks wait without a model until the run's agent-timeout-minutes deadline, with the lease renewing. After checking mergeability, it merges with a head match and accepts only a confirmed merge on the base branch, recording candidate_sha and merge_commit_sha. Failed checks and conflicts use on-conflict; other refusals block. Closing issues happens afterward; a failed close does not undo acceptance.
Recovery only confirms an existing merge; it never merges. Outcomes without merge keep their current behavior. See the merge gates and recovery.
Upgrading: every launcher of a project must run a release supporting merge before its ub-agents.yaml uses the key.
Start sub-issues
An agent that takes issues can start the native sub-issues its run creates:
split: {sub-issues: {add: [needs-preparation]}}
Agents file sub-issues without trigger labels, then report split. The launcher adds the declared labels, which must be issue-agent triggers, and removes the parent's triggers. With approvals on, sub-issues inherit the parent's start. See the outcome contract.
Ask a person
Add a stop label to park the item for a human decision.
maintainer-merge: {add: [needs-human]}
Reporting
The agent reports with one command. Your instructions say which outcome to use when.
$ ub-agents report --outcome approved --summary "Checks pass"
$ ub-agents report --outcome handed-off --summary "Ready for review" --handoff 219After a Claude or Codex run ends, the launcher can record its main-session context window, first, tenth (or last) and peak prompt token counts, and compaction count on the outcome and its handoff copies. Missing or invalid context is omitted. These display-only values do not change results, labels or usage-limit decisions; see the coordination record reference.
Stop reports
A report that parks the item needs at least one ask: --action for each thing a person must do, or --option per alternative for a choice, recommendation first. Each ask is one sentence that names who acts. A max-rounds stop gets a review request from the launcher if no ask is given.
$ ub-agents report --outcome needs-human --summary "Storage policy unclear" \
--option "Owner: keep storage local." --option "Owner: move storage to the cloud."Retry and blocked
--status retry and --status blocked change no labels. Retry runs again after a backoff. Blocked parks the item and also needs --action or --option.
$ ub-agents report --status retry --summary "GitHub returned 502"Key reference
outcomes is a required, nonempty mapping from names to transitions.
| Key | Type and default | Rules |
|---|---|---|
add | List, [] | Must not include the agent's own triggers. May add a stop label. |
remove | List, [] | Must not include a stop label, and no trigger of the agent may be one. |
max-rounds | Positive integer | Needs a configured stop label, and the outcome must not add one. |
sub-issues | Mapping with only add | Nonempty list of issue or either agent triggers, no stop labels. Agents that take issues only. |
merge | String: squash, merge or rebase; omitted by default | pr agents only; no added stop labels or sub-issues, and cannot be the agent's on-conflict outcome. |
See explicit outcomes for validation, transition order, stop checks and recovery, and assignments and attempts for round counting. See launcher merges for the merge gates and recovery rules.