join waits for both, and a reviewer agent reads both checkouts and picks one.
Two agents in one checkout overwrite each other’s files. In two workspaces they edit, test and commit without touching each other or your main checkout.
Before you begin
- The
reliantCLI, v1.21 or later (reliant version). Validating, linting and scenario runs need no account. - A git repository with a test you can run. This guide uses a Python repo with a
text.pyand a unittest. - For the live run: a signed-in CLI (Sign in and tokens) and a connected machine that holds the repository (Run a machine from the terminal).
- The basics of workflow files, from Write your first multi-agent workflow.
1
Create the workflow file
Save this as What each part does:
.reliant/workflows/two-approaches.yaml:.reliant/workflows/two-approaches.yaml
entrylists two nodes, so both branches start together.create_worktreemakes a workspace and outputs itspathandbranch.base_branchstarts from the chat’s workspace branch, or the main checkout’s current commit (HEAD). Addcopy_filesfor untracked files such as.env(Workspaces).project.pathruns each agent inside its workspace. Without it, both would work in your main checkout.thread: mode: forkgives each agent your request; eachinjectadds a different approach.joinwaits for both implementers. A skipped source counts as finished (How workflows run).- The reviewer answers through a schema, so
reportcan name the winning branch.
2
Validate, lint and test it with a scenario
A scenario checks the fan-out and join with mocked results, without spending tokens. Save it as
.reliant/workflows/two-approaches/scenarios/reviewer_picks_b.yaml:.reliant/workflows/two-approaches/scenarios/reviewer_picks_b.yaml
terminal
3
Run it
Commit your work first: each workspace starts from the current commit, so uncommitted edits are not in it.Both workspaces were created in the same second, then both agents ran side by side.
terminal
4
Verify the result
Check the run, then look at the workspaces from the repository:Each candidate’s change is in its own workspace. Here A used The
terminal
re.sub and B used str.isalnum(), as their prompts asked:terminal
report message, in the run under Runs in the app, names the winner and its branch:5
Keep the winner and clean up
Open the winner in the app’s Workspaces panel and commit, push or open a pull request from its Changes tab (Git integration). Then Archive both workspaces. An archived workspace leaves the disk once nothing in it would be lost, so one with uncommitted or unpushed work stays.
locked in git worktree list is Reliant’s lock, so plain git worktree remove refuses. To discard an archived candidate for good:terminal
From a chat: spawn with a workspace
Without a workflow file, ask a chat’s agent to create the workspaces with its worktree tool and start a sub-agent in each:
Chat message
worktree with action: create twice, then spawn twice in one turn:
spawn call
worktree/wc-split-1795170372, worktree/wc-regex-1795170372), and the main agent recommended one (Delegate work to parallel sub-agents). Use a workflow for the same steps every time, and a chat when the split depends on what the agent finds.
The built-in version: Best of Three
Best of Three runs three candidates in a parallelloop, after rewriting your prompt into a specification. It then applies the winner’s changes with git apply, or has an agent merge the best parts, and runs your test and build commands.
What this does not do
- It does not merge anything. Committing, pushing and merging are yours, or a
git_publishnode’s. - The pick is a model’s judgment. To make your test command the gate, add a
runnode per workspace and route onexit_code. - Workspaces are not a sandbox. They isolate the agents’ files from each other, not from your machine.
- Everything runs on one machine. A workspace exists on one machine’s disk, so every agent working in it runs there (chats, workspaces and machines).
- Each candidate costs tokens. Two cost about twice one implementation, plus the review.
Troubleshooting
save_message field 'content' references nodes, which is not available in save_message
save_message field 'content' references nodes, which is not available in save_message
A node’s
save_message reads only output, inputs, workflow and iter. Read nodes.workspace_a.branch in a later node, as report does.no machine has synced this project's workflows yet
no machine has synced this project's workflows yet
The first run on a new folder creates the project before its machine has synced
.reliant/workflows/. Wait about 20 seconds and run it again.fatal: cannot remove a locked working tree, lock reason: reliant: worktree …
fatal: cannot remove a locked working tree, lock reason: reliant: worktree …
Reliant locks the worktrees it creates. Archive the workspace in the app first. To delete its directory anyway, run
git worktree remove -f -f <path>.Next steps
Best of Three
Three candidates, a reviewer, and the winner applied with
git apply.Delegate work to parallel sub-agents
Fan work out from a chat with
spawn, a plan and briefing files.How sub-agents and threads isolate context
Threads, nesting depth, concurrency caps and workspaces.
Workspaces
Create, open, archive and clean up workspaces.