Codumentor logo Codumentor Enterprise

Updates

An installed Codumentor build checks a signed update channel for newer versions. Depending on how it was installed, it then updates itself or tells you what to install. Every download is verified with the Codumentor release key before anything is unpacked. The settings are in the updates config section.

Install modes

What the updater does depends on how Codumentor was installed. It finds out at startup, without network access.

ModeWhenWhat you see
Self-updateA frozen versioned install the running user owns: the Linux .run installer (default ~/.local/share/codumentor), or the Windows per-user install (%LOCALAPPDATA%\Codumentor, pointer file current, stable launcher bin\codumentor.exe)New versions are downloaded and staged in the background. Admins see a "Restart to update" banner in the web UI. The TUI shows a status-bar item that points at codumentor update --apply
AdvisoryA container (CODUMENTOR_CONTAINER=1, set in the image), a root-owned install such as /opt/codumentor, or a frozen install the running user does not ownOnly a notice. A container is told which image tag to pull. Other installs are told which installer to run. Nothing is replaced
NoneA source checkout, or updates.mode: offNo check at all

updates.mode can lower the mode, never raise it. auto keeps what the install supports, advisory stops at the notice, and off stops the check. The default is auto for the community edition and advisory for the full edition.

Only admins (admin:*, the same permission as restart) see the banner and its details. Other users see at most "An update is scheduled" once an admin has applied one.

Restart to update (web UI)

In self-update mode, the banner offers Restart to update. It opens the same dialog as a plain restart, with the list of running work it would cut off. On confirm:

  1. The new version becomes the one the install starts (current). If its data check refuses (see Data snapshots and rollback), nothing changes and the banner shows why.
  2. The server restarts onto the new version.
  3. If the new version exits before it is ready to serve, it is rolled back automatically. See When an update does not start.

The restart needs the built-in supervisor that codumentor api starts. Without one (--no-supervisor, --reload, an ephemeral home), or under a supervisor older than this feature, the update is applied but takes effect only when the server is next started from outside, for example systemctl restart. The banner says so.

The codumentor update command

The command does the same work by hand. Use it for scripted or cron installs, for a TUI-only install, or for an air-gapped host.

CommandWhat it does
codumentor updateChecks the channel. In self-update mode, downloads, verifies and stages a newer version under versions/. The running version and current do not change
codumentor update --checkOnly reports what the channel offers
codumentor update --applyStages, then makes the new version current. It runs from the next start. Old versions and snapshots no kept version needs are then removed
codumentor update --rollbackMakes the previous version on disk current again. Uses no network
codumentor update --from latest.json [--signature FILE] [--apply]Uses a latest.json copied from the update channel, with its payload in the same directory. The signature defaults to latest.json.minisig. The checks are the same as online
--forceSkips the data compatibility check on --apply or --rollback. For support use only (see below)

codumentor update --from, --apply and --rollback are the same on Windows once the process is a frozen versioned install.

A container or an advisory install is told what is available and how to install it. It never stages anything.

updates.mode: off blocks only the network check. --from and --rollback still work, because that is how an air-gapped install updates. advisory does not stop the command either: running it is an explicit admin action.

The command changes what the next start runs. It does not restart a running server. When an --apply or --rollback has to restore data (see below), stop the instance first: the restore is refused while a server, TUI or other command has the instance home open.

Proxies and certificates

The update channel is reached over HTTPS only. The check and the download honour HTTPS_PROXY and NO_PROXY. If the channel's certificate is issued by your own CA, for example behind a TLS-inspecting proxy or on an internal mirror, set SSL_CERT_FILE to a PEM bundle containing that CA. The variable replaces the built-in list of trusted CAs, so the bundle must also hold every public CA you still need. A redirect is followed only to https on the channel's own host.

Data snapshots and rollback

Each build has a data version: the generation of the stored data it reads and writes. The instance home records the one its data is at, in <home>/data_version.

Snapshot. When a new version with a higher data version starts for the first time, it copies the instance's data into <home>/backups/pre-<id>/ before it opens or migrates anything. <id> names the new version. The snapshot holds the data directories, the instance config and the user-layer config.yaml. It leaves out what can be rebuilt or is not data: the vector store, the embedding and @-mention caches, overlay trees, and logs. If the snapshot fails, the new version refuses to start, so an automatic rollback finds the data untouched. When the instance home is inside a project (a workspace home), backups/ holds a .gitignore that keeps the copies out of git.

Rolling back across a data version. An older version cannot read data a newer one migrated. So a move of current to a version with a lower data version restores the snapshot taken when the data left that version's generation. If there is no such snapshot, the move is refused.

A restore discards everything written since the update: conversations, settings, schedules and so on. The discarded data is not deleted. It is moved to <home>/backups/discarded-<UTC time>/, and stays there until you delete it. If the user-layer config.yaml was restored too, note that it is shared by every instance of that user on the host.

--force skips this check and the restore. The older version then runs on data it may not read. Use it only when support asks you to.

Cleanup. Old version directories and snapshots are removed after each successful start, and after update --apply. updates.keep_versions (at least 2) sets how many versions stay. A snapshot stays as long as a kept version might need it. A discarded-* directory stays while a kept version is newer than the data. Nothing is removed while a rollback is restoring the data.

Skipping the snapshot. CODUMENTOR_SKIP_DATA_SNAPSHOT=1 starts a new version without taking the snapshot. The data version is still recorded, so a later rollback across it is refused. Use it when the data is backed up some other way and the copy would take too long or not fit. It also lets a build start over a data_version file that cannot be read, which otherwise refuses the start.

Stores you moved out of the data directories with a CODUMENTOR_*_DB_PATH variable are not in the snapshot. Back them up yourself before an update.

When an update does not start

After a restart to update, the supervisor waits for the new version to report that it is serving. If the new version exits first, the supervisor:

  1. makes the previous version current again, restoring the data snapshot if the data version changed;
  2. starts the previous version once;
  3. records what happened in <install root>/update-event.json.

The record holds the event (update_rolled_back, or update_rollback_refused when the rollback itself was refused), the failed and restored versions, the exit code, the last 40 lines of the failed version's output, the refusal reason, and the data restore message. The admin banner shows it until an admin dismisses it, which deletes the file. If the rollback is refused, or the previous version also fails, the supervisor stops, and your service manager's restart policy applies.

The default install root is ~/.local/share/codumentor on Linux, or CODUMENTOR_PREFIX if you set one at install time. On Windows it is %LOCALAPPDATA%\Codumentor, where current is a pointer file and the stable launcher is bin\codumentor.exe.