Skip to content

fix(auto-reconciler): fix scheduling, notifications, and drift detection#239

Merged
JeroenSoeters merged 4 commits intomainfrom
fix/auto-reconciler-bugs
Feb 13, 2026
Merged

fix(auto-reconciler): fix scheduling, notifications, and drift detection#239
JeroenSoeters merged 4 commits intomainfrom
fix/auto-reconciler-bugs

Conversation

@JeroenSoeters
Copy link
Copy Markdown
Collaborator

@JeroenSoeters JeroenSoeters commented Feb 13, 2026

Summary

Fixes several bugs in the auto-reconciler that prevented it from working correctly:

  • Completion notifications: Auto-reconciler now receives ChangesetCompleted messages to know when to schedule the next reconcile
  • Startup scheduling: Use minimum 1s delay for SendAfter (0s doesn't work reliably in Ergo)
  • Drift detection: GetResourcesAtLastReconcile now gets declared state from the last USER reconcile command, not the latest synced version which includes out-of-band changes

Also improves display format: "Auto-reconcile: every 2m"

The auto-reconciler was only reconciling once because it wasn't
receiving notifications when changesets completed. The changeset
executor sends ChangesetCompleted messages, but the auto-reconciler
was waiting for a ReconcileComplete message that was never sent.

- Set NotifyOnComplete: true when starting changesets
- Handle ChangesetCompleted instead of the unused ReconcileComplete
- Remove dead code: ReconcileComplete struct and its handler
- Use minimum 1s delay instead of 0s for SendAfter (0s doesn't work
  reliably in Ergo framework)
- Add logging for number of stacks found at startup
- Change policy display from "Interval: 2m" to "AutoReconcile: 2m"
  for consistency with "TTL: 1h" format
…t detection

The GetResourcesAtLastReconcile query was getting the latest version of
resources, which includes out-of-band changes pulled in by sync. This
meant auto-reconciler was comparing synced state vs synced state,
detecting no drift.

Fixed to get resources from the last USER reconcile command (excluding
auto-reconciler commands), which represents the declared state that
should be enforced.

Also improved display format to "Auto-reconcile: every 2m".
@JeroenSoeters JeroenSoeters force-pushed the fix/auto-reconciler-bugs branch from 1bb4a97 to d1cfe05 Compare February 13, 2026 23:09
discount-elf
discount-elf previously approved these changes Feb 13, 2026
Moved manual test cases to ~/dev/pel/formae-test-cases/ for local testing.
Fixed gofmt formatting issue in auto_reconciler.go.
@JeroenSoeters JeroenSoeters merged commit b90c4c2 into main Feb 13, 2026
5 checks passed
@JeroenSoeters JeroenSoeters deleted the fix/auto-reconciler-bugs branch February 13, 2026 23:39
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.

2 participants