Commit Graph

254 Commits

Author SHA1 Message Date
Willem Jiang
58c1743ed5 fix: resolve math formula display abnormal after editing report
This fix addresses the issue where math formulas become corrupted or
incorrectly displayed after editing the generated report in the editor.

**Root Cause:**
The issue occurred due to incompatibility between markdown processing
in the display component and the Tiptap editor:
1. Display component used \[\] and \(\) LaTeX delimiters
2. Tiptap Mathematics extension expects $ and 70868 delimiters
3. tiptap-markdown didn't have built-in math node serialization
4. Math syntax was lost/corrupted during editor save operations

**Solution Implemented:**
1. Created MathematicsWithMarkdown extension that adds markdown
   serialization support to Tiptap's Mathematics nodes
2. Added math delimiter normalization functions:
   - normalizeMathForEditor(): Converts LaTeX delimiters to $/70868
   - normalizeMathForDisplay(): Standardizes all delimiters to 70868
3. Updated Markdown component to use new normalization
4. Updated ReportEditor to normalize content before loading

**Changes:**
- web/src/components/editor/math-serializer.ts (new)
- web/src/components/editor/extensions.tsx
- web/src/components/editor/index.tsx
- web/src/components/deer-flow/markdown.tsx
- web/src/core/utils/markdown.ts
- web/tests/markdown-math-editor.test.ts (new)
- web/tests/markdown-katex.test.ts

**Testing:**
- Added 15 comprehensive tests for math normalization round-trip
- All tests passing (math editor + existing katex tests)
- Verified TypeScript compilation and linting

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2025-10-15 08:52:50 +08:00
jimmyuconn1982
24e2d86f7b fix: add max_clarification_rounds parameter passing from frontend to backend (#616)
Bug Fix
This PR fixes the issue where max_clarification_rounds parameter was not being passed from the frontend to the backend, causing a TypeError: '<' not supported between instances of 'int' and 'NoneType' error.

Technical Details
The issue was that the frontend was not passing the max_clarification_rounds parameter to the backend API, causing the backend to receive None values and fail during comparison operations. This fix ensures the parameter is properly typed and passed through the entire request chain.
2025-10-14 17:56:20 +08:00
jimmyuconn1982
2510cc61de feat: Add intelligent clarification feature in coordinate step for research queries (#613)
* fix: support local models by making thought field optional in Plan model

- Make thought field optional in Plan model to fix Pydantic validation errors with local models
- Add Ollama configuration example to conf.yaml.example
- Update documentation to include local model support
- Improve planner prompt with better JSON format requirements

Fixes local model integration issues where models like qwen3:14b would fail
due to missing thought field in JSON output.

* feat: Add intelligent clarification feature for research queries

- Add multi-turn clarification process to refine vague research questions
- Implement three-dimension clarification standard (Tech/App, Focus, Scope)
- Add clarification state management in coordinator node
- Update coordinator prompt with detailed clarification guidelines
- Add UI settings to enable/disable clarification feature (disabled by default)
- Update workflow to handle clarification rounds recursively
- Add comprehensive test coverage for clarification functionality
- Update documentation with clarification feature usage guide

Key components:
- src/graph/nodes.py: Core clarification logic and state management
- src/prompts/coordinator.md: Detailed clarification guidelines
- src/workflow.py: Recursive clarification handling
- web/: UI settings integration
- tests/: Comprehensive test coverage
- docs/: Updated configuration guide

* fix: Improve clarification conversation continuity

- Add comprehensive conversation history to clarification context
- Include previous exchanges summary in system messages
- Add explicit guidelines for continuing rounds in coordinator prompt
- Prevent LLM from starting new topics during clarification
- Ensure topic continuity across clarification rounds

Fixes issue where LLM would restart clarification instead of building upon previous exchanges.

* fix: Add conversation history to clarification context

* fix: resolve clarification feature message to planer, prompt, test issues

- Optimize coordinator.md prompt template for better clarification flow
- Simplify final message sent to planner after clarification
- Fix API key assertion issues in test_search.py

* fix: Add configurable max_clarification_rounds and comprehensive tests

- Add max_clarification_rounds parameter for external configuration
- Add comprehensive test cases for clarification feature in test_app.py
- Fixes issues found during interactive mode testing where:
  - Recursive call failed due to missing initial_state parameter
  - Clarification exited prematurely at max rounds
  - Incorrect logging of max rounds reached

* Move clarification tests to test_nodes.py and add max_clarification_rounds to zh.json
2025-10-14 13:35:57 +08:00
Willem Jiang
2a6455c436 feature: add formula rander in the markdown (#611)
* feature: add formula rander in the markdown

* fixed the lint errors
2025-10-11 23:05:09 +08:00
HagonChan
c214999606 feat: add strategic_investment report style (#595)
* add strategic_investment mode

* make format

* make lint

* fix: repair
lint-frontend
2025-09-24 09:50:36 +08:00
lele3436
26a587c24e fix: frontend supports chinese for listing datasets in RAG (#582)
* fix-web-rag

* Update resource-suggestion.tsx
2025-09-14 20:19:56 +08:00
CHANGXUBO
dd9af1eb50 feat: Implement Milvus retriver for RAG (#516)
* feat: Implement MilvusRetriever with embedding model and resource management

* chore: Update configuration and loader files for consistency

* chore: Clean up test_milvus.py for improved readability and organization

* feat: Add tests for DashscopeEmbeddings query and document embedding methods

* feat: Add tests for embedding model initialization and example file loading in MilvusProvider

* chore: Remove unused imports and clean up test_milvus.py for better readability

* chore: Clean up test_milvus.py for improved readability and organization

* chore: Clean up test_milvus.py for improved readability and organization

* fix: replace print statements with logging in recursion limit function

* Implement feature X to enhance user experience and optimize performance

* refactor: clean up unused imports and comments in AboutTab component

* Implement feature X to enhance user experience and fix bug Y in module Z

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2025-09-12 22:20:55 +08:00
dependabot[bot]
a8a2e29e2c build(deps): bump next from 15.3.0 to 15.4.7 in /web (#556)
Bumps [next](https://github.com/vercel/next.js) from 15.3.0 to 15.4.7.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v15.3.0...v15.4.7)

---
updated-dependencies:
- dependency-name: next
  dependency-version: 15.4.7
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-04 22:26:33 +08:00
Willem Jiang
0a02843666 Fix: build of font end of #466 (#530) 2025-08-21 23:25:52 +08:00
道心坚定韩道友
f17e5bd6c8 FIX/Adapt message box to handle long text in frontend (#466)
* fix:ui

* fix:ui bug

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2025-08-21 10:31:54 +08:00
Anoyer-lzh
270d8c3712 fix: env parameters exception when configuring SSE or HTTP MCP server (#513)
* fix: _create_streamable_http_session() got an unexpected keyword argument 'env'

fix unit error

* update md

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2025-08-20 17:23:57 +08:00
CHANGXUBO
1bfec3ad05 feat: Enhance chat streaming and tool call processing (#498)
* feat: Enhance chat streaming and tool call processing

- Added support for MongoDB checkpointer in the chat streaming workflow.
- Introduced functions to process tool call chunks and sanitize arguments.
- Improved event message creation with additional metadata.
- Enhanced error handling for JSON serialization in event messages.
- Updated the frontend to convert escaped characters in tool call arguments.
- Refactored the workflow input preparation and initial message processing.
- Added new dependencies for MongoDB integration and tool argument sanitization.

* fix: Update MongoDB checkpointer configuration to use LANGGRAPH_CHECKPOINT_DB_URL

* feat: Add support for Postgres checkpointing and update README with database recommendations

* feat: Implement checkpoint saver functionality and update MongoDB connection handling

* refactor: Improve code formatting and readability in app.py and json_utils.py

* refactor: Clean up commented code and improve formatting in server.py

* refactor: Remove unused imports and improve code organization in app.py

* refactor: Improve code organization and remove unnecessary comments in app.py

* chore: use langgraph-checkpoint-postgres==2.0.21 to avoid the JSON convert issue in the latest version, implement chat stream persistant with Postgres

* feat: add MongoDB and PostgreSQL support for LangGraph checkpointing, enhance environment variable handling

* fix: update comments for clarity on Windows event loop policy

* chore: remove empty code changes in MongoDB and PostgreSQL checkpoint tests

* chore: clean up unused imports and code in checkpoint-related files

* chore: remove empty code changes in test_checkpoint.py

* chore: remove empty code changes in test_checkpoint.py

* chore: remove empty code changes in test_checkpoint.py

* test: update status code assertions in MCP endpoint tests to allow for 403 responses

* test: update MCP endpoint tests to assert specific status codes and enable MCP server configuration

* chore: remove unnecessary environment variables from unittest workflow

* fix: invert condition for MCP server configuration check to raise 403 when disabled

* chore: remove pymongo from test dependencies in uv.lock

* chore:  optimize the _get_agent_name method

* test: enhance ChatStreamManager tests for PostgreSQL and MongoDB initialization

* test: add persistence tests for ChatStreamManager with PostgreSQL and MongoDB

* test: add unit tests for ChatStreamManager initialization with PostgreSQL and MongoDB

* test: enhance persistence tests for ChatStreamManager with PostgreSQL and MongoDB to verify message aggregation

* test: add unit tests for ChatStreamManager with PostgreSQL and MongoDB

* test: add unit tests for ChatStreamManager initialization with PostgreSQL and MongoDB

* test: add unit tests for ChatStreamManager initialization with PostgreSQL and MongoDB

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2025-08-16 21:03:12 +08:00
Willem Jiang
ba7509d9ae fix: build of the web (#492) 2025-07-31 11:54:37 +08:00
Willem Jiang
aca9dcf643 fix:try to fix the docker build of front-end (#487) 2025-07-30 09:52:53 +08:00
suntp
e178483971 fix: Add streamable MCP server support (#468)
* fix: Add streamable MCP server support(#349)

* “Revert-timeout”

* fix lint and test check

* modify streamable error notify

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2025-07-29 14:04:04 +08:00
alexezio
89c1b689dc fix: dotenv flags error (#472)
Co-authored-by: BENLIAN <benchi.lian@thoughtworks.com>
2025-07-24 16:53:40 +08:00
orifake
e6ba1fcd82 fix: JSON parse error in link.tsx (#448)
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2025-07-20 14:14:18 +08:00
orifake
8bdc6bfa2d fix: missing i18n message (#410)
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2025-07-14 18:56:17 +08:00
HagonChan
afbcdd68d8 fix: add missing translation for chat.page (#409)
* fix: Error: MISSING_MESSAGE: Could not resolve chat.page` in messages for locale 'en'

Fixed a `MISSING_MESSAGE` error that was occurring on the chat page due to missing translation keys for `chat.page` in the internationalization messages.

* Update en.json
2025-07-14 18:54:01 +08:00
Willem Jiang
2121510f63 fix:catch toolCalls doesn't return validate json (#405)
Co-authored-by: Willem Jiang <143703838+willem-bd@users.noreply.github.com>
2025-07-12 23:31:43 +08:00
vvky
5abf8c1f5e fix: correctly remove outermost code block markers in model responses (fix markdown rendering issue) (#386)
* fix: correctly remove outermost code block markers in frontend

* fix: correctly remove outermost quote block markers in 'dropMarkdownQuote'

* fix: correctly remove outermost quote block markers in 'dropMarkdownQuote'

* fix: correctly remove outermost quote block markers in 'dropMarkdownQuote'

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2025-07-12 22:19:30 +08:00
Willem Jiang
70b86d8464 feat: add the Chinese i8n support on the setting table (#404)
* feat: Added i8n to the mcp table

* feat: Added i8n to the about table
2025-07-12 21:28:08 +08:00
johnny0120
e1187d7d02 feat: add i18n support and add Chinese (#372)
* feat: add i18n support and add Chinese

* fix: resolve conflicts

* Update en.json with cancle settings

* Update zh.json with settngs cancle

---------

Co-authored-by: johnny0120 <15564476+johnny0120@users.noreply.github.com>
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
Co-authored-by: Willem Jiang <143703838+willem-bd@users.noreply.github.com>
2025-07-12 15:18:28 +08:00
JeffJiang
52dfdd83ae fix: next server fetch error (#374) 2025-06-27 14:23:04 +08:00
Abeautifulsnow
9c2d4724e3 improve: add abort btn to abort the mcp add request. (#284) 2025-06-26 08:51:46 +08:00
johnny0120
aa06cd6fb6 fix: replace json before js fence (#344) 2025-06-26 08:40:32 +08:00
Young
82e1b65792 fix: settings tab display name (#250) 2025-06-19 14:33:00 +08:00
Luludle
8823ffdb6a fix: add line breaks to mcp edit dialog (#313) 2025-06-17 08:31:35 +08:00
3Spiders
4fe43153b1 fix(web): priority displayName for settings name error (#336) 2025-06-17 08:26:13 +08:00
DanielWalnut
19fa1e97c3 feat: add deep think feature (#311)
* feat: implement backend logic

* feat: implement api/config endpoint

* rename the symbol

* feat: re-implement configuration at client-side

* feat: add client-side of deep thinking

* fix backend bug

* feat: add reasoning block

* docs: update readme

* fix: translate into English

* fix: change icon to lightbulb

* feat: ignore more bad cases

* feat: adjust thinking layout, and implement auto scrolling

* docs: add comments

---------

Co-authored-by: Henry Li <henry1943@163.com>
2025-06-14 13:12:43 +08:00
JeffJiang
03e6a1a6e7 fix: mcp config styles (#320) 2025-06-13 18:01:19 +08:00
Lan
7d38e5f900 feat: append try catch (#280) 2025-06-12 20:43:50 +08:00
LeoJiaXin
397ac57235 fix: input text not clear when click submit button (#303) 2025-06-11 11:11:48 +08:00
Muharrem Okutan
eeff1ebf80 feat: added report download button (#78) 2025-06-11 09:50:48 +08:00
DanielWalnut
1cd6aa0ece feat: implement enhance prompt (#294)
* feat: implement enhance prompt

* add unit test

* fix prompt

* fix: fix eslint and compiling issues

* feat: add border-beam animation

* fix: fix importing issues

---------

Co-authored-by: Henry Li <henry1943@163.com>
2025-06-08 19:41:59 +08:00
DanielWalnut
0e22c373af feat: support to adjust writing style (#290)
* feat: implment backend for adjust report style

* feat: add web part

* fix test cases

* fix: fix typing

---------

Co-authored-by: Henry Li <henry1943@163.com>
2025-06-07 20:48:39 +08:00
JeffJiang
73ac8ae45a fix: web start with dotenv (#282) 2025-06-05 11:53:49 +08:00
SToneX
0da52d41a7 feat(chat): add animated deer to response indicator (#269) 2025-05-31 19:13:13 +08:00
Aeolusw
eaaad27e44 fix: normalize line endings for consistent chunk splitting (#235) 2025-05-29 20:46:57 +08:00
JeffJiang
4ddd659d8d feat: rag retrieving tool call result display (#263)
* feat: local search tool call result display

* chore: add file copyright

* fix: miss edit plan interrupt feedback

* feat: disable pasting html into input box
2025-05-29 19:52:34 +08:00
JeffJiang
7e9fbed918 fix: editing plan style (#261) 2025-05-29 10:46:05 +08:00
JeffJiang
fcbc7f1118 revert: scroll container display change (#258) 2025-05-28 19:23:32 +08:00
JeffJiang
d14fb262ea fix: message block width (#257) 2025-05-28 19:11:20 +08:00
JeffJiang
9888098f8a fix: message input box reflow (#252) 2025-05-28 16:38:28 +08:00
JeffJiang
462752b462 feat: RAG Integration (#238)
* feat: add rag provider and retriever

* feat: retriever tool

* feat: add retriever tool to the researcher node

* feat: add rag http apis

* feat: new message input supports resource mentions

* feat: new message input component support resource mentions

* refactor: need_web_search to need_search

* chore: RAG integration docs

* chore: change example api host

* fix: user message color in dark mode

* fix: mentions style

* feat: add local_search_tool to researcher prompt

* chore: research prompt

* fix: ragflow page size and reporter with

* docs: ragflow integration and add acknowledgment projects

* chore: format
2025-05-28 14:13:46 +08:00
DanielWalnut
8bbcdbe4de feat: config max_search_results for search engine (#192)
* feat: implement UI

* feat: config max_search_results for search engine via api

---------

Co-authored-by: Henry Li <henry1943@163.com>
2025-05-18 13:23:52 +08:00
Zhengbin Sun
c046d9cc34 fix: update responsive design calculations for chat layout (#168) 2025-05-16 11:40:26 +08:00
Leo Hui
a43db94fb6 feat: refactor crawler trust link style (#166)
* feat: refactor crawler trust link style

* feat: enhance link credibility checks in Markdown and related components
2025-05-15 17:17:10 +08:00
JeffJiang
8802eea0ba fix: report editor styles (#163)
* fix: report editor styles
2025-05-15 15:18:01 +08:00
Leo Hui
1a59accb52 fix: adjust slider width for responsive design in multi-agent visualization (#134) 2025-05-15 11:59:16 +08:00