Run `for_run` and `for_run_step` on the toolset a `DynamicToolset` factory returns, so dynamic capabilities keep nested dynamic tools
Closes #11266
Why we make these changes: A dynamic capability that holds a nested dynamic toolset offers the model no tools. DynamicToolset never called for_run or for_run_step on the toolset its factory returned, so a DynamicToolset nested inside it never evaluated its own factory. PrefixTools(Toolset(factory)), Toolset(DynamicToolset(...)) and harness Linear(auth=callable) all build that nesting once a dynamic capability wraps them. DynamicToolset was the only core toolset that held a child without forwarding these hooks.
The fix comes from #11271 by @dafyy321-pixel, who reported the issue. Its two commits are cherry-picked unchanged.
Forwarding the hooks also changes durable execution, so durable dispatch changes in two places:
- A
per_run_step=Falsedynamic toolset is resolved once per run and shared by every durable unit.RunHeldToolset.steppednow prepares it once per run step under its lock, as a non-durable run does, so parallel tool-call units no longer prepare one shared toolset over each other. - That resolution now also runs the returned toolset's
for_run, in container code. The run holds the toolset only when the engine's dynamic toolset transports are the defaultIdentityParameterTransport, which hands each unit the run's ownRunContext(#8455, #11088). Engines with transports of their own (Temporal, Azure Durable Task, Render) resolve the toolset in each unit, as before. No engine declares anything, andengine_specis unchanged.
New public surface: none.
User-visible behavior:
capability = PrefixTools(Toolset(lambda ctx: FunctionToolset([greet])), prefix='ns')
agent = Agent(model, capabilities=[lambda ctx: capability])
# before: the model is offered [] and a call to `ns_greet` fails with "Unknown tool name"
# after: the model is offered ['ns_greet'], as with `capabilities=[capability]`
Verification:
test_dynamic_capability_initializes_nested_toolset_factorycoversPrefixTools(Toolset(factory))andToolset(DynamicToolset(factory)), registered statically and dynamically. Both dynamic cases fail onmainwith an empty tool list.test_dynamic_toolset_prepares_stable_factory_result_once,…_prepares_replacements_and_removes_tools,…_preparation_failure_exits_only_active_copyand…_exits_entered_combined_after_step_replacementcover hook order, replacements and failure cleanup.- DBOS and Prefect runs make two parallel tool calls through a run-held toolset. Without
RunHeldToolset.stepped, all six cases fail. - Temporal: a returned toolset whose
for_rundoes off-thread I/O runs inside activities, not workflow code. - pgtask, AWS Lambda and deprecated
PrefectAgent: the toolset is resolved and entered once per run, as onmain.JournalDurabilityintest_durable_operation.pyis back on the default spec, so the #8455 tests check an engine that declares nothing.
What changes for existing users: A toolset returned by a DynamicToolset factory now gets for_run before it is entered and for_run_step on every step, also with per_run_step=False, as the lifecycle docs promise; toolsets with the default hooks see no change.
Durable execution: regressions, decisions and open questions for review
Open questions for Douwe
- Is reading
IdentityParameterTransportan acceptable private signal for "units share the run context", or shouldParameterTransportssay so itself? - Should
DurableMCPToolset.for_runeventually use the same signal instead of'enter-in-durable-unit'? Out of scope here. - Is dropping the container-side factory call on Temporal, Azure Durable Task and Render fine, given #8455 said "Temporal is unaffected"?
Douwebot answered all three in its approval of d8710c2: the IdentityParameterTransport gate fits because ParameterTransports already declares out-of-process units (#11088) and #8455 asked for no new engine_spec field; engines with their own transports resolve per unit, which is correct; dropping the workflow-side factory call removes work no activity could reach. The questions stay open for Douwe.
Regressions found while driving this PR, and how each was settled
Every regression below was reproduced with a test or probe that passed on main and failed on the head it names. Each one now passes.
| # | Regression | Settled by |
|---|---|---|
| 1 | Core fix alone (9ebe34f19), DBOS: parallel tool-call units each prepared the shared run-held toolset for the step, so a unit could list a tool on one preparation and call it through another unit's. | RunHeldToolset.stepped: the first unit of a step prepares the held toolset, under its lock, and the step's other units reuse that. An earlier copy-on-step fix in DynamicToolset.for_run_step was reverted for it. |
| 2 | Same cause, two more shapes: a returned toolset whose for_run_step updates itself in place (the pattern in docs/toolsets.md), and a nested per_run_step=True DynamicToolset. | Same fix. DBOS and Prefect test the three shapes (new instance, in place, nested). |
| 3 | Temporal: the run built the run-held toolset in workflow code, so the returned toolset's for_run ran there. With off-thread I/O the workflow failed with NotImplementedError from run_in_executor and timed out. No activity can reach a run-held toolset (_run_context.py strips _run_held_toolsets). | First an engine gate keyed on a per-engine 'dynamic': 'enter-in-durable-unit' declaration (DBOS, Prefect). Now the transport gate: Temporal's transports are its own, so the run holds nothing and the activities resolve the toolset. |
| 4 | pgtask under that per-engine gate: it declared 'dynamic': 'enter-never', so it lost the run-held toolset and resolved and entered it once per step (an MCP session per step), unlike main. | First pgtask declared 'enter-in-durable-unit'. Now covered by the transport gate (pgtask uses identity transports). |
| 5 | Deprecated PrefectAgent: prefectify_dynamic_toolset hardcodes lifecycle='enter-never', so the same per-step resolution happened there. | First that call site declared 'enter-in-durable-unit'. Now it passes units_share_run_context=True, and its lifecycle is back to main's 'enter-never'. |
| 6 | Harness AWSLambdaDurability declares no toolset_lifecycles, so it got the 'enter-never' default and resolved per step. Probe: main {'factory': 1, 'enter': 1}, previous head 99700a49f {'factory': 3, 'enter': 3}. | The transport gate (AWS Lambda uses identity transports), plus an AWS Lambda entry-count test. |
The transport gate, and why
Regressions 4, 5 and 6 were one miss each time: an in-process engine that did not opt in to the per-engine declaration. A probe of the docs' example engine (ImmediateDurability, default spec, four tool calls) shows the same miss for any third-party engine: main resolves the factory once per run, the per-engine head five times, and the transport gate once.
The design trail already settles where the signal belongs:
- In #8455, the run-held dynamic toolset was designed so that an engine that serializes the run context or dispatches the unit to another process "sees none and resolves per unit exactly as before. No engine-specific code, no new
engine_specfield." - #11088 made
ParameterTransports(durable_exec/_operation.py) the public way an engine says its units run in another process. Only Temporal, Azure Durable Task and Render return transports of their own. DBOS, Prefect, pgtask and AWS Lambda use the defaultIdentityParameterTransport.
So _build_dynamic_toolset passes units_share_run_context=True to DurableDynamicToolset when the dynamic get_tools and call_tool operations both use IdentityParameterTransport (argument validation uses the call_tool transport). for_run holds the toolset only then. The per-engine 'dynamic' declarations went back to main's 'enter-never', which also removed the three API-check waivers, the compatibility impact label and its warning. docs/durable_execution/backends.md tells engine authors which transports keep the run-held toolset.
What each engine does compared with main
| Engine | Dynamic toolset transports | per_run_step=False toolset with an id | Compared with main |
|---|---|---|---|
| DBOS, Prefect, pgtask, AWS Lambda | identity (default) | resolved and entered once per run, held for the units | same |
Deprecated PrefectAgent | wrapper passes True | same | same |
| Temporal, Azure Durable Task, Render | their own | resolved in each unit | same per unit; the container no longer runs the factory once for nothing |
| Absurd | does not wrap dynamic toolsets | — | unchanged |
| Out-of-repo engine on the default transports | identity | held for the run | same |
| Out-of-repo engine with its own dynamic transports | its own | resolved in each unit | same per unit, minus the container-side factory call |
On engines that hold the toolset, the returned toolset's for_run (for an MCPToolset, its auth or headers function) now runs in container code too, under the determinism rule that already covers the factory. dbos.md, prefect.md and the harness pgtask and AWS Lambda pages say so.
Rejected alternatives
- Per-engine
'dynamic': 'enter-in-durable-unit'declaration: every in-process engine had to opt in, and regressions 4–6 were each one that didn't. It also changed publicengine_specvalues (three API waivers), against #8455's "no newengine_specfield". - Close and split (ship the core fix without the durable changes): the core fix alone already breaks parallel tool calls under DBOS (regression 1, on 9ebe34f19).
- Defer the returned toolset's
for_runinto the first unit: it diverges from the static MCP path of #10846, moves IPython code mode'sfor_runinto a DBOS step wherein_durable_contextis false, and needs a private core split of factory evaluation from preparation.
Compositions reproduced on main and fixed here
Each offered no tools on main (6d334062f, 673beae05) when registered dynamically, and offers its tools on this branch:
Capability(toolsets=[factory])CombinedCapability([Toolset(factory)])Toolset(DynamicToolset(factory)), withper_run_stepTrueandFalsetoolsets=[lambda ctx: DynamicToolset(factory)], and its.prefixed(...)@agent.toolset(per_run_step=False)returning aDynamicToolset- a factory returning a toolset that overrides
for_run - harness
Linear(auth=callable), throughpydantic_ai_harness/_mcp.py::per_run_connection
clai2's Pylon plugin resolves its key in _for_run instead of passing a callable auth, with a comment that cited this bug. That method still reads the settings for each run and returns no capability until the user signs in or picks a key, so only the comment goes.
PR decisions
2026-11-13 · Build on contributor PR #11271 · iter -
- Decision: Cherry-pick #11271's two commits (authorship kept) and open our own PR on top;
close#11271 with a credit comment linking ours. - Why: A blind validator derived the same fix; #11271 also adds the needed _entered_toolset (CombinedToolset.for_run_step uses dataclasses.replace, so the per-step result is not the entered one). David chose our own PR over driving theirs.
- Source: https://github.com/pydantic/pydantic-ai/issues/11266
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · moves_cache_prefix only where the prefix check fails · iter -
- Decision: Mark test_dynamic_toolset_prepares_replacements_and_removes_tools and test_dynamic_toolset_exits_entered_combined_after_step_replacement[True] with moves_cache_prefix(reason=TOOLS_CHANGE_MID_RUN); both fail fail_function_model_prefix_violations without it, the [False] case passes unmarked.
- Why: #11252's check landed after #11271's base; both tests change the offered tools mid-run on purpose.
- Source: https://github.com/pydantic/pydantic-ai/pull/11252
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · Regression tests for the reported case · iter -
- Decision: Parametrize #11271's test_dynamic_capability_initializes_nested_toolset_factory over PrefixTools(Toolset(factory)) and a capability-level Toolset(DynamicToolset(factory)); both dynamic cases fail on main with an empty tool list.
- Why: Settled scope asks for both compositions; one parametrized test avoids a duplicate of #11271's existing PrefixTools case.
- Source: https://github.com/pydantic/pydantic-ai/issues/11266
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · clai2 Pylon workaround: delete the stale comment only · iter -
- Decision: Delete the PylonPlugin._for_run comment claiming pydantic-ai drops a dynamic toolset returned from a CapabilityFunc; keep the code.
- Why: The code is not dead: _for_run still reads settings per run, checks sign-in and returns None without a key. Only the comment's rationale is false after the fix (Pylon's callable auth goes through the same _mcp.py per_run_connection path as Linear, fixed on this branch).
- Source: https://github.com/pydantic/pydantic-ai/issues/11266
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · Single package label · iter -
- Decision: Label pkg:core only, not pkg:clai2 too.
- Why: .github/workflows/package-label.yml fails a PR with more than one pkg: label; the change serves core users and the clai2 edit is a two-line comment deletion.
- Source: https://github.com/pydantic/pydantic-ai/blob/main/.github/workflows/package-label.yml
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · Behavior notes for the PR body · iter -
- Decision: State in the PR body: a per_run_step=False DynamicToolset now forwards its child's for_run_step; factory-returned toolsets overriding for_run (harness ShellToolset(persist_cwd=True), CodeMode) now get their hooks, as docs/toolsets.md 'Per-run and per-step lifecycle' promises; toolsets with default hooks see no change.
- Why: The DynamicToolset.init docstring scopes per_run_step to factory re-evaluation only.
- Source: https://github.com/pydantic/pydantic-ai/issues/11266
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · pre-push review 1 of 3 at 50d31a40a5355ecc7bbf4367bd8321380c4d8a30 · iter -
- Decision: reserved; dispatching (haiku, effort high, claude -p from policy-base checkout, read-only tools)
- Why: tree bd2dbce853b8a4ec6253badfd239d1098b5bd0fa; scope 673beae05c5baa2d312cca9a66bf361c07c01cb1..50d31a40a5355ecc7bbf4367bd8321380c4d8a30 (full branch); first review
- Source: https://github.com/pydantic/pydantic-ai/tree/prefix-factory-tools
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · pre-push review 1 of 3 at 50d31a40a5355ecc7bbf4367bd8321380c4d8a30 · iter -
- Decision: no code change: 1 (Pylon) dismissed, 2 (visit_and_replace owner) dismissed, 3 verification run, all pass
- Why: tree bd2dbce853b8a4ec6253badfd239d1098b5bd0fa unchanged during review. 1: _for_run already runs once per run, so a callable auth would resolve the key at the same moment; the plain string needs no comment. 2: every visit_and_replace caller (durable _base/_agent, dbos _durability) visits templates before for_run, where _toolset is None and the super() branch runs; a replacement must own the entered context, as the pre-fix copy exiting its visited child did. 3: history append-only, harness code_mode/ipython/shell, clai2 MCP, full DBOS+Prefect files pass; Temporal skips locally on Python 3.15 (sandbox gate), CI's 3.13 lanes cover it.
- Source: https://github.com/pydantic/pydantic-ai/tree/prefix-factory-tools
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · Step-7 second opinion: pydanty:review-lite · iter -
- Decision: Apply pydanty:review-lite as the additional review surface; the enqueue stays with the manager.
- Why: David picked it on the recommendation: one production file with a specific entry/exit-ownership risk across durable engines and wrappers; review-lite charters this diff and only reports.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · pydanty review-lite triage at 50d31a40a · iter -
- Decision: Both findings refuted, no code change; pydanty CHANGES_REQUESTED 5885248149 dismissed with the tracked helper.
- Why: 1 (VCR coverage): the defect is pre-request (tools missing from ModelRequestParameters.function_tools), so a cassette protects nothing; all existing DynamicToolset/dynamic-capability tests use TestModel/FunctionModel with no vcr marks. 2 (durable for_run_step): get_dynamic_tools, call_dynamic_tool and validate_dynamic_tool_args call for_run_step on the run-held toolset in every unit; the cited tracking issue does not exist.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326#issuecomment-6842313973
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · Durable run-held sharing comment · iter -
- Decision: Rewrite the DurableDynamicToolset.for_run comment, comment only: parallel tool-call units can share the held per_run_step=False toolset while its for_run_step returns self (default-hook toolsets; CombinedToolset/WrapperToolset with unchanged children); a result returning a new instance every step is swapped by parallel units concurrently.
- Why: The fix makes a per_run_step=False DynamicToolset swap its operational child in place on every for_run_step, and every durable unit calls for_run_step on the held toolset, so the old comment ('only per_run_step=True swaps in place') went stale. Known limitation, not a regression: on main that child got no for_run_step at all. No code change, no new test (manager decision).
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · Push exemption at 9ebe34f196e2fca86839241a2baf640dce987be1 · iter -
- Decision: Exempt delta, no pre-push review: comments only since reviewed 50d31a40a5355ecc7bbf4367bd8321380c4d8a30 (review 1 of 3).
- Why: git diff 50d31a40a..HEAD touches only durable_exec/_toolset.py comment lines; no docs/** page; budget remaining 2 of 3.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · Regression 1: parallel durable units shared a stepped run-held DynamicToolset · iter -
- Decision: Fix narrowly in DynamicToolset.for_run_step: with per_run_step=False, return a shallow copy holding the stepped child when the child's for_run_step returns a new instance (self when unchanged), never reassigning the shared instance; per_run_step=True keeps in-place transitions. Regression test test_dbos_durability_parallel_calls_use_their_own_step_of_run_held_dynamic_toolset; durable comment rewritten.
- Why: Adversarial verifier reproduced on 9ebe34f19 under DBOS: a unit listed its tool on one stepped instance and called through another (another unit's step state), silently; same test passes on main 673beae05. Copy semantics match CombinedToolset/WrapperToolset.for_run_step; core non-durable chaining across steps is unchanged. Known remaining divergence: under durable, the child's for_run_step runs once per durable unit from the run-held instance, not once per step chained.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · pre-push review 2 of 3 at 37ee2e2486cdb12fec75343bd0562534d456456f · iter -
- Decision: reserved; dispatching (opus, claude -p from policy-base checkout, read-only tools)
- Why: tree acb906636ff5f9784975e95d9abd4f3f1465dc9c; follow-up scope 50d31a40a5355ecc7bbf4367bd8321380c4d8a30..37ee2e2486cdb12fec75343bd0562534d456456f (since reviewed 50d31a40a, tree bd2dbce8) plus affected callers; full branch 673beae05c5baa2d312cca9a66bf361c07c01cb1..37ee2e2486cdb12fec75343bd0562534d456456f as context
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · pre-push review 2 of 3 at 37ee2e2486cdb12fec75343bd0562534d456456f · iter -
- Decision: 3 findings: 1 (nested per_run_step=True race under run-held parent) reproduced, decision escalated; 2 (stale PR body) to do at next metadata sync; 3 (single-use READINESS_WAIT_TIMEOUT) fixed by inlining
- Why: tree acb906636ff5f9784975e95d9abd4f3f1465dc9c unchanged during review. Finding 1: parametrized nested variant fails on head deterministically (called {'call-a': 3, 'call-b': 3} vs listed {'call-a': 2, 'call-b': 3}); on main 673beae05 the same input offers no tools (#11266).
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · Open: nested dynamic toolset race under durable parallel units · iter -
- Decision: Pending manager/David decision; nothing pushed past 9ebe34f19. Local commits 04fe968d1 (copy fix), 37ee2e248 (docstrings), fad153a7a (nested test, failing).
- Why: A run-held per_run_step=False DynamicToolset holding a nested per_run_step=True DynamicToolset (PrefixTools(Toolset(factory)) in a dynamic capability) re-evaluates and swaps the inner child in place in every durable unit; parallel units race. Not a regression by definition (main has no tools for this input).
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · Hold for nested-race verdict · iter -
- Decision: Push nothing and change no code on #13326 until the manager sends the deliberator's verdict on the nested per_run_step=True race options.
- Why: Manager routed the fork (per-step memo in RunHeldToolset / xfail plus follow-up / per-unit resolution, and keep-or-drop of copy fix 04fe968d1) to a deliberator.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · Regression 2: in-place for_run_step under durable parallel units · iter -
- Decision: Stop rule applies: second regression; fork goes to David, push nothing and fix nothing until his pick. Verification only: add an inplace case to the DBOS parallel test, run on fad153a7a and main 673beae05, commit locally.
- Why: Manager's JournalDurability probe: a per_run_step=False factory result whose for_run_step updates itself in place and returns self (docs/toolsets.md lifecycle pattern) mismatches on fad153a7a (listed {'call-a': 2, 'call-b': 3}, called {'call-a': 3, 'call-b': 3}) and is OK on main (for_run_step never called). Deliberator recommends option 1 (RunHeldToolset steps once per run step) and dropping 04fe968d1.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · Second-regression stop queued for David · iter -
- Decision: Keep every local commit unpushed (remote stays 9ebe34f19); finish and report the local DBOS copy/nested/inplace verification; keep the PR monitor running until David's pick.
- Why: Manager queued the regression-2 fork (option 1 per-step RunHeldToolset memo and drop 04fe968d1 recommended by the deliberator) for David.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · David picked (a) widen on 2026-11-13 · iter -
- Decision: Widen: make durable_exec/_toolset.py RunHeldToolset step the run-held toolset once per run step behind its lock; reproduce the Prefect case too; flag the PR for the durable-exec reviewer. Never waive the douwebot gate: when it fails, push the fix and re-run douwebot.
- Why: Regression 2 (in-place for_run_step) and the nested per_run_step=True race both come from every parallel durable unit stepping one shared run-held toolset; stepping once per step matches the non-durable lifecycle.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · Per-step RunHeldToolset fix; copy-on-step reverted · iter -
- Decision: RunHeldToolset.stepped prepares the held toolset once per run step under its lock; get_dynamic_tools, call_dynamic_tool and validate_dynamic_tool_args use it through stepped_toolset_for_unit; DynamicToolset.for_run_step restored to #11271's version (04fe968d1 superseded). Tests: copy/nested/inplace parallel-call cases for DBOS and Prefect (shared tests/durable_exec/parallel_step_scenarios.py), all 6 fail before and pass after; manifest regenerated (+RunHeldToolset.stepped).
- Why: Deliberator's recommendation with option (a): one per-step preparation fixes all three variants and matches the non-durable once-per-step lifecycle, so the copy semantics in core are no longer needed.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · pre-push review 3 of 3 at 9c8ac3bad0b7af0ad227e51fe9d61a5ec6129d07 · iter -
- Decision: reserved; dispatching (opus, claude -p from policy-base checkout, read-only tools)
- Why: tree 0b1cd270cc5fc12df399e964fd7a1ca0e6ebc7de; follow-up scope 37ee2e2486cdb12fec75343bd0562534d456456f..9c8ac3bad0b7af0ad227e51fe9d61a5ec6129d07 (since review 2 at 37ee2e248, tree acb90663) plus affected callers; full branch 673beae05c5baa2d312cca9a66bf361c07c01cb1..9c8ac3bad0b7af0ad227e51fe9d61a5ec6129d07 as context; last review in budget
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · pre-push review 3 of 3 at 9c8ac3bad0b7af0ad227e51fe9d61a5ec6129d07 · iter -
- Decision: remediated: module-level READINESS_WAIT_TIMEOUT in tests/durable_exec/parallel_step_scenarios.py (b4e1af730); prior findings 1 and 3 confirmed fixed; budget exhausted, no fourth review
- Why: tree 0b1cd270cc5fc12df399e964fd7a1ca0e6ebc7de unchanged during review; agent_docs/concurrency.md 'Testing it' names a module-level READINESS_WAIT_TIMEOUT for Event waits, which outranks the general constant-scoping rule review 2 cited
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · douwebot REQUEST_CHANGES at b4e1af730 triage · iter -
- Decision: 2 (move lifecycle tests into tests/test_toolsets.py) and 3 (document per_run_step lifecycle in DynamicToolset.init and docs/toolsets.md) done locally; 1 (factory result's for_run now runs in workflow code under DBOS/Prefect run-held per_run_step=False) escalated as a design choice; push held.
- Why: 1 has two fixes, document vs defer for_run into the first unit; documenting matches ResolveModelId precedent (deterministic, no I/O in workflow code) with per_run_step=True as the I/O escape hatch; deferring needs a core split of factory evaluation from preparation.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · Hold for finding-1 pick · iter -
- Decision: Keep 12f6f4180 and 68a34685f unpushed and leave the douwebot threads open until the manager sends the deliberator's pick on finding 1 (document vs defer for_run into the first unit); PR watch keeps running.
- Why: Manager routed the douwebot finding-1 fork to a deliberator.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · Regression 3 (Temporal, for_run in workflow code) found by the deliberator; stop rule; surfaced to David with options C (gate dynamic like MCP: enter-in-durable-unit on DBOS/Prefect, Temporal enter-never), B, A alone · iter -
- Decision: Hold: no push; 12f6f4180 and 68a34685f stay local; douwebot threads stay open; PR watch keeps running until David's pick.
- Why: Deliberator verdict: A is right on DBOS/Prefect but alone ships a Temporal regression. Recommended C.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · Regression 3 key facts (deliberator verdict) · iter -
- Decision: Cause: durable_exec/_toolset.py DurableDynamicToolset.for_run has no engine gate; it builds RunHeldToolset(toolset_id, await self._dynamic_toolset.for_run(ctx)) whenever per_run_step=False with an id, so on this head the result's for_run runs in Temporal workflow code, which no activity reaches (_run_context.py _NONE_UNLESS_ATTACHED strips _run_held_toolsets). DurableMCPToolset.for_run gates the same construction on lifecycle 'enter-in-durable-unit'; DBOS/Prefect declare 'dynamic': 'enter-never'. Probe (Temporal dev server, UnsandboxedWorkflowRunner): main completes and never runs the result's for_run; head raises NotImplementedError from run_in_executor in workflow activation and the workflow times out. On the remote since the first push; Temporal tests skip locally on Python 3.15.
- Why: Options for David: C (recommended) = A's docs plus 'dynamic': 'enter-in-durable-unit' for DBOS and Prefect, Temporal kept 'enter-never', a Temporal regression test; Temporal also drops main's wasted workflow-side factory call (matches temporal.md 're-resolved inside activities'). B = defer the result's for_run into RunHeldToolset.entered (diverges from #10846's static MCP path, moves IPython code mode for_run into a DBOS step where in_durable_context is False, needs a private core split). A alone ships regression 3. A's precedent: DouweM on #8455 (discussion_r4041958507, r4041959307). Flag, not a regression: IPythonCodeModeToolset.for_run raises UserError under durable execution through a factory on this head (ran on main), matching docs/harness/ipython-code-mode.md. Edit sites: DurableDynamicToolset.for_run comment, RunHeldToolset docstring, durable_exec/AGENTS.md run-held paragraph, dbos.md/prefect.md factory sentence; C adds dbos/_durability.py, prefect/_durability.py, DurableDynamicToolset.for_run, maybe the contract manifest. Full verdict: /home/agent/pydantic/ai/manager/local-notes/readiness/11266/deliberator-13326-forrun.md
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · David picked (C) on 2026-11-13 · iter -
- Decision: Keep the widen; add A's docs (returned toolset's for_run also runs in workflow code under the determinism rule) at the DurableDynamicToolset.for_run comment, RunHeldToolset docstring, durable_exec/AGENTS.md run-held paragraph, dbos.md and prefect.md; declare 'dynamic': 'enter-in-durable-unit' for DBOS and Prefect, keep Temporal 'enter-never', and build the run-held toolset in DurableDynamicToolset.for_run only under enter-in-durable-unit, mirroring DurableMCPToolset.for_run; Temporal regression test; regenerate the contract manifest; push with 12f6f4180 and 68a34685f; never waive the douwebot gate.
- Why: Fixes regression 3 (Temporal for_run in workflow code) and covers douwebot finding 1.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · David: merge #13326 once branch updated + merge bar + durable sign-off from DouweM's durable agent (needs-durable-exec-review) · iter -
- Decision: Manager enqueues once the branch is updated, the head meets the merge bar, and the durable sign-off lands; I report the full gate state and never merge or enqueue.
- Why: David's instruction relayed by the manager.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · Regression 4: pgtask loses run-held dynamic toolset under the C gate · iter -
- Decision: Hold f29340825 unpushed; report to the manager with the narrow fix (pgtask declares 'dynamic': 'enter-in-durable-unit', mirroring its 'mcp' lifecycle).
- Why: Verifier probe (live pgtask Worker and in-process driver, PostgreSQL 16): main and b4e1af730 resolve and enter a per_run_step=False dynamic toolset once per run (MCP initialize 1); f29340825 resolves and enters per durable step (initialize 3-4). pgtask's JournalCallableOperationBackend uses identity parameter transports, so units receive the live RunContext carrying _run_held_toolsets. Azure Durable Task and Render serialize the context (unchanged per step; one fewer workflow-side factory call), code read only.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · Regression 4 (pgtask drops off the run-held path under the C gate: per-step factory/enter/MCP session); surfaced to David with options 1 pgtask declares dynamic enter-in-durable-unit / 2 gate on live-context units / 3 ship as-is · iter -
- Decision: Prepare option 1 locally as its own commit with a pgtask entry-count test (fails on f29340825, passes on it) and re-run the pgtask probe; push nothing; douwebot threads stay open.
- Why: Manager relayed both findings to David.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · Durable sign-off finding: no repo signal; needs-durable-exec-review is routing only · iter -
- Decision: Wait for David to name the sign-off reviewer and form (review state, comment marker or status context) before watching for it.
- Why: .github/workflows/bots.yml durable-exec-label adds the label when touched contract entries > 0 and removes it only when they drop to 0; nothing else in .github reads it; pydantic-ai-pr-review.md and its lock file never mention durable_exec_contract; #13380, #13358 and #13323 merged with the label on and no durable-specific review, comment, status or label change.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-13 · Option 1 prepared for regression 4 at 4b68a996e · iter -
- Decision: pgtask declares 'dynamic': 'enter-in-durable-unit'; TestReplay::test_run_held_dynamic_toolset_is_entered_once_per_run fails on f29340825 ({'factory': 3, 'enter': 3}) and passes on 4b68a996e; held local pending David's pick.
- Why: Verifier probe on a live pgtask Worker and an in-process driver: 4b68a996e restores main's once-per-run resolve, entry and MCP session (initialize 1, tools/list 1) for function and MCP scenarios with one and two tool calls.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-14 · David picked (1) on 2026-11-14 · iter -
- Decision: pgtask declares 'dynamic': 'enter-in-durable-unit' (4b68a996e); push held commits through 4b68a996e under the pushing-commits gate, merge main (12 h freshness lapsed), CI + PR Review Checks + douwebot, close out douwebot threads, metadata check; enqueue stays held until David names the durable sign-off signal; don't ask DouweM.
- Why: Restores main's once-per-run resolve/enter/MCP session on pgtask under the C gate (probe table at 4b68a996e).
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-14 · Push at 008c684322b231b4383757504ed586c3e6bacdc0 without pre-push review: budget exhausted · iter -
- Decision: Push 12f6f4180, 68a34685f, f29340825, 4b68a996e and main merge 008c68432 with no fourth local review; hosted review (PR Review Checks, douwebot) covers the delta.
- Why: Review 3 of 3 ran at 9c8ac3bad (remediated b4e1af730); pushing-commits-to-the-repo: 'After the third review ... Do not dispatch a fourth review. Continue with the push, CI, and hosted review.' Main merge had no conflicts; manifest check passes; targeted pyright clean.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-14 · David's durable sign-off rule (2026-11-14): ask, do not block · iter -
- Decision: David's durable sign-off rule (2026-11-14): ask, do not block. Post one comment asking for the durable agent's review, then enqueue on the merge bar as usual.
- Why: Comment at the merge bar opens with the aica-identity comment line, mentions @DouweM, names the touched contract entries and engine sites and the head SHA; no second comment unless the durable surface changes; the label never blocks; a later 'signed off with notes' becomes a follow-up issue (dsfaccini + pydanty:skip).
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-14 · API-check waivers for engine_spec lifecycle at 31a1b0e2f · iter -
- Decision: Add waivers fb3f5761 (DBOSDurability), 4f42edde (PrefectDurability), 4b4712a7 (PGTaskDurability) against v2.68.0, apply the compatibility impact label, and add a [!WARNING] section stating no existing code needs to change; pushed with no fourth local review (budget exhausted).
- Why: CI quality checks on 008c68432 failed check_api_compatibility on the 'dynamic' lifecycle value David picked (C, option 1); pr_gates.py compatibility_waiver requires the label for any added waiver; precedents #13299, #10476, #11582 waive value-only additions the same way. Only DurableDynamicToolset reads toolset_lifecycles['dynamic'].
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-14 · Push exemption at 254a1a87aab2ef34ce2f05d5a0f912717119e668 · iter -
- Decision: Target-branch merge of 86d9ad923 (#12769) with no conflict resolution; no local review (budget exhausted, and the delta is exempt).
- Why: git diff upstream/main...31a1b0e2f equals git diff upstream/main...HEAD (sha256 match); freshness: merge base was over 12 h old.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-14 · Regression 5 (deprecated PrefectAgent off the run-held path); fix held at 15cf258fa · iter -
- Decision: douwebot review 5905082581 finding 4574077680 reproduced: prefect/_dynamic_toolset.py::prefectify_dynamic_toolset hardcodes lifecycle='enter-never', so under the C gate a PrefectAgent run with an id'd per_run_step=False DynamicToolset resolves and enters it per task. Fix: lifecycle='enter-in-durable-unit' there, plus test_deprecated_agent_holds_per_run_step_false_dynamic_toolset_for_the_run. Held local; douwebot thread left open; stop rule, report to manager.
- Why: Test counts: main 86d9ad923 export {'factory': 1, 'enter': 1}; head 254a1a87a {'factory': 3, 'enter': 3}; fix {'factory': 1, 'enter': 1}. Other hardcoded dynamic lifecycles: temporal/_dynamic_toolset.py 'enter-never' (intended, out-of-process activities); DBOSAgent rejects dynamic toolsets (dbos/_agent.py reject_unsupported_runtime_toolsets).
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-14 · applies David's (C) to prefectify_dynamic_toolset (overmanager, 2026-11-14) · iter -
- Decision: applies David's (C) to prefectify_dynamic_toolset (overmanager, 2026-11-14): push 15cf258fa; a sixth regression stops the PR, reported unfixed, and David gets narrow-or-close.
- Why: Same pick as (C), at a site (C) missed: the deprecated PrefectAgent wrapper hardcoded lifecycle='enter-never'.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-14 · Push at 99700a49fc00ff4bc35bf64e42b7261af6123bf5 without pre-push review: budget exhausted · iter -
- Decision: Push 15cf258fa and the clean merge of 5cf25bc5f (#13452) with no local review; hosted review covers the delta.
- Why: Review budget 3 of 3 used (review 3 at 9c8ac3bad). git diff upstream/main...15cf258fa equals git diff upstream/main...HEAD. Targeted Prefect tests, pyright and contract check pass on 15cf258fa.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-14 · PRC reviewer quota with David; hourly :30 reruns (2026-11-14) · iter -
- Decision: Hold the enqueue. After 16:30Z, rerun only the failed PR Review Checks jobs on the current head once an hour at :30, until they pass or the manager relays David's answer; never stop after 16:30Z. Report when PRC passes, otherwise only changes.
- Why: PRC on 99700a49f failed 'No result: general, tests-and-dependencies' (run 43609052304), the reviewer quota failure; the quota decision is with David.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-14 · Regression 6 (harness AWSLambdaDurability off the run-held path); stop, not fixed · iter -
- Decision: douwebot review 5905466178 finding 4574362451 reproduced; per dispatch 20261114T151325Z step 5, no fix: PR goes to David with narrow-or-close; douwebot thread left open; no DouweM comment; enqueue held.
- Why: AWSLambdaDurability.engine_spec declares no toolset_lifecycles, so 'dynamic' defaults to 'enter-never' (_spec.py) while it still wraps dynamic toolsets and its JournalCallableOperationBackend steps run in-process with the live RunContext. Scratch probe (FakeDurableContext, id'd per_run_step=False DynamicToolset): main 86d9ad923 export {'factory': 1, 'enter': 1}; head 99700a49f {'factory': 3, 'enter': 3}. Engine inventory: DBOS/Prefect/pgtask declare enter-in-durable-unit; Temporal enter-never (out-of-process); Azure Durable Task/Render enter-never (serialized context); Absurd does not wrap dynamic; AWS Lambda is the last in-repo engine on the default.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-14 · PRC rerun loop stopped; hold for David's regression-6 pick · iter -
- Decision: Stopped the hourly PRC rerun loop; keep the PR watch; push nothing; douwebot thread 4574362451 stays open until the manager relays David's pick of narrow (1) / redesign (2) / close-and-split (3).
- Why: The head changes under every option and reviewer quota is short (manager dispatch 20261114T155420Z).
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-17 · Refresh API waivers to the latest release when the hold lifts (v2.69.0 released 2026-11-17 01:03Z) · iter -
- Decision: When the hold lifts: merge main, set 'against' to v2.69.0 (or the latest release at that point) in each waiver under .github/api-compatibility-waivers/ (fb3f5761, 4f42edde, 4b4712a7), run check_api_compatibility.py --against on the merge, and re-pass the gates before the manager enqueues. No push now; keep holding for David's regression-6 pick.
- Why: The API-compatibility gate now compares against v2.69.0, so waivers saying against: v2.68.0 no longer cover their fingerprints; a stale waiver got #13524 ejected from the merge queue (manager dispatch 20261117T015454Z).
- Source: https://github.com/pydantic/pydantic-ai/pull/13524
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-18 · David picked the transport gate for regression 6 (2026-11-18) · iter -
- Decision: David picked the transport gate for regression 6: DurableDynamicToolset holds the run's toolset when the engine's dynamic parameter transport is IdentityParameterTransport; per-engine 'dynamic' declarations revert to main's 'enter-never'; waivers, compatibility-impact label and WARNING removed.
- Why: #8455 says run-held dynamic needs no engine-specific code and no new engine_spec field; #11088 made ParameterTransports the declaration of out-of-process units; regressions 4-6 were each an in-process engine that did not opt in (David, 2026-11-18).
- Source: https://github.com/pydantic/pydantic-ai/pull/8455
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
- Supersedes: David picked (1) on 2026-11-14 (regression-4 per-engine declaration); David picked (C) on 2026-11-13 (per-engine 'dynamic' lifecycle part)
2026-11-18 · One extra pre-push review for the transport gate (David, 2026-11-18) · iter -
- Decision: David authorized one pre-push review beyond the spent 3 for the transport-gate change (David, 2026-11-18). A regression found by that review or any other stops the PR, reported to the manager unfixed.
- Why: The transport gate is a shape change after the budget was spent.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-18 · At the bar the PR goes to Douwe, not the merge queue (David, 2026-11-18) · iter -
- Decision: At the bar this PR goes to Douwe, not the merge queue: review request, mention, #11266 assigned to him; the PR body carries every decision and its reasoning (David, 2026-11-18). I report the bar and stop; the manager sends the Douwe handoff step.
- Why: Douwe and his agents must review without our local notes.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
- Supersedes: David's durable sign-off rule (2026-11-14): ask, do not block; David: merge #13326 once branch updated + merge bar + durable sign-off
2026-11-18 · pre-push review 4 (authorized extra) at 89f2251f42c07f183aaa9d9b33c23c09efc12e3c · iter -
- Decision: reserved; dispatching (opus, env -u UV_PROJECT_ENVIRONMENT claude -p from policy-base checkout cf87b90543a797d134645138079cacf035928060, read-only tools)
- Why: tree 12b21f45a09a4fa3824e403895935d51f3478b54; full-branch scope b11b8984abedc3761d7cc01306aeb3a35f6a33dd..89f2251f42c07f183aaa9d9b33c23c09efc12e3c: the durable gate was redesigned (transport gate) and several unreviewed deltas landed since review 3 at 9c8ac3bad (tree 0b1cd270); David authorized one review beyond the spent 3
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-18 · pre-push review 4 (authorized extra) at 89f2251f42c07f183aaa9d9b33c23c09efc12e3c · iter -
- Decision: 4 findings, no regression; remediated: 1 harness pgtask/aws-lambda docs+READMEs get the held-dynamic-toolset determinism note (do); aws-lambda.md:10 'dynamic-toolset resolution is checkpointed' left as is (skip: pre-existing wording, true for the default per_run_step=True, behavior unchanged vs main); 2 parallel_step_scenarios imports the shared tests._timeouts READINESS_WAIT_TIMEOUT (do); 3 durable_exec/AGENTS.md names DurableDynamicToolset.for_run as the holder (do); 4 RunHeldToolset docstring plural agreement and two comment blocks rewrapped under 120 columns (do). Review budget now fully used; no further local review.
- Why: tree 12b21f45a09a4fa3824e403895935d51f3478b54 unchanged during review; none of the findings is a regression vs main, so the stop rule does not apply
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-18 · Push at d8710c2e802fb9e11e7a87983c7a08d7c765fe6f after review 4 · iter -
- Decision: Push the main merge 6447194b9 (cf conflict in test_dbos/test_prefect imports, both sides kept), the transport gate 41e145109, backends.md 89f2251f4 and the review-4 remediation d8710c2e8; remove the compatibility impact label and the WARNING; reply to and resolve douwebot thread 4574362451; dismiss 5905466178 once CI passes; re-run douwebot.
- Why: Review 4 (David's authorized extra) found no regression; its remediation is docs/comments/test-constant only and gets no fifth review. API check against v2.70.0 exit 0; raw-key check 0; targeted durable tests pass on 41e145109 and the touched tests on d8710c2e8.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-18 · Metadata check on the v9 body · iter -
- Decision: Applied: one-sentence 'What changes for existing users', drop the decisions-template comment, remove area:capabilities (no change under capabilities/; area:tools and area:durable-exec cover the code). Skipped: replacing the before/after example with a call-path diff (net-neutral: the example shows the user-visible effect directly, and earlier metadata checks accepted it).
- Why: Light-tier metadata check against pushing-commits-to-the-repo 'Write the title and body', 'Publish PR decisions' and the area-label rules.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-18 · douwebot APPROVE 5966917729 at d8710c2e8 carries discussion · iter -
- Decision: No code change: the discussion answers the PR body's three open questions and endorses each; note its answers under the open questions (they stay open for Douwe) and re-run douwebot once for an approval the gate counts as clean; if the rerun again carries discussion, escalate to the manager instead of looping.
- Why: review_gates.py douwebot_approval fails any APPROVED body other than 'No blocking findings.' ('Douwebot has discussion findings on this head.'); no inline comments; the discussion names no defect, so the stop rule does not apply.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326#pullrequestreview-5966917729
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-19 · Push exemption at 78615e6b9 (main merge for a fresh douwebot head) · iter -
- Decision: Clean merge of upstream/main e246de029 (12 commits) with no conflict resolution; no local review (budget spent, and the delta is exempt); push, then request douwebot on the new head.
- Why: douwebot skipped d8710c2e8 by design: the discussion body of 5966917729 is a finding a new review cannot clear on that head (comment 6994798298: 'push a new commit, then request a new review'). Same changed files and same per-file added/removed lines as d8710c2e8 vs its base; durable_exec_contract.py --write leaves the manifest unchanged.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326#issuecomment-6994798298
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-19 · Merge bar at 78615e6b9; stopped for the Douwe handoff · iter -
- Decision: Report the bar to the manager and stop; no enqueue. The manager verifies the bar and sends the Douwe handoff step (review request, @-mention comment with the three open questions, #11266 assigned to Douwe).
- Why: CI 44430622445 success; Run benchmarks fails only on tests/_timeouts.py missing from affects_benchmarks (not required, same on main, fixed in #13899/#13930); PR Review Checks success; douwebot 5967534686 APPROVE 'No blocking findings.' with no inline comments, Gate: clean douwebot approval success; 0 of 6 threads unresolved.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326#pullrequestreview-5967534686
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-19 · Handed to Douwe per David · iter -
- Decision: Handed to Douwe per David: review requested, @DouweM comment https://github.com/pydantic/pydantic-ai/pull/13326#issuecomment-6996328794, #11266 assigned to DouweM; not enqueued; worktree torn down after (David, 2026-11-18)
- Why: David's merge-bar handoff: Douwe and his agents review the run-held DynamicToolset redesign on his durable machinery before merge; the PR body carries every decision.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 9f754d1d-57e6-47b8-a7f9-7d1dba631de5
2026-11-23 · thread r4567608527: for_run of a held toolset runs in container code · iter -
- Decision: Keep the returned toolset for_run in container code for run-held toolsets, and document it under the determinism rule.
- Why: A static MCPToolset already runs for_run there, so moving it into RunHeldToolset.entered would diverge from that path.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326#discussion_r4567608527
- Session: 58b94757-a13e-4a7f-96b9-0103a96bb5be
2026-11-23 · thread r4567608535: lifecycle tests live in test_toolsets.py · iter -
- Decision: Move the five DynamicToolset lifecycle tests into tests/test_toolsets.py and drop the separate file.
- Why: Existing DynamicToolset entry and exit tests already live there.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326#discussion_r4567608535
- Session: 58b94757-a13e-4a7f-96b9-0103a96bb5be
2026-11-23 · thread r4567608543: per_run_step=False documents the forwarded hooks · iter -
- Decision: State in the per_run_step docstring and docs/toolsets.md that the returned toolset gets for_run and for_run_step whichever value is set.
- Why: per_run_step=False now stops only factory re-evaluation.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326#discussion_r4567608543
- Session: 58b94757-a13e-4a7f-96b9-0103a96bb5be
2026-11-23 · thread r4574077680: deprecated PrefectAgent keeps one resolution per run · iter -
- Decision: Keep PrefectAgent on the run-held path, first through a lifecycle declaration at its wrapper call site.
- Why: Reproduced: factory and enter counts went 1/1 on main to 3/3 on 254a1a87a, and back to 1/1 with the fix.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326#discussion_r4574077680
- Session: 58b94757-a13e-4a7f-96b9-0103a96bb5be
2026-11-23 · thread r4574362451: gate run-held toolsets on IdentityParameterTransport · iter -
- Decision: Hold the toolset when the dynamic get_tools and call_tool operations both use IdentityParameterTransport, with no per-engine declaration.
- Why: The per-engine declaration missed pgtask, PrefectAgent and AWS Lambda; #8455 asked for no new engine_spec field.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326#discussion_r4574362451
- Session: 58b94757-a13e-4a7f-96b9-0103a96bb5be
- Supersedes: thread r4574077680: deprecated PrefectAgent keeps one resolution per run
2026-11-23 · adopted PR #13326 at 2026-11-23 · iter -
- Decision: Branch-context bootstrapped from existing PR + issue(s). Decisions prior to this entry are backfilled from resolved threads.
- Why: PR predates the branch-context setup
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 58b94757-a13e-4a7f-96b9-0103a96bb5be
2026-11-23 · manager cleared the durable_exec/AGENTS.md diff for adoption · iter -
- Decision: Continue adoption although the diff edits pydantic_ai_slim/pydantic_ai/durable_exec/AGENTS.md.
- Why: The manager read the diff: it documents the transport gate, all four commits touching it are by David, and the branch is on pydantic/pydantic-ai.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 58b94757-a13e-4a7f-96b9-0103a96bb5be
2026-11-23 · scope: leave the three non-blocking durable sign-off notes · iter -
- Decision: Do not act on the three notes in the durable sign-off at 78615e6b9: MCP auth callables in container code, an optional Temporal test, and IdentityParameterTransport subclass detection.
- Why: The sign-off marks them "none blocking" and calls the Temporal test "optional"; this is a deliberate scope call by the manager.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326#issuecomment-7108884768
- Session: 58b94757-a13e-4a7f-96b9-0103a96bb5be
2026-11-23 · pre-push review 1 of 3 at d9b8dab7793176e74d7e3212f7ea1cfa75a081ed · iter -
- Decision: Dispatched to a fresh policy-base reviewer on the strong tier; outcome follows under this anchor.
- Why: Tree cddc3762d096c38fc3e267c870f9e384dcad8d62; scope 7f8b80f86c..d9b8dab779; merge of main with conflict resolution since 78615e6b94.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 58b94757-a13e-4a7f-96b9-0103a96bb5be
2026-11-23 · pre-push review 1 of 3 at d9b8dab7793176e74d7e3212f7ea1cfa75a081ed · iter -
- Decision: no findings
- Why: Reviewed tree cddc3762d096c38fc3e267c870f9e384dcad8d62; scope 7f8b80f86c..d9b8dab779; verdict current at the candidate head.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 58b94757-a13e-4a7f-96b9-0103a96bb5be
2026-11-23 · correction: the review at d9b8dab779 was past the spent pre-push budget · iter -
- Decision: The two entries titled pre-push review 1 of 3 at d9b8dab779 record the fifth dispatch on this PR. The budget was spent on 2026-11-18, so no further local review runs. The 56 archived entries above are restored.
- Why: Adoption started from an empty template after the worktree was recreated, so the count reset and the adoption entry wrongly says the PR predates branch-context. The extra review returned no findings.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 58b94757-a13e-4a7f-96b9-0103a96bb5be
2026-11-23 · Step 7: no additional review surface (overmanager, 2026-11-23) · iter -
- Decision: Choose none for the additional review surface.
- Why: Overmanager pick in local-notes/dispatch-p2-mgr-2-20261123T202409Z.md (manager worktree): David picked pydanty:review-lite earlier and it ran on 11-13, and Douwe reviewed these exact lines today, so another review could only move the head after his sign-off.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326#issuecomment-7108884768
- Session: 58b94757-a13e-4a7f-96b9-0103a96bb5be
2026-11-24 · Late re-confirm rule for the durable sign-off (manager, 2026-11-24) · iter -
- Decision: If Douwe confirms d9b8dab779 before 06:39Z: "report to me at once and don't push". If no reply by 06:30Z: merge upstream/main once. "Merge only if all three hold: the merge has no conflicts; the incoming commits touch no durable files (durable_exec, durable tests, the contract manifest) or DynamicToolset files; and git diff upstream/main...HEAD is unchanged from before the merge (compare with git patch-id)." "If any fails: git merge --abort, no push, report to me." Re-read the PR right before pushing, and abort the merge if d9b8dab779 is confirmed by then. Then key check, push, remove and re-add the douwebot label. Once CI and a real douwebot APPROVE are on the new head, edit issuecomment-7113145991 to name the new head and say it differs only by a clean merge of main: "No new comment and no new ping." If an older head is confirmed after that merge: "don't enqueue anything, report to me". "Never remove needs-durable-exec-review. Only I enqueue, and only a head he confirmed."
- Why: Douwe's sign-off keeps the label until after the last push and re-confirms then; a merge at 06:30Z puts a late confirmation on a head that stays fresh for 12 more hours. Manager dispatch local-notes/dispatch-pr-13326-20261124T003341Z.md.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326#issuecomment-7108884768
- Session: 58b94757-a13e-4a7f-96b9-0103a96bb5be
2026-11-24 · Push exemption at 36a4553687d509d930de73f950ef279a6dd82599 (06:30Z late re-confirm merge) · iter -
- Decision: Clean merge of upstream/main 52d0ebc99f (12 commits) with no conflict resolution, pushed at 06:31Z with no local review (budget spent, and the delta is exempt); douwebot label re-added.
- Why: No reply from Douwe by 06:30Z. All three conditions held: no conflicts; no incoming path matches durable, the engine names, dynamic or contract, and no incoming hunk names DynamicToolset or durable_exec; git diff upstream/main...HEAD patch-id a8467a45 before and after. durable_exec_contract.py --write leaves the manifest unchanged; key check 0; no new PR activity at 06:31Z.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326#issuecomment-7108884768
- Session: 58b94757-a13e-4a7f-96b9-0103a96bb5be
2026-11-24 · Refresh bound for the durable re-confirm (overmanager for David, 2026-11-24) · iter -
- Decision: If Douwe hasn't confirmed 36a4553687 by about 17:52Z (merge base 52d0ebc99f at 05:52:40Z plus 12 h), "merge main once more, under the same three conditions: no conflicts, no incoming durable, DynamicToolset or contract-manifest files, and git diff main...HEAD unchanged. If any condition fails, stop and report." Once CI and douwebot pass, edit issuecomment-7113145991 in place to name the new head; "Post no new comment and ping no one." "That is the last automatic refresh. If he still hasn't replied by that next head's freshness expiry, do not merge again. Stop and report to me." Earlier rules stand: no enqueue by me; report a confirm of an older head; "never remove needs-durable-exec-review".
- Why: Bounds the late re-confirm rule to one more refresh so the branch does not chase main indefinitely; source is overmanager dispatch 2026-11-24T06:52Z relaying David (local-notes/dispatch-pr-13326-20261124T065252Z.md).
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 58b94757-a13e-4a7f-96b9-0103a96bb5be
2026-11-24 · Apply douwebot only after the head's CI is green (David, 2026-11-24) · iter -
- Decision: After every push, wait until the head's CI has finished green, and only then remove and re-add the douwebot label on that head. "Never apply douwebot in the same batch as the push." Replaces "after each push, remove and re-add douwebot".
- Why: David, verbatim: "dont apply douwebot before CI has run. douwebot approved but the rest of CI is still running". Relayed by the overmanager from the PR 14229 worker on 2026-11-24T14:12Z (local-notes/dispatch-pr-13326-20261124T141235Z.md).
- Source: https://github.com/pydantic/pydantic-ai/pull/14229
- Session: 58b94757-a13e-4a7f-96b9-0103a96bb5be
2026-11-24 · Douwebot labels only after the head's CI succeeds, both labels (overmanager correction, 2026-11-24) · iter -
- Decision: The rule covers both douwebot and douwebot:review-agent-config: "After every push, apply either label only after CI succeeds on the head you pushed, and never in the same batch as the push."
- Why: Overmanager correction 2026-11-24T14:30Z to the 14:12Z rule, which named only douwebot (local-notes/dispatch-pr-13326-20261124T143034Z.md).
- Source: https://github.com/pydantic/pydantic-ai/pull/14229
- Session: 58b94757-a13e-4a7f-96b9-0103a96bb5be
- Supersedes: Apply douwebot only after the head's CI is green (David, 2026-11-24)
2026-11-24 · 17:52Z refresh not merged: incoming main touches a durable test · iter -
- Decision: No merge and no push; head stays 36a4553687; report to the manager. Condition 2 of the refresh bound fails: main 0ff10742c5 (24 commits) changes tests/durable_exec/test_prefect.py (fa1caf1203, #14330) and adds tests/harness/computer_use/test_temporal.py (879892fc96, #11037). Conditions 1 and 3 would hold: trial merge clean, PR diff patch-id a8467a45 unchanged before the merge.
- Why: The bound reads "If any condition fails, stop and report." No Douwe reply on the PR at 17:52Z.
- Source: https://github.com/pydantic/pydantic-ai/pull/14330
- Session: 58b94757-a13e-4a7f-96b9-0103a96bb5be
2026-11-24 · Last refresh allows main's test-only durable changes (overmanager for David, 2026-11-24) · iter -
- Decision: Merge main once more; this is the last automatic refresh. Test-only durable changes from main (#14330 in tests/durable_exec/test_prefect.py, #11037's harness Temporal test) are allowed. "Stop and report if any of those fails, or if main brings in a durable source file by the time you merge": no conflicts; no durable source, DynamicToolset or contract-manifest files; PR diff unchanged. Key check before the push; re-apply douwebot only after CI succeeds on the pushed head, "Never in the same batch as the push." Once CI and douwebot pass, edit issuecomment-7113145991 in place to name the new head plus one clause that it also brings in main's #14330 Prefect test pins; "Post no new comment and ping no one." Then "stop at that head's freshness expiry as already ruled: no further merge, report to me."
- Why: Overmanager dispatch 2026-11-24T17:55Z relaying David: the no-durable-files condition protects Douwe's confirmation from changes to durable source; test pins that check durable behavior don't change what he confirmed, and CI should prove the PR against them before the merge queue does.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 58b94757-a13e-4a7f-96b9-0103a96bb5be
- Supersedes: 17:52Z refresh not merged: incoming main touches a durable test
2026-11-24 · Push exemption at b829f7b8709351c5474a7d344de16b88ce1696b7 (last refresh merge) · iter -
- Decision: Clean merge of upstream/main 799e6c9d5c (26 commits) with no conflict resolution, pushed at 17:56Z with no local review (budget spent, and the delta is exempt); douwebot waits for CI on this head.
- Why: No Douwe reply at 17:56Z. Incoming durable files are tests only (tests/durable_exec/test_prefect.py from #14330, tests/harness/computer_use/test_temporal.py from #11037), as allowed; no durable source, DynamicToolset or manifest file; PR diff patch-id a8467a45 before and after; durable_exec_contract.py --write leaves the manifest unchanged; key check 0.
- Source: https://github.com/pydantic/pydantic-ai/pull/13326
- Session: 58b94757-a13e-4a7f-96b9-0103a96bb5be
Checklist
- No breaking changes in accordance with the version policy.
- Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
- PR title is fit for the release changelog.