Repository navigation
v0.24.1
A patch: the bugs the architecture guide's examples found.
Added
- thread/pool:
ErrMixedPools(see Fixed) — the one new name of this patch, a sentinel to match the refusal witherrors.Is.
Fixed
- thread/pool: two
Poolvalues at different levels of one delegation chain (the lead delegates through one pool, the child it runs through another) broke nested approvals: a decision at the top failed the top receipt with "nothing to resume: the child's resume did not survive a restart" while the lower pool ran the approved effect anyway and then could not record its settlement — the effect happened, the lead was told it failed. A delegation from a child session another pool runs — a wrapped tool of the second pool, orSubmitfrom the child's run — is now refused withErrMixedPoolsbefore any child exists; the model reads the refusal as the call's error. OnePoolvalue per chain is the rule (ADR 0022 amendment 2026-11-06); several pools delegating from the top session are unchanged. - thread/pool: a wrapped tool called by a
core.Subagentchild running inside a session turn (or by any run started beneath the turn that is not the turn's own) delegated, writing a receipt into the session that named a call id only the child run held — the hazardErrNestedDelegationalready refused forAgent.CallTool. It is now refused withErrNestedDelegationbefore any child exists. - thread:
thread.RunOptions(core.BeforeDispatch(…)),core.AfterDispatch(…)andcore.IdempotencyKeys(…)were accepted bySendand silently replaced by the session's own (the core keeps the last of each, and the session appends its gate, hook and keys after the caller's options) — a caller's gate never ran.Sendnow refuses them withcore.ErrInvalidRunOption, nothing written, like the other session-owned options; a precondition of your own belongs incore.WrapToolsmiddleware. - core: a handler abandoned at its
Timeout(or the run's cancellation) could keep dispatchingAgent.CallToolcalls afterwards — an email sent after the model was toldOUTCOME_UNKNOWN; under a session the gate refused them, on plain core nothing did. Once the loop has settled a call (timed out, canceled, or its handler returned), aCallToolwhose outer call is that call fails closed withErrNotDispatchedand the inner handler never runs (ADR 0031 amendment 2026-11-06). - thread, thread/pool: a sync delegation cut off by a shutdown whose child then recovered on its own without parking (a keyed retry, a continuation) settled its receipt, but
ResolveDelegationaccepted only a call a mirror named: the pool logged "delegating call no longer pending; the outcome is on the receipt", the parent kept offering the delegating call as a plain pending call, a secondRecoverdid not fix it, and approving it delegated again — the effect twice. The settlement now resolves that call with the child's answer (the text the sync path gives), whichever ofpool.RecoverandRecoverTurnruns first;Recoverresolves one whose resolution a crash lost; until then the call is offered with the reasondelegated: its thread/pool delegation settled and its answer is on the receipt; …andDeciderefuses an approval or edit of it withErrDelegated. A delegation endedcanceled(what the child did is not known) is still a person's to decide, as before: neitherResolveDelegationnorRecoverresolves it, and a call parked while its delegation was open is offered, once that delegation ends canceled, withcut off while it delegated: …(ADR 0032 amendment 2026-11-06). - thread:
OnRequestnever fired for a thread/pool child's request mirrored onto the session (InheritApprovalsdoes not carry it, and the mirror's append notified nobody), so an inbox fed byOnRequestmissed every nested approval — and it did fire for the delegating call the mirror parks under, which no decision can address (ErrDelegated). It now fires once per mirror, after the mirror is durable, on the pool's goroutine and holding no lock, and no longer for a delegating call nobody can approve — one a mirror names, or one parked while its delegation is open after the pool cut its child off (should that delegation end canceled, the call becomes a person's without a second notification;Pendinglists it). - thread/pool:
pool.Closeunderthread.ErrShutdownbefore a parent session whose turn was delegating left the parent running, and the parent's model read the rawthread: the process is shutting down: …as the delegating call's tool error and carried on ("shall I try again?") while the child's receipt stayed open and the next worker completed its effect. The cut-off delegation now answers its call with an unknown outcome (core.ErrOutcomeUnknown): under the session'sParkUnknownthe call parks with the reasondelegated: its thread/pool delegation is still open …(no keyed retry, no grant or Approver, an approval refused), andpool.Recoverresolves it with the child's answer. Shutting sessions down first is still the cleaner order (docs/thread-operations.md§5). - thread: the live
Approver(WithApprover) was handed aRequestwith noMetadata, thoughPendingandOnRequestreport the parking run's; it now carries the same metadata.
Documented
- thread:
Session.Send— the run is a child ofSend's ctx: canceling it cancels the turn (its end entries are still written); an HTTP handler whose request context ends on hang-up should passcontext.WithoutCancel. - core:
OnlyToolsnarrows away anOutput[T]agent'ssubmit_outputunless it is named (ParkAllExceptnever parks it), and a narrowed-away tool still passes throughWrapToolsmiddleware, so anmw.Allowrefusal readsDENIEDbeforeNO_SUCH_TOOL(also onmw.Allow). - core:
ModelToolCallDelta.Namemust be set by an adapter on every delta of a call, not only the first — the loop forwards it as given andOutputDecoder.Feedskips a delta with no name (the first-party adapters do). - thread:
thread.Memory()does not implementWatcher(onMemoryandWatcher). - mcp: an unknown outcome loses its type after one MCP hop — a served
OUTCOME_UNKNOWNarrives asErrToolErrorwith that text, notcore.ErrOutcomeUnknown(onTools,Serve, ADR 0032 amendment 2026-11-06). - thread: under
OnReady,RecoverTurn(likeResume) still starts and returns the run it decides; theApproveris consulted only in a live turn's chain, never for recovery or mirrored requests.