Skip to content

fix(circuit-breaker): preserve recovery timeout while open (#469) - #667

Merged
rafaelscosta merged 1 commit into
mainfrom
fix/issue-469-circuit-breaker-timeout-20260507
May 7, 2026
Merged

fix(circuit-breaker): preserve recovery timeout while open (#469)#667
rafaelscosta merged 1 commit into
mainfrom
fix/issue-469-circuit-breaker-timeout-20260507

Conversation

@rafaelscosta

@rafaelscosta rafaelscosta commented May 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Validation

  • node -c .aiox-core/core/ids/circuit-breaker.js
  • npm test -- tests/core/ids/verification-gates.test.js --runInBand
  • npm run validate:manifest
  • npm run validate:publish
  • npm run lint -- --quiet
  • npm run typecheck
  • npm run test:ci — 314 passed suites, 7835 passed tests, 149 skipped
  • npm test -- tests/core/ids/entity-registry-schema.test.js --runInBand
  • git diff --check

Supersedes #618.
Refs #469.

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Fixed circuit breaker recovery timeout behavior to preserve the original timeout despite repeated failures occurring while the circuit is in the OPEN state. This ensures proper recovery to HALF_OPEN after the timeout elapses.
  • Tests

    • Added regression test to verify circuit breaker timeout handling in the OPEN state.
  • Documentation

    • Added documentation for circuit breaker recovery timeout fix.

@vercel

vercel Bot commented May 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
aiox-core Ready Ready Preview, Comment May 7, 2026 1:28pm

Request Review

@github-actions github-actions Bot added area: agents Agent system related area: workflows Workflow system related squad mcp type: test Test coverage and quality area: core Core framework (.aios-core/core/) area: installer Installer and setup (packages/installer/) area: synapse SYNAPSE context engine area: cli CLI tools (bin/, packages/aios-pro-cli/) area: pro Pro features (pro/) area: health-check Health check system area: docs Documentation (docs/) area: devops CI/CD, GitHub Actions (.github/) labels May 7, 2026
@coderabbitai

coderabbitai Bot commented May 7, 2026

Copy link
Copy Markdown

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 90387799-4e8c-4e3f-844a-090b85eb94ec

📥 Commits

Reviewing files that changed from the base of the PR and between 818c954 and c269e02.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (6)
  • .aiox-core/core/ids/circuit-breaker.js
  • .aiox-core/data/entity-registry.yaml
  • .aiox-core/install-manifest.yaml
  • docs/stories/epic-123/STORY-123.11-circuit-breaker-recovery-timeout.md
  • package.json
  • tests/core/ids/verification-gates.test.js

Walkthrough

This pull request fixes a CircuitBreaker regression where the recordFailure() method would repeatedly update failure timestamps and counters even when the circuit was already OPEN. The fix adds an early-exit guard to skip state mutations during the OPEN state, preserving the original recovery timeout. The change includes a regression test with time mocking, documentation, and a patch version bump to 5.1.7.

Changes

CircuitBreaker Recovery Timeout Fix

Layer / File(s) Summary
Core Logic Fix
core/ids/circuit-breaker.js
recordFailure() returns early when state is OPEN, preventing updates to failure counters and lastFailureTime.
Regression Test
tests/core/ids/verification-gates.test.js
New test mocks Date.now() to verify that repeated failures during OPEN state do not advance lastFailureTime and that transition to HALF_OPEN occurs at the original reset timeout.
Story Documentation
docs/stories/epic-123/STORY-123.11-circuit-breaker-recovery-timeout.md
Documents the recovery timeout bug fix (issue #469), acceptance criteria, and implementation details.
Version & Manifests
package.json, .aiox-core/data/entity-registry.yaml, .aiox-core/install-manifest.yaml
Package version bumped to 5.1.7; entity registry and install manifest regenerated with updated checksums and timestamps.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

area: core, type: test, area: docs, area: installer

Suggested reviewers

  • oalanicolas
  • Pedrovaleriolopez
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly describes the main fix: preserving the recovery timeout in CircuitBreaker's OPEN state, with specific issue reference #469.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/issue-469-circuit-breaker-timeout-20260507

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage Report

Coverage report not available

📈 Full coverage report available in Codecov


Generated by PR Automation (Story 6.1)

@rafaelscosta
rafaelscosta merged commit 29fc469 into main May 7, 2026
41 checks passed
@rafaelscosta
rafaelscosta deleted the fix/issue-469-circuit-breaker-timeout-20260507 branch May 7, 2026 13:33
tuanmedeiros pushed a commit to tuanmedeiros/aios-core-synkraay that referenced this pull request Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: agents Agent system related area: cli CLI tools (bin/, packages/aios-pro-cli/) area: core Core framework (.aios-core/core/) area: devops CI/CD, GitHub Actions (.github/) area: docs Documentation (docs/) area: health-check Health check system area: installer Installer and setup (packages/installer/) area: pro Pro features (pro/) area: synapse SYNAPSE context engine area: workflows Workflow system related mcp squad type: test Test coverage and quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant