Skip to content

HDDS-14818. Recon: Add AI Assistant chat UI for natural-language cluster queries.#10441

Draft
ArafatKhan2198 wants to merge 1 commit into
apache:masterfrom
ArafatKhan2198:chatBotUI2
Draft

HDDS-14818. Recon: Add AI Assistant chat UI for natural-language cluster queries.#10441
ArafatKhan2198 wants to merge 1 commit into
apache:masterfrom
ArafatKhan2198:chatBotUI2

Conversation

@ArafatKhan2198
Copy link
Copy Markdown
Contributor

@ArafatKhan2198 ArafatKhan2198 commented Jun 5, 2026

What changes were proposed in this pull request?

This PR adds a new AI Assistant page to the Recon web UI. It lets an operator ask questions about the cluster in plain English (for example, "How many unhealthy containers are there?" or "List keys in /vol1/bucket1") and get back a readable answer, instead of clicking through screens or calling APIs by hand.

The backend for this (added separately) takes a question, calls the right Recon APIs, and returns a single Markdown answer. This PR is the frontend that talks to that backend and presents it as a modern chat experience.

What it does:

  • Adds a new /Assistant page and a nav entry, shown only when the feature is enabled.
  • Checks /api/v1/chatbot/health first and shows the right state:
    • feature disabled → "not enabled" screen
    • enabled but no API key / provider down → "not configured" screen
    • healthy → full chat
  • Sends questions to /api/v1/chatbot/chat and renders the Markdown reply (including tables, lists, code).
  • Loads available models from /api/v1/chatbot/models and offers a provider + model picker.
  • Handles the slow, no-streaming backend with a loading state, an elapsed timer, and a Stop button to cancel.
  • Handles errors clearly (busy / timeout / server error) with a retry option.
  • Keeps chat history in the browser session until the user clicks "New chat".
  • Shows an "Alpha" label and a short disclaimer (chats are independent, AI may be wrong — verify important data).

Why: Recon already exposes a lot of cluster data, but finding it takes effort. This gives operators a faster, friendlier way to get answers, while staying inside Recon's existing look and feel (teal/green theme, rounded panels, custom Recon AI mark).

Notes / current limits:

  • The backend is stateless, so there is no memory across questions (each one stands alone).
  • Responses arrive all at once (no token streaming); typical answers take a few seconds.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-14818

How was this patch tested?

  • Unit/component tests (Vitest + MSW) covering the chat flow and all backend states: success, disabled, not-configured, busy (503), timeout (504), server error (500), and model-list failures.
  • End-to-end tests (Playwright) that mock each API response and capture screenshots of every state.
  • Manual testing against a running Recon with the chatbot backend enabled.

UI Manual Testing Results Document - https://docs.google.com/document/d/1Ex3L9eY8oNm-73TwdDr6ZO2eDd2kQZ2WOo_8vsk45ic/edit?tab=t.0#heading=h.onx3qjujbc5t

image

…ter queries.

Generated-by: Cursor (Gemini 3.1 Pro / Claude 3.5 Sonnet)
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