Bonsai
Documentation

Transition

A Transition is a path from one status to another on an Issue Type's flow chart. Paths say where an issue can go next; a path marked needs a person is one no agent takes.

A Transition is a path from one status to another. You draw the paths on the flow chart of an Issue Type. Together they say the order of the work: where an issue can go from each status.

QuestionAnswer
What it isA path between two statuses, such as Reviewing → Revising
Who it belongs toThe paths belong to the Issue Type, in its ## Transitions table; each move is recorded in the issue’s state and ## Log
Who can change itYou, on the type’s flow chart. Agents can’t edit a type
NeighboursBoth ends are statuses; what an agent does at the end of a run is Automation

What a path says

  • From and to. A path starts at one status and ends at another. Todo is only ever a start, and Closed only an end: nothing leads back to Todo, and nothing leaves Closed.
  • Needs a person. A path can be marked needs a person. No agent ever takes such a path. When that is where the work should go next, the agent stops, the issue stays in its status and becomes YOUR TURN. The path is taken when you pick it.
  • When. A path can carry a short condition, such as “approved” or “needs changes”. The agent reads it when it decides which way to go. It is a hint for the agent, not a rule Bonsai checks.

A path without the needs-a-person mark is a free path: an agent may take it.

What an agent may do

An agent’s run belongs to one status. When it finishes, the issue can only be in one of two places:

  • still in that status, or
  • at the end of one of that status’s free paths.

Bonsai enforces this on the server, not in a prompt. Inside an automated run, update_issue refuses any other status and lists the ones allowed.

If a status’s only way out is a single free path, the agent doesn’t have to set anything: Bonsai moves the issue there when the run ends. With several free paths the agent picks one, reading the conditions. If it picks none, the issue waits for you.

Transition demo

Live today

Pick a built-in Issue Type, who is acting and the issue's current status. The table lists the paths out of that status: who may take each one and why, and whose turn it is afterwards. A path marked needs a person is never taken by an agent; the issue stays where it is and becomes YOUR TURN.

Issue Type
Who is acting

The issue is in Reviewing and the third party is working on it. What its run may do with each path:

Path toVerdictWhyAfterwards
Revising
when: needs changes
AllowedA free path. The run may set this status; the server accepts it.AGENT'S TURN · the driver
Automation assigns it to the driver.
Deploying to Staging
needs a person · when: approved
Not allowedThis path needs a person, so no agent takes it. The run ends and the issue waits for you.YOUR TURN · the owner (Mei)
The issue stays in Reviewing. A line in its Log says why, and you pick the path.

If the run ends without choosing a path, the issue stays in Reviewing and becomes YOUR TURN. A status runs at most 3 rounds on one issue; after that the issue waits for you.

The same thing happens in the middle of a step: a question under Decisions, a failed run or a pause leaves the issue in its status and makes it YOUR TURN. Which person may take a path that needs a person is still being designed; today anyone who can edit the issue can.

What you do

Starting is yours: an issue in Todo moves only when you start it. So is every path that needs a person. You take a path in two places:

  • The issue page. The play key before the title starts an issue in Todo. When the issue waits on a path that needs a person, the same key lists the paths you can pick.
  • The board. Drag the card.

Changing a status on the web triggers Automation right away. An AI changing the state with update_issue from a chat does not.

Being designed

Which person may take a path that needs a person. Today anyone who can edit the issue can. The recommendation is that it is the issue’s owner or the project’s manager by default.

The built-in Feature’s paths

From → toNeeds a personWhen
Todo → DevelopingYou start it
Developing → Reviewing
Reviewing → Revisingneeds changes
Revising → Reviewing
Reviewing → Deploying to StagingYesapproved
Deploying to Staging → Deploying to ProductionYes
Deploying to Production → Closed

Read it as a story. You start the issue. The driver writes the code, and Bonsai moves the issue to Reviewing because that is the only way out of Developing. The third party reviews: with changes to make, it sends the issue to Revising, and the driver’s fix goes back to Reviewing by itself. Once the review passes, the next path needs a person, so the issue waits for you in Reviewing. You merge the PR and pick Deploying to Staging. After that deploy the issue waits for you again; you check staging and pick Deploying to Production. That deploy has one free way out, so the issue closes by itself and the driver writes back what is worth keeping.

Each of these statuses runs at most three rounds. When a status has used its rounds, the issue waits for you there.

FAQ

Can an agent close an issue?

Yes, if a free path leads to Closed, as after Deploying to Production in the built-in Feature. Mark the path needs a person and closing is yours, as in the built-in Task.

I asked the AI in a chat to change the state with update_issue. Why was nothing assigned?

update_issue from a chat doesn’t trigger Automation. Starting, approving and resuming only count when you do them on the web.

A run moved the issue somewhere its status has no free path to. What happens?

Inside the run, update_issue refuses it. If the issue ends up off the paths anyway, it becomes YOUR TURN where it is, and ## Log says why.

Does waiting for me count as a Transition?

No. Waiting never changes the status. The issue stays where it is and only its Turn flips to yours.

Are Transition and Turn the same thing?

No. A transition is a path between statuses and belongs to the type. The Turn is who the issue is with right now and belongs to the issue.