feat(engine): add pre-flight check to skip coder sessions when work is done (fixes #511)#513
Open
feat(engine): add pre-flight check to skip coder sessions when work is done (fixes #511)#513
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Added a lightweight pre-flight check that runs before every first-attempt coder session. It evaluates three gates in order (short-circuiting on first failure): (1) task group completion via DB then tasks.md fallback, (2) no active critical/major review findings, (3)
make testpasses. If all gates pass, the session is skipped and the node is marked completed — saving the full cost of an Opus coder session.Closes #511
Changes
agent_fox/engine/preflight.pyrun_preflight(),is_task_group_done(),has_active_critical_findings(),do_tests_pass()agent_fox/engine/engine.py_prepare_launch()for coder archetype on attempt 1; add_run_preflight()helperagent_fox/knowledge/audit.pyPREFLIGHT_SKIPaudit event typetests/unit/engine/test_preflight.pyTests
tests/unit/engine/test_preflight.py: DB completion check, file completion check, DB-first fallback, findings detection (critical/major/minor), test pass/fail gate, full preflight flow, short-circuit behaviorVerification
Auto-generated by
af-fix.