Give the `PydanticAIDocs` and `BrowserUse` toolsets an `id`, as Temporal requires
Written by Claude Code on behalf of @DouweM.
Part of #9233
Why we make these changes
A Temporal agent with PydanticAIDocs or BrowserUse fails at construction with Toolsets that are 'leaves' ... need to have a unique id ... Temporal, because both build their toolset without an id. For PydanticAIDocs the error's advice doesn't help: the capability already has id='pydantic_ai_docs', it just isn't forwarded. These were the last two _TOOLSET_WITHOUT_ID exemptions citing #9233 in tests/capability_cases.py.
PydanticAIDocsforwards itsidto its toolset, so the default'pydantic_ai_docs'and a customidname the toolset;id=Nonestays id-less, as theunset_idcontract asks.BrowserUsepasses itsid, or'browser_use'when unset, asShellandFileSystemdo. Its capabilityiddefault is unchanged (Collidescase), so repeats behave as before.
Left open on #9233: whether FileSystem/Shell should declare a capability default id, which tests/capability_cases.py records as an owner decision (merging would union allow-lists).
New public surface
PydanticAIDocsToolset(..., id: str | None = None)andBrowserUseToolset(..., id: str | None = None): optional keyword, likeShellToolset/FileSystemToolset. API compat check against v2.77.0 passes.
User-visible behavior
Agent(model, capabilities=[PydanticAIDocs(), TemporalDurability()])
# before: UserError (leaf toolset needs an id)
# after: registers agent__<name>__toolset__pydantic_ai_docs__call_tool
PydanticAIDocs still doesn't run under Temporal: each run builds a new toolset with the same id, which Temporal refuses when the run starts in a workflow (the DURABLE_TEMPORAL exemption in tests/capability_cases.py). #15623 fixes that by sharing the toolset across runs, and the docs now say so.
Verification
- New
test_temporal_names_pydantic_ai_docs_activities_after_the_capability_idintests/harness/test_durable_engine_exports.py(default and customid), andtest_the_toolset_id_is_the_capability_id_or_browser_useintests/harness/browser_use/test_browser_use.py. That module can't name Temporal, because the harness Temporal job collects every module that mentions it and has nobrowser_use. unset_id/custom_idcontracts now hold forPydanticAIDocsandcustom_idforBrowserUse(stale exemptions removed).- Without the fix, the
PydanticAIDocstest fails with the TemporalUserError(run in-process). TheBrowserUsetest runs only in the browser-use CI job (not installed locally). scripts/durable_exec_contract.py --write: no change.
What changes for existing users
No persisted unit name moves: Temporal and every engine that wraps function toolsets refused these toolsets, and DBOS doesn't wrap FunctionToolsets. Outside durable execution the toolsets' id is now set instead of None.
- Deprecated
PrefectAgent: it accepted the id-less docs and browser toolsets and wrapped them in tasks. Their task names don't change, but the task cache key includes the toolset id. So aPrefectAgentflow retried across the upgrade misses its saved result once and runsread_pyai_docsorbrowse_webagain, the same as when a tool's description changes between releases. - DBOS with
child_workflowselected (viaSetToolMetadata): these toolsets now register a child workflow, where that setup raisedUserErrorbefore. This can change DBOS's application-version hash.
PR decisions
- 2026-11-30 pre-push review 1 of 3 at 5d33d665536652ac808b1ef57e4c07e5d47744d0: no findings (
current at 5d33d66). Tree 58d88b08a9b81818bdf05c975f6922802d08d10a; full branch vs merge base ffd953b3b2; fresh read-only reviewer from anorigin/mainpolicy checkout. - 2026-11-30 scope: fix only the capabilities whose toolset Temporal refuses; deriving default ids in the engines (position-based, or one generic
call_toolunit) was considered and left out, as it adds a new identity rule that maintainers chose against (_explicit_idonly,durable_exec/_base.py). - 2026-11-30 083f6ad5 pushed under the test-harness-repair exemption, chained from reviewed SHA 5d33d66 (review budget 1 of 3 used). The delta is test code only: it moves the BrowserUse test off Temporal and pins
TemporalDurability[None]for Pyright, after the first CI run. - 2026-11-30 b9b1d168 and 23c42ae7 pushed under the same test-only exemption, chained from 5d33d66. b9b1d168 asserts the BrowserUse toolset's
_explicit_id(PR Review Checks finding). 23c42ae7 builds the docs test's agents inline, so Pyright infers their deps type. - 2026-11-30 6986d877 pushed under the same test-only exemption, chained from 5d33d66. It applies two PR Review Checks findings: the Temporal test moves to
test_durable_engine_exports.py, and the BrowserUse test asserts the publicid. Three findings were declined with evidence: the test never runs the agent, so the docs-path env var can't reach it; no CI job has bothbrowser_useandtemporalio; DBOS doesn't wrapFunctionToolsets.
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.