kaxil commented on code in PR #76864:
URL: https://github.com/apache/airflow/pull/76864#discussion_r4550718547


##########
providers/common/ai/src/airflow/providers/common/ai/durable/capability.py:
##########
@@ -99,8 +101,39 @@
 # types have changed since, so replaying it would fail on every retry.
 _UNLOADABLE = "the recorded result no longer loads, so it was written by 
another version"
 
-_NO_CONFIG: RoleBasedOperationConfig[None] = RoleBasedOperationConfig(
-    model=None, event=None, capability=None, tool=None
+# How an operation's step is run: looked up in the journal and recorded, or 
always run live.
+_StepMode: TypeAlias = Literal["journal", "live"]
+
+
+def _is_tool_journaled(tool_def: ToolDefinition) -> bool:
+    """Whether calls of a tool are journaled; ``metadata={"airflow": False}`` 
runs them live on every attempt."""
+    setting = (tool_def.metadata or {}).get(TOOL_CONFIG_KEY)
+    if setting is None:
+        return True
+    if isinstance(setting, bool):
+        return setting
+    raise UserError(

Review Comment:
   Done in be8340156d3. A bad value now raises `DurableToolMetadataError`, an 
`AirflowFailException`, before the first model request, so the task fails once. 
I check it in `before_model_request` rather than `prepare_tools`: the request's 
tool definitions carry metadata from `SetToolMetadata`, which wraps the 
toolset, while `prepare_tools` saw them before that metadata was applied. 
Outside a task, where durable execution is off, nothing is checked. Docs no 
longer say "as do its retries".



-- 
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