OpenProgram Docs

Branch settings

Each branch of a conversation runs with its own settings and its own state, so two branches can run side by side.

Where a setting comes from

Every branch keeps its settings on its own record in branch_refs; the conversation's top-level fields are the selected branch's projection. resolve_branch_settings(session, branch) returns each setting's values, sources and inherited (what it follows when unset). Every entry reads through it: web, channels, scheduled runs, always-on, Goals and --print.

Setting left unsetFalls back to
Model, Web search, FastThe branch's Agent as it is now, then the product default
EffortThe Agent, then the project, then the product default
Permission mode, SandboxThe project, then the product default
AgentThe default Agent

Following the Agent

  • A new conversation and an Agent switch write no model, so an edit of the Agent's model reaches the next turn.
  • Admission records the model in turn_settings. When the Agent changed it since the last turn on that line, the user message carries model_change, the page shows a one-line note and the cache-break report names model_switch.
  • A move to a model with a smaller window compacts first, with the old model.
  • scripts/maintenance/migrate_branch_follow_agent.py clears models and web-search switches that only copied the Agent's. It is a dry run by default and writes a backup before it changes anything.

Writing a setting

  • POST /api/sessions/{id}/branch_settings stores only what differs from inherited; an equal value is written as unset. reset_fields also puts a setting back to inherit.
  • GET on the same path and the reply to a write return the resolved values.
  • A message to an existing conversation sends no settings; a new conversation sends only the controls the person changed.
Why this design
DecisionFollowsWhy
Follow the AgentClaude Code and Hermes: unset means follow the layer above. Codex: the warning on a model change and the downshift compactionThe Agent is the identity a person maintains; an edit of its model should reach the conversations that use it
Order per fieldClaude Code: model and effort come with the Agent, permission from the environmentPermission is what this folder may do, a project boundary; model and effort are how the assistant works. Codex's single layer order would let a project override an Agent's model, which projects here do not set
Background entries read their own branchClaude Code delivers a scheduled task to its owner; OpenCode resolves the session's Agent when the check firesA scheduled command on another branch ran with the selected branch's permission, so loosening the main line loosened it too
Retry and edit copy the current settingsCodex, Pi and OpenCodeA snapshot of the old turn would loosen a permission the person tightened since; the current values are on the controls
Only differences are writtenClaude Code's picker writes nothing for the default"Set on this branch" then means the person set it

Where tool state belongs

StateKept perTurn on another branch
TodosBranch (todos.json keeps one board per branch); a new branch starts from a copy of its parent'sIts own board
GoalConversation, bound to the branch it was started on (an older Goal belongs to the branch selected when it is read)Runs without the Goal; the Goal's own branch runs with it, selected or not
Compaction summaryChain (the summary's covers_ids)Allowed
Occupancy (last_prompt_tokens)Branch record; the conversation keeps the selected branch'sAllowed
Read-before-edit baselinesBranch history: each read is recorded against its turn in read_baselines.jsonl (local and SSH under their own key)Only reads on its own line count, and none from before the latest compaction on it
Plan mode, background shells, permission rules, spilled tool output, memory writesNot yet established

A load and get_run_state return running_branches. branch_running_task carries the branch's name and wait_state (approval or input), so a pane can list runs on other branches.

Why this design
DecisionFollowsWhy
Read baselines from historyClaude Code's extractReadFilesFromMessagesThe same in every process (Worker, CLI, scheduled run); a fork, a rewind and a compaction need no extra bookkeeping
Todos per branchClaude Code: one list per execution contextA side branch writing the conversation's board overwrote the main line's
Goal bound to its branchCodex: a goal per threadSame reason; only commands that act on the whole conversation stay on the selected branch
Operations hold only their branchesCodex: a constraint lands on the thread acted onEach branch has one foreground operation; a node shared by several branches needs all of them idle
Runs on other branchesClaude Code's footer badge per task; the states from Codex /sideA run waiting for approval blocks work, so it belongs beside the input. Only the data is sent so far

What is not yet done: Activity and control, Implementation status.

Last updated · 2026-11-25