---
title: Upgrade weft
description: What broke in each weft release before 1.0 and what to write instead, how the apidiff gate decides what may break, the thread 0.9.0 migration checklist, and how to read the CHANGELOG.
url: https://weftgo.dev/docs/production/upgrading/
type: how-to
sources:
  - 'W11-fix3, v0.20.2: weft/studio/pricing.go:885-960 (tally: a session''s or an experiment''s reason drops yet when every unknown part is a derived run with no usage); weft/studio/api.go:2364-2391 (numberDerivedTurns: by start order, after the thread''s highest)'
  - 'weft/CHANGELOG.md:9-19 (## 0.20.2 — 2026-10-27: ### Fixed only, six entries: save as test without tools, the runs list, the derived page, the waterfall, the sessions list and Agents bars, the panel; no Breaking, no Upgrade notes)'
  - 'weft/CHANGELOG.md:20-30 (## 0.20.1 — 2026-10-27: ### Fixed only, six Studio and devtools panel entries; no Breaking, no Upgrade notes)'
  - weft/CHANGELOG.md:71-87 (0.20.0 Breaking), 91-94 (0.20.0 Upgrade notes) at v0.20.2
  - 'weft/CHANGELOG.md:102 (## 0.19.0 — 2026-10-26), 152-164 (#### Breaking: weft/otel''s explicit Local, weft mcp''s compact rows, the cross-agent refusal, the engine default, the aligned diff, differs, save as test''s chain, weft export --wefttest''s tree, CommandStore.DeleteRuntime, the replay as the same turn, the error''s source ordinal), 142-143 (Changed: the scripted refusals'' and the scripted miss''s sentences), 166-169 (### Upgrade notes: schema 0025 / 0028, the manifest hash), 174 (Fixed: the manifest hash after the WrapModel chain)'
  - weft/studio/playground.go (checkTargetNamed, crossAgentMsg, the engine "" and live alike); weft/studio/diff.go (diffAlign, diffRow, diffSummary.kept, maxForkDepth 8); weft/studio/fixtures.go (keptPrefixHeader Weft-Kept-Prefix); weft/cmd/weft/api.go (--wefttest, --fixtures-only, --test, --force); weft/obsdb/commands.go:68-73 (DeleteRuntime); weft/runtime/executor.go (keptSteps; the source's step ordinal error); weft/runtime/options.go:300-312 (no link beside a Local-only pipeline); weft/otel/options.go (Local, NoDiscovery)
  - weft/CHANGELOG.md:1-7 (Keep a Changelog, pre-1.0, one tag plus a core tag per release since 0.9.0)
  - weft/CHANGELOG.md:244-254 (0.18.0 breaking)
  - weft/CHANGELOG.md:305-307, 323-325 (0.17.0 breaking), 387-396 (0.16.0), 1218-1233 (0.14.0 Changed — breaking), 1920 (0.13.0), 2361-2397 (0.12.0 breaking and migration), 2584-2602 (0.11.0), 2630-2687 (0.10.0), 3112-3140 (0.9.0), 3191-3203 (0.8.0 preamble), 3295, 3330, 3388, 3392, 3497, 3500 (0.8.0 breaking), 3888-4005 (thread 0.9.0 migration checklist), 4660-4664 (studio 0.3.0 Removed), 4702 (store removed), 6534 (0.2.0 Replay retracted)
  - weft/MIGRATION-0.9.md (the go.mod rules, the checklist, the optional core rewrite)
  - weft/README.md:1066-1077 (API stability is enforced)
  - weft/scripts/apidiff.sh:1-60 (enforce, report, skip; fail closed; APIDIFF_STRICT), 70-80 (policy_of), 205-230 (REPORTED, INCOMPATIBLE)
  - 'weft/core/.apidiff-allow (no entries at v0.20.2; Reset at v0.7.0: ReplayPolicy, Replay, ReplaySafe, ReplayNever)'
  - weft/AGENTS.md:752-777 (Working in this repo, the apidiff paragraph)
  - weft/docs/adr/0027-framework-module-and-core.md (one framework module, core, the facades, two tags)
  - weft/docs/adr/0024-observability-data.md:46-66 (store deleted, no data migrates), 300-310 (the obsdb schema and the attribute names are the contract)
  - 'weft/docs/thread-operations.md (upgrade notes: format versions, ErrNewerFormat)'
  - weft/obsdb/sqlite/migrations.go:81-101 (ErrNewerSchema); weft/obsdb/clickhouse/migrations.go:222
  - 'weft/CHANGELOG.md:613-625 (0.15.0: stable runtime ids, studio/runtime New(opts...), cancel 409 to 403), 3984 (a resumed child queues for a slot), 3989-3993 (Fork: when given none, mirrored requests)'
  - weft/core/observe.go:917-945 (execute_tool error.type values)
  - weft/docs/thread-operations.md:9-12 (not a compatibility promise)
  - weft/otel/pipeline.go:218 (Start takes ctx)
  - weft/CHANGELOG.md:311 (0.17.0 views waterfall, story, raw; keys; e gone; ?scale= replaces ?axis=), 312 (selection keys s<step>:m, c:resume:<call>; old ?sel= forms resolve)
  - 'weft/studio/web/src/lib/links.ts:33-36 (RunView), 74-84 (sel keys, axis read never written); weft/studio/web/src/routes/runs.$id.tsx:206-213 (scaleOf: events is order), 238-240 (scale from axis), 1193-1196 (keys r, l, s, w)'
  - 'weft/CHANGELOG.md:420-470 (0.15.1 Changed: empty metadata value, session identity keys, sessions?public_id= scoped)'
  - weft/core/metadata.go:30-36 (an empty value means none); weft/thread/turn.go:1357-1444 (runMetadata stamps "" for every session-owned key it has no value for); weft/thread/identity_nested_test.go:41 (TestNestedSessionRunCarriesNoEnclosingPublicID)
  - 'weft/CHANGELOG.md:1187-1202 (0.14.0 Changed: Sweep passes, experiments 50, scope.Header page_url); weft/obsdb/db.go:143, 1000 (SweepBatch); weft/studio/experiments.go:189; weft/scope/scope.go:40, 67-70, 228-237'
  - weft/CHANGELOG.md:1711-1720 (0.13.0 params laid over the agent's), 1817-1819 (tool_choice auto); weft/core/run.go:919-922; weft/runtime/executor.go:1503
  - 'weft/CHANGELOG.md:2536-2542 (stable dev token, --rotate-token), 2572-2580 (0.11.0: not printed); weft/cmd/weft/token.go:17-29 (the stable token signs panel tokens); weft/studio/auth.go:169-182 (signPanelToken with the token as key)'
  - 'weft/CHANGELOG.md:2706-2712 (0.10.0: system prompt and catalog reach content-on destinations)'
---

# Upgrade weft

Before 1.0, weft breaks its API on purpose and says so: every breaking change is a line in [the CHANGELOG](https://github.com/weftgo/weft/blob/v0.20.2/CHANGELOG.md) under the release that made it. Breaking changes usually ship without a deprecation shim; where an old form is still read, the entry says so. The loop (`github.com/weftgo/weft/core`, which the root `weft` package aliases) is held to additive change by a CI gate; `thread`, `obsdb`, `otel`, `runtime` and `studio` may break in a minor release. To upgrade, read every breaking entry between your version and the new one, change what it names, and upgrade every process that opens a shared database together.

```sh
go get github.com/weftgo/weft@v0.20.2
go mod tidy
go build ./... && go vet ./...
```

The compiler finds renamed and re-signed Go names. The rest of this page is what it does not find: changed wire values, routes, records, CLI output and behaviour.

## API stability

CI runs `scripts/apidiff.sh` over both modules, each against its own last tag:

| Module | Policy | What an incompatible change does |
|---|---|---|
| `github.com/weftgo/weft/core` | enforce | Fails the build, unless apidiff's exact line is listed in `core/.apidiff-allow` with a reviewed justification |
| `github.com/weftgo/weft` (the framework) | report | Prints `REPORTED (not fatal, … is pre-freeze)`; the next tag is then a minor bump with a breaking CHANGELOG entry, not a patch |
| `examples/*` | skip | Never tagged |

What this means for you:

- **Code against `core`, and against the root `weft` package (a facade over it), keeps compiling across minor releases.** The gate fails the build only for `core`; the rest of the `weft` module is report-only. A `core` change apidiff flags but that is source-compatible (a return type widened to a superset interface, a trailing variadic added) passes only when its exact line is in the allow file, which is emptied at each tag; at v0.20.2 it lists nothing. By policy, renaming or removing an exported name in `core` is never allowed.
- **The root package is a generated facade over `core`**: `weft.Agent` is `core.Agent`. The gate reports the facade's changes with the framework module, but each one mirrors a `core` change that passed the enforced gate.
- **`thread`, `obsdb`, `otel`, `runtime` and `studio` are pre-freeze** (ADR 0024's programme; `thread` is not frozen yet). Their breaking changes ship in minor releases. For `thread`, each one also adds a line to the CHANGELOG's migration checklist saying what to write instead.
- **Data contracts are versioned separately.** The `obsdb` schema migrates itself at `Open` and refuses a newer one with [`sqlite.ErrNewerSchema`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/obsdb/sqlite#ErrNewerSchema) or [`clickhouse.ErrNewerSchema`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/obsdb/clickhouse#ErrNewerSchema) ([Migrations](https://weftgo.dev/docs/production/storage-backends/#migrations)). `thread`'s format today reads every older file (pinned by the format goldens) and fails loudly on newer data; before 1.0 that is practice, not a compatibility promise ([Upgrade weft, for sessions](https://weftgo.dev/docs/sessions/operations/#upgrade-weft)).

The gate fails closed: a tree that does not compile, or an apidiff run that writes no report, never reads as "no incompatible changes". A module added to `go.work` without a policy fails the gate until it gets one.

## Read the release history

The CHANGELOG lists releases newest first, in Keep a Changelog's form. Since 0.9.0 a release is two tags in order: `core/vX.Y.Z` first, then the framework's `vX.Y.Z` tidied against it (ADR 0027). Before 0.9.0 each module was tagged on its own, so older headings name modules: `## thread 0.9.0 / thread/sqlite 0.3.0`, `## obsdb 0.1.1 / obsdb/clickhouse 0.1.1 / …`, and 0.8.0 and 0.7.0 have a subsection per module.

Where the breaking entries sit:

- `### Changed — breaking` (0.9.0 to 0.14.0), with `### Changed — migration` in 0.12.0.
- `#### Breaking` under `### Changed` (0.16.0 to 0.18.0), each item tagged **Breaking (record)**, **(API)**, **(API values)**, **(Go)**, **(CLI)**, **(reader)** or **(UI links)** by what it breaks. From 0.19.0 each item reads **Breaking:** followed by the area it changes (`weft/otel`, `studio`, `runtime`, …). Since 0.18.0 a `### Upgrade notes` section says what the first start on the new version does to your data.
- `(breaking)` in a module's heading (0.8.0's `obsdb/clickhouse 0.2.0 (breaking)`, `otel 0.2.0`, `studio 0.4.0`, `runtime 0.2.0`), with the breaking items listed first.
- `### Changed (breaking) — the migration checklist` for `thread` 0.9.0.

<span id="history-0-2-0"></span>

Some entries are history, not instructions. In 0.2.0, `Replay`/`ReplayPolicy` and the manifest's `replay` key were retracted until a checkpoint store existed; they returned in 0.7.0 as `weft.Replay`, `ReplaySafe` and `ReplayNever`, the side-effect class the playground reads.

## Breaking changes

Each row is an entry of a release's breaking or migration section (0.12.0's last five rows are from its `### Changed — migration`), or one marked (Changed), (Fixed) or (Added) that is worth acting on: what changed, and what to write instead. Go changes the compiler reports are marked (Go).

### 0.20.2

No Breaking and no Upgrade notes: 0.20.2 is a fix release. Move `go get github.com/weftgo/weft@v0.20.2` (it requires `weft/core` v0.20.2) and rebuild a self-built `@weftgo/devtools` package; no API, record, route or schema changes. Its `### Fixed`:

- Save as test (and `weft export --wefttest`) on a run that offered no tools writes a test that compiles: it no longer declares a tool-result handler it never uses (`declared and not used: answer`).
- The runs list fits its frame from 1280 to 1800 px: a run that delegated shows its subagents' tokens on a second line, a token pair breaks only at its dot, the agent column holds a longer name, the run column steps its width, and the refresh button stays at the end of the first row.
- A derived run's fix says what to set without a repository path, and its waterfall starts under the view's controls, the layout toggle ending that row.
- The waterfall keeps a duration on one line ("21.3 ms"), shows a span's whole name when its row has room, and keeps an attempt's name beside its error chip.
- The sessions list breaks "awaiting a decision · 1 call" and "1 exchange · 2 turns" only at their dot, and its find box shows "find title, prompt, id" whole; the Agents page's bars end at one place.
- The panel's header shows each figure whole or not at all; the narrow dock's run picker puts the status, steps and duration before the title; a running turn's duration reads "…"; a parked call's arguments read on one line; the decision field's placeholder is "result or deny reason", shown whole.

### 0.20.1

No Breaking and no Upgrade notes: 0.20.1 is a UI patch. Move `go get github.com/weftgo/weft@v0.20.1` (it requires `weft/core` v0.20.1) and rebuild a self-built `@weftgo/devtools` package; no API, record, route or schema changes. Its `### Fixed`, in Studio and the devtools panel:

- The run page's waterfall draws only the time-axis ticks its track's width holds; a derived run's root row counts its steps as its header does ("2 steps", it read "0 steps"); an attempt's error chip (`model_error`, `stream_idle`) stays whole beside its name.
- The runs list and the sessions list fit a 1280 px window with the sidebar open: the runs list's model column shows from 1536 px, and its status, tokens and cost wrap.
- `/agents?agent=<name>` keeps the named card in view while the numbers above it load. The Agents page says a registration time as relative, the full stamp on hover; its proposed-prompt pointer reads "to keep it, copy it into the agent's weft.Instructions(…) in your code".
- A plain Go error a tool layer hid (`mw.MapErrors` over an `errors.New` value) reads `INTERNAL ← plain error`, not `INTERNAL ← *errors.errorString`, and an `errors.Join` or two-`%w` error reads `joined errors`; the recorded `weft.tool.error_masked` is unchanged and stays on the hover.
- The call graph sizes its nodes and column gaps to their words: an edge label no longer prints over a node, and a node grows to 420 px at most, a longer name cut with an ellipsis and whole on hover.
- The panel: a page of runs' header reads `batch <id> · N runs` at every dock width, the count in the title; the Timeline axis names its two ends; "has error" is a normal checkbox on its label's line; the replay drawer's engine options no longer wrap into two overlapping columns in a 640 px dock; a parked call's "result to resolve with" field is 25 characters wide instead of squeezed.

### 0.20.0

Every row of 0.20.0's `#### Breaking` and `### Upgrade notes`. 0.20.0 records the middleware onion and an MCP server's identity, scopes the devtools panel to a batch of runs by tags, and gives Studio and the panel one vocabulary ([The onion in the record](https://weftgo.dev/docs/guides/middleware/#the-onion-in-the-record), [MCP identity](https://weftgo.dev/docs/guides/mcp/#mcp-identity), [Scope the panel](https://weftgo.dev/docs/observe/devtools/scope/)).

| What changed | What to write instead |
|---|---|
| (manifest) `weft.manifest.hash` changes for four kinds of agent. One with a tool defined outside weft: a tool's `source` is the import-path form, `github.com/x/app/tools.go:12` (was `tools.go:12`). One with model or tool middleware or hooks, which the manifest now lists. One with an `Output` (`submit_output`'s `output_type`), or with `Params` (the manifest's `params`). Middleware names no longer depend on inlining: weft's own read `mw.Allow`, a named function its name, a closure `func@<dir>/<file>:<line>` | Regenerate `weft.json` (`go test ./... -update`). A run recorded before 0.20.0 keeps its hash and reads "stale" against the new manifest; `weft doctor`'s `manifest` line reads current again once the agent runs on 0.20.0 ([The manifest](https://weftgo.dev/docs/guides/manifest/)) |
| (records, `weft/mcp`) A tool imported under `mcp.Server(name)` records `source` `mcp:<name>` in the tools record, and `weft.tool.origin` on its spans | Match the `mcp` prefix, not the literal `mcp`; without `mcp.Server` the source is still `mcp` |
| (records, `weft/mcp`) A JSON-RPC error answer from a live server (its handler failed, the tool is not listed) is `error.type` `mcp_rpc_error`, no longer `mcp_transport` | `mcp_transport` now means no answer only; read the three kinds ([Use MCP](https://weftgo.dev/docs/guides/mcp/)) |
| (records) A failed `attempt` span's `error.type` is classified: `rate_limit`, `overloaded`, `timeout`, `auth`, `server_error`, `context_overflow`, weft's own failures, else `model_error`. It read `model_error` for every provider failure. `weft.attempt.layer` gains `retry` | Match the classes. A reader that took any non-empty `weft.attempt.layer` for a fallback compares with `fallback` ([Report attempts](https://weftgo.dev/docs/guides/retries-and-fallback/#report-attempts)) |
| (panel) The Timeline tab is the **waterfall** tab: its id is `waterfall` (`#weft-tab-waterfall`, the stored layout's `tab`, `weft_step=<n>.<tab>` links); a stored `tab: "timeline"` opens the story tab | Write `waterfall` in links and selectors ([Read runs in the panel](https://weftgo.dev/docs/observe/devtools/reading-runs/)) |
| (API values) `delegated_cost_reason` says "child runs": `1 of 3 child runs unpriced: …`, `1 of 3 child runs' cost not known yet (…)`, `N of M child runs carry another public id, or none: …` | Match "child runs" (was "subagent runs") |
| (API values) The `hidden` hole's reason reads `your token's access does not reach this: a read-only panel token reads no system prompt or tool catalog`, its fix `use a playground token`. The `no_public_id` reason and the app-owned 403 say "session", and a parked plain `Generate`'s fix reads `resume it in your app; …` | Match the new sentences |
| (API values) A session's or an experiment's unknown cost reason drops "yet", `N of M turns' cost not known (…)`, when every unknown part is a derived run that reported no usage. `GET /api/sessions/{id}` numbers a session's derived top-level turns 1..n in `runs[].turn`, by start order, after the thread's highest turn (was 0 for each) | Read `turn` as a display number on derived sessions ([Browse sessions](https://weftgo.dev/docs/observe/studio/sessions-and-traces/)) |
| (Go, `weft/scope`, `obsdb`) `scope.Scope` (now holding `Tags`), `obsdb.TraceQuery`, `obsdb.TreeQuery` and `obsdb.TreeRun` are no longer comparable with `==`. `scope.Parse` reads a first segment that is one of the form's keys (`session=…`, `tag.<k>=<v>`) as that key, not as a public id | Use [`Scope.Equal`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.0/scope#Scope.Equal); compare the queries field by field |
| (Go, `obsdb`) `SessionQuery.Meta` scopes turns before the grouping, as `SessionQuery.PublicID` does: a session whose turns carry the tags only partly is listed, counted and summed from the tagged turns alone. `/api/sessions?tag.<k>=<v>` follows | Expect partial sessions under a tag filter |
| (API) A read-scoped panel token is served stock spans without their system prompt (`gen_ai.system_instructions`, system-role messages, plain `gen_ai.prompt`, the system message events) | A page that needs them mints a playground token ([Secure the devtools panel](https://weftgo.dev/docs/observe/devtools/security/)) |
| (API) `POST /api/panel-tokens` refuses a body field it does not know: `{"scope":"playground"}` is a 400 naming the fields | Send `"playground": true` |
| (CLI) One Studio per SQLite file: `weft studio` and `weft dev` take `<db>.lock`, and a second `weft studio` on the file is refused with exit 1 (it said `…, reusing` and exited 0) | Sign in to the running one with `weft open --with-token`, or stop it first ([One Studio per database](https://weftgo.dev/docs/reference/cli/#one-studio-per-database)) |
| (CLI) The API clients' `--url` default is the resolver's (the discovery file before 7331), no longer `$WEFT_STUDIO_URL` else 7331; `weft runs`' table columns changed | Scripts read `weft runs --json`, which is unchanged ([The weft command](https://weftgo.dev/docs/observe/cli/)) |
| (CLI) `weft doctor`'s manifest check is labelled `manifest` (was `weft.json`), its source the first words | Match `manifest` |
| (CLI) `weft mcp`'s `events` tool renames the route's `done` to `run_terminal`: the run ended, which is not the last page | Read `run_terminal`, and follow `next_after` for more pages ([Let Claude Code read your runs](https://weftgo.dev/docs/observe/weft-mcp/)) |
| (API) With a `runtime.Sessions` runtime connected, a cancel on the app's own turn is 409 `cancel is not supported on an app turn: …`, and a steer on an app turn that runs nothing is 409 (`no running turn to steer: …`), no longer 202 then failed | Handle the 409; without such a runtime the three verbs still answer 403 "app-owned turn" |
| (Upgrade notes) The SQLite file moves to schema 0026 and a ClickHouse database to 0033 on first open; a 0.19.x binary refuses it with `ErrNewerSchema`. SQLite 0026 and ClickHouse 0031 re-derive the stock GenAI traces the new derived-run rule changes, once, and `Open` waits for it (about 1 s per 10,000 traces) | Keep a copy if you may go back, upgrade every process that opens the database together, and open a store with many stock traces with `weft studio` once before pointing a running app at it ([The 0.20 re-derive](https://weftgo.dev/docs/production/storage-backends/#the-020-re-derive)) |
| (Upgrade notes) `<db>.lock` beside a SQLite file stays on disk after exit; a symlink, directory, other non-regular file or (unix) hard link at that path is refused at start | Leave the lock file in place; remove a planted one to start |
| (Upgrade notes) Breakpoints set with a surface are stored as a JSON object in the same column: a 0.19.x Studio opened on that store reads no set for that runtime | The runtime's registration re-delivers its own set |

### 0.19.0

Every row of 0.19.0's `#### Breaking` and `### Upgrade notes`, and two (Changed) entries whose text a caller may match. 0.19.0 makes the playground's replays the same turn as their source and lines the compare up on it ([Replay a run from any step](https://weftgo.dev/docs/observe/playground/replay/), [Compare runs step by step](https://weftgo.dev/docs/observe/studio/compare/)).

| What changed | What to write instead |
|---|---|
| (Go, `weft/otel`) An explicit `otel.Local(...)` switches the discovery file off, as an explicit `otel.Studio` does: a pipeline that names its store writes only to the stores it names and the environment's (`WEFT_STUDIO_URL`, `OTEL_*`), never into a running `weft studio` or `weft dev` it found on disk. A Local-only pipeline used to join that Studio too and write every run twice. `otel.Install()` with no destination still joins | To write to both, name the Studio as well, `otel.Install(otel.Local(path), otel.Studio(url, token))`, or set `WEFT_STUDIO_URL`. An `otel.OTLP`, `Datadog`, `Langfuse` or `Exporters` destination does not switch the read off: add [`otel.NoDiscovery()`](https://pkg.go.dev/github.com/weftgo/weft@v0.19.0/otel#NoDiscovery) to keep a test out of a running Studio ([The discovery file](https://weftgo.dev/docs/observe/weft-dev/#the-discovery-file)) |
| (Go, `weft/runtime`) `runtime.Install` beside an installed pipeline with a Local store and no Studio skips the discovery file, opens no link and logs one WARN (`weft/runtime: the pipeline records only into a Local store … no link opened`). It used to register with the discovered Studio, which could then start runs whose spans never reached it | Setup A dials its embedded Studio with `runtime.Local(srv)`; a running Studio takes `runtime.Studio(url, tok)` beside `otel.Studio(url, tok)`. A pipeline started with `otel.NoGlobal()` is not installed, so the rule does not see it: name the Studio there too |
| (CLI) `weft mcp`'s list tools (`runs`, `search`, `sessions`, `session`, `live`) answer compact rows. Empty fields and the run row's trace id, hashes, record counts and `meta` are left out. `model` reads `provider/name`, `err` is cut to 200 characters, and every cost reason in one top-level `cost_reasons` list, a session's `outcomes` strip as `outcome_counts` and its turns cut against `turn_defaults` | Read the compact fields, or pass `full: true` for the route's JSON as served; the `run` tool still answers one run's row whole ([Compact rows](https://weftgo.dev/docs/observe/weft-mcp/#compact-rows)) |
| (API) `POST /api/playground/runs` refuses a source run recorded by another agent than the command's target, 400 `source run <id> is agent <recorded>; this command targets agent <target>: …`, and a command that names no agent, 400 `a run needs an agent: …`. In 0.18.3 a replay ran the target's prompt and tools over the source's transcript silently | Send `agent` with every command, equal to the source's recorded agent; send `"cross_agent": true` to replay it as another agent on purpose ([The target check](https://weftgo.dev/docs/observe/playground/replay/#the-target-check)) |
| (UI links) A playground form, link or saved experiment without an engine no longer means live: it means the command's own choice, scripted when it can answer, else live. A saved experiment's engine, live included, is kept as a pick | Put `engine=live` in a link that must call the model. Over the API, a body without `engine` still runs live ([Choose the engine](https://weftgo.dev/docs/observe/playground/replay/#choose-the-engine)) |
| (API) `GET /api/diff` aligns two runs on the step ordinals of the nearest run both share, following each side's `weft.forked_from` chain (at most 8 links). A replay's steps line up with its source's from its `from_step`; the source's earlier steps are rows with `kept: true`; two replays of one run align on it, with `kept_by` naming the side that kept the shared run's step. In 0.18.3 an identical replay from step 1 read "changed at every step" | Key the rows as the shared run's ordinals. `step` is the aligned ordinal, and `a_step` and `b_step` each side's own (null where a side has no step; link to a run's step by its own). `kept` is the prefix the replay did not re-run, `aligned` `{replay, source, a_from, b_from}` and `summary.kept` the count of kept rows. Runs with no lineage align by their own ordinals, as before |
| (API) A usage that differs where a side billed no tokens (the scripted engine's 0 → 0) is no longer a change: `GET /api/diff` lists it in the row's new `differs`, not `changes` | Read `differs` beside `changes`; a scripted replay's usage is in `differs` by design |
| (API) Save as test on a replay composes its whole `forked_from` chain: the source's fixtures for every step the replay kept, then its own renumbered after them, so the generated test replays the turn from its start. A scripted replay's fixtures are stamped with the source's model. A source that is gone, derived, or did not record each kept step is a 409, never a partial test. An agentless run's test file is `run_replay_test.go` (package `run_test`), no longer `replay_replay_test.go` | Expect one test per turn; the export names the chain in its `Weft-Kept-Prefix` header (`<source>#<n>`). Rename any reference to `replay_replay_test.go` ([Turn a Studio run into a test](https://weftgo.dev/docs/testing/studio-runs-as-tests/)) |
| (CLI) `weft export <id> --wefttest <dir>` writes Studio's save-as-test tree into the package directory `<dir>`: `<agent>_replay_test.go` beside `testdata/TestReplay_<run>/*.json`, a test that passes under `go test`. It was the fixtures alone under `<dir>/<run id>/`. A test file or fixtures already there need `--force`; a symlinked `testdata` is refused before any write | Point `--wefttest` at the package directory. For the fixtures alone, add `--fixtures-only` (they land under `<dir>/<test>`, the run id by default); `--test <name>` is now refused without it |
| (Go) `obsdb.CommandStore` gains `DeleteRuntime(ctx, runtimeID)`: a runtime's row and its breakpoint set removed, its commands and routes kept (Studio's forget) | A third-party [`obsdb.CommandStore`](https://pkg.go.dev/github.com/weftgo/weft@v0.19.0/obsdb#CommandStore) adds it; the first-party backends have it ([Forget a runtime](https://weftgo.dev/docs/observe/playground/runtimes/#forget-a-runtime)) |
| (behaviour, `runtime`) A replay from step n > 0, live or scripted, is the same turn: it runs with [`weft.KeptSteps(n)`](https://pkg.go.dev/github.com/weftgo/weft@v0.19.0#KeptSteps), so the kept steps count toward the agent's `MaxSteps` and `DetectLoops`, and an unchanged replay of a turn a guard stopped stops the same way at the same step. A substitute chain's legs continue the turn too; its error "the substitute chain spent N steps, the agent's budget is N" is gone | Expect a replay from step n to make at most `MaxSteps` − n model calls, and match the chain's `max_steps` end instead of the removed error. A decision on a parked replay still resumes with a fresh budget ([A replay continues the turn](https://weftgo.dev/docs/observe/playground/replay/#a-replay-continues-the-turn)) |
| (API values, `runtime`) A replay's command error names the step in the source's ordinals and says so: `weft: run failed at step 3 (the source's step ordinal; this run's step 1): …` for a replay from step 2. It read `run failed at step 1: …` | Match the new form; the replayed run's own record keeps its own step numbering |
| (Changed, API values) Every scripted refusal is a sentence that says what differs and the two ways on. For example, `scripted cannot try a changed system prompt: … — run on live, or drop the prompt change` (was `scripted engine with an instructions override would silently replay the old answer (WEFT-PLAYGROUND §5.5)`) | Match the new sentences ([When scripted cannot answer](https://weftgo.dev/docs/observe/playground/replay/#when-scripted-cannot-answer)) |
| (Changed, API values) The scripted engine's miss reads `no recorded turn for step N (scripted engine, key …): <why> [<components>]; …`; it read `no recorded turn for this request (scripted engine, key …): the input changed since the recording, or the run is not scripted-replayable` | Match `no recorded turn for`, or read the command's `reason` (`{kind: "scripted_miss", step, components, message}`) |
| (Upgrade notes) The SQLite file moves to schema 0025 and a ClickHouse database to 0028 on first open; a 0.18.x binary refuses the migrated database with `ErrNewerSchema`. A large SQLite file's first open waits for the `span_stats` backfill, and `Open` logs the span count and the duration | Keep a copy of the database before you upgrade if you may go back, and upgrade every process that opens it together ([Migrations](https://weftgo.dev/docs/production/storage-backends/#migrations)) |
| (Upgrade notes) An agent behind a model middleware that does not forward `Info` gets a new `weft.manifest.hash`: the hash is now always sha256 of `weft.Manifest(agent)`, what `weft/runtime` registers | Nothing to change in code. Its runs on either side of the upgrade read as two builds ([The manifest hash](https://weftgo.dev/docs/guides/manifest/#the-manifest-hash)) |

### 0.18.0

| What changed | What to write instead |
|---|---|
| (record) Only a `core.Subagent` child carries `weft.parent.run.id` and `weft.parent.call.id`. Any other run started on a tool call's context (a `thread/pool` child session's turn, another agent's `Generate` in a handler, a run under a Subagent child's own tool call) carries `weft.caller.run.id` and `weft.caller.call.id` instead, a link, not parenthood. A run started inside a run's machinery (its model chain, `PrepareStep`, a tap, `OnRunEnd`) carries neither | Key pool children and nested `Generate`s on `weft.caller.*`. Studio reads both; records written before 0.18.0 keep their `weft.parent.*` link |
| (API) A caller-linked run has no `parent_run_id`: it is no longer in a run's `children`, `children_count`, `?tree=1` spans or `tree=1` export. `GET /api/sessions` groups a session over its own turns, so a pool child session is listed and counted in `total`, and `GET /api/sessions/{id}` answers it instead of 404 | Read caller-linked runs from the row's `caller_run_id` / `caller_call_id` and the run document's `caller_linked`. A client after top-level sessions only skips rows with a `parent_session` |
| (API) A session row's and document's `status` is its newest turn's outcome. Before 0.18.0 it read `failed` for a cancelled or busy-ended turn and `succeeded` for a parked one. `?status=` agrees for `succeeded`, `failed`, `running` and `interrupted`; `cancelled`, `ended`, `parked` and `resumed` are a 400 there | Read the outcome word, or the newest run's own `status` from `/api/runs?session=`; filter an open park with `awaiting=1` |
| (Go) `obsdb.SessionQuery` (`Parents`, `IDs`, `Meta`) and `obsdb.SessionRow` (`SummarizerModels`, `Outcomes`) are no longer comparable | Compare the fields you need instead of `==`, and key a map on `ID` |
| (record) A trace holds `chat` spans for `thread`'s summarizer calls, with `weft.chat.role` `summarizer` | Skip those spans when you sum `gen_ai.usage.*` over a run's `chat` spans as its model use, as obsdb and Studio do |
| (record) `weft.approval.actor` on a `Quorum(n > 1)` resume names every approver that counted toward the quorum, sorted, deduped and comma-joined; it was the last signer alone | Split it on `,` |
| (CLI) `weft mcp`'s run summary and `explain_failure` say "N calls awaiting a decision"; they said "pending approval" or "awaiting approval" | Match the new words, or read `pending` |
| (API) `GET /api/diff`'s side keeps its `hidden` hole's `count` beside a withheld prompt; at v0.17.0 a read token's hidden hole carried no count | Read the side's `system_hidden` for "the system prompt is hidden", not a count-less `hidden` hole |
| (UI links) `/sessions/$id` opens on the timeline | A link meant for the turns table adds `?view=table`, newest first; `&order=oldest` for the old order |
| (UI links) `?scale=graph` on `/runs/$id` opens the loop graph | A link meant for the agents' call graph adds `&level=agents` |

### 0.17.0

| What changed | What to write instead |
|---|---|
| `weft.override.params` on `invoke_agent` is the `Params` replacement by the request record's lower-case names (`{"temperature":0.4,"top_p":null}`), with `null` for each knob the agent set and the replacement leaves unset; it was the Go struct's JSON (`{"Temperature":0.4,…}`). A params override's `weft.override.hash` changes with it, and a named tool choice with no name reads `tool`, not `tool:` | Read the lower-case keys in queries and alerts on the attribute; do not compare hashes across 0.16.0 and 0.17.0 runs. Studio reads both shapes |
| `GET /api/runs?status=` takes only `running`, `succeeded`, `failed`, `interrupted`, `parked` and `cancelled`; any other word is a 400 naming them, as `/api/search` already was. In 0.16.0 an unknown word listed nothing, and `status=parked` was an empty 200 | Send one of the six words. `weft runs --status <word>` takes them too; another word exits 2 |
| Playground share links and drafts made before 0.17.0 (form v1, with the matrix's own "from step") are refused | Re-create them from the saved experiment ("clone into the form"); the step is now the source block's picker |
| (Changed, UI links) The run page's views are `waterfall` (the default, the run tree; it was `trace`), `story`, `raw` and the new `logs`. The keys are `w`, `s`, `r` and `l`; `e` is gone. "trace" now names only the `/traces` page | Press `w` for the run tree; links without `?view=` open it, `?view=story` and `?view=raw` are unchanged, and a `?view=trace` link opens the waterfall |
| (Changed, UI links) The run tree's switch is `?scale=time\|order\|graph`, which replaces `?axis=`; the `t` key steps it | Write `?scale=`. A pre-0.17.0 `?axis=time` or `?axis=events` link still reads, as `time` or `order` |
| (Changed, UI links) Selection keys are one scheme on the run page and the trace page: a chat span is `s<step>:m` (was `s<step>`), a denied call `c:resume:<call>` (was `c:<step>:<call>`), and the trace's root run is bare | Write the new keys in `?sel=`; the old forms (`t:<span id>`, a bare `c:<call id>`, a denied call's `c:<step>:<call>`) still resolve |

### 0.16.0

| What changed | What to write instead |
|---|---|
| An `execute_tool` span's `error.type` for a contained panic is `panic` (with `weft.panic.layer`), and for `weft/mcp` failures `mcp_transport` or `mcp_tool_error`; all three were `tool_error` | Key queries and alerts on `tool_error`, `panic`, `mcp_transport` and `mcp_tool_error`, and expect the other values `error.type` takes (`timeout`, a `ToolError` code, a context error name) |
| A tracer-only app's runs, and runs whose record tail a destination dropped, read `succeeded` or `failed` from their stored `invoke_agent` span, no longer `interrupted` | Expect `?status=interrupted`, `succeeded` and `failed` counts to move; `interrupted` now means a run that never ended |
| A weft run with spans and no stored record badges `not_recorded` (cause `no_logger`, or `gap`/`events_lost`), no longer `derived` | Treat `derived` as a stock-span run's badge only |
| (Go) `obsdb.DB` gains `CountLogs` | A third-party `obsdb.DB` adds it |
| (Go) `obsdb.PromptRecord` carries `Segments` (a slice) and is no longer comparable | Compare the fields you need; it is no longer a map key |
| The run row's `meta` no longer carries `weft.run.stopped_by` or `weft.cancel.cause` | Read the run row's `stopped_by` and `cancel_cause` |
| `cost_badge` gains `scripted` (an exact $0 for `wefttest/*` and the runtime's scripted engine); `cost_reason` texts changed; `weftarena/*` has no $0 rule | Handle the new badge value; do not match `cost_reason` text |
| (Go) An `INVALID_INPUT` tool error's `ToolError.Err` wraps `ErrInvalidToolInput` instead of being it: `te.Err == weft.ErrInvalidToolInput` is false | Use `errors.Is(err, weft.ErrInvalidToolInput)`; the model-visible text is unchanged |
| The `weft runs` table gains PROMPT and STOPPED BY columns after STEPS | Parse `weft runs --json`, not column positions |
| (Changed) The `ErrModelRetriesExceeded` run error's text adds the budget: `tool "x" retried 3 times, past MaxModelRetries(2)` | Match with `errors.Is`, not the text |

### 0.15.1

| What changed | What to write instead |
|---|---|
| (Changed) An empty value in `weft.Metadata` or `weft.WithMetadata` means "none": it removes the key the run would inherit from its parent run or the context, and is never stored or put on a span. It used to set an empty attribute | Set a non-empty value to keep a key; pass `""` only to remove one |
| (Changed) A thread session's run carries its own identity keys: `weft.public_id`, `weft.session.forked_from`, `weft.session.parent` and `weft.session.parent_call` take the session's value, or `""` (none, so the key is absent) when it has none. A session without `thread.PublicID` whose `Send` runs inside another session's tool handler no longer inherits that session's public id | Give each session that must be scoped its own `thread.PublicID`. A plain `Generate` in a tool handler still inherits every pair |
| (Changed) `GET /api/sessions?public_id=` scopes the runs before grouping, for every token: a row's turns, usage, first/last seen, status and cost are that public id's runs alone. For the server token the cost was the whole session's | Expect lower per-row figures where a session's turns carry two public ids; the unfiltered list is unchanged |

### 0.15.0

| What changed | What to write instead |
|---|---|
| (Go) `studio/runtime`'s `New()` became `New(opts ...Option)`: every call compiles, but a func value of type `func() *RuntimeServer` no longer matches (apidiff reports it incompatible) | Call `runtime.New(...)` directly, or change the func type to take the options |
| Cancel on an app-owned run (`POST /api/runs/{id}/cancel`, no runtime started it) was 409; it is 403 now. With a connected runtime of the run's service that registered `runtime.Sessions` the route answers 202 and forwards it, and that runtime rejects a cancel (no per-turn cancel) | Treat 403 "app-owned turn" as the refusal, and read the `fix` it carries |
| (Changed) A runtime's id is stable per (service, cwd, agent set), `rt_` + 16 hex, and `<id>-<pid>` when another process holds it | Keep `/runtimes/<id>` links; a client adopts the `runtime_id` the registration answers ([Runtime ids](https://weftgo.dev/docs/production/studio-operations/#runtime-ids)) |

### 0.14.0

| What changed | What to write instead |
|---|---|
| The wefttest export zip puts its fixtures under `testdata/TestReplay_<run>/` beside the test skeleton | Unzip it into the package directory, not into `testdata/<TestName>/` |
| (Go) `otel.Pipeline.LoggerProvider()` returns `*otel.LoggerProvider`, which embeds `*sdklog.LoggerProvider` | Method calls are unchanged; a variable typed `*sdklog.LoggerProvider` takes `.LoggerProvider` |
| `/api/meta`'s `pricing` is an object `{source, path?, dated, models}`, where it was `false` | Read `pricing.source` |
| (Go) `obsdb.DB` gains `Traces` | A third-party `DB` adds it, grouping its spans by trace id (obsdbtest's `Traces` case pins the answer) |
| (Go) `obsdb.DB` gains `DeleteRun`, `DeleteSession`, `Sweep` and `Vacuum` | A third-party `DB` adds them, touching its own tables only (obsdbtest cases of the same names) |
| (Changed) `scope.Header` stamps `weft.page_url` (the request's Referer, else Origin, sanitised) on every run under the handler, on every destination, so a secret in a page path travels with it | Strip such a path in your own middleware before `scope.Header`, or do not wrap those routes with it |
| (Changed) `DB.Sweep` (and so `studio.Retain`, `--retain`, `weft vacuum --retain`) deletes in passes of `obsdb.SweepBatch` (500) root runs; on an error, the earlier passes stay deleted. The count it returns is the total | Do not expect a failed sweep to roll back; run it again |
| (Changed) `GET /api/experiments` lists the 50 most recently updated experiments by default and adds `total` | Pass `?limit=` (up to 200) and read `total` for the number saved |

### 0.13.0

| What changed | What to write instead |
|---|---|
| (Go) [`runtime.TranscriptEdit`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/studio/runtime#TranscriptEdit) (package `weft/studio/runtime`) gains `Kind`, `Index` and `Args json.RawMessage` and is no longer comparable | Compare the fields you need, or their JSON. Every recorded wire body still decodes |
| (Changed) A playground command's sampling override (`options.temperature`, and `params`) is laid over the agent's own `weft.Params` instead of replacing it, so `weft.override.params` and `weft.override.hash` carry the merged values | Do not compare override hashes across the change. A command cannot clear the agent's `stop` or `max_tokens` |
| (Fixed) `weft.override.tool_choice` reads `auto` for an auto override; it recorded `""`, which read like no override. The override hash of such a run changes | Match `auto` in queries on the attribute |

### 0.12.0

| What changed | What to write instead |
|---|---|
| A token in the URL (`?token=`) is refused on every `/api` route, in every setup: a 401 that names the grant | Send `Authorization: Bearer <token>`. An `EventSource` requests `POST /api/live-grant` and opens `/api/live?…&sig=`. The `#token=` fragment of `weft open` and `weft studio --open` links is unaffected: it never reaches the server |
| The Studio UI and the devtools panel open every live stream with a live grant; the UI adopts a link's token from its `#token=` fragment only and strips a `?token=` | Share links with `#token=`; a `?token=` in a shared link is stripped |
| `data-public-id` (and `weft:public-id`, `mount({publicId})`) is deprecated; still read | Write `data-scope="pub_…"`, `weft:scope`, `mount({scope})` |
| `/api/meta`'s `content` note for `none` reads "the latest run captured no content: weft.Content(false) on the agent, or no destination takes content" | Match the `none` mark, not the note's text |
| The panel's badge attribute is `data-hole` (was `data-weft-hole`) | Update host selectors and tests |
| `mount()` from `@weftgo/devtools` returns `WeftDevtoolsElement \| null`: `null` under `enabled: false` or on a server | Check the result before calling methods on it |
| The panel no longer adopts a `<script>` tag for a generic `data-endpoint`/`data-token` alone | Put `data-weft` on a tag whose `src` is not the bundle's own URL, or configure a higher rung (meta tags, the element, `mount()`) |

### 0.11.0

| What changed | What to write instead |
|---|---|
| The panel no longer finds its script tag by file name (`panel(-vX)?.js`); a bare `<script type="module" src="/studio/panel.js">` with no panel attribute is not found, and its auto dock removes itself | Add `data-weft`: `<script type="module" src="/studio/panel.js" data-weft>`, or use a `weft:*` meta tag, the element or `mount(opts)` |
| `studio/cmd` is removed | `go install github.com/weftgo/weft/cmd/weft@latest` and run `weft studio` (every flag kept); `studio --version` is `weft version`, `studio doctor` is `weft doctor` |
| `/api/meta`'s `db` is an object `{kind, path, size}`, not the kind string | Read `db.kind`; `path` and `size` (WAL included) are served only to loopback without a `Token` and to the server token |
| (Changed) The dev token is stable per database (`<db>.token` beside the SQLite file, 0600) and no longer printed: `weft studio`'s banner and `weft dev`'s line show the bare URL. Only a database with no file (`:memory:`, ClickHouse) still gets a printed per-process token | Use `--open` or `weft open --with-token` to hand it to a browser; `weft dev`'s app still gets `WEFT_STUDIO_TOKEN` |
| (Added) `--rotate-token` (on `weft studio` and `weft dev`) writes a new stable token. The token is also the key that signs panel tokens, so rotating it invalidates every panel token minted before | Mint new panel tokens after a rotation |

### 0.10.0

| What changed | What to write instead |
|---|---|
| One version, the module's: `version.Version` is the release tag and `studio.Version` equals it (`v0.4.1` became `v0.9.0`), so `/api/meta`'s `studio_version` and the panel's stamp move with the module. A panel built for `v0.4.1` refuses a Studio reporting `v0.9.0` | Serve the panel from the same release as Studio; compare `studio_version` with the framework tag |
| `/api/meta`'s `weft_version` is the framework module's build-info version (`version.Runtime()`), not the `core` dependency's | Read it as the framework version |
| (Changed) The system prompt and the tool catalog reach content-on destinations (`otel.Local`, `otel.Studio`) under the content policy; before, no record carried the instructions text | Redact the prompt (`ContentPrompt`) or turn content off for a destination it must not reach ([content and privacy](https://weftgo.dev/docs/production/content-and-privacy/)) |
| (Go) `obsdb.DB` gains `TranscriptBatches` | A third-party `DB` returns its messages records through `obsdb.DedupBatches` and implements `Transcript` as `obsdb.TranscriptBodies(batches)` |
| `/api/runs/{id}/transcript` rows carry the stored `index`, `step` (or `-1` with `"badge": "not_recorded"`) and `input` (`"badge": "derived"` where inferred), no longer derived from message order | Read the stored fields and their badges |
| (Go) `obsdb.DB` gains `Requests`, `Prompt`, `Tools` and `Catalogs`; `obsdb.RunRow` gains `InstructionsHash`, `CatalogHash` and `RequestCount` | A third-party `DB` reads its records through `obsdb.RequestRecordOf`, `PromptRecordOf` and `ToolsRecordOf` and answers a missing hash with `obsdb.ExplainMissing` |
| `obsdb/clickhouse`'s unreleased migration 0004 gained columns | Recreate a ClickHouse database a development build migrated with 0004's earlier text |
| (Go) `obsdb.DB` gains `Compactions` | A third-party `DB` builds each through `obsdb.CompactionOf`, orders them with `obsdb.SortCompactions`, and keeps `weft.messages.reason` records out of `Transcript` |
| (Go) `obsdb.DB` gains `OtherLogs` | A third-party `DB` implements it as `obsdb.ReadOtherLogs(ctx, db, runID, q, candidates)` |

### 0.9.0

| What changed | What to write instead |
|---|---|
| `github.com/weftgo/weft` is the whole framework, one module at one version. The adapters, `thread`, `otel`, `obsdb`, `studio` and `runtime` are packages of it, with unchanged import paths. A go.mod that still requires a retired module path beside the framework at v0.9.0 fails with `ambiguous import` | Drop every `github.com/weftgo/weft/<layer>` requirement (`go mod edit -droprequire=…`), drop `replace` lines for them, then `go get github.com/weftgo/weft@v0.9.0` (or later) and `go mod tidy`. [`MIGRATION-0.9.md`](https://github.com/weftgo/weft/blob/v0.20.2/MIGRATION-0.9.md) has the full command and a prompt for a coding agent |
| The loop alone is the module `github.com/weftgo/weft/core` (with `core/wefttest` and `core/mw`), tagged `core/vX.Y.Z` | Nothing, unless you want the loop with no other dependency than the OTel API: then import `core` instead of `weft` |
| The root package, `mw`, `wefttest` and `wefttest/conformance` are generated facades over `core` | Nothing: `weft.New`, `wefttest.Script` and `mw.Retry` compile unchanged, and `weft.Agent` is `core.Agent` |
| The layers' signatures name `core` types where they named the root package's | Nothing: the same types |
| `mw.IsContextOverflow(err)` is exported | Call it instead of a copy of the overflow marker table |

### 0.8.0

| What changed | What to write instead |
|---|---|
| obsdb/clickhouse migration 0003 stores `otel_traces.SpanKind` and `StatusCode` in the collector's spelling (`Internal`, `Error`, …); rows stored before it are not backfilled | Query the new spelling, or both |
| (Go) `otel.Pipeline` is no longer comparable | Compare `*Pipeline` values, and key maps on the pointer |
| Without a `Token`, Studio's API answers only a loopback `Host` or an `AllowOrigins` host:port | An embedded Studio served on a real hostname sets `studio.AllowOrigins(...)` or `studio.Token` ([Secure Studio](https://weftgo.dev/docs/production/security/)) |
| `studio/runtime`'s `RuntimeServer.Enqueue` (and the approval and steer paths) refuse a command id outside `ValidCommandID` (`ErrInvalidCommandID`), decisions for calls not pending, and out-of-range option values | Send valid ids and only pending calls' decisions |
| `runtime.AllowSideEffects` is honoured only in `side_effects: "allow"`; an opted-in tool no longer runs for real in `substitute` (the default) or `park` | Ask for `allow` when a tool must run for real |
| Side-effect parking is default-deny (`weft.ParkAllExcept`): tools from a `ToolSource` and Subagent children's tools park unless vouched safe or opted in | Mark read-only tools `weft.Replay(weft.ReplaySafe)`, or opt them in with `AllowSideEffects` |

## Removed

0.7.0 deleted `weft/store` (step 5 of ADR 0024) and rewrote Studio on `obsdb`. No data migrated: runs recorded in a store database are not read by Studio.

| Removed | Use instead |
|---|---|
| The module `weft/store`, entirely. `store/v0.1.3` still resolves from the module proxy for code pinned to it | Record through `weft/otel` (`otel.Install()`, or `p, err := otel.Start(ctx, otel.Local(":memory:"), otel.NoGlobal())` per test) and read through `obsdb`; serve Studio with `studio.DB` |
| Studio's store-era JSON keys: `tags`, `parent_id`, the run document's `result`, `meta`'s `store` key, and the UI's inline `Nested` folding | `meta`, `parent_run_id`, `meta`'s `db`; child runs are separate runs |
| Studio's `eventCache`, `storeKind`, everything typed on `store.RunRecord`, and the 409 `newer_format` mapping | Unknown ids are 404 and other database errors 500 `internal` |

## Thread migration checklist

`thread` 0.9.0 (with `thread/sqlite` 0.3.0) is the one release with a `thread` migration checklist; no later release broke `thread`. Upgrading from before it, the compiler finds the renamed and re-signed names; this table is the CHANGELOG's:

| Was | Write now |
|---|---|
| `thread.Instructions("…")` (a `CompactOption`) | `thread.SummaryInstructions("…")` |
| `thread.Disabled()` | `thread.NoAutoCompact()` |
| `thread.Proceed`, `thread.Cancel` (variables) | `thread.Proceed()`, `thread.Cancel()` |
| `thread.WithApprover(a)` + `thread.ApproverTimeout(d)` | `thread.WithApprover(a, d)`, `d` positive |
| `thread.SignDecision(secret, r, d)` with a hand-kept key map | `ring.Sign(r, d)` or `key.Sign(r, d)`; `SignDecision` stays for a bare secret |
| `thread.OpenConfig`, `thread.ResolveOpen` | `backend.Config`, `backend.Resolve` (package `thread/backend`) |
| `Estimator.Estimate(...) int`, `thread.SummaryMaxTokens(int)`, `SummaryInput.MaxTokens int` | `int64` |
| `Trimmer.Trim(ctx, msgs) ([]weft.Message, TrimReport)` | `([]weft.Message, error)`; the entry's `TrimRecord` is the report |
| `Preparation.SplitPrefix`, `Summary.Reason`, `SummaryInput.SummaryModel`, `Compaction.FilesModified`, `thread.ErrNotImplemented` | Removed: nothing set, read or returned them |
| `(*CorruptError).Unwrap() error` | `Unwrap() []error`; `errors.Is` and `errors.As` reach the class and the cause |
| `thread.Memory()` as a `func() Storage` value | It is `func(...OpenOption) Storage`; calls are unchanged |
| `p.Wrap(...)` returning a tool | `p.MustWrap(...)`, or `tool, err := p.Wrap(...)`; one name wraps one agent (`ErrDuplicateWrap`) |
| `p.Register(id, agent)` | Returns an `error` |
| `p.Decide(ctx, parent, ds...) (*thread.Turn, error)`, blocking | `err := p.Decide(...)` records and arms; then `p.Wait(ctx, parent, receiptID)` or the parked turn's `Next()` |
| `p.Cancel(receiptID)`, `p.Forward(ctx, receiptID, msg)` | `p.Cancel(ctx, parent, receiptID)`, `p.Forward(ctx, parent, receiptID, msg)` |
| `pool.Receipt.State` as a `string` | `pool.State` (same wire strings; `r.State.Settled()`) |
| `errors.Is(err, pool.ErrNotRunning)` for a wrong id | `pool.ErrUnknownReceipt`; `ErrNotRunning` is "the receipt exists and is in another state" (`*pool.StateError`) |

The behaviour changes the compiler does not find, each with what to do:

- **Close before reopening.** One `Session` holds the writer lease from its first write until `Close`; a second `Session` on the same session gets `ErrLocked`. Call `s.Close(ctx)`; in a test that stands in for a fresh process, `st.(thread.Releaser).Release(ctx, id)`.
- **Never append behind a `Session`.** A `Session` whose stored session gained entries it did not write fails its next write with `ErrStale`. Open the session again.
- **`Open` runs nothing and refuses header options.** `WithMeta`, `PublicID` and `WithLineage` passed to `Open` fail with `ErrCreateOnly` (they were ignored). Pass them to `Create`. Steers a crashed writer left wait in `s.Queue()`: send, or `s.Continue(ctx)`.
- **`Open` can refuse a file it used to open.** A malformed tree is `ErrCorrupt`. Open the backend with `thread.Salvage()` to read around damage; `s.LoadReport()` says what was skipped.
- **`SetInfo` rejects `weft.` keys** with `ErrReservedKey`. Set them at `Create`. A `SetInfo` with nothing to record writes no entry.
- **A dropped turn returns `ErrDropped`.** `turn.Wait()` on a message `ClearQueue` removed returned `nil, nil`. Check for `ErrDropped`; use `turn.Outcome()` to tell a delivered steer from a deferred one.
- **`Wait` returns before the between-turn compaction.** Code that relied on compaction having run after `Wait` calls `s.WaitIdle(ctx)`.
- **`s.Audit()` returns approval entries only.** Read turn entries from `s.Entries()`. A resume is two `StepResume` entries: `started`, then `completed` or `failed`.
- **`thread.RunOptions` rejects `weft.Approve`, `Deny`, `Resolve` and `ResolveError`** (and still `Messages`, `Prompt`, `RunID`, `Steering`) with an error wrapping `weft.ErrInvalidRunOption`. Record decisions with `s.Decide`.
- **`Query.Meta` needs the key present.** A filter `{"k": ""}` no longer matches sessions without `k`.
- **`Decide` validates.** Two decisions for one call, an empty batch and a decision with no outcome are `ErrInvalidDecision`; an expired request is `ErrExpired`; a delegating call is `ErrDelegated`. It always records `Via: "user"`.
- **`ErrExpired` reads `thread: approval request expired`.** Match with `errors.Is`; `Session.Request` returns it for a lapsed request.
- **`DecideSigned`** returns `ErrBadSignature` for an unknown key id (was `ErrUnknownKey`) and `ErrNotPending` for a signature minted for an earlier occurrence. Signatures minted before 0.9.0 do not verify: request a new challenge.
- **`NewKeyring` needs at least one key.** `RequireSigned` without a keyring holding an active key fails `Create` and `Open`; `SignDecision` signs an empty `Who` as the key's id.
- **Compaction is between turns.** `Compact`, `ApplyCompaction` and `Uncompact` return `ErrBusy` while a turn runs and `ErrAwaitingApproval` while requests are pending. `Create` and `Open` validate the knobs (`ErrCompactConfig`). `Pin` refuses an entry without a message (`ErrNotPinnable`).
- **A custom `Trimmer` may only replace tool-result content.** Any other change fails the trim and the summary runs.
- **An overflow that is re-run leaves two turn entries.** Code counting turn entries per `Send` reads `TurnEntry.ReRun`.
- **A non-user steer** is refused by `Send` with an error wrapping `weft.ErrInvalidSteer`.
- **Pool.** The bound is per `Pool` value; a delegation deeper than `MaxDepth` is refused (`SUBAGENT_DEPTH`), a cycle with `SUBAGENT_CYCLE`; `Decide` no longer waits for the child; a resumed child queues for a slot; children inherit the parent's `RequestExpiry`, `Clock`, `Quorum`, keyring and `RequireSigned`. After a restart call `p.Recover(ctx, parent)`.
- **`Fork` takes its own options** and inherits nothing from the origin, except that a fork of a `RequireSigned` session requires signed decisions and takes the origin's keyring when given none. Copied queued steers are recorded as dropped, mirrored child requests are left out, and unsettled pool receipts are settled canceled.
- **`jsonl.Open` fails on a platform with no file lock** unless `thread.NoLock()` is passed.
- **`thread/sqlite` migration 0003 is one-way.** A binary from before it refuses the database with `sqlite.ErrNewerSchema` (package `thread/sqlite`). Upgrade every process that opens it together.
- **`thread/sqlite` durability follows the fsync policy.** `FsyncEveryAppend` (the default) is `synchronous=FULL`, so appends are slower than before, when the backend ran `NORMAL` whatever was asked. Pass `FsyncOnFlush` for `NORMAL`.

## Best practices & gotchas

- **Read every release's breaking section, not only the newest.** Pre-1.0 most breaking changes ship without a shim: a skipped release's change is still yours to make. (Source: `CHANGELOG.md:1-7`; `README.md:1066-1077`)
- **Upgrade Studio, its apps and the panel together.** The panel refuses a Studio that reports a newer version, and an older binary refuses a migrated database with `sqlite.ErrNewerSchema` or `clickhouse.ErrNewerSchema`. (Source: `CHANGELOG.md:2630-2639`; `obsdb/sqlite/migrations.go:81-101`)
- **Keep alerts on recorded values in step with releases.** `error.type`, `weft.override.params` and status words changed in minor releases (0.16.0, 0.17.0); the compiler cannot see them. (Source: `CHANGELOG.md:305-306, 376-377`)
- **Run obsdbtest against your own `obsdb.DB`.** The interface grew in 0.10.0, 0.14.0 and 0.16.0, and each new method has a conformance case. (Source: `CHANGELOG.md:390, 1230-1233, 2632-2676`)

## See also

- [Operate sessions in production](https://weftgo.dev/docs/sessions/operations/#upgrade-weft)
- [Choose the observability database: SQLite or ClickHouse](https://weftgo.dev/docs/production/storage-backends/#migrations)
- [Install weft](https://weftgo.dev/docs/get-started/install/)
- [The CHANGELOG on GitHub](https://github.com/weftgo/weft/blob/v0.20.2/CHANGELOG.md)

Symbols used: [`version.Version`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/version#Version) · [`version.Runtime`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/version#Runtime) · [`studio.Version`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/studio#Version) · [`obsdb.DB`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/obsdb#DB) · [`obsdbtest.Run`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/obsdb/obsdbtest#Run) · [`otel.Pipeline`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/otel#Pipeline) · [`otel.LoggerProvider`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/otel#LoggerProvider) · [`weft.ErrInvalidToolInput`](https://pkg.go.dev/github.com/weftgo/weft/core@v0.20.2#ErrInvalidToolInput) · [`weft.ParkAllExcept`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#ParkAllExcept) · [`weft.Replay`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#Replay) · [`mw.IsContextOverflow`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/mw#IsContextOverflow) · [`thread.NoAutoCompact`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/thread#NoAutoCompact) · [`thread.SummaryInstructions`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/thread#SummaryInstructions) · [`thread.WithApprover`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/thread#WithApprover) · [`thread.Salvage`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/thread#Salvage) · [`thread.NoLock`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/thread#NoLock) · [`backend.Resolve`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/thread/backend#Resolve) · [`pool.State`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/thread/pool#State)
