pierrejeambrun opened a new pull request, #75208: URL: https://github.com/apache/airflow/pull/75208
#74272 and #74355 made `LLMOperator` publish its model name, `usage` and `run_id` on XCom and stamp the task-instance identity on its GenAI spans. #74334 added the AI Model tab that reads those XComs. `LLMBranchOperator`, `LLMSQLQueryOperator`, `LLMSchemaCompareOperator` and `LLMFileAnalysisOperator` got none of this, because they override `execute()` without calling `super().execute()`. You couldn't see what a branch or SQL-generation task cost, or which model answered, without reading its logs. This was left as follow-up work in those PRs. Calling `super().execute()` from the subclasses would not work. `LLMOperator.execute()` also writes the generic decision record and applies the confidence gate, the `on_uncertain` policy and its own review body. `LLMBranchOperator` replaces all of that with its own decision record. The SQL, schema-compare and file-analysis operators don't use any of it. Copying the reporting block into four overrides would mean four copies of the failure path and its guards to keep in sync. So the reporting now happens in `_run_llm`, which every one of these `execute()` methods already calls to run the agent. The four subclasses report the same metadata as `LLMOperator` without changing their own code, and so would any future subclass. The AI Model tab is now scoped to the four operators and their `@task.llm_*` decorators too. `LLMBatchOperator` is not an `LLMOperator` subclass and is unchanged. The changes to existing subclass tests are mechanical. The agent mocks now allow `instrument`, since identity stamping runs. The `run_sync` call assertions now include the `usage` (and, where a task instance is present, `run_id`) the run is called with. related: #74272, #74334, #74355 --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (Opus 5.5) Generated-by: Claude Code (Opus 5.5) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- 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]
