YAshhh29 commented on code in PR #71575:
URL: https://github.com/apache/airflow/pull/71575#discussion_r4150235864


##########
providers/common/ai/docs/durable_execution.rst:
##########
@@ -102,6 +102,33 @@ cache:
    never replays responses that belong to a different conversation.
 4. After successful completion, the cached steps are deleted.
 
+Fingerprints are computed from pydantic's JSON rendering of each value, the 
same
+rendering a json-mode dump produces, so ordinary types that are not JSON -- a
+``datetime`` or ``Decimal`` tool argument, a dataclass in ``tool_choice``, the
+bytes in a ``BinaryContent``, a dict keyed by date -- fingerprint normally, and
+entries cached by an earlier version still match. The one adjustment is that 
the
+members of a ``set`` are ordered before hashing, so a set matches on a later
+attempt too. If a value cannot be rendered at all, that step is not cached, 
and on
+retry it runs live rather than replaying an unverified entry. A parameter 
annotated ``Iterable[...]`` is one such case:
+pydantic validates it lazily, and reading it in order to hash it would consume
+the input the tool itself has not read yet, so the step runs live instead of
+being cached.
+
+On the model path this is rarely confined to a single step: the causes are 
such a
+value in ``model_settings``, which is attached to every request, in the tool
+definitions the request carries, or in the message history, which every later
+request carries forward. Any one of them degrades all subsequent model steps 
the
+same way, leaving durable execution with nothing to
+replay, so the retry re-runs the agent at full cost. The

Review Comment:
   Reworded along those lines. It now says it degrades every model step from 
that point on, so the retry re-runs from there. For settings and tool 
definitions that point is normally the first request, though callable settings 
or a tool's `prepare` can bring one in later.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to