Turn state machine
A turn is one full cycle from the user sending to the agent finishing a reply. A conversation has at most one in-flight turn. Parallelism is multiple conversations.
Terminal states
When a turn ends it enters exactly one of the following. The states are exclusive.
| State | Meaning |
|---|---|
| Completed | The agent finished a normal reply |
| Failed | The agent reported an error |
| Cancelled | The user stopped the turn |
| Interrupted | The Host exited during the turn (crash, kill, restart) |
Interrupted means the Host process disappeared. The agent may already have written files. Startup recovery marks leftover in-flight turns Interrupted so the conversation can accept a new turn. An interrupted turn is started again by the user.
Resume and rebind
Resume loads context into a newly started agent process. The in-progress token stream ends with the old process. Whether resume is available depends on capability bits the agent declared over ACP.
When loading the old agent session fails, confirmation may attach a new cold-start session (rebind). VibeX history stays. Hidden agent-side context starts empty. Handoff for the new process is written in the next message.
Fork
When the agent declares fork and an active session exists, fork copies visible history and agent-side context, then evolves independently. Otherwise the new conversation is a copy without hidden context. Fork starts from the current state.
Rollback to here on a user message truncates later generation so the user can edit and resend. Undo under a turn restores workspace files to the checkpoint taken before that message. The conversation record stays.
How-to: Turns: stop, resume, fork.
One in-flight at a time
While idle, the scheduler claims the next queued input and makes a new turn. Sends during an in-flight turn join the queue. Steering writes into the current in-flight turn. Cancel applies to that turn. Content already in the event log and files already written remain.
Handoff from orchestration
Delegated children, Workflow agent steps, and Automation single-session targets all create real turns. They reuse this chapter’s terminal states and the one-in-flight rule. Workflow pause cancels in-flight turns and continue opens a new turn. Automation recovery marks leftover direct turns Interrupted.

