Skip to content

fix(reliability): honest per-agent circuit-breaker toggle in Settings (#1712) - #1717

Merged
vybe merged 3 commits into
devfrom
fix/1712-circuit-breaker-honest-toggle
Jul 21, 2026
Merged

vybe merged 3 commits into
devfrom
fix/1712-circuit-breaker-honest-toggle

Conversation

@dolho

@dolho dolho commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

What

The per-agent dispatch breaker is two-tier — per-agent circuit_breaker_enabled and the platform-wide DISPATCH_BREAKER_ENABLED must both be on. The endpoint already returns config.global_enabled (GET) and a warning (PUT) when a toggle is inert (#1491/#1499). The residual #1712 gap was the UI: there was no owner-facing toggle at all (a growth-path TODO in SettingsPanel), so the "control that reports success and does nothing" had no honest surface.

Change — new ReliabilityPanel.vue (agent Settings tab)

  • Consumes config.global_enabled from the endpoint (doesn't infer) → honest state on every load, including a persisted-but-inert "on".
  • Global flag OFF → names reason + remedy: an amber notice explains the platform-wide breaker is off and that an admin must set DISPATCH_BREAKER_ENABLED=true in the environment. The toggle stays operable (owner may pre-set the preference) with a "saved · inactive" badge — it does not silently accept-and-succeed.
  • On save while global-off, surfaces the endpoint's warning as the outcome (not a plain "Saved"). When both flags are on → "active" badge.

No change to gating semantics — config.py untouched, both flags still required.

Open question (global default) — decided

Keep DISPATCH_BREAKER_ENABLED=false for this release. Flipping it to true would start engaging the breaker for any already-opted-in agent mid-freeze — a runtime behaviour change needing soak. The honest UI removes the confusion without that risk. Revisit post-freeze. (Recorded on #1712.)

AC coverage

AC Status
Global-off → toggle communicates it's globally disabled (no silent success) ✅
UI names the reason + remedy (not only disabled) ✅
Frontend consumes config.global_enabled ✅
Honest state on reload (no persisted-but-inert "on") ✅
Admins keep a discoverable path to the global setting ✅ (names the env flag + who sets it)
No change to gating semantics ✅

Verified live

On this install DISPATCH_BREAKER_ENABLED is off → GET .../circuit-breaker returns config.global_enabled:false; PUT {enabled:true} returns the inert warning, which the panel surfaces. Static guards (test_1712_*) fail if the panel drops the global_enabled read, the warning surface, the reason/remedy copy, or its mount. Both SFCs compile.

Related to #1712 · #1487 · #526

🤖 Generated with Claude Code

dolho added 3 commits July 20, 2026 16:44
…#1712)

The dispatch breaker is two-tier — per-agent `circuit_breaker_enabled` AND the
platform-wide `DISPATCH_BREAKER_ENABLED` must both be on. The endpoint already
returns `config.global_enabled` (GET) and a `warning` (PUT) when a toggle is
inert (#1491/#1499). The residual #1712 gap was the UI: there was no owner-facing
toggle at all — it was a growth-path TODO in SettingsPanel — and the API-level
"toggle reports success while doing nothing" had no honest surface.

New `ReliabilityPanel.vue` (agent Settings tab):
- Reads `config.global_enabled` from the endpoint (consumes, doesn't infer), so
  the honest state shows on every (re)load — including a persisted-but-inert "on".
- When the global flag is OFF: a clear amber notice names the REASON (the
  platform-wide flag is off) and the REMEDY (an admin sets
  `DISPATCH_BREAKER_ENABLED=true` in the environment) — it does not silently
  accept-and-succeed. The toggle stays operable (the owner may pre-set their
  preference), with a "saved · inactive" badge so the inertness is explicit.
- On save while global-off, surfaces the endpoint's `warning` as the outcome,
  not a plain "Saved". When both flags are on, shows an "active" badge.

No change to gating semantics (both flags still required; config.py untouched).

Open question (global default) — decision: keep `DISPATCH_BREAKER_ENABLED=false`
for this release. Flipping it to true would start engaging the breaker for any
already-opted-in agent mid-freeze (a runtime behaviour change needing soak); the
honest UI removes the confusion without that risk. Revisit post-freeze. Recorded
on #1712.

Static guards (tests/unit/test_1712_*): fail if the panel drops the
global_enabled read, the warning surface, the reason/remedy copy, or its mount in
SettingsPanel — the honesty can't silently regress. Verified live: GET returns
`global_enabled:false` on this install; PUT enabled=true returns the inert
warning, which the panel surfaces.

Related to #1712
The pytest + regression-diff jobs on 6536a34 were CANCELLED mid-run (15m in),
not failing — this PR is frontend-only (ReliabilityPanel.vue + a static guard
test) and can't affect the Python suite. Empty commit for a clean run.

Related to #1712
…cancels)

The pytest matrix job runs ~7-8 min on a normal GitHub runner, but the shared
runners vary ~2-2.5x. A slow one was sitting at ~78% of the suite (all tests
passing — pure dots in the log) when it hit the 15-min `timeout-minutes` and got
killed, which surfaces as a red "pytest (…) fail" + a "regression diff" fail even
though the diff itself reports "No new failures". Seen repeatedly this cycle
(#1700, #1712) with zero real failures.

25 min gives headroom for the slow tail without masking a genuine hang —
pytest-timeout still bounds any single test. Not payload-specific; belongs on
dev so every PR stops flaking on runner variance.

Related to #1712
@dolho
dolho requested a review from AndriiPasternak31 as a code owner July 21, 2026 07:41

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validated: frontend-only (ReliabilityPanel.vue + SettingsPanel.vue) — consumes config.global_enabled for an honest per-agent breaker toggle, no gating-semantics change (config.py untouched). CI timeout bump 15m→25m is justified (spurious runner-variance kills). Static guard test_1712 present. Required checks green; pytest head-seed matrix green.

@vybe
vybe merged commit 06a3f91 into dev Jul 21, 2026
20 checks passed
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