Skip to content

feat: add new design for messages and add inline references#2020

Merged
lucaseduoli merged 20 commits into
mainfrom
feat/chat_reference_number
Jul 6, 2026
Merged

feat: add new design for messages and add inline references#2020
lucaseduoli merged 20 commits into
mainfrom
feat/chat_reference_number

Conversation

@lucaseduoli

@lucaseduoli lucaseduoli commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces significant improvements to the chat assistant's user experience by adding detailed popovers for retrieved search result "chunks" (citations) and enhancing metadata handling across both frontend and backend. The main changes include new UI components for chunk details, improved citation handling in assistant messages, and expanded metadata support throughout the data flow.

Enhanced Citation Display and Chunk Details:

  • Added a new ChunkPopup component that displays detailed information about a cited chunk, including source text, parser, chunking configuration, embedding model, score, and a link to the original document. This popover appears when a user clicks on a citation in the assistant message.
  • Updated AssistantMessage to support citation click handling, manage popover state, preprocess citations, and render CitationCards and the new ChunkPopup for interactive chunk exploration. [1] [2] [3] [4] [5] [6]
image image

Improved Metadata Flow and Types:

  • Extended backend (opensearch_multimodal.py) and frontend (useGetSearchQuery.ts, related types) to include additional metadata fields for each chunk: parser, chunk_size, and chunk_overlap, ensuring this information is available for display in the UI. [1] [2]
  • Enriched the metadata returned for each search hit with chunk_id, id, and score fields for more precise chunk identification and scoring in the UI.

Type and API Consistency:

  • Updated TypeScript types and API interfaces to support the new metadata fields and function call structures, ensuring type safety and consistency across the codebase. [1] [2] [3]

These changes collectively provide users with a richer, more interactive experience when reviewing AI-generated responses and their supporting sources.


Most Important Changes:

1. User Interface Enhancements

  • Added the ChunkPopup component for detailed chunk/citation popovers, including metadata and source text, accessible from assistant messages.
  • Updated AssistantMessage to support citation click events, manage popover state, preprocess citations, and render CitationCards and ChunkPopup. [1] [2] [3] [4] [5] [6]

2. Metadata and Backend Support

  • Extended backend search results to include parser, chunk_size, and chunk_overlap fields for each chunk, and added chunk_id, id, and score to chunk metadata. [1] [2]

3. TypeScript Types and API Consistency

  • Updated frontend types and API interfaces to support the new metadata fields and function call structures, ensuring end-to-end consistency. [1] [2] [3] [4]

Summary by CodeRabbit

Summary of changes

  • New Features
    • Search/chat citations now expose richer chunk details (including chunk identifiers and parser/chunking metadata).
    • Added interactive citation cards and a citation-driven chunk details popup (with “View document” when available).
    • Markdown citations are now clickable to drive the citation popup; onboarding now preserves assistant function-call data.
  • Bug Fixes
    • Improved citation preprocessing/click handling and hardened streaming function-call argument parsing.
  • Style
    • Refreshed assistant message layout and feedback control styling; expanded dark-theme background tokens.
  • Chores
    • Updated agent and ingestion instruction rules to align citation formatting and chunking parameters.

@lucaseduoli lucaseduoli self-assigned this Jul 3, 2026
@github-actions github-actions Bot added frontend 🟨 Issues related to the UI/UX backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) enhancement 🔵 New feature or request labels Jul 3, 2026
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a7682e78-ba6b-46ff-8e77-717ab56e1c89

📥 Commits

Reviewing files that changed from the base of the PR and between 17b08af and ccf6414.

📒 Files selected for processing (1)
  • frontend/lib/constants.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/lib/constants.ts

Walkthrough

The PR threads parser and chunk metadata through ingestion, indexing, search, retrieval, and prompt generation, adds onboarding assistant function-call persistence, and introduces citation preprocessing with interactive assistant-message chunk rendering.

Changes

Citation-aware chunk metadata flow

Layer / File(s) Summary
Stream parsing
frontend/lib/chat-stream-parsers.ts
Normalizes streamed function-call arguments and real-time function-call events.
Index metadata
src/models/processors.py, src/services/document_index_writer.py, src/services/chat_service.py, src/services/langflow_file_service.py, src/services/langflow_ingest_token_service.py
Adds parser and chunk sizing fields to processed documents, indexing context, and ingest context propagation.
Search and retrieval metadata
flows/components/opensearch_multimodal.py, src/services/search_service.py, src/agent.py, src/config/config_manager.py
Returns chunk metadata from OpenSearch, enriches search results, and updates retrieval-source and citation prompt text.
Assistant message function calls
src/api/settings/models.py, frontend/app/api/mutations/useUpdateOnboardingStateMutation.ts, frontend/app/api/queries/useGetSettingsQuery.ts, frontend/app/onboarding/_components/onboarding-content.tsx
Adds optional functionCalls to assistant-message models and preserves them in onboarding state and persistence.
Citation data shapes and preprocessing
frontend/app/api/queries/useGetSearchQuery.ts, frontend/app/chat/_types/types.ts, frontend/app/chat/_components/function-calls/result.tsx, frontend/components/markdown-citations.ts, frontend/components/markdown-renderer.tsx
Expands chunk/tool-call types, adds citation preprocessing, and makes #citation-* links clickable.
Assistant citation UI
frontend/app/chat/_components/assistant-message.tsx, frontend/app/chat/_components/chunk-popup.tsx, frontend/app/chat/_components/citation-cards.tsx, frontend/app/chat/_components/message.tsx, frontend/app/chat/_components/message-actions.tsx, frontend/app/globals.css, frontend/tailwind.config.ts
Renders citation cards and chunk popups in assistant messages, updates assistant styling, and adjusts related theme/button styles.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

  • langflow-ai/openrag#1623: Related to the same citation and answer-formatting system prompt changes in src/config/config_manager.py.
  • langflow-ai/openrag#1742: Related to Langflow ingestion wiring and chunk-metadata propagation in src/services/chat_service.py and adjacent ingest code.
  • langflow-ai/openrag#1984: Related to assistant-message.tsx handling of functionCalls in the same chat UI codepath.

Suggested labels: enhancement

Suggested reviewers: mfortman11, edwinjosechittilappilly

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: redesigned chat messages and inline citation references.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/chat_reference_number

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

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

React Doctor found 6 new issues in 1 file · 6 warnings · score 78 / 100 (Needs work) · 3 fixed · vs main

6 warnings

components/connectors/shared-bucket-view.tsx

  • ⚠️ L37 Large component is hard to read and change no-giant-component
  • ⚠️ L72 Event logic handled in an effect no-event-handler
  • ⚠️ L73 Event logic handled in an effect no-event-handler
  • ⚠️ L76 Event logic handled in an effect no-event-handler
  • ⚠️ L81 Derived value copied into state no-derived-state
  • ⚠️ L85 Missing effect dependencies exhaustive-deps

Reviewed by React Doctor for commit ccf6414. See inline comments for fixes.

@github-actions github-actions Bot added enhancement 🔵 New feature or request and removed enhancement 🔵 New feature or request labels Jul 3, 2026
@github-actions github-actions Bot added enhancement 🔵 New feature or request and removed enhancement 🔵 New feature or request labels Jul 3, 2026
@github-actions github-actions Bot added enhancement 🔵 New feature or request and removed enhancement 🔵 New feature or request labels Jul 3, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 4

🧹 Nitpick comments (5)
frontend/app/chat/_types/types.ts (1)

40-84: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider extracting a shared metadata type to reduce 4x field duplication.

embedding_model, parser, page, score, chunk_size, chunk_overlap are each declared four times (top-level, data, data.metadata, metadata). This mirrors the fallback chain in chunk-popup.tsx's getMetadataValue, so the shape duplication is functionally intentional, but keeping the field list in sync across four spots increases the chance of drift when new metadata fields are added.

♻️ Suggested refactor
+interface ChunkMetadataFields {
+  embedding_model?: string;
+  parser?: string;
+  page?: number | string;
+  score?: number | string;
+  chunk_size?: number | string;
+  chunk_overlap?: number | string;
+}
+
 export interface ToolCallResult {
   text_key?: string;
   data?: {
     file_path?: string;
     text?: string;
-    page?: number | string;
-    score?: number | string;
-    embedding_model?: string;
-    parser?: string;
-    chunk_size?: number | string;
-    chunk_overlap?: number | string;
-    metadata?: {
-      embedding_model?: string;
-      parser?: string;
-      page?: number | string;
-      score?: number | string;
-      chunk_size?: number | string;
-      chunk_overlap?: number | string;
-      [key: string]: unknown;
-    };
+    metadata?: ChunkMetadataFields & { [key: string]: unknown };
+    [key: string]: unknown;
+  } & ChunkMetadataFields;
+  default_value?: string;
+  chunk_id?: string;
+  id?: string;
+  filename?: string;
+  source_url?: string | null;
+  text?: string;
+  metadata?: ChunkMetadataFields & { [key: string]: unknown };
+  [key: string]: unknown;
+}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/app/chat/_types/types.ts` around lines 40 - 84, The ToolCallResult
shape repeats the same metadata fields in four places, which makes future
updates easy to drift. Extract a shared metadata type for the common fields used
by chunk-popup.tsx’s getMetadataValue fallback chain, then reuse it for
ToolCallResult’s top-level, data, data.metadata, and metadata properties. Keep
the overall structure the same, but centralize the repeated field list so new
metadata fields only need to be added once.
src/services/langflow_file_service.py (1)

476-478: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Centralize parser label strings to avoid drift.

"Docling Serve 1.20.0" and "URL Ingester" are hardcoded here, while processors.py defines DOCLING_PARSER_LABEL/TEXT_PARSER_LABEL constants for the same values, and chat_service.py also hardcodes "URL Ingester" in two places. Consider moving these labels into a shared module (e.g. alongside the existing constants in processors.py, or a new constants.py) and importing them everywhere they're used, so a future rename/version bump doesn't require hunting down every literal.

Also applies to: 648-650

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/services/langflow_file_service.py` around lines 476 - 478, The parser
labels are duplicated as hardcoded strings, so centralize them in a shared
constant location and reuse those symbols everywhere. Move or reuse the existing
DOCLING_PARSER_LABEL and TEXT_PARSER_LABEL definitions from processors.py, and
replace the inline “Docling Serve 1.20.0” and “URL Ingester” literals in
langflow_file_service.py and chat_service.py with imports from that shared
source. Keep the naming consistent across the related parser/service methods so
future version or label changes only need one update.
src/services/chat_service.py (1)

107-128: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicated DocumentIndexContext/ingest-token construction across langflow_chat and upload_context_chat.

Both methods build an almost identical URL-ingest DocumentIndexContext (now with the added parser/chunk_size/chunk_overlap fields) and mint a token the same way. Extracting a small helper (e.g. _build_url_ingest_token(...)) would prevent the two call sites from drifting as more fields are added.

Also applies to: 524-545

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/services/chat_service.py` around lines 107 - 128, The URL-ingest
`DocumentIndexContext` and token minting logic is duplicated in `langflow_chat`
and `upload_context_chat`, so extract it into a shared helper such as
`_build_url_ingest_token(...)` or a small builder used by both methods. Move the
repeated `DocumentIndexContext` construction in `chat_service.py` into that
helper, including the new `parser`, `chunk_size`, and `chunk_overlap` fields,
and have both call sites reuse it to keep the two paths in sync.
src/agent.py (1)

37-37: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

System prompt duplicated verbatim across three files.

The identical prompt string (with the new citation rule) is hardcoded in src/agent.py (line 37), src/config/config_manager.py (AgentConfig.system_prompt), and frontend/lib/constants.ts (DEFAULT_AGENT_SETTINGS.system_prompt). Any future change to citation formatting or tool instructions must be kept in sync across all three, which is error-prone.

Consider deriving agent.py's in-memory default from config_manager.AgentConfig.system_prompt (single backend source of truth), and having the frontend fetch it from settings rather than hardcoding a copy.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/agent.py` at line 37, The system prompt text is duplicated across
multiple places, so changes to tool instructions or citation formatting will
drift out of sync. Make `src/agent.py` use the single backend source of truth
from `AgentConfig.system_prompt` in `src/config/config_manager.py`, and remove
the hardcoded frontend copy in `DEFAULT_AGENT_SETTINGS.system_prompt` by loading
it from settings instead. Keep the prompt content centralized and referenced by
`agent.py`, `AgentConfig`, and `DEFAULT_AGENT_SETTINGS` so there is only one
canonical prompt to update.
frontend/app/chat/_components/chunk-popup.tsx (1)

63-71: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Hardcoded fabricated parser version as fallback.

When no parser metadata is present, this falls back to a hardcoded, specific-sounding version string "Docling Serve 1.20.0" rather than a generic label. Unlike formatSplitConfig, which correctly falls back to actual settings values, this presents a guessed, potentially stale/incorrect version as if it were factual data.

♻️ Proposed fix
   const fileExt = filename.split(".").pop()?.toLowerCase() || "";
   if (fileExt === "txt" || fileExt === "md") return "Text Parser";
-  return "Docling Serve 1.20.0";
+  return "Docling Serve";
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontend/app/chat/_components/assistant-message.tsx`:
- Around line 292-296: The filename derivation in assistant-message.tsx is
duplicated and diverges from citation-cards.tsx, so both consumers should use
the same shared helper. Extract the “derive display filename from data.file_path
or filename” logic into a common helper near the existing markdown-renderer.tsx
utilities (or another shared location), then update assistant-message.tsx and
citation-cards.tsx to call it so the fallback behavior and default label stay
consistent.

In `@frontend/app/chat/_components/chunk-popup.tsx`:
- Around line 176-247: The chunk popover in the popup component behaves like a
modal but is missing dialog semantics and an initial focus target. Update the
main container rendered by the chunk popup (the fixed motion.div in the chunk
popup component) to expose dialog accessibility metadata such as role="dialog"
and aria-modal="true", and ensure focus moves into the popup when isOpen becomes
true. Use a ref on the popup shell or the existing “Close chunk details” button
to set initial focus in the same chunk-popup component, and keep the Escape
handler wired through the existing onClose logic.

In `@frontend/app/chat/_components/citation-cards.tsx`:
- Around line 36-90: In the citation card rendering inside citedSources.map, the
page label only checks page !== null, so undefined still renders as “page
undefined”. Update the page handling to treat undefined as absent and, if
available, fall back to item.data?.page before displaying it. Keep the existing
filename fallback pattern consistent in the same component so the page text is
only shown when a real value exists.

In `@src/services/document_index_writer.py`:
- Around line 224-237: The `chunk_size`/`chunk_overlap` coercion in
`document_index_writer.py` is silently falling back to the raw value when
`int(value)` fails, which can create OpenSearch mapping conflicts. Update the
loop in the document-building logic so that invalid non-numeric values are
skipped instead of assigned to `doc[field_name]`, keeping the indexed type
consistent with the existing numeric mapping. Use the existing `context` and
`metadata` lookup flow around `parser`, `chunk_size`, and `chunk_overlap` to
locate the fix.

---

Nitpick comments:
In `@frontend/app/chat/_types/types.ts`:
- Around line 40-84: The ToolCallResult shape repeats the same metadata fields
in four places, which makes future updates easy to drift. Extract a shared
metadata type for the common fields used by chunk-popup.tsx’s getMetadataValue
fallback chain, then reuse it for ToolCallResult’s top-level, data,
data.metadata, and metadata properties. Keep the overall structure the same, but
centralize the repeated field list so new metadata fields only need to be added
once.

In `@src/agent.py`:
- Line 37: The system prompt text is duplicated across multiple places, so
changes to tool instructions or citation formatting will drift out of sync. Make
`src/agent.py` use the single backend source of truth from
`AgentConfig.system_prompt` in `src/config/config_manager.py`, and remove the
hardcoded frontend copy in `DEFAULT_AGENT_SETTINGS.system_prompt` by loading it
from settings instead. Keep the prompt content centralized and referenced by
`agent.py`, `AgentConfig`, and `DEFAULT_AGENT_SETTINGS` so there is only one
canonical prompt to update.

In `@src/services/chat_service.py`:
- Around line 107-128: The URL-ingest `DocumentIndexContext` and token minting
logic is duplicated in `langflow_chat` and `upload_context_chat`, so extract it
into a shared helper such as `_build_url_ingest_token(...)` or a small builder
used by both methods. Move the repeated `DocumentIndexContext` construction in
`chat_service.py` into that helper, including the new `parser`, `chunk_size`,
and `chunk_overlap` fields, and have both call sites reuse it to keep the two
paths in sync.

In `@src/services/langflow_file_service.py`:
- Around line 476-478: The parser labels are duplicated as hardcoded strings, so
centralize them in a shared constant location and reuse those symbols
everywhere. Move or reuse the existing DOCLING_PARSER_LABEL and
TEXT_PARSER_LABEL definitions from processors.py, and replace the inline
“Docling Serve 1.20.0” and “URL Ingester” literals in langflow_file_service.py
and chat_service.py with imports from that shared source. Keep the naming
consistent across the related parser/service methods so future version or label
changes only need one update.
🪄 Autofix (Beta)

✅ Autofix completed


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f0be1b9c-eec0-4b2a-808c-c6d0d230a818

📥 Commits

Reviewing files that changed from the base of the PR and between ea47033 and 42231a6.

📒 Files selected for processing (29)
  • flows/components/opensearch_multimodal.py
  • flows/ingestion_flow.json
  • flows/openrag_agent.json
  • flows/openrag_nudges.json
  • flows/openrag_url_mcp.json
  • frontend/app/api/mutations/useUpdateOnboardingStateMutation.ts
  • frontend/app/api/queries/useGetSearchQuery.ts
  • frontend/app/api/queries/useGetSettingsQuery.ts
  • frontend/app/chat/_components/assistant-message.tsx
  • frontend/app/chat/_components/chunk-popup.tsx
  • frontend/app/chat/_components/citation-cards.tsx
  • frontend/app/chat/_components/function-calls/result.tsx
  • frontend/app/chat/_components/message-actions.tsx
  • frontend/app/chat/_components/message.tsx
  • frontend/app/chat/_types/types.ts
  • frontend/app/globals.css
  • frontend/app/onboarding/_components/onboarding-content.tsx
  • frontend/components/markdown-renderer.tsx
  • frontend/lib/constants.ts
  • frontend/tailwind.config.ts
  • src/agent.py
  • src/api/settings/models.py
  • src/config/config_manager.py
  • src/models/processors.py
  • src/services/chat_service.py
  • src/services/document_index_writer.py
  • src/services/langflow_file_service.py
  • src/services/langflow_ingest_token_service.py
  • src/services/search_service.py

Comment thread frontend/app/chat/_components/assistant-message.tsx Outdated
Comment thread frontend/app/chat/_components/chunk-popup.tsx Outdated
Comment thread frontend/app/chat/_components/citation-cards.tsx
Comment thread src/services/document_index_writer.py
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Fixes Applied Successfully

Fixed 5 file(s) based on 4 unresolved review comments.

Files modified:

  • frontend/app/chat/_components/assistant-message.tsx
  • frontend/app/chat/_components/chunk-popup.tsx
  • frontend/app/chat/_components/citation-cards.tsx
  • frontend/components/markdown-renderer.tsx
  • src/services/document_index_writer.py

Commit: 9baa93adfe9fe66b13437b16b6dc6b34b979055e

The changes have been pushed to the feat/chat_reference_number branch.

Time taken: 5m 51s

@github-actions github-actions Bot added enhancement 🔵 New feature or request and removed enhancement 🔵 New feature or request labels Jul 3, 2026
@github-actions github-actions Bot added the enhancement 🔵 New feature or request label Jul 6, 2026

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (2)
src/api/settings/models.py (1)

81-86: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Validator silently drops malformed result payloads.

ignore_non_list_result converts any non-list, non-None result value to None without logging, so malformed onboarding payloads fail silently instead of surfacing an error. Given src/**/*.py should use get_logger for diagnostics rather than staying silent, consider logging a warning when discarding an unexpected shape.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/api/settings/models.py` around lines 81 - 86, The ignore_non_list_result
validator in the settings model is silently discarding unexpected result
payloads by turning any non-list, non-None value into None. Update this
validator to use get_logger and emit a warning whenever it drops a malformed
result shape, while still preserving the current fallback behavior. Keep the
change localized to the validator on the result field so onboarding payload
issues are visible in diagnostics instead of failing silently.
frontend/app/onboarding/_components/onboarding-content.tsx (1)

59-68: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate hasNestedResults type guard.

This is byte-for-byte identical to hasNestedResults in frontend/app/chat/_components/assistant-message.tsx (Lines 59-68 per the graph context). Consider extracting to a shared module (e.g. alongside ToolCallResult/FunctionCall types or a small citation-utils.ts) to avoid drift between the two copies.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/app/onboarding/_components/onboarding-content.tsx` around lines 59 -
68, The hasNestedResults type guard is duplicated in onboarding-content.tsx and
assistant-message.tsx, so move this logic into a shared helper module and import
it from both places to prevent drift. Keep the existing hasNestedResults
behavior unchanged, but centralize it near the related
ToolCallResult/FunctionCall types or in a small shared utility file. Update both
onboarding-content and AssistantMessage to use the shared implementation instead
of maintaining two copies.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@frontend/app/onboarding/_components/onboarding-content.tsx`:
- Around line 59-68: The hasNestedResults type guard is duplicated in
onboarding-content.tsx and assistant-message.tsx, so move this logic into a
shared helper module and import it from both places to prevent drift. Keep the
existing hasNestedResults behavior unchanged, but centralize it near the related
ToolCallResult/FunctionCall types or in a small shared utility file. Update both
onboarding-content and AssistantMessage to use the shared implementation instead
of maintaining two copies.

In `@src/api/settings/models.py`:
- Around line 81-86: The ignore_non_list_result validator in the settings model
is silently discarding unexpected result payloads by turning any non-list,
non-None value into None. Update this validator to use get_logger and emit a
warning whenever it drops a malformed result shape, while still preserving the
current fallback behavior. Keep the change localized to the validator on the
result field so onboarding payload issues are visible in diagnostics instead of
failing silently.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 255f0a5f-68f0-42a9-924f-c1e8541d803b

📥 Commits

Reviewing files that changed from the base of the PR and between 04b8a03 and 1e106f3.

📒 Files selected for processing (6)
  • frontend/app/chat/_components/assistant-message.tsx
  • frontend/app/chat/_components/citation-cards.tsx
  • frontend/app/onboarding/_components/onboarding-content.tsx
  • frontend/components/markdown-citations.ts
  • frontend/components/markdown-renderer.tsx
  • src/api/settings/models.py
🚧 Files skipped from review as they are similar to previous changes (3)
  • frontend/components/markdown-citations.ts
  • frontend/components/markdown-renderer.tsx
  • frontend/app/chat/_components/assistant-message.tsx

@github-actions github-actions Bot added enhancement 🔵 New feature or request and removed enhancement 🔵 New feature or request labels Jul 6, 2026
@github-actions github-actions Bot added enhancement 🔵 New feature or request and removed enhancement 🔵 New feature or request labels Jul 6, 2026
@lucaseduoli

lucaseduoli commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

Approved by the design team

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontend/app/chat/_components/chunk-popup.tsx`:
- Around line 110-112: The popup’s initial focus is being handled with a
mount-only useEffect in chunk-popup’s PopoverContent, so it won’t refocus
correctly when reopening different citations. Move the close button focusing
logic into PopoverContent’s onOpenAutoFocus handler, call
event.preventDefault(), and focus closeButtonRef.current there instead of
relying on the existing effect.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2986af33-4f4c-4d76-b21f-1b8da4d8a98d

📥 Commits

Reviewing files that changed from the base of the PR and between a7cba51 and 6d0704b.

📒 Files selected for processing (3)
  • frontend/app/chat/_components/assistant-message.tsx
  • frontend/app/chat/_components/chunk-popup.tsx
  • frontend/app/chat/_components/citation-cards.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • frontend/app/chat/_components/citation-cards.tsx
  • frontend/app/chat/_components/assistant-message.tsx

Comment thread frontend/app/chat/_components/chunk-popup.tsx Outdated
@github-actions github-actions Bot added enhancement 🔵 New feature or request and removed enhancement 🔵 New feature or request labels Jul 6, 2026
@github-actions github-actions Bot added enhancement 🔵 New feature or request and removed enhancement 🔵 New feature or request labels Jul 6, 2026
@lucaseduoli lucaseduoli merged commit dd29ef8 into main Jul 6, 2026
36 of 41 checks passed
@github-actions github-actions Bot deleted the feat/chat_reference_number branch July 6, 2026 14:53
lucaseduoli added a commit that referenced this pull request Jul 7, 2026
…model option (#2031)

* fix: remediate image_scan CVEs in backend, frontend, and langflow images (#2000)

* fix light color text catergory chips in light mode (#2013)

Co-authored-by: Olfa Maslah <[email protected]>

* fix: upgraded version of docling (#1995)

* changed version of docling

* fix logs not being the correct ones

* go back to sequential building to save space

* add cache to builds

* remove single use results from docling manager

* revert single use results

* change the ray tenant id header

* added env

* changed cache to hit if no changes were made

* fix hash for cache

* style: ruff autofix (auto)

* fixed coderabbit

* style: ruff autofix (auto)

* added comment on docling manager

* style: ruff autofix (auto)

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* feat: add chunk level page source (#2015)

* Changed export docling document to append page number

* update result on frontend to append page number

* document how to get page number in readmes

* Update flows/components/export_docling_document.py

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update flows/components/export_docling_document.py

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix: apply CodeRabbit auto-fixes

Fixed 1 file(s) based on 1 unresolved review comment.

Co-authored-by: CodeRabbit <[email protected]>

* update component code

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: CodeRabbit <[email protected]>

* fix: error in skip duplicates functionality for folder ingest for connectors (backport of #1941) (#2018)

* fix: error in skip duplicates functionality for folder ingest for connectors 75616(#1842) (#1941)

* fix: enhance duplicate handling and indexing for connector file uploads

* style: ruff autofix (auto)

* fix: improve duplicate handling in connector sync functionality

* chore: trigger CodeRabbit

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
(cherry picked from commit effaf02)

* style: ruff autofix (auto)

* fix: remove duplicate test definitions from main merge

The automated merge-from-main on this branch concatenated two tests
(test_connector_processor_indexes_cleaned_filename,
test_langflow_connector_processor_uses_cleaned_filename) that already
existed under both names, tripping ruff F811. Keep one copy of each,
preferring the version wired with connector_id_exists=True to match
current check_document_exists behavior.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* fix: Ingestion of buckets not working right after connection is tested - CPD #75506 (#1942) (#2019)

* fix: update bucket ingestion messages for clarity and consistency

* fix: guard bucket pre-selection against connection ID mismatch

The defaults query returns the first S3/COS connection regardless of active
status. Only pre-select saved bucket_names when the defaults connection_id
matches the current connector.connectionId to avoid seeding the wrong
buckets if a stale connection exists alongside the active one.



* fix: prevent defaults from overwriting user bucket selections

Two issues in the initial-selection effect:
1. hasAppliedInitial was only set when valid buckets were found, leaving the
   effect live across bucket refreshes and allowing stale defaults to overwrite
   selections made after a refetch.
2. No guard against the async race where buckets loads before initialSelectedBuckets:
   user clicks buckets, defaults arrive later and silently overwrite them.

Fix: mark hasAppliedInitial unconditionally on first evaluation, and only apply
defaults when selectedBuckets is still empty (user hasn't acted yet).



---------


(cherry picked from commit f3823b8)

Co-authored-by: Claude Sonnet 4.6 <[email protected]>

* fix: handle orphan files and return appropriate responses when syncing connectors (#1785) (#2016)

* feat: handle orphan files and return appropriate responses when syncing connectors

* feat: refactor GoogleDriveOAuth to separate required scopes and add handling for missing optional group scopes in tests

* style: ruff autofix (auto)

* feat: add handling for skipped files and warnings in task processing and UI components

---------


(cherry picked from commit aca865a)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* fix: enhance error handling for document processing and add OCR requirement check for image files (#1859) (#2017)

* fix: enhance error handling for document processing and add OCR requirement check for image files

* style: ruff autofix (auto)

* remove clickhouse connect from langflow image (#1801)

* chore: fix ci (#1889)

* Update processors.py

* test fix

* fix ci

---------




(cherry picked from commit a286581)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Lucas Oliveira <[email protected]>
Co-authored-by: Edwin Jose <[email protected]>

* fix: bump golang.org/x/net to v0.55.0 to remediate CVE-2026-25680 and CVE-2026-39821 (#2014)

* feat: add new design for messages and add inline references (#2020)

* update opensearch multimodal and flows to support parser, chunk size and chunk overlap

* update backend to support citations and chunk metadata

* update frontend to support citations and metadata, implement new design for assistant message

* changed the prompt for the agent

* changed the prompt for the agent

* remove hallucinated chunk references

* adjust design of citations and where popover appears

* adjusted design for message, popover and cards

* fix React Doctor picks

* fix: apply CodeRabbit auto-fixes

Fixed 5 file(s) based on 4 unresolved review comments.

Co-authored-by: CodeRabbit <[email protected]>

* style: apply biome auto-fixes [skip ci]

* updated colors in ibm mode

* fixed react doctor picks

* added correct type and validation for function calls

* remove style for message when on onboarding

* fix message not being w full

* remove search query in end of the message

* change popup to use shadcn popover

* fix coderabbit's suggestion

* increase prompt limit

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: CodeRabbit <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* apply new settings on retry (#2010)

* fix: preserve HTTPException status in update_docling_preset (#1586) (#2004)

* fix: report actual synced connection count in connector_sync (#1547) (#2006)

* fix: restore LLM model values in reapply_all_settings fallback (#1587) (#2008)

* fix: prevent partial matches for exact token searches (#2003)

* fix: prevent partial matches for exact token searches (#1937)

* style: ruff autofix (auto)

* chore: remove unused json import

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* fix: target agent component when updating chat flow system prompt (#2001)

* fix: target langflow agent component for system prompt update instead of provider LLM component

Signed-off-by: vchen7629 <[email protected]>

* fix: removed unused llm_provider arg from _update_langflow_system_prompt

Signed-off-by: vchen7629 <[email protected]>

* test: add unit tests for update_chat_flow_system_prompt

Signed-off-by: vchen7629 <[email protected]>

* style: ruff autofix (auto)

* fix(test): resolve flow path relative to repo root in test_langflow_agent_system_prompt

Signed-off-by: vchen7629 <[email protected]>

* style: ruff autofix (auto)

---------

Signed-off-by: vchen7629 <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* fix: replaced hardcoded docker.io prefix with a env variable prefix for private repo compatibility (#2002)

Signed-off-by: vchen7629 <[email protected]>

* fix: resolve Pydantic delta serialization warnings in agent streaming (#2005)

* fix: updated agent model dump to exclude delta field

Signed-off-by: vchen7629 <[email protected]>

* test: added regression unit test to verify response field + no warnings

* style: ruff autofix (auto)

* test: added additional unit test to verify that model_dump without exclusion raises the warning

Signed-off-by: vchen7629 <[email protected]>

* style: ruff autofix (auto)

* test: tighten delta warning assertion to match specific Pydantic error

Signed-off-by: vchen7629 <[email protected]>

* style: ruff autofix (auto)

---------

Signed-off-by: vchen7629 <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* fix: prevent exception details from leaking in API error responses (#2007)

* fix: removed str(e) in exceptions to prevent internals from leaking

Signed-off-by: vchen7629 <[email protected]>

* style: ruff autofix (auto)

* fix: added missing status_code

Signed-off-by: vchen7629 <[email protected]>

* style: ruff autofix (auto)

---------

Signed-off-by: vchen7629 <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* Changed docling options to include local support and be shown in the Langflow tab

* style: ruff autofix (auto)

* enable ollama and delete unused file

* fix next lint

---------

Signed-off-by: vchen7629 <[email protected]>
Co-authored-by: Gautham N Pai <[email protected]>
Co-authored-by: Wallgau <[email protected]>
Co-authored-by: Olfa Maslah <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: CodeRabbit <[email protected]>
Co-authored-by: Rico Furtado <[email protected]>
Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Co-authored-by: Edwin Jose <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Mike Fortman <[email protected]>
Co-authored-by: hunterxtang <[email protected]>
Co-authored-by: NishadA05 <[email protected]>
Co-authored-by: Zephyrus <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) enhancement 🔵 New feature or request frontend 🟨 Issues related to the UI/UX lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants