#[0.13.1] - 2026-03-30
Patch release that adds the agent prompt to OTel span attributes and simplifies internal agent and watch-loop code.
#Fixed
-
Agent prompt now captured in tracing spans
The input prompt passed to
agent.run()was not included in OpenTelemetry span attributes, making it difficult to correlate a trace with the original request in observability tooling (Datadog, Jaeger, etc.)._map_metadata_to_attributes()now writes the prompt underdaita.agent.prompt, truncated to 2 000 characters:python# visible in your OTel backend after this release daita.agent.prompt = "Summarize the Q4 report and highlight risk items."No changes to user-facing code are required — the attribute is populated automatically from the
promptkwarg already passed internally tospan(). -
Watch loop
_previous_valueassignment made unconditionalIn
BaseAgent._watch_loop(),state._previous_valuewas only updated on the trigger and resolve branches, not on the neutral (no-op) branch. This meantprevious_valueavailable inside a handler could be stale if several no-op ticks occurred between trigger events.The assignment is now the first thing done each iteration, before any branch is taken, so handlers always see an accurate previous value.
-
_call_on_errorextracted from_invoke_handlerThe pattern of calling
config.on_errorand silently swallowing any secondary exceptions was duplicated forTimeoutErrorand generalExceptionpaths in_invoke_handler. The two identical blocks have been collapsed into a single_call_on_error()helper — no behavioral change. -
Agent.__init__andAgent.runinternal cleanup