Skip to content

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

Merged
ArafatKhan2198 merged 8 commits into
apache:masterfrom
ArafatKhan2198:chatBotUI2
Jun 12, 2026
Merged

HDDS-14818. Recon: Add AI Assistant chat UI for natural-language cluster queries.#10441
ArafatKhan2198 merged 8 commits into
apache:masterfrom
ArafatKhan2198:chatBotUI2

Conversation

@ArafatKhan2198

@ArafatKhan2198 ArafatKhan2198 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

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
video1352097730.mp4

…ter queries.

Generated-by: Cursor (Gemini 3.1 Pro / Claude 3.5 Sonnet)
…hat.

Generated-by: Cursor
Co-authored-by: Cursor <cursoragent@cursor.com>

@devmadhuu devmadhuu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ArafatKhan2198 for the patch. Had a high level view of patch. Some findings. Pls check.

@ArafatKhan2198
ArafatKhan2198 requested a review from devmadhuu June 11, 2026 08:56
ArafatKhan2198 and others added 2 commits June 11, 2026 16:12
…lback.

Generated-by: Cursor
Co-authored-by: Cursor <cursoragent@cursor.com>
@devmadhuu

Copy link
Copy Markdown
Contributor

@ArafatKhan2198 , changes largely looks good , but just a nit that as discussed yesterday, lets not give user the option to select ready made prompt for list keys or any pagination API. Also making all pagination APIs providing output in bounded limits can be done in follow up PRs.

Replace Browse Keys with a cluster-wide volumes and buckets summary
prompt and use the database icon on the welcome screen.

@devmadhuu devmadhuu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ArafatKhan2198 for improving the patch. Changes LGTM +1

@ArafatKhan2198

Copy link
Copy Markdown
Contributor Author

Thanks @devmadhuu I have replaced Browse Keys with a cluster-wide volumes and buckets summary
prompt.

image

Fix RAT check failures for Playwright and Vitest files added with the
Recon AI chat UI.
@ArafatKhan2198
ArafatKhan2198 marked this pull request as ready for review June 11, 2026 14:09
Avoid duplicate React keys when messages are created within the same
millisecond.

@spacemonkd spacemonkd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this patch @ArafatKhan2198.
I have a few review comments, apart from that it LGTM

- useChat.hook: Use isInFlightRef to avoid recreating sendMessage on flight toggle
- assistant.tsx: Pass model and provider to sendMessage during handleRetry and handleRegenerate
- Composer.tsx: Remove unused getProviderForModel import
- assistant.less: Scope prefers-reduced-motion to .assistant-page-container
- MessageList.tsx: Only pass onRegenerate handler to assistant messages

@spacemonkd spacemonkd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes @ArafatKhan2198.
This LGTM now, +1

@ArafatKhan2198
ArafatKhan2198 merged commit ddb2384 into apache:master Jun 12, 2026
40 checks passed
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.

3 participants