Repository navigation
fix(monitoring): report measured 0% uptime and 0 ms latency from perform_health_check - #4720
Merged
vybe merged 2 commits intoNov 23, 2026
Merged
Conversation
…orm_health_check
perform_health_check built its 24h figures with a truthiness test, so a
measured 0.0 came back as None ("never measured") on POST
/api/monitoring/agents/{name}/check and the first-check path of the GET.
Use 'is not None', as Abilityai#4699 did for the router's own builder.
Fixes Abilityai#4702
Signed-off-by: Alex <[email protected]>
… — mechanical, per the merge-train note on the PR - tests/unit/test_4702_perform_health_check_zero.py: register the module under test with monkeypatch.setitem instead of a bare sys.modules write (lint_sys_modules.py: 0 -> 1 violation) - docs/memory/learnings/: fragment for the truthiness-zero class (Abilityai#4685, Abilityai#4699, Abilityai#4702) Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Eugene Vyborov <[email protected]>
Contributor
|
merge-train (2026-11-22): on this train. Validated at Two mechanical changes pushed to your branch as
I also approved this fork's CI runs, so the checks will run now. |
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.
Fixes #4702
Description
perform_health_checkbuiltuptime_percent_24handavg_latency_24h_mswith a truthiness test (if uptime else None). A measured0.0(an agent down for the whole 24 h window, or a measured 0 ms latency) is falsy, soPOST /api/monitoring/agents/{name}/check(and the MCP check tool wrapping it) and the first-check path ofGET /api/monitoring/agents/{name}returnednull, which consumers read as "never measured". Both fields now useis not None, as #4699 did for the router's own builder.Related Issue
Fixes #4702
Journey Impact
Journey Impact: none: only the health check response changes, from
nullto0.0when 0 was measuredType of Change
Testing
New
tests/unit/test_4702_perform_health_check_zero.py(registered intests/registry.json) drivesperform_health_checkwith the probes and DB stubbed: a measured0.0uptime and0.0latency must come back as0.0(fails ondevwithNone), and no measurement at all still readsNone. With the fix both pass, as doestest_monitoring_dormant_skip.py.Checklist
git commit -s) — required for contributors outside the core teamThis PR was prepared with AI assistance (Claude Code); disclosed here as CONTRIBUTING asks.
🤖 Generated with Claude Code