Upgrade weft
Before 1.0, weft breaks its API on purpose and says so: every breaking change is a line in the CHANGELOG 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.
go get github.com/weftgo/weft@v0.20.2go mod tidygo 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
Section titled “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 rootweftpackage (a facade over it), keeps compiling across minor releases. The gate fails the build only forcore; the rest of theweftmodule is report-only. Acorechange 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 incoreis never allowed. - The root package is a generated facade over
core:weft.Agentiscore.Agent. The gate reports the facade’s changes with the framework module, but each one mirrors acorechange that passed the enforced gate. thread,obsdb,otel,runtimeandstudioare pre-freeze (ADR 0024’s programme;threadis not frozen yet). Their breaking changes ship in minor releases. Forthread, each one also adds a line to the CHANGELOG’s migration checklist saying what to write instead.- Data contracts are versioned separately. The
obsdbschema migrates itself atOpenand refuses a newer one withsqlite.ErrNewerSchemaorclickhouse.ErrNewerSchema(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).
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
Section titled “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 — migrationin 0.12.0.#### Breakingunder### 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 notessection says what the first start on the new version does to your data.(breaking)in a module’s heading (0.8.0’sobsdb/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 checklistforthread0.9.0.
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
Section titled “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
Section titled “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
Section titled “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.MapErrorsover anerrors.Newvalue) readsINTERNAL ← plain error, notINTERNAL ← *errors.errorString, and anerrors.Joinor two-%werror readsjoined errors; the recordedweft.tool.error_maskedis 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 runsat 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
Section titled “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, MCP identity, Scope the panel).
| 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) |
(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) |
(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) |
(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) |
(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) |
(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; 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) |
(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) |
(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) |
(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) |
(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) |
(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
Section titled “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, Compare runs step by step).
| 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() to keep a test out of a running Studio (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) |
(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) |
| (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) |
(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) |
(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 adds it; the first-party backends have it (Forget a runtime) |
(behaviour, runtime) A replay from step n > 0, live or scripted, is the same turn: it runs with weft.KeptSteps(n), 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) |
(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) |
(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) |
(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) |
0.18.0
Section titled “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 Generates 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
Section titled “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
Section titled “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
Section titled “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
Section titled “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) |
0.14.0
Section titled “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
Section titled “0.13.0”| What changed | What to write instead |
|---|---|
(Go) 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
Section titled “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
Section titled “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
Section titled “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) |
(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) |
| 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 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 |
| 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) |
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
Section titled “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
Section titled “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
Sessionholds the writer lease from its first write untilClose; a secondSessionon the same session getsErrLocked. Calls.Close(ctx); in a test that stands in for a fresh process,st.(thread.Releaser).Release(ctx, id). - Never append behind a
Session. ASessionwhose stored session gained entries it did not write fails its next write withErrStale. Open the session again. Openruns nothing and refuses header options.WithMeta,PublicIDandWithLineagepassed toOpenfail withErrCreateOnly(they were ignored). Pass them toCreate. Steers a crashed writer left wait ins.Queue(): send, ors.Continue(ctx).Opencan refuse a file it used to open. A malformed tree isErrCorrupt. Open the backend withthread.Salvage()to read around damage;s.LoadReport()says what was skipped.SetInforejectsweft.keys withErrReservedKey. Set them atCreate. ASetInfowith nothing to record writes no entry.- A dropped turn returns
ErrDropped.turn.Wait()on a messageClearQueueremoved returnednil, nil. Check forErrDropped; useturn.Outcome()to tell a delivered steer from a deferred one. Waitreturns before the between-turn compaction. Code that relied on compaction having run afterWaitcallss.WaitIdle(ctx).s.Audit()returns approval entries only. Read turn entries froms.Entries(). A resume is twoStepResumeentries:started, thencompletedorfailed.thread.RunOptionsrejectsweft.Approve,Deny,ResolveandResolveError(and stillMessages,Prompt,RunID,Steering) with an error wrappingweft.ErrInvalidRunOption. Record decisions withs.Decide.Query.Metaneeds the key present. A filter{"k": ""}no longer matches sessions withoutk.Decidevalidates. Two decisions for one call, an empty batch and a decision with no outcome areErrInvalidDecision; an expired request isErrExpired; a delegating call isErrDelegated. It always recordsVia: "user".ErrExpiredreadsthread: approval request expired. Match witherrors.Is;Session.Requestreturns it for a lapsed request.DecideSignedreturnsErrBadSignaturefor an unknown key id (wasErrUnknownKey) andErrNotPendingfor a signature minted for an earlier occurrence. Signatures minted before 0.9.0 do not verify: request a new challenge.NewKeyringneeds at least one key.RequireSignedwithout a keyring holding an active key failsCreateandOpen;SignDecisionsigns an emptyWhoas the key’s id.- Compaction is between turns.
Compact,ApplyCompactionandUncompactreturnErrBusywhile a turn runs andErrAwaitingApprovalwhile requests are pending.CreateandOpenvalidate the knobs (ErrCompactConfig).Pinrefuses an entry without a message (ErrNotPinnable). - A custom
Trimmermay 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
SendreadsTurnEntry.ReRun. - A non-user steer is refused by
Sendwith an error wrappingweft.ErrInvalidSteer. - Pool. The bound is per
Poolvalue; a delegation deeper thanMaxDepthis refused (SUBAGENT_DEPTH), a cycle withSUBAGENT_CYCLE;Decideno longer waits for the child; a resumed child queues for a slot; children inherit the parent’sRequestExpiry,Clock,Quorum, keyring andRequireSigned. After a restart callp.Recover(ctx, parent). Forktakes its own options and inherits nothing from the origin, except that a fork of aRequireSignedsession 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.Openfails on a platform with no file lock unlessthread.NoLock()is passed.thread/sqlitemigration 0003 is one-way. A binary from before it refuses the database withsqlite.ErrNewerSchema(packagethread/sqlite). Upgrade every process that opens it together.thread/sqlitedurability follows the fsync policy.FsyncEveryAppend(the default) issynchronous=FULL, so appends are slower than before, when the backend ranNORMALwhatever was asked. PassFsyncOnFlushforNORMAL.
Best practices & gotchas
Section titled “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.ErrNewerSchemaorclickhouse.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.paramsand 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
Section titled “See also”- Operate sessions in production
- Choose the observability database: SQLite or ClickHouse
- Install weft
- The CHANGELOG on GitHub
Symbols used: version.Version · version.Runtime · studio.Version · obsdb.DB · obsdbtest.Run · otel.Pipeline · otel.LoggerProvider · weft.ErrInvalidToolInput · weft.ParkAllExcept · weft.Replay · mw.IsContextOverflow · thread.NoAutoCompact · thread.SummaryInstructions · thread.WithApprover · thread.Salvage · thread.NoLock · backend.Resolve · pool.State