Upgrade Kraft
By the end you have a newer Kraft release, with a backup of your database taken first,
and kraft admin health names the new version. The page also says how to go
back to the version you had.
Coming from 1.4? Don't follow the steps on this page: 1.4's own
kraft admin update mishandles the install. Follow
Coming from 1.4
instead. What's new says what you get.
Before you start
- You know how Kraft was installed: with uv or
install.sh, with Homebrew, with pipx or pip, or from a source checkout. The update step differs for each. - You can pick a moment when no agent is running, or you pause the running
items first. Step 4 restarts the server, which ends the agents of items that
run in place. Across a major version
kraft admin restartrefuses andkraft admin update --restartwaits while anything runs, so onlykraft admin update --now, orkraft admin stop --nowthen a start, ends the rest. sqlite3orpython3is on yourPATH, for the backup.
Upgrade
- Back up the database. A newer Kraft can migrate
run/orchestrator.dbforward when it starts, and there is no way back: the version you had then refuses to start on it (database schema vN is newer than code vM). The backup is what lets you roll back.
This copy is safe while the server runs. The file is named for the second you run the command, so a backup taken at another time never replaces this one, and a rollback to 1.4 needs the backup from before the first upgrade. The command prints the name: write it down, and keep the file.-readonlyopens the database you copy from read-only, so a wrong path fails instead of making an empty backup.runfollowsKRAFT_RUN_DIR, thenKRAFT_HOME, as Kraft does:run="${KRAFT_RUN_DIR:-${KRAFT_HOME:-$HOME/.kraft}/run}" backup="$HOME/kraft-backup-$(date +%Y%m%d-%H%M%S).db" sqlite3 -readonly "$run/orchestrator.db" ".backup '$backup'" && chmod 600 "$backup" && echo "$backup"/home/you/kraft-backup-20261002-093015.db
Thechmodkeeps the copy readable by you alone, as the database is.
Back up and restore the database has the form for a machine withoutsqlite3, and how to check the copy and put it back. Kraft also copies the database itself before it migrates it, as The copy Kraft makes before an upgrade says. Take your own anyway: you know when you made it, and it doesn't depend on the version you upgrade to. - Pause the running items, or wait until none run. The restart in step 4 ends the agents of in-place items; across a major version it waits or refuses while anything runs. The commands are in A restart leaves local steps running.
- Install the newest release. On 1.4, don't run this command: follow
Update from 1.4.
kraft admin update
It prints the release it installs:kraft 2.0.0 -> v2.0.1 kraft v2.0.1 installed. Restart a running server: kraft admin restart
What it runs depends on how Kraft was installed:- uv or script install:
uv tool install --force --python 3.X "kraft-sdlc[vector]==X.Y.Z". Thevectorextra (when you have it) and a Python you chose with--pythonstay. With no--pythonrecorded, it asks for the minor version Kraft runs on now, such as3.13, so a lateruv python upgradestill carries Kraft along. - Homebrew:
brew upgrade kraft. - pipx, pip or a source checkout: nothing, because a uv copy would sit
beside the
kraftyou run and change nothing. It prints the command that updates the install you have instead, such aspipx install --force --python /path/to/python "kraft-sdlc==X.Y.Z".
On a uv install, uv records the exact version, souv tool upgradeleaves Kraft where it is: update withkraft admin update. In the few minutes after a release, before PyPI has it,kraft admin updateinstalls the release's wheel from GitHub instead.
A Kraft add-on runs on one major version of Kraft. Beforekraft admin updateinstalls a release of another major, it lists the loaded add-ons that release would leave out, and asks:kraft 3.0.0 would stop loading these add-ons until each publishes a version for it: release@acme 1.0.0 needs Kraft 2.x Install it anyway? [y/N]
A no installs nothing. After a yes, or-y, each listed add-on stays installed and stops loading, and a chain that extends it stops resolving.kraft admin addon updatebrings it back once its author publishes a version for the new major. - uv or script install:
- Restart the server so it runs the new release. Either run
kraft admin restart, or give step 3--restart(kraft admin update --restart) to do both.
Within a major version the restart leaves the local steps of worktree items running: the new server starts a local worker of its own and takes the steps over. The old worker exits once it has finished its processes.kraft admin update --restartto a new major version doesn't restart at once. It marks the release for when Kraft is free and says so, since the new major can't take over the old one's steps. With no server running it only installs.kraft admin update --nowinstalls and restarts at once, ending every step.kraft admin restartonto a new major with an item active exits 1 and names--when-freeandkraft admin stop --now.
Without a restart, a running server keeps running the old release, the board shows a page saying to restart instead of the interface, andkraft admin doctorwarns on itsrestartrow. The page doesn't appear when you update from 1.4 or from a 1.5.0 release candidate before rc14: see If you used 1.4's update anyway. - Check the result:
kraft --version kraft admin health--versionprintskraftand the release, such askraft 2.0.1.healthprints the same release on itsversionrow, and noinstalledrow that saysrestart pending:status ok version 2.0.1
Therestartrow ofkraft admin doctorreadsthe server (pid N) runs the installed version (2.0.1).
Update when Kraft is free
Added in 2.3
Kraft can take a release for you, at a moment when it costs no running work. You mark a release, or turn on auto-update, and Kraft installs it and restarts once nothing is going on. Nothing is held while it waits: items still start, and Kraft tries again a minute later.
Kraft is free when no agent session is running and no work item is active, waiting, queued or rate_limited. An item waiting for a person (needs_human), paused, blocked, completed or abandoned doesn't hold it back. If you set allowed hours, Kraft also waits for them. Once it is free and has decided to go ahead, it starts no new walk or agent session until it has installed and restarted, about a minute, so nothing is cut off while starting.
If the restart never happens, that hold lapses after 15 minutes and Kraft looks again.
- Open Settings › About. On a release install made with uv, an available version has an Install when free button, and a marked one has Don't. The CLI does the same:
kraft admin update --when-free kraft admin update --when-free v2.3.0 kraft admin update --cancel-when-free
The mark works whatever the switches say, and stays across a restart. A new major version is offered beside the newest release of your major, and installs only when you mark it. - To have Kraft mark releases itself, turn on Update automatically. It marks each new minor or patch release on your channel. Both switches are off until you turn them on. Restart when free also restarts a dev install or a settings change when it is free. A release Kraft installed itself always finishes with its restart.
- Optionally, add Allowed hours, such as
01:00-06:00, in the server's local time. Kraft updates and restarts only inside them, and only when free. A person's mark waits for them too.
About says what is waiting and why it isn't done yet: waiting for 1 running item, outside 01:00-06:00, attached to a terminal. It also keeps how the last attempt ended.
What Kraft does when it is free
- It claims the moment, and checks that it is still free.
- It installs the marked release, after the checks
kraft admin updatemakes. Kraft installs nothing that would ask a question by hand: a configuration migration, add-ons the release would drop, a leftoverkraftuv tool. It refuses, says why on About, and leaves the old version running. Runkraft admin updateyourself. It also holds a release that would break one of your overrides ofkraft-default, or whosekraft-defaultit can't compare (below). - It checks that the new install can start: it imports the server, reads every configuration file, and checks the bind address and port, without starting anything.
- It copies the configuration directory and the databases, then restarts. The new server comes up on probation: it answers, and starts no walk, poller or loop until a helper has seen it come up as a new process, of the new version for a release.
- If it doesn't come up in time, the helper puts back what changed: it reinstalls the previous version, restores the configuration and the databases, and starts that version. About shows the failure. The same version isn't tried again until you mark it again.
A dev install, installed from a checkout, has no release to look for. Install it yourself with just install; its restart then waits for a free moment, if you turned on Restart when free. If the old server can't start on what is installed, Kraft is left down, and About says so.
Which servers can restart themselves:
- A service (launchd or systemd) and a server started with
--detachcan. They restart through their own manager, or by stopping and starting in the background. - A server started in a terminal can't. About shows the update and says it is attached to a terminal. Restart it there.
A failed or refused attempt, and each one that works, is written to run/logs/server.log and shown on About. Kraft's notifications carry events of work items, which an update doesn't belong to, so they don't carry it.
What an upgrade leaves in config
An upgrade never changes $KRAFT_HOME/config/, with three exceptions:
- An install still on Kraft 0.x's template format (a
registry.yaml, nolibrary.yaml) is migrated, after a prompt. See A 0.x home. - The first start of 2.0 or later rewrites
theme.yamlonce if it still haspalette. See The interface. - The first start of 2.0 or later renames a 1.4
templates/toconfig/and moves two keys betweenpolicy.yamlandintake.yaml, rewriting the files it moves a key between. See Config directory and files.
Kraft's own chains and library aren't config: they are the built-in add-on
kraft-default, which an upgrade updates with Kraft. A home seeded before that
keeps its full copies; see
Move onto kraft-default.
What an update shows about kraft-default
Added in 2.6
Your chains extends: kraft-default:<id>, so a release can change what they
run. kraft admin update compares the new release's kraft-default with the
running one before it installs anything, so declining needs no rollback. It
downloads the release's wheel, which also carries the web UI, so the step can
take a while on a slow connection.
kraft admin update
- The review. It prints what changes how far a run goes (a gate removed, a
merge step added), the chain changes, and any
extends:or override of yours that the new version breaks, naming what breaks, asbreaks:lines. The first line names both versions, as inkraft-default@kraft 2.5.0 -> 2.6.0. - The question. If anything changed, broke or couldn't be compared, it
asks
Install it? [y/N]. Anything butyoryesinstalls nothing, and so does an answer with no terminal.-yanswers yes, as it does for the other questions in an update, so a script can accept. Whenkraft-defaultis the same it printskraft-default: unchangedand asks nothing. - Can't compare. With no network for the wheel, or a broken
policy.yaml, it sayskraft-default: cannot compare: ...and still asks. - Across a major with
--restart.kraft admin update --restartto a new major hands off to the when-free path. It prints the same review first, and doesn't ask. If something breaks, or it can't compare, it adds that the update is held until you runkraft admin updatewithout--restartand accept.
An unattended update (--when-free, Install when free, Update
automatically) can't ask, so it decides alone and -y isn't a way around it:
- It holds when the new
kraft-defaultwould break one of your overrides, or Kraft can't compare. It installs nothing, and drops the mark.kraft admin doctor'skraft-defaultrow says why and names the file and node.- Run an interactive
kraft admin update, accept with the break shown, then fix the override. - You can't fix it first: renaming it to the new node ID breaks
defaulton the release you are running. - Until you fix it, filing on
defaultanswers 422 with the resolver's message.quick-taskand other chains keep working.
- Run an interactive
- Otherwise it installs, and the
kraft-defaultrow lists what changed, including changes to how far a run goes, until the next update. This is the one change to a run's reach that an update installs without showing it first.
The first upgrade onto the release that added this shows no preview, because the
kraft admin update that runs is the previous release's. From then on, every
update does. A rollback or downgrade needs nothing: the older Kraft serves its
own kraft-default, and work items already running keep the one they were filed
with.
What doctor lists about kraft-default
Kraft's own chains and library are the built-in add-on kraft-default, read from the installed Kraft, so they can't fall behind it. The kraft-default row of kraft admin doctor is always ok, and a warning when it has any of these lines:
| Line | Meaning | Fix |
|---|---|---|
the <version> update was held: ... | An unattended update would break one of your overrides, or Kraft couldn't compare. | Run kraft admin update, accept with the break shown, then fix the override it names, as above says. Until you do, filing on default answers 422. |
<from> -> <to> changed kraft-default: | An unattended update installed a release that changed it; the lines say how, including changes to how far a run goes. | None. It clears at the next update. |
chains/<file>.yaml is a full copy and hides kraft-default:<id> | A home seeded before the built-in keeps its own copy, which Kraft never rewrites. | See Move onto kraft-default. |
kraft-default@<collection>: Kraft now ships kraft-default itself; ... | An add-on copy installed from GitHub on 2.5 is left out in favour of the built-in. | Run kraft admin addon update kraft-superpowers@kraft-sdlc, then kraft admin addon uninstall kraft-default@kraft-sdlc. See If you installed kraft-default from GitHub. |
harnesses.yaml lacks <names>; using the packaged ones | Your file lacks a harness or profile kraft-default needs, and Kraft supplies it from the package. | None needed; define the name in harnesses.yaml to change it. See Names from the package. |
repository id kraft-default is kraft-default's namespace; rename it | A repos.yaml entry uses the reserved ID. | Rename the repository. |
maxima: clamps kraft-default task(s): ... | policy.yaml's maxima: is below some built-in tasks' caps. They run clamped; the add-on stays. | Raise maxima:, or accept the clamp. |
The board shows the same lines in a banner, "Kraft's own chains need attention", and the webhook and a hidden browser tab are told once for each new state, so you need not run doctor to see it. Hide until it changes hides the banner in that browser. The banner never makes /api/health degraded.
Pin or roll back a version
kraft admin update only installs the newest release on a channel; it can't
target a version. Install a specific version with the package manager instead.
To go back to an earlier 2.x release, pin it, as below, then follow Roll back to an earlier 2.x release. To go back to 1.4, see Roll back to 1.4.
Pin a version
- uv or script install. Name the version, and the Python you run Kraft on
(
"$(uv tool dir)/kraft-sdlc/bin/python" -Vprints it):uv tool install --force --python 3.X "kraft-sdlc==X.Y.Z"
Without--python, uv moves Kraft to its default Python. Add the extra if you use vector search:"kraft-sdlc[vector]==X.Y.Z". To stay on that version, don't runkraft admin update; it moves you to the newest release again. - Homebrew. The tap has one formula, which each release rewrites to the
newest version, so Homebrew can't install an older one.
brew pin kraftstopsbrew upgrade, and with itkraft admin update, from moving the version you have. To go back to an older release,brew uninstall kraftand install that version with uv.
Add vector search
Search works out of the box as full-text search. To add vector (semantic) search
to a uv or script install, reinstall the version you run, on the Python it runs
on, with the vector extra. It downloads a model of about 130 MB on the first
search.
uv tool install --force --python 3.X "kraft-sdlc[vector]==X.Y.Z"
Name both the Python and the version. Without the version, uv installs the
newest final release, which on a release candidate is an older Kraft that
refuses to start on its database. Without --python, uv rebuilds Kraft on its
own default Python. kraft --version prints kraft X.Y.Z.
kraft admin doctor's embeddings row prints this command filled in for your
install. On a pipx or pip install it prints that installer's command instead;
the Homebrew formula doesn't ship the vector extra.
If the model can't be downloaded (offline, or a proxy refuses Hugging Face),
search keeps working as full-text search and says so in a note. A search
that asks for mode=vector answers 422 with the reason. kraft admin doctor
fails its embeddings row, and /api/health reports the model's state as
failing.
A failed download is remembered for five minutes, so neither a search nor an approval retries it on every call. Approving a gate doesn't wait for the model: the gate's document is indexed just after the approval answers.
On Python 3.15 the vector extra doesn't install yet, on any machine:
onnxruntime has no build for 3.15. A plain uv tool install picks the
newest Python installed: if that's 3.15, install Kraft with --python 3.14.
On an Intel Mac, or on Apple Silicon before macOS 14, the vector extra
installs only on Python 3.12 or 3.13: on 3.14 the package that runs the model,
onnxruntime, has no build for those Macs, and the install fails to resolve.
Install Kraft with --python 3.13 there. A plain uv tool install or
install.sh can pick 3.14 when the machine has no Python 3.12 or newer.
Next steps
- Back up and restore the database: take the backup, and find the copy to roll back to.
- Move onto kraft-default: move an older home's full copies of the chains onto the built-in.
- update.yaml: the switches and allowed hours for updating when Kraft is free.
- Run Kraft as a service: update and restart a service.
- Troubleshooting: when an item stops after an upgrade.
Run Kraft as a service
Start Kraft at login and restart it if it exits, set its environment, stop or remove the service, and run a second instance beside the first.
Move onto kraft-default
Replace the full copies of Kraft's chains in your config with thin chains that extend the built-in kraft-default, so each upgrade brings you its changes and your edits stay.