Skip to content

fix(slm): read the install metrics host figures from the dashboard's real shape (#20815) - #20997

Closed
mrveiss wants to merge 3 commits into
mainfrom
issue-20815-install-metrics
Closed

mrveiss wants to merge 3 commits into
mainfrom
issue-20815-install-metrics

Conversation

@mrveiss

@mrveiss mrveiss commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Thinking Path

The install metrics screen read system_metrics.cpu_percent and friends from /monitoring/dashboard/overview. That route returns the monitor's dict, whose host block is system with cpu_usage_percent / memory_usage_percent (the names monitoring_utils.py reads), so the host card was always "Not reported". The route is response_model=dict, so it publishes no schema and there is no generated type to import; the reader's single declaration is now aligned with what the backend produces. The route itself matches its (untyped) contract, so no backend change.

What Changed

  • useInstallMetricsApi.ts: InstallSystemMetrics is now cpu_usage_percent / memory_usage_percent, dashboard field system; disk and process count removed (the monitor reports neither); new analysisMeasured() and isMainAppUnauthorised().
  • InstallMetricsOverview.vue: reads the real fields; the route's default analysis (healthy, score 0, no bottlenecks) is shown as not reported.
  • InstallMetrics.vue: isEmpty counts measured host or analysis figures; new unauthorised state when all six reads fail with 401/403.
  • Locales: drop stat.disk / stat.processes; add unauthorisedTitle / unauthorisedBody (English copies, as the other locales for this screen).
  • InstallMetrics.test.ts: fixtures shaped like the route payload; new tests for host-measured, analysis-measured, default analysis, 401/403, 502/503/504 and mixed failures.

Verification

  • npx vitest run src/views/monitoring/InstallMetrics.test.ts in autobot-slm-frontend: 17 passed.
  • Control: the same test file against the pre-change source: 9 failed, 8 passed.
  • eslint on the touched files clean; vue-tsc --noEmit exit 0.
  • repo_tests i18n, locale, API-contract, file-size and UI-literal guards: 116 passed.

Risks

Disk and process count no longer appear on the card; they had no source. Other locales carry English text for the two new keys until translated.

Model Used

Claude Sonnet 5.5 (claude-sonnet-5-5)

Issue Link

Closes #20815

Single-issue rationale: the only open PR on these SLM install-metrics files; no sibling issue shares the scope.

Changelog fragment

  • Added changelog/unreleased/{issue}-{slug}.md — or N/A (internal change)

Checklist

  • Code follows AutoBot patterns from CLAUDE.md
  • Tests added or updated (or N/A with reason)
  • Documentation updated if behavior changed
  • Pre-commit hooks pass (git commit runs them automatically)
  • PR targets main (not release)
  • No secrets or credentials in the diff

🤖 Generated with Claude Code

@mrveiss mrveiss added this to the M3 - Refined GUI complete milestone Nov 7, 2026
@mrveiss mrveiss added bug Something isn't working frontend phase:M3.6 SLM platform screens labels Nov 7, 2026
@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 26 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 361d419 and 54c4603.

Files selected for processing: 15

  • autobot-slm-frontend/src/components/monitoring/install/InstallMetricsOverview.vue
  • autobot-slm-frontend/src/composables/useInstallMetricsApi.ts
  • autobot-slm-frontend/src/locales/ar.json
  • autobot-slm-frontend/src/locales/de.json
  • autobot-slm-frontend/src/locales/en.json
  • autobot-slm-frontend/src/locales/es.json
  • autobot-slm-frontend/src/locales/fa.json
  • autobot-slm-frontend/src/locales/fr.json
  • autobot-slm-frontend/src/locales/he.json
  • autobot-slm-frontend/src/locales/lv.json
  • autobot-slm-frontend/src/locales/pl.json
  • autobot-slm-frontend/src/locales/pt.json
  • autobot-slm-frontend/src/locales/ur.json
  • autobot-slm-frontend/src/views/monitoring/InstallMetrics.test.ts
  • autobot-slm-frontend/src/views/monitoring/InstallMetrics.vue
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Notice: 29 open PRs — past the runaway threshold (25)

This is not a request to defer this PR. There is no cap on open PRs (#19397) -- nothing blocks opening or pushing a PR.

This notice only means the count is high enough to be worth a glance for a runaway — something opening PRs in a loop, or a merge pipeline that has stalled so nothing is draining.

Currently open:

If the queue is draining normally, ignore this. Otherwise:

  1. Check whether CI is dispatching at all — see the ci-dispatch-watchdog status on these PRs
  2. Approved PRs land through the merge train the coordinator sequences (merge commits, never squash) -- check the open chore(merge-train) PR is moving, not each PR on its own
  3. Look for a loop opening near-identical PRs

Warn-only runaway detector — .github/workflows/pr-queue-gate.yml. It never blocks a merge.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No new hardcoded values of either class — ssot and other both block.

Known backlog in pipeline-scripts/hardcoded_values_baseline.txt is suppressed and tracked in #14371.

This was referenced Nov 7, 2026
@mrveiss

mrveiss commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

Code review (code-reviewer pass) at f4353a8

Verdict: APPROVE

No blocker or major findings. The system.cpu_usage_percent / system.memory_usage_percent fields match what autobot-backend/api/monitoring_utils.py:153-154 reads, new keys exist in all locales, the unauthorised state is distinct from unavailable (polling still stops through throwUnlessLoaded(!down)), and the tests include mixed-refusal and 502/503/504 controls.

Severity file:line finding suggested fix
minor autobot-slm-frontend/src/composables/useInstallMetricsApi.ts (analysisMeasured) Treats the analysis as measured only when score > 0 or a bottleneck is named. A computed analysis whose score is genuinely 0 with no bottlenecks is shown as "not reported". The comment records this choice. Prefer a backend signal (for example the route's monitoring_active, already in the test fixture) if the route exposes it.
nit autobot-slm-frontend/src/views/monitoring/InstallMetrics.vue:124 Nested ternary for the state. Extract a small stateOf(reading) function.

@mrveiss

mrveiss commented Nov 7, 2026

Copy link
Copy Markdown
Owner Author

Landed on main via merge train #21051 (merge commit 9acab51); every commit of head f4353a8 is in main.

@mrveiss

mrveiss commented Nov 18, 2026

Copy link
Copy Markdown
Owner Author

Branch audit (zero-change deletion). This PR shows 0 changed files against main (head cf20a787f4): every change it carried is already in main. Closing and deleting the branch through this PR; it can be restored with the Restore branch button below.

@mrveiss mrveiss closed this Nov 18, 2026
@mrveiss
mrveiss deleted the issue-20815-install-metrics branch November 18, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working frontend phase:M3.6 SLM platform screens

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(slm): install metrics reads a payload shape the route does not return — host card always 'Not reported'

1 participant