Back to Changelog
v0.13.1
March 30, 2026

Patch: Input tracing & agent internals cleanup

Fixed

#[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 under daita.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 prompt kwarg already passed internally to span().

  • Watch loop _previous_value assignment made unconditional

    In BaseAgent._watch_loop(), state._previous_value was only updated on the trigger and resolve branches, not on the neutral (no-op) branch. This meant previous_value available 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_error extracted from _invoke_handler

    The pattern of calling config.on_error and silently swallowing any secondary exceptions was duplicated for TimeoutError and general Exception paths in _invoke_handler. The two identical blocks have been collapsed into a single _call_on_error() helper — no behavioral change.

  • Agent.__init__ and Agent.run internal cleanup