Skip to content

Instruct agents to reduce direct AirflowException usage#68656

Merged
shahar1 merged 1 commit into
apache:mainfrom
shahar1:agent-instructions-reduce-airflowexception
Jun 17, 2026
Merged

Instruct agents to reduce direct AirflowException usage#68656
shahar1 merged 1 commit into
apache:mainfrom
shahar1:agent-instructions-reduce-airflowexception

Conversation

@shahar1

@shahar1 shahar1 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Human Summary

I've noticed that agent created PRs still use raise AirflowException directly, which might indicate a bug in the corresponding pre-commit (should be handled separately) - but it would be also nice to enforce it from the agent's side as well.

AI Summary

Make explicit on both the authoring and review sides that direct AirflowException raises are being reduced, not added. New direct usages are disallowed (already enforced by the check-no-new-airflow-exceptions prek hook), and the reviewer guidance clarifies that the only acceptable movement of an AirflowException line is relocating an already-existing one verbatim during a refactor, which is not a new usage.


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the 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) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

Make explicit on both the authoring and review sides that direct
AirflowException raises are being reduced, not added. New direct usages
are disallowed (already enforced by the check-no-new-airflow-exceptions
prek hook), and the reviewer guidance clarifies that the only acceptable
movement of an AirflowException line is relocating an already-existing
one verbatim during a refactor, which is not a new usage.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@shahar1

shahar1 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

Idea:
Maybe we could have a mechanism to turn each pre-commit into a skill that instructs the agent how to pass it, so we could avoid polluting the agents' instructions with detailed coding standards that basically "echo" the purpose of the pre-commits.

Flow example:

  1. In each pre-commit's script (or description in .pre-commit-config) we'll have the detailed instruction (as a comment).
  2. We'll have a script that generates a skill for each pre-commit.
  3. Each coding standard in code-review.instructions.md will include a table where each row indicates the pre-commit and what should trigger it (e..g, if the agent thinks of raising an exception - it should load the skill that is associated with it.

@shahar1
shahar1 merged commit c5bbd4b into apache:main Jun 17, 2026
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants