kaxil opened a new pull request, #73366: URL: https://github.com/apache/airflow/pull/73366
`LLMBranchOperator.execute` builds the enum of branch options straight out of `self.downstream_task_ids`, which is a `set`. Set iteration order follows string hashing, and Python randomises string hashing per process, so two workers running the same task can send the model the same branches in a different order. The approval path a few lines below already does `sorted(self.downstream_task_ids)` for its review form; the enum now sorts the same way. For a text model this is mostly cosmetic. For a classifier model such as TypeSafe Jev (#73363), option order is part of the question, and the classifier guide already warns that order can influence a close pick. A branch that is deterministic on one worker and different on the next is a hard bug to reproduce, which is why this is worth a fix on its own rather than waiting for the larger work on confidence handling. The test sets `downstream_task_ids` to a reverse-sorted list and asserts the enum members reach `create_agent` in sorted order. Two sets of the same strings would iterate identically within one process, so that would not have exercised anything; the list stands in for an unlucky set order. The test fails on `main` with the members reversed. --- ##### Was generative AI tooling used to co-author this PR? <!-- If generative AI tooling has been used in the process of authoring this PR, please change below checkbox to `[X]` followed by the name of the tool, uncomment the "Generated-by". --> - [ ] Yes (please specify the tool below) <!-- Generated-by: [Tool Name] following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) --> --- * Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information. Note: commit author/co-author name and email in commits become permanently public when merged. * For fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed. * When adding dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x). * For significant user-facing changes create newsfragment: `{pr_number}.significant.rst`, in [airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments). You can add this file in a follow-up commit after the PR is created so you know the PR number. -- 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]
