Commit Graph

7736 Commits

Author SHA1 Message Date
Haruko386
4885dda32a fix: failed to set right status in memory (#17472)
As title

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-07-28 19:13:22 +08:00
Jin Hai
7f21a7ba18 Go: add context, part14 (#17446)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-28 19:05:59 +08:00
Wang Qi
b4170d0dfd Dev/enhance dev script (#17487) 2026-07-28 17:47:45 +08:00
Wang Qi
795bd7c00f Fix: expose the real error when ingest error (#17485) 2026-07-28 17:32:32 +08:00
buua436
b7ddf45774 fix: stabilize wiki planning and artifact graph rendering (#17473) 2026-07-28 17:08:40 +08:00
Yash Raj Pandey
730de9cc7f Fix tag CSV parser splicing wrong text after a multi-line quoted field (#17131) 2026-07-28 17:04:11 +08:00
Yash Raj Pandey
b08e5f5647 Fix: RAGFlowJsonParser crashes with IndexError on top-level JSON scalars (#16877) 2026-07-28 16:58:42 +08:00
Wang Qi
b8bb2297f9 Fix Markdown parser, the table should be inside chunk (#17477) 2026-07-28 16:00:52 +08:00
Lynn
675c35a2de Fix: rm tenant llm call (#17476) 2026-07-28 15:54:44 +08:00
balibabu
fe38d5f246 Feat: Delete dataset level graph. (#17474)
### Summary

Feat: Delete dataset level graph.
2026-07-28 15:27:08 +08:00
qinling0210
ad2102c1a8 fix(infinity): parent_kwd incorrectly split as keyword list causing orphaned clusters (#17475)
…rphaned clusters

### Summary

**Problem**
When deleting a document from the knowledge base, the parent cluster
could never be located and was therefore never cleaned up, leaving
orphaned clusters in Infinity indefinitely.

**Root Cause**
InfinityConnection.field_keyword() treats all _kwd-suffixed columns as
keyword lists and applies .split("###") to them in get_fields().
parent_kwd was missing from the exclusion list. This caused a parent
cluster name like "Toronto Transit & Authority Control 5e8d5eb6" to
become ['Toronto Transit & Authority Control 5e8d5eb6'] (a
single-element list). When that list was fed into _nav_cluster_id(), it
produced a different hash than the actual cluster's hash (computed from
the plain string), so every deletion-time cluster lookup silently
failed.

**Fix**
Added "parent_kwd" to the exclusion list in field_keyword(), alongside
docnm_kwd, important_kwd, question_kwd, etc.
2026-07-28 15:26:40 +08:00
Hz_
19b60132da fix(go-agent): use session IDs for cancellation and context flow (#17462)
## Summary

- Propagate request contexts through Agent Canvas execution and external
calls.
- Replace internal task IDs with session IDs while retaining `task_id`
as a wire alias.
- Complete session-scoped cancellation with Redis lease and token
validation.

## Testing

- Go backend tests passed.

<img width="1176" height="574" alt="image"
src="https://github.com/user-attachments/assets/b86560be-9b8d-45bb-97e9-921dffab8ebe"
/>
2026-07-28 14:59:34 +08:00
balibabu
cc0fbd37ef Fix: Unable to navigate from the agent list page to the compilation editing page. (#17460) 2026-07-28 13:59:57 +08:00
Wang Qi
0fdefb284e Sandbox: bump rate limit from 5/second to 60/second (#928) (#17469) 2026-07-28 13:53:56 +08:00
Jack
9b0719fa94 fix: Go ingestion migration batch 5 (Parser 1.1/1.7/2.11, Chunker 1.7/1.8/2.6/2.7, Tokenizer 6x fixes) (#17419)
## Summary

Continuation of the Python→Go ingestion pipeline migration (File →
Parser → Chunker → Extractor → Tokenizer). Fixes cover Parser, Chunker,
and Tokenizer gaps identified. Fix page number (0-indexed and 1-index
mixed before fix; use 1-indexed after fix) and chunk order issues.

### Parser
- **Slides TCADP (1.7):** `pptx_tcadp.go` + TCADP branch in
`pptx_parser.go`/`ppt_parser.go` — PowerPoint files now support
`parse_method="tcadp"` via the TCADP cloud service, matching the
spreadsheet-family TCADP pattern. PPT containers pass `"PPT"` as
fileType (not hardcoded `"PPTX"`).
- **Audio default output_format (2.11):** `defaultSetups()` audio
default changed from `"text"` to `"json"`, aligning with Python
`parser.py:232` and `AllowedOutputFormat["audio"]={"json"}`.
- **PDF VLM enhancement (1.1):** `maybeDispatchPDFVisionEnhancement` in
`pdf_vision_dispatch.go` enriches image/table items with IMAGE2TEXT
model descriptions after PDF parsing, mirroring Python
`enhance_media_sections_with_vision`. Semaphore fix: acquire before
goroutine start to prevent unbounded goroutine creation.
- **json family (2.3):** reclassified as Keep Go — `json_parser.go` is a
functional enhancement, not a parity gap.
- **page number:** changed from "mixed use of 1-indexed & 0-indexed" to
"1-indexed"

### Chunker
- **BULLET_PATTERN fallback (1.7):** 4th-level fallback in
`resolveTitleLevels` (`title.go`) detects bullet/numbered-list patterns
(Chinese legal, numbering, English) when outline + regex levels produce
only bodyLevel. Guarded by `allBodyLevel` to never override existing
structure.
- **Tag/One chunker fields (1.8):** `tag.go` sets `TopInt` from source
row index; `one.go` preserves `Positions`/`PDFPositions` from source
items. TSV multi-line RowNum fix: tracks `contentStart` for correct row
attribution.
- **Overlapped_percent normalization (2.6):**
`NormalizeOverlappedPercent` in `schema/chunker.go` mirrors Python
`common/float_utils.py:50-58` — accepts `[0,1)` fraction or `[0,90]`
percent, normalizes to canonical `[0,90]`.
- **Paragraph splitting (2.7):** aligned to Python flow `naive_merge` —
`CRLF` normalization, `splitKeepingDelimiter` preserves sentence
delimiters, single-section merge with token-budget-governed chunking.
- **chunk order:** sort by reading order

### Tokenizer
- **Phantom chunk filtering (Omission 2):** `isPhantomChunk` + filter
loop in `chunksFromTokenizerUpstream` skips zero-value ChunkDocs.
- **Batch size env var (Omission 3):** `embeddingBatchSize()` reads
`TOKENIZER_EMBEDDING_BATCH_SIZE`, defaults to 16.
- **Summary empty check (Diff 5):** `TrimSpace(s) != ""` → `s != ""`,
matching Python truthy check.
- **chunk_order_int all paths (Diff 8):** set unconditionally before
full_text/embedding branching.
- **Timeout default (Diff 10):** `600s` → `60s`, matching Python
`@timeout(60)`.
- **Small maxTokens truncation (Diff 14):** `truncateForEmbedding`
returns `""` when `maxTokens <= 10`, matching Python.

### Code review fixes
- Semaphore acquire moved before goroutine in `pdf_vision_dispatch.go`
(concurrency control)
- Context propagation in `pptx_tcadp.go` (cancellation support)
- Test resolver leak fix in `media_dispatch_test.go` (defer restore)
- Migration history comments removed per AGENTS.md

## Test plan
```
bash build.sh --test ./internal/parser/parser/... ./internal/ingestion/component/...
```

## Notes
- Migration diff tracking: `docs/migration_python_go_diff.md`
- Remaining gaps: Extractor component only (21 items)
2026-07-28 11:12:52 +08:00
chanx
326893811a fix(web): identify provider instances by id and skip clean cards on save (#17424) dev-20260728 2026-07-28 09:49:57 +08:00
Wang Qi
619b58faef Add {date} replacement to chat (#17430) 2026-07-28 09:49:17 +08:00
Lynn
15f8ef7409 Fix: code review (#17442) 2026-07-28 09:47:22 +08:00
rayhan
8b793ee148 fix: remediate litellm CVEs by upgrading from 1.82.5 to 1.84.0 (#17448)
## Summary
  
Remediates nine litellm CVEs (3 CRITICAL, 6 HIGH) by upgrading the exact
pin from `==1.82.5` to `==1.84.0` in `pyproject.toml`.
  
  | CVE | Severity | Fixed in |
  |---|---|---|
  | CVE-2026-35030 | CRITICAL | 1.83.0 |
  | CVE-2026-42208 | CRITICAL | 1.83.7 |
  | CVE-2026-49468 | CRITICAL | 1.84.0 |
  | CVE-2026-35029 | HIGH | 1.83.0 |
  | CVE-2026-40217 | HIGH | 1.83.10 |
  | CVE-2026-42203 | HIGH | 1.83.7 |
  | CVE-2026-42271 | HIGH | 1.83.7 |
  | CVE-2026-47101 | HIGH | 1.83.14 |
  | CVE-2026-47102 | HIGH | 1.83.10 |
  
`litellm` was pinned to `==1.82.5` because versions 1.82.6 - 1.82.8 had
a broken `litellm.caching.caching` import chain, and 1.88.0 had a broken
`litellm.integrations.custom_logger` import.
  Both issues are resolved in 1.84.0.
The exact pin is retained (rather than a range) due to litellm's history
of introducing regressions on minor bumps.
2026-07-28 00:25:05 +08:00
Jack
76acd499d4 Fix: use independent fixtures in ClampsOverlappedPct test (#17416)
## Problem
`TestMergeByTokenSizeFromJSON_ClampsOverlappedPct` reused a single
`items` fixture across four calls to `mergeByTokenSizeFromJSON`.

`mergeByTokenSizeFromJSON` mutates its `perItem` argument in place and
returns the same backing array (token.go: `perItem[idx] = merged`). As a
result:
- The 2nd and later calls merged already-merged chunks instead of the
original input.
- Because the returned slice aliases the input, later calls silently
overwrote the earlier results (`at100`, `at0`, ...).
- `reflect.DeepEqual(at100, at150)` was therefore vacuously true — the
test was a **false positive** that never actually exercised the clamp.
It would still pass even if the clamp were broken.

This is exactly the defect flagged in the review comment on PR #17396.

## Fix
Add a `clampOverlapFixture()` factory and build a fresh fixture for
every call, so that 150 / 1e300 / -5 / -1e300 are applied to the
original input.

## Verification
- The test passes after the fix.
- When the clamp logic was temporarily disabled, the test **failed**
(panic at token.go:768 — the negative index produced by an out-of-range
pct), proving the fixed test is no longer a false positive and can catch
a clamp regression.

## Scope
Test file only. No production code change (verified `token.go` is
identical to `upstream/main`).

Refs: review comment on PR #17396.
2026-07-27 22:02:41 +08:00
Jin Hai
1436fcaca5 Go: add context, part13 (#17445)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-27 21:19:39 +08:00
balibabu
1cce9b64f1 Feat: Search for knowledge-base-level graph nodes. (#17444) 2026-07-27 21:03:30 +08:00
rayhan
1ae1dd1edb fix: remediate nltk CVEs by constraining to >=3.10.0 (#17443)
## Summary
  
Remediates five nltk CVEs by adding `nltk>=3.10.0` to
`constraint-dependencies` in `pyproject.toml`.
  
  | CVE | Severity | Installed | Fixed in |
  |---|---|---|---|
  | CVE-2025-14009 | CRITICAL | 3.9.2 | 3.9.3 |
  | CVE-2026-0846 | HIGH | 3.9.2 | 3.9.3 |
  | CVE-2026-0847 | HIGH | 3.9.2 | — |
  | CVE-2026-33231 | HIGH | 3.9.2 | 3.9.4 |
  | CVE-2026-33236 | HIGH | 3.9.2 | — |
  | CVE-2026-54293 | HIGH | 3.9.2 | 3.10.0 |
  | CVE-2026-33230 | MEDIUM | 3.9.2 | 3.9.4 |
  
  CVE-2026-0847 and CVE-2026-33236 have no confirmed fixed version.
 
`nltk` is a transitive dependency (pulled in by `crawl4ai` and
`infinity-sdk`). No package in the graph caps it below 3.10.0. It was
stuck at 3.9.2 simply because the lockfile had never been re-resolved.
2026-07-27 20:38:49 +08:00
Kevin Hu
f9e47ae0b9 Feat: More APIs for compiler list and deletion of compilation result. (#17425)
### Summary

 More APIs for comliler list and deletion of compilation result.
2026-07-27 20:11:18 +08:00
Jin Hai
f73f4cb720 Go: add context, part12 (#17435)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-27 19:30:41 +08:00
buua436
5bfd59f894 fix: delete navigation subtrees correctly (#17434) 2026-07-27 19:13:02 +08:00
euvre
f6464c909d fix: prevent child delimiter add from submitting form (#17421) 2026-07-27 19:11:05 +08:00
euvre
246c40c4e6 fix: show resolved embedding model display name in dataset list (#17415) 2026-07-27 19:09:16 +08:00
Haruko386
0a8f28ff36 Go: add token usage for baidu, minimax, moonshot and mistral (#17413)
### Summary

As title, related to #16990

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-07-27 18:04:36 +08:00
Haruko386
27801cfe84 fix: updable to get update-time when forgot the message (#17395)
### Summary

As title

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-07-27 18:03:58 +08:00
Jin Hai
19d861b797 Go: add context, part11 (#17426)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-27 17:48:44 +08:00
euvre
30b40caff8 Fix agentbot embedded chat streaming envelope (#17420) 2026-07-27 17:39:44 +08:00
Zhichang Yu
61d58f598e Introduced oxfmt (#17431)
Introduced oxfmt
2026-07-27 17:38:52 +08:00
chanx
4551f945fc fix: improve model merging logic in useModelsDerived for better instance-specific values (#17422) 2026-07-27 17:37:20 +08:00
chanx
b5633eb6f0 fix: update delimiter form field layout for better alignment (#17432) 2026-07-27 17:34:13 +08:00
chanx
4231db78e7 fix: add document name display in testing result cards (#17427) 2026-07-27 17:28:22 +08:00
Hz_
944d726284 fix(go-models): record provider token usage (#17423)
## Summary

- Parse chat, embedding, and rerank usage from provider responses
- Record usage with the correct model type even when no usage sink is
provided
- Cover SiliconFlow, Aliyun, Huawei Cloud, Qiniu, and VolcEngine
response formats
2026-07-27 17:16:50 +08:00
buua436
6e1e540f98 fix: persist pipeline tree graph rows (#17400) 2026-07-27 16:40:29 +08:00
Jin Hai
49e6181eca Go: add context, part10 (#17417)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-27 16:14:23 +08:00
Wang Qi
cd846cc9d4 Enhance: localhost:9385 -> sandbox-executor-manager:9385 (#17414) 2026-07-27 15:20:09 +08:00
Jin Hai
3065a29935 Go: add context, part9 (#17412)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-27 15:06:48 +08:00
Jack
a6a67c5ece Chunker: port Python overlapped_percent normalization and BULLET_PATTERN title fallback (#17396)
## Summary

Closes two Chunker migration gaps documented in
`docs/migration_python_go_diff.md`
(diffs **2.6** and **1.7**), improving parity with the Python ingestion
pipeline.

This is the code portion of commit `261e1fd0b` on branch
`fix/batch-3-4`; the
migration document itself is tracked separately (untracked in this
commit).

### Diff 2.6 — `overlapped_percent` missing Python normalization

Python's `normalize_overlapped_percent` (`common/float_utils.py:50-58`)
accepts a
`[0,1)` fraction (the flow-canvas UI validates `[0,1)`), multiplies it
by 100,
`int()`-truncates, and clamps to `[0,90]`. Go previously only accepted a
raw
`[0,90]` percentage and **rejected** out-of-range input, so a Python
config
passing `0.1` (meaning 10%) silently produced ~0% overlap.

Added `normalizeOverlappedPercent`
(`internal/ingestion/component/chunker/common.go`) mirroring the Python
helper:

- parses numbers and numeric strings (mirrors Python `float()`; bad /
`NaN` / `Inf` → `0`),
- `0 < v < 1 → v *= 100`,
- `int()` truncation,
- clamps to `[0,90]`.

Wired into `tokenChunkerParam.Update` (`token.go`); the merge math
(`token.go:705`, `(100-x)/100`) already matched Python.
`TokenChunkerParam.Validate`
(`schema/chunker.go`) now only guards direct struct construction.

Tests: `TestNormalizeOverlappedPercent`, extended
`TestTokenChunker_NewAcceptsPythonOverlappedRange` (adds fraction/clamp
inputs),
new `TestTokenChunker_NormalizesOverlappedPercent`. The existing
reject-test cases
for `<0` / `>90` were removed because they are now normalized/clamped
(Python parity).

### Diff 1.7 — missing `BULLET_PATTERN` title-level fallback

`resolveTitleLevels` (`title.go`) now applies a 4th-level fallback: when
outline +
regex + layout all yield body level, `bulletsCategory` selects the
best-matching
bullet-pattern group (Chinese legal / numbering / Chinese numbering /
English legal
— mirroring `rag/nlp/__init__.py:258-320`) and assigns structural
levels. Guarded by
`allBodyLevel` so it never overrides an existing outline/regex level.

Tests: `TestResolveTitleLevels_BulletFallback` (4 subtests).

### Incidental test adjustments included in the commit

- `token_batch1_test.go`: overlap input changed `0.3` → `30.0` to
reflect the
  post-normalization 30% semantics.
- `real_consumer_test.go`: updated `LoadFromIngestionTask(task)` →
`LoadFromIngestionTask(ctx, task)` for the new context-first signature.

## Verification

`bash build.sh --test ./internal/ingestion/component/...` — chunker +
schema suites
pass, no regression (CGO build).

## Migration doc reference

`docs/migration_python_go_diff.md` §Chunker 1.7 and 2.6 are marked
**Fixed** for
these changes.
2026-07-27 14:42:44 +08:00
euvre
58f67870ae fix: refresh memory sidebar avatar immediately after update (#17401) 2026-07-27 14:09:02 +08:00
euvre
585142c5d3 fix(web): correct dataset configuration page title and description (#17407) 2026-07-27 14:02:53 +08:00
euvre
6cc862fc00 Fix: agent list owner filter not applied (#17410) 2026-07-27 13:58:43 +08:00
Lynn
9bec8d12bb Fix: simplify verify go (#17397) 2026-07-27 13:54:36 +08:00
Jin Hai
f5aa5f7d94 Go: context, part8 (#17405)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-27 13:38:15 +08:00
S
c48eb70e67 Improve "Delimiter for text" UX: clearer tooltip + live parsed-delimiter preview (#17385)
## Summary

Improve the UX of the **"Delimiter for text"** field on the dataset
configuration page. The field is a single string with a backtick-based
mini-syntax, but both the tooltip and the surrounding UI failed to
surface what delimiters the backend would actually derive from a given
value — leaving users to discover by trial-and-error that the same
string produces different splits depending on file type (see #7436,
#4704, #9680).
2026-07-27 13:21:54 +08:00
Jin Hai
1571abd98a Go: add context, part7 (#17402)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-27 11:23:06 +08:00
Jin Hai
9d4847beaf Go: add context, part6 (#17399)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-27 11:09:17 +08:00