OpenProgram Docs

Self-update

An Agent can change OpenProgram itself: its tools, its interface, even the code that does the updating. Writing is never restricted; only going live is checked.

Build and trial copy of your data Switch run by the old version Verify real turn, then 120 s fails nothing live changed fails goes back
  1. Build and trialcopy of your dataon failure, nothing live changed
  2. Switchrun by the old version
  3. Verifyreal turn, then 120 son failure, goes back

This page covers an installation that runs from sealed versions, under <state>/runtime. For a source checkout see Developer mode and Upgrade.

Windows is implemented but has not run on a Windows machine. A Windows trial has no OS sandbox: a temporary data directory, a separate port and a sanitized copy are its only isolation, and every Windows result says so.

How the Agent changes itself

Ask for the change in a conversation. The Agent uses one tool, self_update, not available in plan mode.

ActionEffect
begin(task)Opens a private copy of the code at work/<task> as the turn's working directory
prepare(task, goal, assertions)Hands committed work over for building, checking and switching
statusProgress and the queue. Default.
retry(update_id)Next attempt after a failure, at most three in one chain
cancel(update_id)Stops an update before the switch, or removes a queued one
versionsLists the versions kept
undo(target)Goes back

prepare needs a clean tree with commits beyond the running code; otherwise it says what is missing. A change based on an older commit is rebased.

After prepare

PhaseWhat happensOn failure
buildingBuilds a sealed version from the commitStops; the worktree stays
trialRuns on a copy of your data, on its own port, with no credentials and a fake model. An independent verifier checks the assertions.Stops; nothing live touched
readyIf the running code moved, rebases and tries again, at most three timesStops and names the conflicting files
quiescingWaits up to 10 minutes for a quiet moment, then checkpoints what is running. Gives up at 30 minutes.Stops; nothing closed
activatingStops the worker, moves the current pointer, starts the new versionGoes back
verifyingProbes, runs one real Agent turn, watches for 120 secondsGoes back
During and after the switch
CaseBehavior
Who switchesThe old version, from outside the worker. A new updater takes effect from the next switch.
Several requestsOne update runs at a time; others queue.
Messages during the switchMessages, scheduled turns and always-on wakes are saved, shown as "Switching versions; this runs as soon as that finishes.", and run right after, on whichever version came up.
New version failsThe conversation says why, and a read-only diagnosis starts.
Old version does not returnEnds in needs_manual_recovery; the reason is in <state>/runtime/recovery.log.

Undo

TargetEffect
A version id still keptTries that version and switches to it. Later commits are saved.
One commitReverted alone, through the normal path. A conflict stops the undo and names the files.
TerminalNo trial; works even when the running version is broken:
openprogram versions list
openprogram versions use <id>

Versions

Each version is a sealed directory under versions/, and the file current says which runs. OpenProgram keeps the current version, the last good one, the one before it and recent ones. A version that ends abnormally twice on probation, or three times in ten minutes later, is replaced by the last good one, and the next start says so.

Your data

ChangeRule
Going backCode only; conversations, settings and files stay.
Schema and configAdditive only, so older versions can read your data. The trial enforces this.
Destructive migrationDeclared in its commit. Databases, conversations, memory and config.json are backed up at the switch, and the result names the backup:
openprogram versions restore-data <backup>
Editing a running version directly

Not refused. At the next start the launcher saves the changed files and a patch under unapplied/, restores the version, and says once how many files were set aside. The Agent can take that patch through the normal path.

Developer mode

<state>/runtime/developer.json, holding {"checkout", "python"}, runs from a source checkout: no pointer, trial or automatic return, and self_update activates nothing. Commit in the checkout and restart the worker.

Upgrade

Last updated · 2026-11-25