Recommend `on_change='append'` for instructions that change mid-conversation across the docs
Merged
DO
1mo ago+194+194+012345678901234567890123456789-21-21-01234567890123456789
Follow-up to #8188. Before this PR, on_change='append' was documented only in docs/agent.md. Now every page that explains dynamic instructions recommends it for instructions that change mid-conversation, explains the trade-off (the prefix stays cached, at the cost of storing the block's complete new text in history for each change) and shows how to opt in on that surface.
Docs only. Docstrings change but code doesn't.
docs/agent.md: a tip in the Instructions section, a recommendation and trade-off in "Appending instruction changes", a table of how each instruction source opts in, and a list of the sources that can't opt in yet, each with an alternative that can (except MCP server instructions).docs/toolsets.md: a new "Toolset instructions that change" section with a runnableFunctionToolsetsubclass example.@toolset.instructionshas noon_change. The section also coversget_instructions()on custom toolsets, and@agent.toolset(id=...)for dynamic toolsets.docs/capabilities/custom.md: a new "Instructions that change during a conversation" section. Its runnable example hasget_instructions()return anInstructionPart(on_change='append')thatfor_runrebuilds per run, and it points toCapabilityplus@capability.instructions(..., on_change='append')for text that changes during a run. The steering-messages table now recommends append mode instead of saying "re-sends everything uncached".docs/capabilities/caching.md,docs/message-history.md,docs/models/anthropic.md,docs/models/openai.md: short pointers where those pages describe dynamic instructions and the cache.- Docstrings:
AbstractCapability.get_instructions,AbstractToolset.get_instructions,FunctionToolset.instructions, andon_changeonAgent.instructionsandCapability.instructions. - Agent skill:
AGENTS-CORE.mdlists how each surface opts in.CAPABILITIES-AND-HOOKS.mdno longer recommends aget_instructionscallable for tracked state.
Checklist
- No breaking changes in accordance with the version policy.
- Any permitted compatibility impact has a label, warning, migration, release note, and exact API-check waiver.
- PR title is fit for the release changelog.
š¤ Generated with Claude Code