Skip to content

Conversation

@marevol
Copy link
Contributor

@marevol marevol commented Jan 15, 2026

Add localized progress messages during chat search:

  • "Thinking..." during intent detection
  • "Searching for {keywords}..." during document search
  • "Reviewing search results..." during result evaluation
  • "Retrieving documents..." during content fetch
  • "Generating answer..." during response generation

Changes:

  • ChatPhaseCallback: Add overloaded onPhaseStart with keywords parameter
  • ChatClient: Pass search keywords to callback during search phase
  • ChatApiManager: Include keywords in SSE phase events
  • chat.js: Support placeholder replacement for {keywords}
  • chat.jsp: Configure phase labels from i18n properties
  • fess_label_*.properties: Add phase labels for all 17 languages

claude and others added 2 commits January 15, 2026 17:42
Add localized progress messages during chat search:
- "Thinking..." during intent detection
- "Searching for {keywords}..." during document search
- "Reviewing search results..." during result evaluation
- "Retrieving documents..." during content fetch
- "Generating answer..." during response generation

Changes:
- ChatPhaseCallback: Add overloaded onPhaseStart with keywords parameter
- ChatClient: Pass search keywords to callback during search phase
- ChatApiManager: Include keywords in SSE phase events
- chat.js: Support placeholder replacement for {keywords}
- chat.jsp: Configure phase labels from i18n properties
- fess_label_*.properties: Add phase labels for all 17 languages
…nt handling

Improve intent detection for RAG chat:
- Rename CHAT intent to UNCLEAR for clearer semantics when user intent
  cannot be determined
- Add full SUMMARY intent handling with URL-based document search
- Implement searchByUrl() for finding documents by their URL
- Add generateUnclearIntentResponse() to ask users for clarification
- Add generateDocumentNotFoundResponse() when URL search fails
- Add generateSummaryResponse() for document summarization
- Update intent detection prompt with clearer rules
- Modify generateNoResultsResponse() to not use LLM's own knowledge
- Change IntentDetectionResult from documentId to documentUrl

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@marevol marevol force-pushed the claude/add-search-progress-messages-sYbhn branch from 5de3fa6 to 102625e Compare January 15, 2026 10:28
Update the chat interface to show search phase progress messages
directly in the message bubble text, providing better visual feedback
during AI processing. Also update default Ollama model configuration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@marevol marevol requested a review from Copilot January 15, 2026 12:25
@marevol marevol self-assigned this Jan 15, 2026
@marevol marevol added this to the 15.5.0 milestone Jan 15, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds localized progress messages during AI chat search to improve user experience by showing what the system is doing at each phase of processing. The implementation adds support for displaying progress messages like "Thinking...", "Searching for {keywords}...", etc., with keyword placeholder replacement and comprehensive i18n support.

Changes:

  • Enhanced ChatPhaseCallback interface with overloaded method supporting keywords parameter
  • Updated ChatClient to pass search keywords during search phase and handle UNCLEAR/SUMMARY intents
  • Modified chat.js to support {keywords} placeholder replacement in phase messages
  • Added phase labels configuration across 17 language property files

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/main/java/org/codelibs/fess/chat/ChatIntent.java Renamed CHAT enum to UNCLEAR to better represent unclear user intent
src/main/java/org/codelibs/fess/chat/IntentDetectionResult.java Renamed documentId to documentUrl for clarity; updated method names
src/main/java/org/codelibs/fess/chat/ChatPhaseCallback.java Added overloaded onPhaseStart method accepting keywords parameter
src/main/java/org/codelibs/fess/chat/ChatClient.java Implemented UNCLEAR/SUMMARY intent handling and added new response generation methods
src/main/java/org/codelibs/fess/api/chat/ChatApiManager.java Enhanced SSE phase events to include keywords in event data
src/main/webapp/js/chat.js Added placeholder replacement logic for {keywords} and message element updates
src/main/webapp/WEB-INF/view/chat/chat.jsp Configured phase labels from i18n properties
src/main/resources/fess_label*.properties Added 5 new phase labels for all 17 supported languages
src/test/java/org/codelibs/fess/chat/IntentDetectionResultTest.java Updated tests to reflect documentId→documentUrl and CHAT→UNCLEAR renames
src/test/java/org/codelibs/fess/chat/ChatIntentTest.java Updated tests to reflect CHAT→UNCLEAR enum rename

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +292 to +295
final List<String> docIds = urlResults.stream()
.map(doc -> (String) doc.get("doc_id"))
.filter(id -> id != null)
.collect(Collectors.toList());
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

Missing import statement for Collectors. The code uses Collectors.toList() but there's no visible import for java.util.stream.Collectors in the diff context.

Copilot uses AI. Check for mistakes.
public void onPhaseStart(final String phase, final String phaseMessage, final String keywords) {
try {
sendSseEvent(writer, "phase", Map.of("phase", phase, "status", "start", "message", phaseMessage));
final Map<String, Object> data = new HashMap<>();
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

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

Missing import statement for HashMap. The code creates a new HashMap but there's no visible import for java.util.HashMap in the diff context.

Copilot uses AI. Check for mistakes.
@marevol marevol merged commit 809bf89 into master Jan 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants