Repository navigation
Changed (breaking)
- thread: the key names the effect while its outcome is unknown (ADR 0032, the 2026-11-10 amendment). A call to a tool that is not
ReplaySafetimed out, its handler ran on, a person skipped its recovery request — and when the model asked for the same tool with the same arguments again, the repeat sat in a new entry, got a newIdempotencyKey, and ran beside the still-running first handler: a deduplicating receiver could not tell it was the same effect, soshiporchargecould happen twice. Now, once a call's outcome is unknown in a session (a recovery request, a skip, anOUTCOME_UNKNOWNresult), a later call to the same tool with the same canonical arguments (keys sorted, numbers by value —1is1.0) runs under the earlier call's key until a call under that key answers; a deliberate second order after an answer still gets a key of its own. The session records the inherited key before the call runs (anapproval_auditentry with stepkey, new fieldsEntry,Tool,ArgsSHA256,Key), written with"v":7: a session that holds one is refused by a 0.24 reader (ErrNewerFormat). Migration: deploy readers before writers, as for format 6; nothing to change in code. - thread: the still-running gate. While an abandoned handler of a tool (not
ReplaySafe) still runs in this process for a call the session holds, a new call to that tool parks for a person, whatever its arguments, reasonan earlier call of this tool is still running: its handler was abandoned and has not returned; approve once it has returned, deny to skip this call— no grant or Approver is consulted.Decidenow refuses approving or editing any of the session's own requests of a tool whose abandoned handler still runs withErrStillRunning(it refused only the abandoned call's own recovery request). Migration: an application that approves onErrStillRunningwaits forthread.AbandonedHandler(r.RunID, r.CallID)of the earlier call's recovery request (or retries later), as it already does for recovery requests. - thread:
Forkcarries effect identity. A fork derived every copied call's key from its own session id, so a fork'sRecoverTurnretried a cut-offReplayKeyedcall under a key the receiver never saw, askedReconcileunder it ("missing": the call reran), and a person's retry of a copied recovery request did the same — the effect twice, in the keyed case with no person deciding.Forknow appends a key record, with the origin's key, for each effect of unknown outcome open at the fork point and each copied call that may run again (cut off, parked for recovery, inherited). A call that never started keeps its own key in the fork. Migration: none; a fork written this way is format 7. - core: a
BeforeDispatchgate whose error wrapsErrApprovalRequiredparks the call (pending, handler never run) instead of failing it withErrNotDispatched(ADR 0031, 2026-11-10). The core always matched it through the wrapped error; it is now the contract, pinned byTestBeforeDispatchParkParksTheCall. - thread/pool: a mirrored child request carries the child's key (
ApprovalRequestEntry.IdempotencyKey, additive;Request.IdempotencyKeyon the parent names it). The parent's own call to a tool whose child handler still runs parks behind the gate, and with the same arguments, once it has returned, runs under the child's key.
Security
- thread/pool:
ApproveAlwayson a pool child's mirrored request minted a grant in the parent session, bound to the parent's own tool of the same name — another system — whose next matching call then ran unasked; the "always" the person meant never reached the next delegation. The parent now mints nothing for a mirror; the decision'sAlwayswish replays into the child, which mints its own grant (TestApproveAlwaysOnAMirrorMintsNoParentGrant). - thread/sqlite (behaviour change):
thread.Deleteerases the session's bytes, not only its rows. The deleted conversation stayed readable on disk with a hex dump — the freed pages kept their cells, and the write-ahead log kept every frame that had ever held them (a test found the deleted text 275 times in the-walwhile the Storage was open, 25 times in the main file afterClose). Every connection now runssecure_delete=ON(deleted cells and freed pages are zeroed), andDeleterunsPRAGMA wal_checkpoint(TRUNCATE)after its commit, so a nil return means none of the session's bytes are left in the database file or its log. A reader holding the log past the 30 s busy timeout (orctxending) makesDeletereturn an error wrapping the newsqlite.ErrErasureIncomplete— the session is deleted (LoadanswersErrNotFound), its bytes may still be in the log — and the newsqlite.Checkpoint(ctx, st)finishes the erasure once the reader is gone. Cost: every delete in the database writes zeros over what it frees, and everyDeletecheckpoints and fsyncs the main file. Migration: a caller that treated anyDeleteerror as "nothing deleted" checkserrors.Is(err, sqlite.ErrErasureIncomplete)and callssqlite.Checkpoint(a retriedDeleteanswersErrNotFound); a database written by an earlier build may still hold earlier deletes' bytes in its free pages —VACUUMit once.docs/thread-operations.md§12 says whatDeleteerases on each backend and what it cannot (backups, copies, the filesystem's blocks).
Fixed
-
core, anthropic, google: a provider's opaque signature goes back to that provider only.
ReasoningPart.SignatureandToolCallPart.Signaturedid not say who issued them, so after a mid-session model switch the anthropic adapter sent a Gemini thought signature to Anthropic as a thinking block's signature, and the google adapter sent an Anthropic signature to Gemini as raw bytes (on a thought part or a function call) — a request the API most likely rejects (found by reading; not reproduced against the live APIs).ReasoningPart,ToolCallPart,ModelReasoningDeltaandModelToolCallgainProvider(json:"provider,omitempty", additive): the adapters set it to their provider id ("anthropic","google") on every signature they yield, and send a signature back only when the tag is their own; a part tagged with another provider is treated as unsigned (the reasoning is dropped, the call goes without a signature). An untagged signature — a transcript recorded before this release — is sent as before, so a session that stayed on one provider keeps its reasoning; an untagged signature from another provider is still sent, as only a tagged one can be told apart.wefttestfixtures record the tag. A customModelthat yields signatures should setProvideron those events; one that does not gets the legacy rule (ADR 0001, amendment 2026-11-11;TestConvertSignatureProviderTag). -
thread: thread records held past their bound (256, for a run that has not reported yet) were dropped with only a Debug line at
Close, so a reader took the record stream as whole (R5). The first drop now logs a WARN, andClose's count is a WARN (TestHeldRecordOverflowIsWarned). The drop still does not reachotel.ErrRecordsLost: the records never reached the pipeline. -
thread: a
Forktaken while the origin's turn ran a call with effects copied the call as cut off, and the fork'sRecoverTurnretried it (ReplayKeyed) or asked itsReconcile("missing": it reran,ReplayNever) beside the origin's live handler.Forknow files the origin's running handlers of copied dispatched calls as still running: the fork parks the call for a person and refuses an approval until the handler returns (TestForkDuringARunningCallParksItForAPerson). -
thread: a storage write that hung inside the dispatch gate (which holds the session's lock across the dispatch record's append and flush — a stalled fsync on a failing disk or NFS) made
Close(ctx)ignore its context and block until the write returned (R12).Closenow waits for the lock under ctx: it gives up when ctx ends and fells the turn once the write returns; a laterClosefinishes (TestCloseGivesUpWhileAStorageWriteHangs). -
core:
OutputDecoder.Feeddid quadratic work in a streamed submission's length — every args delta re-closed and re-decoded the whole buffer (a 350 KB submission in 11-byte deltas read 5.6 GB). Past 4 KiB it now decodes a delta once the arguments have grown by an eighth since the last attempt, so the total is linear; small submissions still get a partial on every delta, partials still only grow, the whole-callToolStartis always decoded (the last partial is the complete submission) andResultis unchanged. Nothing model-visible. -
core, mcp:
Agent.ServeCall(and somcp.Serve) ignored the agent'sParkSource: a tool a breakpoint named ran over MCP, and a panicking source — which parks every call in a run — failed open. A served call now reads the sources once per call; a named call (any call but theOutputanswer, when a source panicked) is refused with theErrApprovalRequirederror aRequireApprovaltool gets there, and does not run (ADR 0030, amendment 2026-11-10). -
core (breaking): a panic in user code the loop calls on its own goroutine — a
PrepareStepfunction, aToolSourceread, aStopWhencondition, aSteerFunc, aUseModelmodel'sInfo— killed the process underStream(and so under everyweft/threadturn): the run guard ended the span and re-panicked on the producer goroutine, where nothing could recover it. The run now fails instead, underGenerateandStreamalike, with a*RunErrorwrapping the new*PanicError(Value,Stack) and the now exportedErrRunPanicked, the partial transcript onResult; the span still readsrun_panicked.OnRunEndnow fires for such a run (it did not: "a crash is not an outcome"). Code that recovered aGeneratepanic should checkerrors.Is(err, weft.ErrRunPanicked)instead. ASubagentchild whose loop panics now readsSUBAGENT_FAILED: … weft: run panicked: …to the parent's model instead of the handler-panic result (ADR 0016, amendment 2026-11-10). -
thread (tests; no behaviour change):
TestShutdownCauseOnTheTurnContextreadReady()the moment the cut-off turn'sWaitreturned, while the turn's runner was still alive —Readyis nil then, as its godoc says — and failed about one run in four under the race detector on two cores (CI's, on a 0.24.1 release commit). It waits for the session to be idle first (WaitIdle). -
thread/pool (tests; no behaviour change): two tests of a cut-off delegation assumed an order nothing gives them, and failed on a machine with two cores — CI's, on the 0.24.1 and 0.24.2 release commits.
TestCutOffDelegateRecoveredUnparkedResolvesTheParentCalllet the held handler go and recovered at once: closing the hold only makes the handler's goroutine runnable, so the recovery still read it as running and parked the call for a person, as it must, and the test waited 15 s for a keyed retry that was never due. Its helper's release now returns once the handler has returned as the process sees it (thread.AbandonedHandler).TestCloseGiveUpSyncDelegationIsNotOfferedAsARetryshared one script among the child's runs, so the child asked forshipagain once its mirror was denied — a new call under its own key — and that raced the test's own release ("2 ship handlers ran at once"); the child's model now asks once per conversation, so a second handler can only be a second delegation's or a retry.Recover's godoc said a handler the cut-off left running "is waited for by the child's own recovery"; it says what happens: the call parks for a person while the handler runs, and an approval waits for it.