feat(circuit-breaker): read-only state introspection (0.14.0)#70
Merged
Conversation
…perty Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…otes Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Design + plan for the read-only state property + public CircuitState enum, and the Active Index entry. Bundle stays active/draft until merge. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
lesnik512
added a commit
that referenced
this pull request
Jun 16, 2026
Post-merge bookkeeping for PR #70: fill the 0.14.0 release-notes PR number, mark the bundle shipped (pr: 70), move it active -> archive, flip its Index line to Archived, and trim the deferred CircuitBreaker entry to just manual control now that read-only state has shipped. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Exposes the circuit breaker's current state read-only, via a public
CircuitStateenum and astateproperty on bothAsyncCircuitBreakerandCircuitBreaker— for health/readiness endpoints, dashboards, and tests.Closes the cheap half of the deferred CircuitBreaker introspection item (manual control
force_open/force_closedstays deferred). Ships as 0.14.0 (additive, no breaking changes).What's in it
CircuitStateenum — promoted from the private_CircuitState(CLOSED/OPEN/HALF_OPEN); exported fromhttpwareandhttpware.middleware.resilience.stateproperty on both wrappers — a pure read of the stored state: no lock, no clock, and it never triggers the lazyOPEN→HALF_OPENtransition (that stays inadmit, on the next request afterreset_timeout). SostatereportsOPENuntil a request is actually admitted as the probe — documented as the raw-read caveat.architecture/resilience.md,docs/resilience.md, and 0.14.0 release notes.No behavior change to either trip mode; version is tag-driven, so
pyproject.tomlis untouched.Design + plan:
planning/changes/active/2026-06-16.03-circuit-breaker-state/.Test plan
just test— 704 passed, 100% coveragejust lint— clean (ruff format/check + ty)reset_timeoutwith no request); public-API export + identitymkdocs build --strict— clean🤖 Generated with Claude Code