Skip to content

feat(engine): add pre-flight check to skip coder sessions when work is done (fixes #511)#513

Open
mickume wants to merge 1 commit intodevelopfrom
feat/issue-511-preflight-check
Open

feat(engine): add pre-flight check to skip coder sessions when work is done (fixes #511)#513
mickume wants to merge 1 commit intodevelopfrom
feat/issue-511-preflight-check

Conversation

@mickume
Copy link
Copy Markdown
Contributor

@mickume mickume commented Apr 22, 2026

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 test passes. 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

File Change
agent_fox/engine/preflight.py New module: run_preflight(), is_task_group_done(), has_active_critical_findings(), do_tests_pass()
agent_fox/engine/engine.py Integrate preflight in _prepare_launch() for coder archetype on attempt 1; add _run_preflight() helper
agent_fox/knowledge/audit.py Add PREFLIGHT_SKIP audit event type
tests/unit/engine/test_preflight.py 21 unit tests covering all gates, short-circuit logic, DB/file fallback

Tests

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

Verification

  • All existing tests pass: ✅ (5249)
  • New tests pass: ✅ (21 new, 5270 total)
  • Linter / formatter: ✅
  • No regressions: ✅

Auto-generated by af-fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant