Repository navigation
fix(monitoring): report measured 0% uptime and 0 ms latency instead of null - #4699
Merged
Merged
Conversation
…f null
The agent health detail handler used a truthiness test for the 24h
figures, so a measured 0.0 came back as null ("never measured"). Use
'is not None' so only a missing measurement is null.
Fixes Abilityai#4685
Signed-off-by: Alex Castillo <[email protected]>
2 tasks
Contributor
|
merge-train (2026-11-21): on this train. Validated at The same truthiness bug is still in Your CI runs were waiting for maintainer approval; they are approved and running now. |
6 of 12 tasks
vybe
added a commit
to pcbeingused333/trinity
that referenced
this pull request
Nov 22, 2026
… — 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]>
vybe
added a commit
that referenced
this pull request
Nov 23, 2026
…orm_health_check (#4720) * fix(monitoring): report measured 0% uptime and 0 ms latency from perform_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 #4699 did for the router's own builder. Fixes #4702 Signed-off-by: Alex <[email protected]> * merge-train: sys.modules lint fix + learnings fragment (#4702) — 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 (#4685, #4699, #4702) Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Eugene Vyborov <[email protected]> --------- Signed-off-by: Alex <[email protected]> Signed-off-by: Eugene Vyborov <[email protected]> Co-authored-by: Eugene Vyborov <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
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 #4685
Description
GET /api/monitoring/agents/{name}builtuptime_percent_24handavg_latency_24h_mswith a truthiness test (if uptime else None). A measured0.0(an agent unreachable for the whole 24 h window, or a measured 0 ms latency) is falsy, so the response carriednull, which consumers read as "never measured". Both fields now useis not None, so only a missing measurement isnull.Related Issue
Fixes #4685
Journey Impact
Journey Impact: none: only the agent health detail response changes, from
nullto0.0when 0 was measuredType of Change
Testing
New
tests/unit/test_4685_health_measured_zero.py(registered intests/registry.json) calls the real handler against a real DB (same harness as #3950): an agent with only an unreachable aggregate check and a 0.0 ms network check must report0.0for both fields (fails ondevwithNone), and an agent whose only checks are outside the 24 h window still reportsNonefor both. With the fix both pass, as do the 10 tests intest_3950_fleet_health_current.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