Commit Graph

8089 Commits

Author SHA1 Message Date
buua436
42329f140d feat: add agent filter counts (#17984) 2026-08-07 15:29:07 +08:00
buua436
d63ad40c65 fix: reject duplicate chat parameter keys (#17977) 2026-08-07 15:28:30 +08:00
balibabu
4d1da18e84 Fix: The height of the source code mode in the wiki template's Markdown editor is too small. (#17982) 2026-08-07 14:55:30 +08:00
balibabu
e2e70cea92 Fix: Clicking the confirm button on the WikiCommitModal does not validate the form. (#17981) 2026-08-07 14:55:18 +08:00
chanx
048affd2ab fix(i18n): clarify selectAll label selects current page only (#17974) 2026-08-07 14:54:37 +08:00
Kevin Hu
a25ff22aca Refactor: check the evidences while formalize answer. (#17951)
### Summary

Check the evidences while formalize answer.
2026-08-07 14:51:54 +08:00
Lynn
045ba3970a Fix: verification message (#17978) 2026-08-07 14:44:23 +08:00
Wang Qi
550283c356 Fix generate graph error (#17966) 2026-08-07 14:29:01 +08:00
chanx
ed96379c47 fix(markdown): open non-PDF document references in internal viewer (#17971) 2026-08-07 14:23:40 +08:00
buua436
48b2d3b914 fix: preserve page index chapter chunk provenance (#17963) 2026-08-07 13:47:04 +08:00
Haruko386
615c7d8bcb feat[Go]: implement data source gmail and test prune (#17969)
### Summary

As title
2026-08-07 13:35:57 +08:00
balibabu
84b94d4b30 Fix: Remove leading and trailing whitespace from the pageIndex data returned by the backend. (#17967) 2026-08-07 13:32:09 +08:00
buua436
f77f2bb9ce fix: optimize timeline compilation template (#17972) 2026-08-07 13:31:33 +08:00
Yee
27c8b1a061 fix(nginx): use 127.0.0.1 in python conf to avoid ~1s IPv6 fallback latency (#17909)
## Problem

In the default deployment (`API_PROXY_SCHEME=python`), the nginx config
generated from `docker/nginx/ragflow.conf.python` uses:

```nginx
proxy_pass http://localhost:9381;  # admin
proxy_pass http://localhost:9380;  # api
```

Inside the RAGFlow container, `/etc/hosts` maps `localhost` to both
`127.0.0.1` and `::1`:

```
127.0.0.1   localhost
::1         localhost ip6-localhost ip6-loopback
```

But the backend services (`ragflow_server.py` on 9380, admin server on
9381) only listen on IPv4 (`127.0.0.1`). When nginx resolves `localhost`
to `::1`, the upstream connection fails and nginx falls back to the IPv4
address - each fallback adds ~1 second of latency.

Co-authored-by: Jin Hai <haijin.chn@gmail.com>
2026-08-07 11:32:43 +08:00
balibabu
b099c88c3f Fix: Deduplication of wiki entity types (#17965) 2026-08-07 11:29:05 +08:00
balibabu
5c8c4346a9 Fix: Start a new conversation; an additional conversation entry will appear once the chat ends. (#17964) 2026-08-07 11:28:50 +08:00
Jack
57cacaddf9 refactor[Go]: remove chunker dead code & fix stale/false descriptors (L1/L2/L3) (#17960) 2026-08-07 11:07:45 +08:00
Jack
e587c56460 refactor(go): clean up TokenChunker delimiter routing and children appliers (#17954) 2026-08-07 11:07:21 +08:00
Jack
16ac94cff5 fix(parser/chunk): dedupe CompileDelimiterPatternList active entries (#17939)
Restore the deduplication that was dropped when #17926 was merged.
`CompileDelimiterPatternList` now keeps a `seen` set and collapses
equivalent active entries (both backtick-inner and bare) into a single
alternation. This PR also removes the dead code that the re-review
surfaced.
2026-08-07 10:06:04 +08:00
Jack
cdef804555 fix(chunker): decide token merge on running sum, not re-tokenized join (#17948) 2026-08-07 09:57:01 +08:00
Jack
891d05baf9 refactor: extract TruncateRunes to internal/utility and fix integration build (#17938) (#17944) 2026-08-07 09:55:26 +08:00
chanx
1ef7910103 fix(memory): display embd_name with fallback to embd_id in form field (#17956) dev-20260807 2026-08-07 09:34:30 +08:00
Haruko386
f532f27f1f feat[Go]: complete the base for data Syncer (#17890)
### Summary

As title

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-08-06 20:09:46 +08:00
Yingfeng
1b8151a1f6 Refine agentic search (#17900) 2026-08-06 19:42:05 +08:00
chanx
973d9b6b26 fix(setting-model): saved instance api_key edits not triggering save (#17942) 2026-08-06 19:38:29 +08:00
Lynn
2e0b82be30 Fix: recognize data type in parse method table (#17946) 2026-08-06 19:37:57 +08:00
chanx
dac86b3aae feat: add html file type icon (#17925) dev-20260806-2 2026-08-06 17:30:44 +08:00
Jack
477469f94c Refactor(task): collapse duplicated debug-result helpers (#17937)
Collapses three duplicated/dead code smells in the canvas debug-result
path of `internal/ingestion/task` (remaining findings #2/#3/#4 from the
package CTO review):

- **#2 — vector-key stripping duplication.** `isVectorKey` (the full
stripper: fixed legacy keys `vector`/`embedding`/`feature`/`q_vec` plus
the `q_<dim>_vec` pattern) was re-implemented as a weaker inline copy in
the golden-compare tool (`tool/compare_pipeline_golden.go`) that only
matched `q_<dim>_vec` and let real vectors leak into the diff. Exported
as `IsVectorKey` and reused by the tool.
- **#3 — near-duplicate deep copy.** `deepCopy` and `deepCopyStrip` were
identical walkers differing only in vector stripping. Parameterized
`deepCopy(v any, stripVector bool) any` and deleted `deepCopyStrip`.
- **#4 — redundant switch.** `lookupComponentOutput` had two switch
cases with identical bodies (both the `map[string]map[string]any` and
`map[string]any` state shapes). Unified into a single `found`/`ok`
resolution; nested-state and flat-fallback semantics unchanged.
2026-08-06 17:21:55 +08:00
Wang Qi
23b20a098a Fix ragflow server hung after parsing a big file (#17936) 2026-08-06 17:01:53 +08:00
buua436
8379165c12 fix: record generated wiki page versions (#17931) 2026-08-06 16:49:50 +08:00
chanx
7d0d1ab642 fix(tree-select): allow collapsing parent nodes during search (#17934) 2026-08-06 16:23:56 +08:00
chanx
642515524d fix(agent): hide log sheet when closing chat sheet (#17927) 2026-08-06 16:22:44 +08:00
chanx
f72cb14e18 feat: add json file preview and icon (#17930) 2026-08-06 16:22:32 +08:00
chanx
5c6536a86c fix(number-input): improve value handling for out-of-range inputs (#17921) 2026-08-06 16:21:31 +08:00
Hz_
ef0b293271 fix(go-models): validate embedding request limits (#17919)
## Summary

- Add embedding batch-size metadata to model responses and tenant
overrides.
- Validate embedding dimensions and batch limits across provider
verification and embedding requests.
- Expand validation tests for defaults, limits, and missing metadata.

---------

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
Co-authored-by: Jin Hai <haijin.chn@gmail.com>
2026-08-06 16:18:12 +08:00
Jack
60df86bfa2 fix(go): unify children delimiter pattern with backtick-strip + rune order (#17926)
`compileChildrenPattern` re-implemented the delimiter-list compile
inline with two divergences from the shared
`CompileDelimiterListPattern`:

- It never stripped backticks, so a backtick-wrapped
`children_delimiter` like `` `###` `` matched the **literal wrapped
token** rather than the inner `###`.
- It sorted by **byte length** instead of rune count (`sortSlice`), so
multi-byte delimiters could be ordered incorrectly and a longer
delimiter could fail to win over a shorter prefix.
2026-08-06 16:10:30 +08:00
Zhichang Yu
2e37997ab9 Go knowledge compiler with scheduler-driven dataset compilation (#17913)
Ports dataset knowledge compilation (wiki/graph/tree/mindmap) to the Go
scheduler with a status contract, aligns wiki storage/retrieval with
Python, sizes prompts by content_length, and resolves embedding batch
size from provider capability.
2026-08-06 15:54:00 +08:00
Jack
addc5acdc0 fix(tokenizer): align important_kwd split to English comma (DSL parity, A2) (#17928)
## Summary

Port the DSL tokenizer's `important_kwd` splitting into the Go
`Tokenizer` component so the indexed keyword array is byte-compatible
with the Python DSL pipeline and with the keyword-extraction prompt
contract.

- **Problem:** The Go component split `keywords` on the full ASCII+CJK
delimiter set (`utility.SplitKeywords`, regex `[,,;;、\r\n]+`), while the
DSL baseline `rag/flow/tokenizer/tokenizer.py:153` uses
`keywords.split(",")`, and `rag/prompts/keyword_prompt.md` instructs the
LLM to delimit keywords by **ENGLISH COMMA**. For a dataflow canvas that
includes the Tokenizer component, this divergence made Go's indexed
`important_kwd` differ from the Python-DSL-built index (CJK
commas/semicolons were split in Go but kept whole in Python).
- **Fix:** Use `strings.Split(kw, ",")` at `tokenizer.go:701`,
preserving empty middle elements to match Python's `"a,,b".split(",") ==
["a","","b"]`. The indexing fallback layer
(`internal/ingestion/task/indexdoc/process.go`) already mirrors the
Python multi-delimiter fallback (`dataflow_service.py:322`), so only the
component layer diverged and only it is changed.

## Test plan

- `TestTokenizerComponent_ImportantKwd_CommaOnly` (no build tag, default
`go test ./...`): switches the tokenizer to the identity engine (no CGo
pool needed) and asserts `"kw1,kw2;kw3,kw4"` → `["kw1","kw2;kw3,kw4"]`;
also asserts `important_tks` still tokenizes the full keyword string.
- `TestTokenizerComponent_Invoke_KeywordSplitCommaOnly` (`integration`
tag, real CGo analyzer): covers comma-split, CJK/semicolon-not-split,
and empty-middle preservation.
- Both tiers pass (unit `ok`, integration `ok`).

## Regression notes

- Intentional behavior change for canvases that include the Tokenizer
component: keywords containing `;`/`、`/newlines now stay as one keyword
(matching Python DSL) instead of being split. Re-indexing existing
Go-built data will change the `important_kwd` set — expected parity
cost, documented in code comments and commit message.
- Canvases without a Tokenizer component are unaffected (they hit the
unchanged multi-delimiter fallback).
- Other fields (`important_tks`, `questions`, `summary`, `text`) are
untouched; the `utility` import was removed cleanly.
2026-08-06 15:52:50 +08:00
Jack
109b74e410 refactor(go): remove dead atom-split helpers from TokenChunker (#17920)
## Summary
- Remove `splitOversizedUnit`, `splitAtomByTokenBudget` and `atomRE`
from `internal/ingestion/component/chunker/token.go`.
- Delete `split_oversized_guard_test.go` (added by #17740), which
guarded the removed atom-split behaviour.
- Drop the now-unused `wordCount`/`charCount` helpers from
`token_strict_cap_test.go`.
- Add `TestMergeByTokenSize_OversizedUnitStaysWhole` to pin the #17799
contract invariant (over-budget unit stays whole, never atom-split) on
the **text path**. The JSON path is already covered by
`TestMergeByTokenSizeFromJSON_OversizedUnitStaysWhole`.

## Why
The production merge path (`mergeByTokenSize` /
`mergeByTokenSizeFromJSON`) keeps over-budget units whole and relies on
the embedding/rerank layer to truncate them, per the TokenChunker
contract (#17799: remove atom-split, no hard_cap). The deleted helpers
implemented the opposite behaviour and had **no production caller**, so
they contradicted the contract and misled readers into thinking
atom-split was active.

## Parser vs chunker layering
Python's `_split_oversized_unit` lives at the **parser layer**
(pre-split before `naive_merge`), not in the chunker. Go's parser
backends are currently skeletons, so there is no parser-side equivalent
yet; if added later it belongs in `internal/parser/parser/*`, not the
chunker.

## Test plan
`bash build.sh --test ./internal/ingestion/component/chunker/...`
passes; the new text-path test passes and the orphaned atom-split tests
are gone.

## Changes
- 3 files changed, 32 insertions(+), 250 deletions(-)
2026-08-06 15:50:52 +08:00
Jack
bb96bb687d refactor(task): sink parser page-cap override into pipeline package (#17905)
## Summary

Moves the canvas-debug parser page-cap injection out of the `task`
orchestrator and into a **debug-agnostic** `pipeline` helper, so
`PipelineExecutor` keeps only the orchestration skeleton (resolving one
of the P1 review findings: the executor was overloaded with
DSL/parser-param assembly).

### Changes
- **`pipeline/parser_page_cap.go`** (new):
- `BuildParserPageCapOverride(parserConfig, dsl, docType, capPages int,
parserComponentName string, familyOf)` — injects the
`ParserConfig[cpnID][family]["pages"]` cap through the same
`override_params` channel production uses. The cap value and family
resolution are injected by the caller, so the function carries no debug
semantics and is reusable for any page-cap scenario.
- `ExtractParserCpnID(dsl, parserComponentName)` — shared Parser cpnID
discovery from (optionally enveloped) DSL.
- `UnwrapCanvasDSL(raw []byte)` — exported single source of truth for
stripping the `{"dsl": {...}}` canvas envelope.
- `pipeline` does **not** import `component` (no reverse dependency);
callers inject `component.ComponentNameParser` /
`component.ParserFileFamily`.
- **`task/pipeline_executor.go`**: removed `injectDebugPageCap` (the
`debugPageCapPages = 2` constant stays in the task package). The debug
branch now calls `pipeline.BuildParserPageCapOverride(...)`.
- **`task/pipeline_executor.go` `warnUnknownComponentParams`**: fixed a
production no-op bug — it passed the enveloped DSL straight to
`ExtractAllComponentParams`, which silently errored and disabled the
unknown-cpnID guard. It now unwraps the envelope first.
- **`task/debug_result_dsl.go`**: reuses `pipeline.UnwrapCanvasDSL`
instead of a third inline envelope-unwrap copy.

### Behavior
No external debug-preview behavior changes. The three original
invariants are preserved exactly:
1. explicit `pages` caps under `cpnID+family` are respected (not
overwritten),
2. an empty family (unknown docType) is a no-op,
3. the injected shape is `[]any{[]any{1, capPages}}` (the
`[]any`-of-`[]any` form `NormalizePDFPages` requires).

## Test plan
- New `pipeline/parser_page_cap_test.go`: `BuildParserPageCapOverride`
(inject / respect-existing / unknown-family no-op / no-Parser no-op),
`ExtractParserCpnID` (enveloped + raw), `UnwrapCanvasDSL`.
- `task/debug_test.go`: `TestInjectDebugPageCap` migrated to the new
helper; new
`TestWarnUnknownComponentParamsDetectsUnknownCPNFromEnvelope` captures
the warning via `zaptest/observer` to prove the envelope no-op bug is
fixed.
- Both `internal/ingestion/pipeline` and `internal/ingestion/task` pass
`build.sh --test` (unit tier).

## Notes
- `TOKEN_CHUNKER_HANDOFF.md` is an unrelated untracked file and was
deliberately **not** included in this PR.
2026-08-06 15:50:39 +08:00
Jack
e95c81326e test(chunker): lock non-text segments as standalone on merge (closes #17889) (#17896)
## Background

Issue #17889 asks that, when merging adjacent segments, the chunker
first
checks each segment's type and only merges **text** segments —
**table**,
**image**, and any other non-text type must each remain a standalone
chunk
and must never be merged with a neighbouring segment.

## Why this PR closes #17889 (no Go code change required)

After tracing the Go TokenChunker, the requirement is **already
satisfied**
on the structured (JSON / chunks) path. The type-aware rule is enforced
at
three layers in `internal/ingestion/component/chunker/`:

- `common.go:138` `itemDocType` derives the type from `doc_type_kwd`
(`"table"` -> `"table"`, `"image"` -> `"image"`, anything else ->
`"text"`).
It does **not** depend on the `ck_type` field being populated, so the
type
  survives even when only `doc_type_kwd` is set (e.g. upstream
  Title/Group/Hierarchy chunks).
- `token.go:756` `chunkFromItem` emits a non-text item as a single
standalone
  chunk before the merge loop ever runs.
- `token.go:1050` `mergeByTokenSizeFromJSON` forces any non-text chunk
standalone (`if ck.CKType != "text"`); and `token.go:991` starts a
*fresh*
  text chunk after a non-text chunk, so text on either side of a
  table/image is never merged across it.

The only path without type information is the raw markdown/text/html
string
path (`PayloadFormatMarkdown/Text/HTML`), where the input is by contract
an
untyped string and `applyChildrenDelim` hard-codes `CKType: "text"` so
merging is correct. There is no non-text segment to merge there, so this
is
out of #17889's scope (which is about the merge logic).

## Why the Python side is deferred

The Python `naive` parser path does not thread a `ck_type` through to
`merge_paragraphs` / `naive_merge` / `naive_merge_with_images`
(`rag/nlp/__init__.py`): its parsers emit flat `(text, pos)` sections
plus a
parallel `section_images` list, and the type-aware `_merge_cks` rule
(`rag/nlp/__init__.py:1749`) is only wired into the docx path.
Propagating
`ck_type` end-to-end across every Python parser is a large refactor, so
it is
intentionally **not** part of this PR. The Go engine is the active
ingestion
path, and it already honors the rule.

## This PR

Adds a regression-lock (characterization) test, not a fix:

- `TestTokenChunker_InvokeJSONPayload_KeepsNonTextStandalone` feeds a
  `[text, table, text, image, text]` structured payload and asserts it
  produces exactly five standalone chunks in the order
`text, table, text, image, text` — proving tables/images stay standalone
  and text on either side is not merged across them.

Verified green:

```
bash build.sh --test -run TestTokenChunker_InvokeJSONPayload_KeepsNonTextStandalone ./internal/ingestion/component/chunker/...
--- PASS: TestTokenChunker_InvokeJSONPayload_KeepsNonTextStandalone (0.07s)
```

## Related
- Issue #17889
- PR #17808 (chunking refactor, merged)
- Contract doc #17799
2026-08-06 15:50:14 +08:00
Lynn
457830f312 Fix: display embd_name in list memory api response (#17932) 2026-08-06 15:43:07 +08:00
Jin Hai
405275935f Go: fix unused check (#17922)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-08-06 14:45:10 +08:00
buua436
66f2c84c3f fix: hide resume parser option (#17923) 2026-08-06 14:07:24 +08:00
euvre
ae66eb835a fix(web): file list total count doesn't match displayed rows (#17747) 2026-08-06 13:53:42 +08:00
euvre
e9dd0314f0 Fix: dataflow log sheet shows the previous run's log in Go mode (#17790) 2026-08-06 13:51:50 +08:00
euvre
0054657c7c fix: keep agent chat history anchored when resizing the input box (#17834) 2026-08-06 13:51:22 +08:00
Jin Hai
8bc34219f5 Go: fix plenty of warnings (#17918)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-08-06 13:36:04 +08:00
chanx
b71e84838d fix(document-preview): make ExcelCsvPreviewer adapt to container resize (#17906) 2026-08-06 13:26:24 +08:00
buua436
97f9ae5896 refa: unify wiki example naming (#17910) 2026-08-06 13:24:27 +08:00