Skip to content

fix(monitoring): scope heatmap color intensity to the agents actually shown - #5899

Merged
pedrofrxncx merged 2 commits into
mainfrom
fix/heatmap-color-scale-excludes-hidden-agents-w4
Aug 11, 2026
Merged

fix(monitoring): scope heatmap color intensity to the agents actually shown#5899
pedrofrxncx merged 2 commits into
mainfrom
fix/heatmap-color-scale-excludes-hidden-agents-w4

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Follows #5865 (tool-call heatmap by agent), which just merged.

In ToolAgentHeatmap (Overview tab), the color-intensity scale (maxValue) was computed over all (agent, tool) cells that use a top tool — before narrowing down to the top-N agents actually rendered. An agent that doesn't make the top-N by overall total, but has one large spike on a single top tool, would still inflate maxValue, silently dimming every cell of the agents that are shown (their true max never reaches the top color bucket).

Why a maintainer wants this: the heatmap is a proxy for spotting the heaviest tool/agent combos at a glance — with the bug, the color scale can be stretched by data the user never sees, making the visible cells look uniformly lighter than they should.

Fix: extracted the tool/agent selection + color-scale calculation into a pure computeHeatmapView() helper (apps/web/src/routes/orgs/monitoring/utils.ts), and moved the maxValue computation to run only over the cells for the agents that end up in topAgentIds. Added utils.test.ts with a regression test reproducing the bug (an excluded agent's spike no longer sets the max) plus a basic top-N capping test.

How to confirm: bun test apps/web/src/routes/orgs/monitoring/utils.test.ts.

Locally ran: bun run fmt, cd apps/web && bunx tsc --noEmit, bunx oxlint on the touched files, and the targeted test above — all clean. Full CI validates the rest.


Summary by cubic

Fixes heatmap color intensity in Monitoring Overview by basing the scale only on the agents shown. Visible spikes now render with the correct intensity.

  • Bug Fixes
    • Added computeHeatmapView in apps/web/src/routes/orgs/monitoring/utils.ts to select top tools/agents and compute maxValue only for rendered cells.
    • Updated ToolAgentHeatmap in overview.tsx to use computeHeatmapView; resolved merge conflict in overview.tsx after syncing with main.
    • Added utils.test.ts with a regression test (excluded-agent spike no longer skews scale) and a top‑N capping test.

Written for commit 2401bbc. Summary will update on new commits.

Review in cubic

@pedrofrxncx
pedrofrxncx enabled auto-merge (squash) August 11, 2026 14:39
@pedrofrxncx
pedrofrxncx merged commit c3b5215 into main Aug 11, 2026
31 checks passed
@pedrofrxncx
pedrofrxncx deleted the fix/heatmap-color-scale-excludes-hidden-agents-w4 branch August 11, 2026 15:28
decocms Bot pushed a commit that referenced this pull request Aug 11, 2026
PR: #5899 fix(monitoring): scope heatmap color intensity to the agents actually shown
Bump type: patch

- decocms (apps/api/package.json): 4.200.2 -> 4.200.3
- @decocms/native (apps/native/package.json): 4.200.2 -> 4.200.3

Deploy-Scope: web
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.

1 participant