Conversation
Introduces a CircuitBreaker class implementing the CLOSED → OPEN → HALF_OPEN state machine with configurable failure threshold and exponential backoff cooldown. Includes a CircuitBreakerRegistry for lazy per-DAO breaker creation and unit tests covering threshold, reset, and probe behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wires the CircuitBreakerRegistry into config (env vars), the proxy catch-all, the fan-out helper, and both service classes. Adds a global CircuitOpenError handler returning 503. Exposes per-DAO circuit states on the /health endpoint. Updates all affected tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Search endpoints were missing the cache-control middleware, causing search results to bypass the gateful Redis cache-aside layer entirely. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f11b8b136a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
This comment was marked as resolved.
This comment was marked as resolved.
4xx client errors should not count as upstream failures. Mirrors the existing proxy route behavior (res.status >= 500). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Resolve conflicts: - apps/api proposals: keep both skip-pagination tag (dev) and setCacheControl (HEAD) - apps/gateful/src/index.ts: keep CircuitBreakerRegistry import (HEAD) and storeOpenApiSpec (dev) - apps/gateful/src/shared/fan-out.ts: use dev's structured logger with HEAD's CircuitOpenError vs error severity split
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c126b5539c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 54f5716018
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Summary
Add a circuit breaker with exponential backoff to the Gateful API gateway, protecting the system from cascading failures when upstream DAO APIs become unavailable. When a DAO backend exceeds a configurable failure threshold, its circuit opens and requests are fast-failed with a 503 response until a cooldown-based probe succeeds.
Changes
CircuitBreakerclass (shared/circuit-breaker.ts): implements the CLOSED -> OPEN -> HALF_OPEN state machine with configurable failure threshold, cooldown, exponential backoff, and max cooldown capCircuitBreakerRegistry(shared/circuit-breaker-registry.ts): lazily creates and manages per-DAO circuit breaker instancesCIRCUIT_BREAKER_FAILURE_THRESHOLD,CIRCUIT_BREAKER_COOLDOWN_MS, andCIRCUIT_BREAKER_MAX_COOLDOWN_MSenv vars with sensible defaults/healthresponseCircuitOpenErrorlogs from error to warnDaosService,DelegationService): updated constructors to accept and pass through the registryCircuitOpenErrorand returns a 503 JSON responseUploading Screen Recording 2026-04-13 at 15.39.47.mov…