fix: dashboard search stays on legacy path without false partial#2020
fix: dashboard search stays on legacy path without false partial#2020kingpanther13 wants to merge 9 commits into
Conversation
…ting auto-generated dashboards as scan failures ha_search(search_types=["dashboard"]) was forwarded to the ha_mcp_tools component, whose search command has no dashboard surface — the request bounced off the component schema into a warning-laden legacy fallback on every call. Requests naming a surface the component lacks now stay on the legacy path silently, like the other route-ineligible modes; supported-type pins keep the component fast path. The legacy dashboard scan also counted auto-generated dashboards (never taken control, lovelace/config answers config_not_found) as failed scans, so a stock install reported partial: true with "N dashboard(s) not scanned". A config-less dashboard has nothing to scan and now reads as a clean no-match. Fixes #2008 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DxGQhYBQg7681uCdr9w9qB
|
@codex review — apply the review criteria in .gemini/styleguide.md in addition to AGENTS.md guidance |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…ng gate to component schema Review round: config_not_found is HA's code for BOTH "No config found." (auto-generated dashboard — clean skip) and "Unknown config specified" (dashboard deleted since the registry-list snapshot — a genuine gap), so the skip now matches the message too, via the canonical error extractors. A lockstep contract test pins the routing gate's allowlist to the real component schema and the public search_types vocabulary, since the silent legacy route removed the warning that would have exposed future drift. Also: seam test composing both fixes through ha_search, e2e assertions against the real component, and a stale client-envelope comment corrected. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DxGQhYBQg7681uCdr9w9qB
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DxGQhYBQg7681uCdr9w9qB
|
/review |
|
@codex review — apply the review criteria in .gemini/styleguide.md in addition to AGENTS.md guidance |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…ss search The ha_mcp_tools component already answers a cross-dashboard search in one in-process frame, and ha_config_get_dashboard(mode="search") routes through it — ha_search's dashboard surface never did, fanning out one lovelace/config read per dashboard even with the component installed. The bucket now rides the component search for the exact-match, no-body shape (the default ha_search call), with the legacy walk kept for fuzzy scoring, include_config bodies, truncated frames, and every component- fallback case. YAML-mode dashboards, which the component deliberately never scans (their bodies can carry resolved !secret values), surface as an explicit partial reason instead of looking exhaustive. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DxGQhYBQg7681uCdr9w9qB
Live parity check: the component match only knows the config body's (often absent) title, so records fell back to the url_path where the legacy walk emits the registry row's title. The rows are already fetched for the YAML exclusion count — join them for the title. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DxGQhYBQg7681uCdr9w9qB
|
/review |
|
@codex review — apply the review criteria in .gemini/styleguide.md in addition to AGENTS.md guidance |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac03dca116
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codex review round on the component wiring: the card-scoped matches walk narrowed ha_search's dashboard coverage (a view-title-only hit vanished), the yaml exclusion count missed a YAML-mode default dashboard (no list row), and fail-soft load errors made unreadable dashboards look clean. The component's search mode now also emits document_matches (a per- dashboard whole-config substring verdict, ported leaf-for-leaf from the server's _search_in_dict), yaml_skipped counted in-process over the full map, and load_failed with ConfigNotFound kept a clean skip. The server requires the new dashboards_doc_search capability (component 1.3.0) and those keys, or falls back to the full legacy walk — a pre-1.3.0 component never narrows coverage. Registry titles ride a separate doc key so MODE 4 match-record parity keeps the body title. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DxGQhYBQg7681uCdr9w9qB
|
/review |
|
@codex review — apply the review criteria in .gemini/styleguide.md in addition to AGENTS.md guidance |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
CI round: the info drift guard and manifest parity test pin the literal capability list and version — updated for dashboards_doc_search / 1.3.0. The guarded ConfigNotFound import resolves to Any under mypy's homeassistant override, so the assignment ignore was unused. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DxGQhYBQg7681uCdr9w9qB
|
/review |
|
@codex review — apply the review criteria in .gemini/styleguide.md in addition to AGENTS.md guidance |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The dashboard search coverage was supposed to be there all along, so this is a patch on the pending version line, not a new-feature minor. Capability negotiation (dashboards_doc_search), never the version, gates the server routing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DxGQhYBQg7681uCdr9w9qB
|
/review |
|
@codex review — apply the review criteria in .gemini/styleguide.md in addition to AGENTS.md guidance |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f76caf0d13
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… path
Codex round: the legacy walk always emits ("default", "Default
Dashboard") for the built-in dashboard; a taken-control default can
carry its own title, which the component-served record must not leak
into the envelope — record-shape parity between the two paths.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxGQhYBQg7681uCdr9w9qB
|
/review |
|
@codex review — apply the review criteria in .gemini/styleguide.md in addition to AGENTS.md guidance |
What does this PR do?
Fixes #2008.
ha_search(search_types=["dashboard"])was forwarded to theha_mcp_toolscomponent, whose search command has no dashboard surface — every call bounced off the component schema into a legacy fallback with acomponent search path failed (...)warning. And the legacy dashboard scan counted auto-generated dashboards (never taken control of —lovelace/configanswersconfig_not_found) as failed scans, so a stock install reportedpartial: truewithN dashboard(s) not scanned (config or list fetch failed).Both reproduced live before the fix (component-rejection warning on every dashboard search; the false
partialappears as soon as a never-edited dashboard exists).ha_searchnow routes asearch_typesnaming a surface the component lacks (dashboard) straight to the legacy path, silently — the same treatment as the other route-ineligible modes. Pins of supported types keep the component fast path (_component_serves_search_types).ha_search's dashboard bucket now rides theha_mcp_toolscomponent's in-process cross-dashboard search (the same frameha_config_get_dashboard(mode="search")already uses) for the exact-match, no-body shape — one WS frame instead of onelovelace/configread per dashboard. Fuzzy scoring,include_configbodies, truncated frames, and every component-fallback case keep the legacy walk. YAML-mode dashboards, which the component deliberately never scans (bodies can carry resolved!secretvalues), surface as an explicit partial reason._search_one_dashboardtreatsconfig_not_foundas a clean no-match: a config-less auto-generated dashboard has nothing to scan, so it no longer counts towarddashboard(s) not scanned. Genuine failures (403 soft-fail, non-dict shape, raised fetch) still flagpartial.Type of change
Testing
partial: false,warnings: []with a config-less dashboard present; component fast path unaffected)uv run pytest)uv run ruff check)Checklist