You work on one branch at a time. The branch, or the exact commit, you have open decides what your conversations run against, what the Agent Builder works on, and where its pushes land. The Branches window, where you move between branches, also lets you compare any two commits before you open one or make it live.
#Which one do I need?
Most work on branches comes down to a handful of situations. Find yours, then follow the section it points to.
| You want to… | Do this | Section |
|---|---|---|
| Try a change without touching the branch your team is working on | Start a new draft branch, make the change there, test it | Start a new draft branch |
| See how the agent behaved before a change | Open the earlier commit and talk to it | Open a branch or a commit |
| Keep working from an earlier commit after the branch has moved on | Branch from mine on the banner | What HEAD means |
| Use a teammate's work in your branch | Pull from their branch | Bring changes from another branch |
| Review a branch before it goes live | Compare it with the live commit | Compare two commits |
| Find out which commit changed a behavior | Ask what one commit changed | See what one commit changed |
#An example from start to finish
ACME Air's agent is live on Initial Branch. The team wants to try a new cancellation rule without disturbing it:
- They start a draft branch called Cancellation policy from the commit before any fee existed, so the draft begins from known behavior.
- On that branch they ask the Agent Builder to add a USD 15 convenience fee for cancellations made through the agent, test it in a conversation, and push. The branch now has two commits: the starting point and the fee.
- A teammate who still has the first commit open sees the moved on banner and selects Open head to catch up.
- Before anyone makes it live, they ask what changed since the previous commit. The builder answers by area: the cancellation flow, the cancellation results, and what gets recorded.
- Customers are still served by the live commit on Initial Branch throughout. Nothing changes for them until someone makes the new commit live. See Make a commit live.
#Open a branch or a commit
Select the branch pill in the top bar to open the Branches window.
Under Other branches, find the branch and select Open.
To open one exact commit instead, select the branch's commit count to list its commits, then select the commit's row.
The card moves up to Currently open and the branch pill shows the tag you opened. Close the window to get back to work.
Opening a branch keeps you on its newest commit, including commits other people push after you open it. Opening a specific commit keeps you on that commit.
#What changes when you open another branch
- New conversations run on the commit you opened. A thread stays tied to the commit it ran on: if you open a thread from a different commit, the composer says This conversation ran on that commit and waits until you switch to it, using the Current commit picker beside the note.
- The Agent Builder starts fresh on that branch: your next message opens a new session there. Sessions you had on other branches stay in All sessions, and any unsaved changes stay with the session that made them. Push them first if you want them kept as a commit.
- The Program files view (
</>) shows the commit you opened.
#What HEAD means
HEAD marks the newest commit on a branch, the one the next push builds on. If you open an older commit of a branch, a banner at the top of the Branches window says the branch moved on, and that a push from where you are would be refused. Choose one of:
- Open head to move to the newest commit,
- Branch from mine to start a new draft branch from the commit you have open,
- View diff to ask the builder what changed between your commit and the head.
The same banner appears when a teammate pushes to your branch while you have an older commit of it open.
When to use each. Open an older commit when you want to see or show how the agent behaved before a change: talk to it, read its program, then go back with Open head. Choose Branch from mine when you want to keep building from that older point, for example to try a different approach than the one the branch took.
#Start a new draft branch
- In the Branches window, select New branch. To start from a particular commit, select the branch icon on that commit's row (New draft from this commit) instead.
- Under Name, type a name, or keep the suggestion: the source branch's name followed by (continued).
- Under From branch and At commit, choose where to cut the branch. Both start on what you have open.
- Select Create branch.
The new branch becomes the one you have open. Nothing on the source branch changes. If you cut from an older commit, the dialog reminds you that everything committed after it stays on the source branch.
Good reasons to start a draft branch
- To try something you may throw away. A draft costs nothing to abandon: archive the branch and the source is exactly as it was.
- To work alongside someone else. Two people on two branches never overwrite each other's unsaved work.
- To prepare a change while the live commit keeps serving customers. Make it live only when it has been tested and compared.
#Bring changes from another branch
To bring another branch's work into the branch you have open:
- On the Currently open card, select Pull from.
- Under From branch and At commit, pick the commit to bring in.
- Select Pull in.
The Branches window closes and the Agent Builder does the work in Build mode: it brings the clean changes in, tells you what needed a decision and how it settled it, then validates the program. The result is unsaved changes, so test them, then push. See Unsaved changes and Push.
You can start the same thing from the other end: on a commit row of another branch, select the merge icon, whose tooltip reads Bring followed by the commit and your branch's name.
#Compare two commits
Compare tells you what differs between two commits of your agent, by area and in plain words. The Agent Builder reads both programs and answers in its pane. Nothing is changed by asking. Use it before you make a commit live, to review a teammate's branch, or to find out when a behavior changed.
- Select the branch pill in the top bar to open the Branches window.
- Select Compare. The Compare two commits dialog opens.
- Under Base and At commit, check the first commit. It starts on the branch and commit you have open; change either if you want to read from somewhere else.
- Under Compare with, pick a branch (Pick a branch…), then its commit under At commit. The commit list marks which commit is the newest and which is live.
- Select Compare.
The Branches window closes and the builder answers in Ask mode, area by area, reading the base as the one you start from. If you pick the same commit on both sides, the dialog asks you to pick two different commits.
- Before going live, compare the live commit with the commit you are about to make live. Expand the branch that is marked Live to find the live commit.
- Ask follow-up questions in the same builder session, for example "Which kinds of conversation would behave differently?"
#See what one commit changed
Each commit row in the Branches window has a compare icon. Its tooltip reads What changed since followed by the previous commit, or What changed in this commit? on the first commit of a branch. Select it and the builder explains what that commit changed compared with the one before it.
This is the quickest way to find when a behavior changed: start at the newest commit and ask each one in turn until the answer mentions it.
#From the CLI
If you work from the CLI as well, apollo pull after a Playground push keeps your checkout current, and apollo merge-from brings another branch's changes in locally. See the CLI workflows. For a line-by-line diff of the program files, use apollo diff <tag> <tag> with the tags of the two commits. See the CLI command reference.