Upgrading to threads
This page is for an operator who runs the previous version of Yak, where each task was one Claude CLI run in a fresh sandbox, and wants to move to the version built on threads. A fresh install does not need it: see Setup.
What Changes for Users
Section titled “What Changes for Users”- Work happens in threads: one sandbox, one Claude session and one Claude account that stay with a conversation across turns. Channels still create tasks, and each task runs as a turn in a thread. See Concepts.
- Everyone runs on a Claude account (a setup token or an API key) instead of the shared login on the server.
- People can teleport a thread to their own computer, use the
yakCLI, and connect over SSH or the browser terminal. - Threads have previews, can split into sub-threads, can span several repositories and can notify people by push.
- Repository settings that lived in the database move into
.yak/files in each repository. See Repository config.
What Changes on the Host
Section titled “What Changes on the Host”| Area | Change |
|---|---|
| Queue | Workers read Redis only (QUEUE_CONNECTION=redis). A new yak-redis container holds the queues. |
| New host services | yak-broker (with the auth proxy), yak-jump-sshd, yak-wake, yak-termbridge. |
| New container programs | yak-thread-drivers, yak-credential-socket, reverb. |
| New queues | yak-render, yak-deployments, yak-poll join yak-claude and default. yak-claude jobs now time out after 3600s. |
| Sandboxes | One sandbox per thread, named yak-thread-<id>, stopped and destroyed by timers. The sandbox network gets an ACL and the sandbox base image is rebuilt (yak_sandbox_base_version 5). |
| Claude login | The shared claude login session is no longer used by threads. |
| Firewall | Port 2222 opens for the SSH jump host. |
| Build tools | The machine that runs Ansible needs Go 1.26+ and Node.js. |
| Telemetry | A yak-telemetryd container holds System page metrics. |
Operations describes each part.
New Required Vault Variables
Section titled “New Required Vault Variables”The playbook stops before it changes anything if these are missing. Generate each as shown in Setup.
| Variable | Generate with |
|---|---|
redis_password | openssl rand -hex 32 |
telemetryd_ingest_token, telemetryd_query_token | openssl rand -hex 32 each |
yak_session_store_key | openssl rand -base64 32 (never change it afterwards) |
reverb_app_id, reverb_app_key, reverb_app_secret | random strings |
yak_ssh_internal_token | openssl rand -hex 32 |
Keep yak_app_key as it is. The old database holds values encrypted with it. The playbook reads /etc/yak/app_key from the server if the vault value is blank.
Upgrade Steps
Section titled “Upgrade Steps”Do these in order. Pick a quiet time: the container is recreated.
-
Back up the MariaDB database and
/home/yak/data. The migrations add tables and columns and drop therisk_profilestable, so a dump is the only way back for that table. See Backups. -
Install Go 1.26+ and Node.js on the machine that runs Ansible.
-
git pullthe release, add the new variables to the vault. -
Run the full playbook:
ansible-playbook ansible/playbook.yml. Do not use--tags yak-containerfor this first run, because the broker, SSH and sandbox network roles are not in that tag. In order, the playbook:- rebuilds the sandbox base image, adds the sandbox ACL and the firewall rules;
- starts Redis, the broker and telemetryd;
- drains running work (
yak:drain), recreates the container (the entrypoint runsphp artisan migrate --force), and runsyak:resume; - runs
yak:queue:move-database-jobsto move jobs left in the oldjobstable onto Redis, thenyak:resume-interrupted-tasksto requeue tasks the drain failed; - installs the SSH services.
-
Mark old previews as gone. Branch deployments whose containers no longer exist must not show as running. The playbook does not run this, so you do:
Terminal window docker exec -u www-data yak php artisan yak:mark-deployments-gone --dry-rundocker exec -u www-data yak php artisan yak:mark-deployments-goneIt needs the
incuscommand on the host. Marked previews rebuild on demand. -
Sign in and add the first Claude account. The migration makes the person with the lowest user id an admin, unless
YAK_SYSTEM_ACCOUNT_ADMIN_IDSis set. Admins add more admins under Settings > People. Without a usable account a new task cannot start a thread, so tasks resumed in step 4 fail until you do this. After adding the account, retry them from the dashboard. Steps: Setup, First sign-in. -
Ask each person to add their own account under Settings > Claude accounts, or let them use the shared Yak account.
-
Move repository settings into the repositories. This opens one pull request per active repository and does not change anything else. Merge them, then check each repository:
Terminal window docker exec -u www-data yak php artisan yak:migrate-config --dry-rundocker exec -u www-data yak php artisan yak:migrate-configUse
--repo=<slug>for one repository. A repository that already has.yak/files is skipped. The pull request no longer writes a risk profile; concerns come from a file you draft in step 9. -
Convert any
.yak/risk-profile.ymlto the concerns format (version: 2). Yak no longer reads the older format (version: 1) or therisk_profilesdatabase table, which the migrations drop. A repository whose file is stillversion: 1counts as invalid: with the co-owner gate onenforce, every change is held, and risk-based approvals approve nothing. Open the repository’s Approvals page and use Draft concerns to get a pull request with a version 2 file, then merge it. Details: Repository config. -
Repository templates built on an older base image are out of date. Re-run setup for a repository (
yak:setup-repo <slug>or Run setup again in its Sandbox section) if its first thread reports a stale or missing template. -
If you used the shared login before, you can stop running
yak-claude-login. The System rows “Claude CLI” and “Claude Max Session” still probe it and may stay red. Threads do not depend on them.
Tasks in flight
Section titled “Tasks in flight”yak:drain waits for tasks in Running or Retrying (up to yak_drain_max_wait_seconds, 2700 by default) and force-fails what is left. yak:resume-interrupted-tasks requeues those tasks, at most three times each. Tasks awaiting CI or a clarification are left alone and continue under the new version. Jobs left in the database queue move to Redis in step 4, so none are lost or run twice.
Rollback
Section titled “Rollback”The old agent path is gone, so a rollback is a redeploy of the previous image, not a switch.
- The new migrations add tables and columns and drop the
risk_profilestable. The previous version expects that table, so roll back that one migration first (php artisan migrate:rollback --path=database/migrations/2026_12_04_125837_drop_risk_profiles_table.phpin the new image) or restore the dump from step 1. - Check out the previous release and redeploy its image with its own playbook:
ansible-playbook ansible/playbook.yml --tags yak-container -e yak_image_tag=<previous sha>. Use the vault and roles of that release, since the old image expects the database queue. - Jobs queued on Redis while the new version ran stay in Redis and do not run on the old version. Let the queues empty before you roll back.
- Threads and their session data stay in the database, unused by the old version.
If the database itself is damaged, restore the dump from step 1.
Checklist
Section titled “Checklist”https://yak.example.com/healthshows Queue Worker, Redis, Incus Daemon and Sandbox Base Template green.systemctl is-active yak-broker yak-wake yak-termbridge yak-jump-sshdprintsactivefour times.docker exec yak pgrep -fa 'yak:thread-drivers|yak:credential-socket|reverb:start'lists all three.jobsis empty:docker exec yak-mariadb mariadb -uroot -p -e 'select count(*) from yak.jobs'prints 0.yak:mark-deployments-gone --dry-runreports a total of 0.- A new thread on a test repository streams output and ends in a PR.
- A message sent to an existing thread from the dashboard starts a new turn.
yak sshto a thread connects through port 2222.- Each repository has a merged
.yak/pull request.