Commit Graph

7644 Commits

Author SHA1 Message Date
euvre
80d61ac8e2 fix(agent): return tavily tool errors as result instead of crashing the ReAct agent (#17274) 2026-07-24 10:57:18 +08:00
Hz_
e66d617f4f fix(go-model): default Jina rerank top_n to document count (#17242)
## Summary

- Default Jina rerank `top_n` to the document count
- Add coverage for default and explicitly configured `top_n` values

## Testing

- `bash build.sh --test -c -o /tmp/ragflow-models.test
./internal/entity/models`
- `git diff --check`
2026-07-24 10:53:09 +08:00
Hz_
339bba8793 refactor(go-models): share chat response handling (#17289)
## Summary

- Add provider-specific DeepSeek chat response handling aligned with its
documented schema.
- Share Zhipu and DeepSeek usage accounting and chat response helpers.

## Testing

- `go test -c -o /tmp/ragflow-models.test ./internal/entity/models`

#17284
2026-07-24 10:51:37 +08:00
Ehsan
e25b929a38 fix(deepdoc): match table columns within the same page (#17282) 2026-07-24 10:39:57 +08:00
Wang Qi
1b07bf286d Only record and show the log in final state (#908) (#17302) 2026-07-24 10:08:44 +08:00
euvre
40388c4a71 fix(models): surface MiniMax rate-limit and API errors instead of generic messages (#17292) 2026-07-24 09:54:08 +08:00
euvre
99bea630b0 fix: agent session round count not incremented in Go mode (#17295) 2026-07-24 09:53:58 +08:00
chanx
3dc298dbf5 fix(web): prevent multi-select popover from closing on first selection (#17310) dev-20260724 2026-07-24 09:29:40 +08:00
rayhan
35e1cc77e8 remediate CVE's by upgrading mcp to >=1.28.1 (#17315)
## Summary
  
Remediates HIGH severity CVEs in the `mcp` package by bumping from
`>=1.19.0` to `>=1.28.1,<2` in `pyproject.toml`.
  
  | CVE | Severity | Package | Installed | Fixed in |
  |---|---|---|---|---|
  | CVE-2025-66416 | HIGH | mcp | 1.19.0 | 1.23.0 |
  | CVE-2026-52869 | HIGH | mcp | 1.19.0 | 1.27.2 |
  | CVE-2026-59950 | HIGH | mcp | 1.19.0 | 1.28.1 |

Raised lower bound to `>=1.28.1`, added `<2` upper bound per the MCP SDK
maintainers' recommendation to avoid unstable major releases.
  
  ## Verification
  
All module paths RAGFlow imports from `mcp` remain present and unchanged
in 1.28.1:
  
  - `mcp.client.session.ClientSession`
  - `mcp.client.sse.sse_client`
  - `mcp.client.streamable_http.streamablehttp_client`
  - `mcp.types.CallToolResult, ListToolsResult, TextContent, Tool`
  - `mcp.server.lowlevel.Server`
  - `mcp.server.sse.SseServerTransport`
  - `mcp.server.streamable_http_manager.StreamableHTTPSessionManager`
  
  Import smoke test confirmed all seven paths resolve correctly.
  
  ## Testing
  
  - MCP unit tests pass (`test/unit_test/mcp/`)
  - All MCP import paths verified present and functional on 1.28.1
  - `uv sync` resolves cleanly, no unexpected transitive version jumps
2026-07-23 22:47:31 +08:00
Jack
902d05b22b feat: parser component param check and family mapping fixes (#17312)
## Summary

Adds construction-time parameter validation to the ingestion
`ParserComponent` (mirroring the applicable subset of Python
`ParserParam.check()`), fixes a family-mapping mismatch that silently
skipped `output_format` validation and setup configuration for
image/audio files, and aligns the no-CGO parser stubs with the CGO
variants by threading `context.Context` through `ParseWithResult`.
2026-07-23 22:06:22 +08:00
Jin Hai
61201e437d Go: fix context (#17277)
### Summary

Continue to add context

---------

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-23 21:48:54 +08:00
Yingfeng
08e5d9c6be Fix infinity for compilation (#17313) 2026-07-23 21:43:56 +08:00
buua436
0c5732108a fix: support Infinity knowledge compilation (#17288)
### What problem does this PR solve?

Fix Infinity compatibility issues in knowledge compilation.

This change:

- Stores compilation source ID lists as JSON arrays in Infinity.
- Parses JSON array fields when reading compiled documents.
- Uses `json_contains` for filtering JSON array fields.
- Adds the missing `name` column to the Infinity mapping.
- Updates dataset navigation KNN search to use the unified
`MatchDenseExpr` interface.
- Handles unavailable embeddings without querying an invalid `q_0_vec`
field.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
2026-07-23 20:48:39 +08:00
qinling0210
a84d2ae3d2 fix(infinity): avoid hangs with pooled connections and bounded timeouts (#17287)
### Summary

**Issue**
When calling Infinity under concurrent load, one shared connection was
reused across concurrent operations, it just hangs.
 

**Solution**
Avoid hangs with pooled connections and bounded timeouts
2026-07-23 20:37:38 +08:00
euvre
4dfa5b145b fix: chat attachments not used in Go mode (#17259) 2026-07-23 20:24:13 +08:00
Jack
d12fd3b79d feat: parser pages range and parse type validation for dataset/document (#17293)
## Summary

Adds page-range parsing support to the Go-native pipeline path and
introduces strict `parse_type` validation for both dataset and document
update endpoints.

## What changed

### Pages range parsing
- **`internal/utility/pdf_pages.go`** — `NormalizePDFPages`: normalizes
raw page ranges (list of `[from,to]` 1-indexed inclusive ranges) into
sorted, merged, deduplicated `[][]int`. Invalid ranges are dropped.
- **`internal/ingestion/pipeline/pdf_pages.go`** —
`NormalizeParserConfigPages`: walks any parser_config map and normalizes
`"pages"` values under every component → filetype setup, so the
persisted config always carries clean, merged ranges.
- **`internal/deepdoc/parser/pdf/parser.go`** — integrates
`resolvePagesToProcess` to filter parsed PDF pages by the configured
ranges.
- Pipeline integration (parser pages):
`internal/parser/parser/pdf_parser_common.go`, `chunk_process.go`, plus
associated e2e and unit tests.

### Parse type validation (shared logic)
- **`internal/service/parser_mode.go`** (new) — `ValidateParseTypeMode`:
shared function that validates `parse_type` (1=BuiltIn/parser_id,
2=Pipeline/pipeline_id) and ensures the corresponding field is present.
Used by both dataset and document update endpoints.
- **`internal/service/dataset/crud.go`** / `update.go` — replaces inline
`isPipelineMode`/`isBuiltinMode` computation with the shared
`service.ValidateParseTypeMode`.
- **`internal/service/document/document_dataset_update.go`** — adds
strict `parse_type` validation in `validateDatasetDocumentUpdate`,
simplifies the reparse logic to a two-way switch (isBuiltin/isPipeline)
now that parse_type is always valid.
- **`internal/service/document/document.go`** — adds `ParseType` field
to `UpdateDatasetDocumentRequest`.
- **`internal/service/document/document_dataset_update.go`** —
`updateDocumentParserConfig` fallback path when DSL loading fails.
- **`internal/service/parser_mode_test.go`** (new) — test coverage for
nil, invalid, and missing-field scenarios.

### Frontend
- **`web/src/interfaces/request/document.ts`** — adds `parseType` to
`IChangeParserRequestBody`.
- **`web/src/hooks/use-document-request.ts`** —
`useSetDocumentPipelineParser` sends `parse_type` in the PATCH payload.
- **`web/src/pages/dataset/dataset/use-change-document-parser.ts`** —
Go/Python branching for the document parser config dialog.
-
**`web/src/components/document-pipeline-dialog/use-document-pipeline-form.ts`**
— `buildSubmitData` returns `parseType` (bugfix: was dropped from the
return value).

### Test changes
- **Removed**: 2 tests that verified the old "mutually exclusive" error
(replaced by `ValidateParseTypeMode` coverage).
- **Modified**: 6 tests across document and dataset packages to include
`ParseType` in request structs.
- **Added**: new e2e tests for pages parsing (`pages_e2e_test.go`,
`pdf_parser_pages_e2e_test.go`) and unit tests for `NormalizePDFPages`,
`NormalizeParserConfigPages`, `resolvePagesToProcess`.

## Backward compatibility
- The `parse_type` field is **required** when `parser_id` or
`pipeline_id` is sent. This changes the contract for both dataset and
document PATCH endpoints, but aligns the Go backend with the existing
frontend behavior (the frontend already sends `parse_type`). Callers
that omit `parse_type` when updating parser/pipeline selections will
receive a clear error message.
- Existing callers that only update fields like `name`, `enabled`, or
`meta_fields` are unaffected.
- Test updates ensure all known call sites are compliant.
2026-07-23 19:57:27 +08:00
euvre
fce2a94fe0 fix(go): resolve custom tenant model in LLM agent canvas component (#17187) 2026-07-23 19:37:13 +08:00
maoyifeng
b5e1b5dfd5 Fix use secrets gitee token (#17297)
### Summary

1. use  secrets gitee token
2. add gitee token to dockerfile
3. modify  pull_request  to pull_request_target
2026-07-23 19:34:02 +08:00
Lynn
c3e03f5c06 Fix: update base_url and model list for provider tencent Hunyuan (#17304) 2026-07-23 19:24:54 +08:00
euvre
387279b317 fix: prevent summary countdown text from flickering in data source log table (#17258) 2026-07-23 19:23:53 +08:00
Haruko386
5d8dfa610c fix: unable to get prologue in agent bot (#17299)
### Summary

As title
2026-07-23 19:13:45 +08:00
Haruko386
efe6bca5b3 refactor: the request body build (#17286)
### Summary

As title
2026-07-23 19:12:58 +08:00
Kevin Hu
3e4c6dfc0a Feat: refine the tree navigation during compilations (#17140) 2026-07-23 18:39:16 +08:00
buua436
d4a8c91f3c refa: improve tree clustering (#17285) 2026-07-23 17:49:13 +08:00
euvre
7b64e4dc5d fix: correct auto-parse switch thumb alignment in data source settings (#17252) 2026-07-23 17:05:50 +08:00
euvre
418d3c8cef fix: fetch all knowledge bases via pagination in link-to-dataset dialog (#17170) 2026-07-23 16:48:05 +08:00
Lynn
6467df3437 Fix: Xinference asr model call (#17283) 2026-07-23 15:57:45 +08:00
buua436
e3e2d0a3ec fix: optimize knowledge compilation LLM behavior and PageIndex ordering (#17270) 2026-07-23 14:30:43 +08:00
balibabu
c48a59db96 Feat: Add page rank to ParserForm (#17267) 2026-07-23 14:23:07 +08:00
Lynn
4a2564c7da Feat: OpenAI-API-Compatible (#17276) 2026-07-23 13:39:57 +08:00
Yurii214
64be8585aa fix(deepdoc): keep pipe tables inside markdown code fences (#17201) 2026-07-23 13:31:35 +08:00
Andrew Chen
8af2467112 fix(html_parser): keep text before the first block element (#17073) 2026-07-23 12:43:16 +08:00
Jin Hai
5478f955ab Go: add context to DAO (#17269)
### Summary

DAO layer doesn't use context, this PR is to fix it.

---------

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-23 12:15:58 +08:00
euvre
7b29fc10ca fix(agent): wire memory persistence in Message component (Go runtime) (#17256) 2026-07-23 11:37:59 +08:00
euvre
b095a5511a fix: make qwen3-vl-plus usable as chat/vision model in Go mode (#17254) 2026-07-23 11:14:08 +08:00
balibabu
1e445fbd68 Feat: Alter "Compilation" to "Operator" (#17273)
### Summary

[Feat: Alter "Compilation" to
"Operator"](f52684dc23)
2026-07-23 11:09:12 +08:00
rayhan
3bc39f94e8 fix: remediate CVE-2026-53533 by upgrading aiosmtplib to >=5.1.1 (#17264)
## Summary
  
Bumps `aiosmtplib` from `>=5.0.0` to `>=5.1.1,<6.0.0` in
`pyproject.toml`.
  
  | CVE | Severity | Package | Installed | Fixed in |
  |---|---|---|---|---|
  | CVE-2026-53533 | MEDIUM | aiosmtplib | 5.0.0 | 5.1.1 |
  
This is a direct dependency upgrade, no override or constraint needed.
2026-07-23 10:42:41 +08:00
buua436
d0a48816bb fix: improve page index descriptions (#17268) 2026-07-23 10:34:45 +08:00
euvre
a5aa9489f2 fix(chunker): glue delimiter to preceding segment instead of emitting it as a standalone chunk (#17168) 2026-07-23 10:13:46 +08:00
Jack
f7446cae7b Feat: upgrade office_oxide from 0.1.2 to 0.1.8 (#17262) 2026-07-23 09:59:34 +08:00
euvre
3733da2773 fix: count distinct chunk IDs so doc.chunk_num matches actual indexed chunks (#17182) 2026-07-23 09:58:43 +08:00
chanx
e3975b58eb fix: improve model merging logic in useModelsDerived for better instance-specific values (#17250) 2026-07-23 09:58:41 +08:00
euvre
db1559f71b fix: prevent thinking content from leaking into visible answer in shared chat (Go mode) (#17225) 2026-07-23 09:58:24 +08:00
buua436
285f3e4c7e refa: optimize wiki compilation concurrency (#17192) 2026-07-23 09:56:51 +08:00
Jin Hai
d19a036cda Go: add context to lots of interface (#17253)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
dev-20260723
2026-07-22 22:30:57 +08:00
balibabu
b3d394954d Feat: Support pipeline-related configuration at the document level. (#17212)
### Summary

Feat: Support pipeline-related configuration at the document level.
2026-07-22 22:24:50 +08:00
deadtrickster
dccc0a4bee docs: fix markdownlint and command issues across READMEs (#17261)
Fixes markdownlint findings and two carried-over command bugs that exist
identically across `README.md` and all translations (markdownlint just
never ran on them):

- **MD045** — alt text on documentation images.
- **MD014** — drop `$ ` prompts from command blocks with no output.
- **MD040** — language on the `/etc/hosts` fenced block; remove a stray
empty code block in `README_tzh.md`.
- `sudo brew install jemalloc` → `brew install jemalloc` (brew rejects
sudo).
- Infinity migration: the `up` command now uses
`docker/docker-compose.yml`, matching its `down`.

MD028 is intentionally left: its only fix folds a note into the
preceding `[!CAUTION]`/`[!WARNING]` admonition.

Split out of #17240 to keep that PR scoped to the Russian translation.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 21:47:58 +08:00
maoyifeng
92c1a232a3 fix CI add gitee token temporarily (#17263)
### Summary

fix CI add gitee token temporarily
2026-07-22 21:35:57 +08:00
Hz_
2487d4b8f7 feat(go-models): expand providers (SiliconFlow, Qiniu, Huawei Cloud, Jina) tool call support (#17241)
## Summary

- Add tool call support for SiliconFlow, Qiniu, Huawei Cloud, and Jina
while consolidating shared OpenAI-compatible helpers used by Aliyun
- Handle streaming tool call deltas and advertise tool support for
eligible provider models
- Add cross-provider tool call tests and enable Qiniu connection
verification through the models endpoint

#16990
2026-07-22 21:27:58 +08:00
Haruko386
29292e9622 fix: can get duplicate agent-name when update agent (#17232)
### Summary

As title
2026-07-22 21:27:25 +08:00