GoalToolsMiddleware(
self,
)AgentMiddleware[GoalToolState, ContextT]Expose constrained goal tools and maintain the goal-state notice.
Besides registering get_goal/get_rubric/update_goal, this middleware
keeps the model oriented at each model boundary: before_model persists a
fresh goal-state notice into checkpointed history when the latest one no
longer matches authoritative state, and wrap_model_call re-pins the
notice into the (post-summarization) request when the persisted one is out
of view. Tool usage guidance lives in the tool docstrings and notices.
Persist a current goal-state notice into checkpointed history.
This is the durable half of the notice mechanism; the transient
counterpart in wrap_model_call re-pins the notice into a request whose
persisted notice has scrolled out of the model-visible window.
Persist a current goal-state notice at an async model boundary.
Async twin of before_model; see it for the persisted-vs-transient split.
Re-pin the goal-state notice into each model request when needed.
Re-pin the goal-state notice into each async model request when needed.