feat: post-transition cooldown for FissionFusionManager (#68)#77
feat: post-transition cooldown for FissionFusionManager (#68)#77
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0bf8eab4f5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| """ | ||
| # Cooldown gate: suppress transitions during refractory period | ||
| if self._last_transition_time is not None: | ||
| elapsed = (datetime.now(UTC) - self._last_transition_time).total_seconds() |
There was a problem hiding this comment.
Use monotonic time for cooldown gating
Measure the cooldown with a monotonic clock instead of datetime.now(UTC), because wall-clock adjustments (e.g., NTP corrections or manual time changes) can make elapsed jump backward or forward and incorrectly prolong or bypass the refractory period. In long-running agents this can produce unexpected transition suppression or immediate re-transition even though the intended cooldown duration has not actually passed.
Useful? React with 👍 / 👎.
Suppress transitions during refractory period after fission/fusion to prevent rapid oscillation. Default cooldown: 2× evaluation_interval. - _last_transition_time tracked in perform_fission() and perform_fusion() (including early-return paths) - should_transition() returns None during cooldown - 5 new tests in TestTransitionCooldown Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0bf8eab to
8babe81
Compare
Summary
2 × evaluation_interval(60s at default 30s interval)should_transition()returnsNoneduring cooldown — hysteresis alone was insufficient for conflict-resolution transitionsperform_fission()andperform_fusion()record transition time (including early-return paths)Closes #68
Test plan
TestTransitionCooldownruff check+mypy— 0 errors🤖 Generated with Claude Code