Skip to content

fix(engine): skip redundant cleanup ingestion when barrier already ran (fixes #505)#509

Open
mickume wants to merge 1 commit intodevelopfrom
fix/issue-505-double-git-ingestion
Open

fix(engine): skip redundant cleanup ingestion when barrier already ran (fixes #505)#509
mickume wants to merge 1 commit intodevelopfrom
fix/issue-505-double-git-ingestion

Conversation

@mickume
Copy link
Copy Markdown
Contributor

@mickume mickume commented Apr 22, 2026

Summary

Eliminates double git ingestion at end-of-run by tracking whether a sync barrier already performed ingestion. The _cleanup_infrastructure function now skips run_background_ingestion when the barrier flag is set, while still running it when no barrier fired (e.g., single-task plans or sync_interval=0).

Closes #505

Changes

File Change
agent_fox/engine/run.py Set _barrier_ingestion_ran flag in _barrier_sync; guard cleanup ingestion behind flag check
tests/unit/engine/test_double_ingestion.py 3 regression tests

Tests

  • test_cleanup_skips_ingestion_after_barrier — no double ingestion
  • test_cleanup_ingests_when_no_barrier_ran — cleanup still works when needed
  • test_barrier_failure_still_sets_flag — flag set even on ingestion failure

Verification

  • All existing tests pass: ✅ (5246 unchanged)
  • New tests pass: ✅ (3 added)
  • 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