Commit Graph
10360 Commits
Author SHA1 Message Date
dependabot[bot] dfd2153bd4 build(deps-dev): bump pillow from 12.0.0 to 13.0.0 in /sdk/python (#21401) 2026-10-23 15:49:05 +08:00
Jin Hai 1d7744f944 CLI: model group (#21392)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-10-23 15:48:38 +08:00
Sbaaoui Idriss ab3cdbd317 fix(agent): save incomplete search filters and gate Run (#21370) 2026-10-23 15:38:45 +08:00
Sbaaoui Idriss 5850c68981 fix(agent): save incomplete SQL connections and gate Run (#21369) 2026-10-23 15:23:49 +08:00
Sbaaoui Idriss 247f3c8ed1 fix(agent): save incomplete Iteration outputs and gate Run (#21368) 2026-10-23 15:02:22 +08:00
Sbaaoui Idriss 68bb332f9e fix(agent): save incomplete Loop settings and gate Run (#21367) 2026-10-23 14:42:43 +08:00
chanx 4fe7ef1b05 fix(files): make only folder names clickable in the file list (#21394) 2026-10-23 14:37:44 +08:00
Sbaaoui Idriss 8fc01ad537 fix(agent): save incomplete input options and gate Run (#21366) 2026-10-23 14:29:47 +08:00
xugangqiang fced7746a3 fix(parser): make IsPDFParseMethod recognize registered external analyzer methods (#21383) 2026-10-23 14:26:06 +08:00
maoyifeng 03b8170134 add python-release workflow on gitHub actions webpage (#21391)
add python-release workflow on gitHub actions webpage
2026-10-23 14:16:40 +08:00
Sbaaoui Idriss d3cd3df397 fix(agent): save incomplete Compiler drafts and gate Run (#21365) 2026-10-23 14:15:18 +08:00
Wang Qi 0a613b1c6e Refactor: Knowledge compilation: move knowledge_compile_docs column backlog_doc_ids and inflight_doc_ids to seperated tables (#21381) 2026-10-23 14:05:36 +08:00
chanx 0da322950c fix(chat): relocate decision model to agentic settings and allow inheriting it (#21386) 2026-10-23 14:04:33 +08:00
Sbaaoui Idriss 5dc57e450d fix(agent): save incomplete Invoke mappings and gate Run (#21364) 2026-10-23 14:02:07 +08:00
chanx 65f543a63b fix(web): show admin error toasts at the top-right position (#21387) 2026-10-23 13:56:57 +08:00
Wang Qi 848d21fc30 Revert "feat(ingestion): generate TOC chunks in the Go Extractor" (#21385) 2026-10-23 13:50:09 +08:00
Yash Raj Pandey 7d188e1abe feat(ingestion): generate TOC chunks in the Go Extractor (#21090) 2026-10-23 13:45:17 +08:00
Sbaaoui Idriss 6193ca3d96 fix(agent): save incomplete data operations and gate Run (#21363) 2026-10-23 13:41:33 +08:00
ZZZZY eb939014f7 fix(infinity): split InsertChunks into batches of 8192 rows (#21380) 2026-10-23 13:36:13 +08:00
Jin Hai b73f030931 CLI: add show model stats (#21376)
```
SHOW MODEL STATS;
SHOW MODEL STATS DAYS 7; 
SHOW MODEL STATS FROM '2024-01-01' TO '2024-01-31';

SHOW MODEL STATS DAYS 7 'openai';                        -- provider
SHOW MODEL STATS DAYS 7 'openai' 'prod';                 -- provider + instance
SHOW MODEL STATS DAYS 7 'openai' 'prod' 'gpt-4o';        -- provider + instance + model

SHOW MODEL STATS DAYS 7 BY DATE;
SHOW MODEL STATS DAYS 7 BY MODEL;
SHOW MODEL STATS DAYS 7 BY INSTANCE;
SHOW MODEL STATS DAYS 7 BY PROVIDER;

SHOW MODEL STATS DAYS 30 'openai' BY DATE;
SHOW MODEL STATS DAYS 30 'openai' 'prod' BY MODEL;
SHOW MODEL STATS DAYS 30 'openai' 'prod' 'gpt-4o' BY DATE;
SHOW MODEL STATS FROM '2024-01-01' TO '2024-01-31' 'azure' BY INSTANCE;
SHOW MODEL STATS FROM '2024-01-01' TO '2024-01-31' BY PROVIDER;
```

---------

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-10-23 13:29:40 +08:00
Bruce-Yii 301e1498bc fix(ingestion): reject disabled model instances during resolution (#20207) 2026-10-23 13:18:10 +08:00
monsterlag e34fd2b5ca fix(chunker): retain position-only figures in title chunkers (#21309)
> [!NOTE]
> **AI-generated, not reviewed by a human.** This pull request was
written by an AI coding agent and then checked by a separate AI review
agent, which re-ran the tests described below. No human has reviewed the
code. It is submitted by @monsterlag, who runs these agents. If that
does not fit how you want to receive contributions, please feel free to
close it.


### Summary

Fixes #21260.

Title-family chunkers treated captionless PDF figures carrying only
coordinates as empty, dropping them before preview cropping and merging
text across the missing figure.

Keep structured records when the existing position decoder/merger
retains rows from either `positions` or `_pdf_positions`. Check decoded
content rather than serialized JSON length so `[]`, `null`, empty rows
and short rows still count as empty.

Regression tests cover GroupTitle, HierarchyTitle and Manual with either
position field or both, empty-position records between text chunks, and
`root_chunk_as_heading`. The crop/upload regression verifies a
position-only figure after the root heading supplies text.

This change is limited to record retention. Crop and tokenizer filters
for media whose finalized text remains empty are unchanged; it does not
enable end-to-end indexing of textless figures.

### Testing

- Reproduced the empty-position regression before this revision: 36
strategy/field/value combinations and the root-heading case failed; all
pass after the fix.
- Passed focused position/crop regressions with `bash build.sh --test
-count=1 -run
'TestTitleFamily.*Position|TestCropTitleChunks.*PositionOnly'
./internal/ingestion/component/chunker`.
- Passed `bash build.sh --test -count=1
./internal/ingestion/component/...`, including the full chunker suite
and the wrapper's native unit tests.
- Passed `gofmt`, `git diff --check`, and lefthook pre-commit checks.

Tests used Go 1.27, project-pinned native libraries, and the isolated
Clang/LLD 21 sysroot prepared during implementation. A local
`GOFLAGS=-exec=...` loader wrapper supplies the newer glibc/libstdc++
needed by those libraries; no build configuration or environment files
are included.
2026-10-23 12:50:02 +08:00
Sbaaoui Idriss dc0fdb185e fix(agent): save incomplete Message drafts and gate Run (#21355) 2026-10-23 09:59:38 +08:00
buua436 0b46ece31b feat(permission): align resource and agent ownership (#21350) dev-20261023 2026-10-23 09:36:46 +08:00
Lynn 4fd8c439af Fix: export deleteIfEqual for ee (#21351) 2026-10-22 20:15:55 +08:00
balibabu 9cd7ba8065 Fix: Change the naive setting to naive. (#21353) 2026-10-22 20:15:22 +08:00
xugangqiang 6a2ef7ec6b refactor(deps): rename ragflow_deps directory to deps (#21345)
## Summary

Rename the repository dependency-resource directory `ragflow_deps/` to
`deps/`, and update every hardcoded reference to that directory name so
the rename does not break resource loading at build/runtime.

This is not a purely cosmetic rename: the Go runtime hardcodes the
directory name as a resource search path (e.g.
`internal/common/model_assets.go` trimming the `deps/` prefix, and the
tokenizers joining `deps/` into candidate paths), and the Dockerfiles
copy assets into `/ragflow/deps`. Those literals must move together with
the directory, otherwise assets fail to resolve.

## Two intentional exceptions (kept unchanged)

The rename deliberately keeps two names that only *coincidentally*
contained the old string:

- The published image tag `infiniflow/ragflow_deps:latest` (used by
`Dockerfile`, `Dockerfile_base`, docs, and CI `image inspect` checks).
- The CI install path `/opt/ragflow_deps` inside the CI runner image
(`build.sh` `SYSTEM_DEPS_TOKENIZER`).

## Changes

- `git mv ragflow_deps deps`.
- `build.sh`: `CL100K_TABLE_RELPATH`, native asset zip path, and related
references updated to `deps/`.
- `tools/scripts/download_dev_deps.py`: `RAGFLOW_DEPS_DIR` points at
`deps/`.
- Go runtime resource search paths (`internal/common`,
`internal/tokenizer`) updated to the `deps/` layout.
- `Dockerfile` / `Dockerfile_base`: container asset path changed to
`/ragflow/deps`; kept tag `infiniflow/ragflow_deps:latest` unchanged.
- Docs / `AGENTS.md` / CI workflow paths updated to the new directory
name.

## Test plan

- Go unit tests in `internal/common` and `internal/tokenizer` updated to
the new `deps/` layout and pass via `bash build.sh --test`.
- Python download scripts import and build URLs correctly (`py_compile`
clean).
- Added `tools/scripts/test_dep_rename_invariants.py` as a regression
guard asserting the two intentional exceptions (`/opt/ragflow_deps` and
`infiniflow/ragflow_deps`) stay intact, so a future blanket rename
cannot silently regress them.

---

## Follow-up fix (commit 2f6857095d)

The original rename used a blanket `sed s/ragflow_deps/deps/g` and only
selectively reverted `build.sh`. That left two intentionally-kept names
rewritten, which this follow-up restores:

- CI install path `/opt/ragflow_deps` — `sep-tests.yml` had been changed
to read `/opt/deps`, breaking the offline cl100k table fallback (the
cached-image path pointed at a directory that never receives the file).
Restored to `/opt/ragflow_deps`.
- Published image tag `infiniflow/ragflow_deps` — left as bare
`infiniflow/deps` in `sep-tests.yml` comments/echo, `.dockerignore`, and
`Dockerfile` / `Dockerfile_base` error messages. Restored to
`infiniflow/ragflow_deps`.

The regression guard `tools/scripts/test_dep_rename_invariants.py` was
added to prevent recurrence.
2026-10-22 19:20:42 +08:00
chanx 395ee73a65 fix(web): restore auto-metadata checkbox in reparse dialog (#21346) 2026-10-22 19:10:30 +08:00
ciel cc1b077db6 fix(openai): pass request reasoning level to AsyncChat so reasoning=5 selects the agentic path (#21342) 2026-10-22 19:09:44 +08:00
Sbaaoui Idriss 76b068fba2 fix(mcp): remove unused force_refresh parameter (#21349) 2026-10-22 19:09:10 +08:00
Wang Qi e6ae78c8d3 Agent: add apply version and delete by version APIs (#21352) 2026-10-22 19:07:28 +08:00
jay77721 17f173c288 refactor(parser): remove dead output_format readers (#21336) 2026-10-22 17:40:41 +08:00
Wang Qi a8d39e1fd1 Fix: keep all user agent versions (#21343) 2026-10-22 17:38:13 +08:00
xugangqiangandCodeBuddy Code fa0bae42b0 refactor(parser): remove dead ParseResult.Text field and text output path (#21334)
## Summary

The DSL no longer supports `output_format` selection.
`normalizeParserJSON` (in `internal/ingestion/component/parser.go`)
hardcodes `setup["output_format"] = "json"` for every parser setup, so
the `ParseResult.Text` field — populated only on the now-unreachable
text output path — is dead.

This change removes `ParseResult.Text` and every read/write site:

- `internal/parser/parser/parse_result.go`: drop the `Text` field and
update payload-family helpers (`isPayloadZero`, `payloadFamily`, etc.).
- `internal/parser/parser/email_parser.go` / `doc_parser.go`: drop the
text-output branches and `output_format:"text"` handling.
- `internal/ingestion/component/parser.go`: the normalization already
forces `json`; remove the text branch in `normalizeParserJSON` /
`buildParserOutputs`.
- `internal/service/file/file_content.go`: `parseResultText` no longer
reads `res.Text`; it falls back to `res.Markdown` for legacy
markdown-only payloads.
- `internal/service/document/document_artifact.go`: DOC preview now
reads preview text from the JSON items.
- `internal/parser/parser/pdf_result.go`: drop the dead `case
result.Text != ""` fallback in `NormalizeResult` (no PDF producer sets
`parser.ParseResult.Text`; confirmed by grep).

## Test plan

- Updated / removed obsolete text-path unit tests; added guard tests
(`text_field_removed_test.go`, `text_field_removed_doc_test.go`)
asserting the field is gone and JSON is the only output family.
- `bash build.sh --test ./internal/parser/parser/...
./internal/ingestion/component/... ./internal/service/file/...
./internal/service/document/...` — all green.
- Full `bash build.sh --test` regression — all green (no FAIL).
- `bash build.sh --go` builds both `ragflow-cli` and `ragflow_server`.

## Notes

`deepdoctype.ParseResult` (a different struct in
`internal/deepdoc/parser/type`) still has its own `Text` / `Sections`
fields; those are unrelated and intentionally untouched.

---------

Co-authored-by: CodeBuddy Code <noreply@codebuddy.ai>
dev-20261022
2026-10-22 16:23:48 +08:00
adws 9c41ec8dbd refactor(admin): move ingestion task listing to EE (#21312) 2026-10-22 16:23:44 +08:00
Jin Hai 721d750a78 disable admin available check (#21335)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-10-22 16:22:06 +08:00
chanx 6acaf12da4 fix(web): unmount form fields when shouldRender is false (#21323) 2026-10-22 15:53:43 +08:00
balibabu c8ba2259bf Fix: TypeScript errors in agent test files (#21314) 2026-10-22 15:53:12 +08:00
balibabu 332830ff43 Fix: Remove the output_format field from the form for the parser operator. (#21303) 2026-10-22 15:52:59 +08:00
jay77721 c34e873824 fix(sdk): align Python SDK with RAGFlow 1.0 dataset API (#21319) 2026-10-22 15:45:08 +08:00
Harsh Kashyap 5227bb24f6 fix(chunker): strip the title-family params ManualChunker cannot honour (#20139) (#20220) 2026-10-22 15:35:22 +08:00
xugangqiangandCodeBuddy Code 31296803d4 Add typed envelope accessors for ingestion component boundaries (#21273)
## What

Add **typed read-side accessors** for the ingestion canvas envelope so
consumers
read `[]ChunkDoc` / `[]parser.DocItem` instead of bare type assertions,
and remove
the three silent carrier-mismatch skips that the untyped
`map[string]any` form
allowed:

- `chunker` `imageUploadDecorator` — id-stamp + image-upload pass
- `knowledge_compiler` `mergeChunks` / `buildInputs`
- `task/indexdoc` `NormalizeChunks`

Introduce the read-side `schema.GetChunks` accessor plus the lossless
`schema.ChunkCarrierToMaps` bridge. The speculative `PutChunks` /
`PutParseItems` /
`GetParseItems` helpers added alongside it were dead code (no production
callers)
and have since been removed; `GetChunks` accepts the legacy
`[]map[string]any` and `[]any` carriers as well as `[]ChunkDoc`, so no
producer
needs to change for consumers to migrate.

Reconcile `ChunkDoc.MarshalJSON` with `ToMap` via a shared non-recursive
`wireMap`, so the typed `[]ChunkDoc` form and the legacy
`[]map[string]any` wire
form serialize **identically** (parity-gated by test). This matches the
existing
`DocItem` `MarshalJSON`→`ToMap` pattern and fixes the empty-text
media-chunk
divergence (`text` was dropped by `omitempty`).

## Why

The untyped envelope forced every consumer to repeat bare
`.([]map[string]any)`
assertions and defensive `switch`/`clog.Warn` fallbacks; a carrier-type
mismatch
silently skipped work (e.g. the image-upload decorator). Centralizing
the typed
read behind accessors removes that fragility while keeping the wire
format
unchanged.

## Scope / design decision

**Producers continue to emit the documented `[]map[string]any` wire
form** (built
internally as `[]ChunkDoc` and converted via `schema.ChunkDocsToMaps`).
Consumers
read through `GetChunks` / `ChunkCarrierToMaps`, which bridge both
carrier forms,
so this change is strictly additive — no flag day, no producer
migration.

A follow-up attempt to make producers emit the typed `[]ChunkDoc`
carrier directly
(Phase 4) was **reverted** (final commit). Rationale:

- It violates the documented component-output contract: `ChunkerOutputs`
and the
  tokenizer output are specified as `list[object]` / `map[string]any`.
- It breaks every consumer that reads `out["chunks"].([]map[string]any)`
at the
  **Go value layer** — including concurrent `main` changes (e.g.
`pdf_postprocess_test`) that panic. JSON-byte parity (`MarshalJSON ==
ToMap`) is
necessary but **not sufficient**: consumers assert on the value type,
not the
  serialized bytes.
- Changing the producer emission type is a **shared-wire contract
change**. It
  must not be done as a side effect of a feature PR; it requires its own
  contract-change epic: revise the documented contract, coordinate all
consumers, and land it as a flag-day or with an explicit transition
window.

The original typed-access goal is already fully met by the read-side
accessors
above, so no producer change is needed.

## Testing (TDD)

Failing tests were written first for: the accessors (round-trip,
legacy-map
bridge, empty/nil, garbage-no-panic, parse-items), the serialization
parity gate,
and each migrated consumer (typed-carrier acceptance). Unit tier is
green:

`bash build.sh --test ./internal/ingestion/...` — all packages ok.
`internal/service/document` (only non-ingestion `schema` importer) also
ok.

## Risk

Low. The `Component.Invoke` signature is unchanged, agent/canvas is
untouched,
the wire format is byte-identical, and `GetChunks` bridges both carrier
forms.

---------

Co-authored-by: CodeBuddy Code <noreply@codebuddy.ai>
2026-10-22 15:15:23 +08:00
Lukas 4969b7b41a fix(parser): place a table's footer rows after its body (#21283)
### Summary

`tableutil.ParseTableHTML` builds table rows in source order. HTML 4
required `<tfoot>` to come before `<tbody>`, and browsers draw it below
the body wherever it stands. Tables written in that order are still
common: generated reports, documentation tools, older CMS exports. For
those tables the footer row landed between the header and the data:

```html
<table>
  <thead><tr><th>Item</th><th>Qty</th></tr></thead>
  <tfoot><tr><th>Total</th><th>3</th></tr></tfoot>
  <tbody><tr><td>pen</td><td>1</td></tr><tr><td>ink</td><td>2</td></tr></tbody>
</table>
```

```text
main:         Item | Qty / Total | 3 / pen | 1 / ink | 2    HeaderRows = 2
this branch:  Item | Qty / pen | 1 / ink | 2 / Total | 3    HeaderRows = 1
```

A footer of `<th>` cells was also counted as a second header row,
because the header count is the leading run of `<th>` rows.

### What changed

`ParseTableHTML` collects the rows of a `<tfoot>` apart and appends them
after the body. Their `<th>` flags go with them, so they no longer
extend the header. Tables without a `<tfoot>` are unchanged. Nested
tables are still folded into their cell by `cellText`, as before.

The HTML parser's table items, the chunker and the deepdoc converter all
build their grids through `ParseTableHTML` / `BuildTableData`, so they
all get the rendered order.

### Testing

`TestParseTableHTMLFooterRowsComeLast` uses the table above and expects
the rows in rendered order with one header row. It fails on `main` with
`HeaderRows = 2`.

```
CGO_ENABLED=0 go test ./internal/parser/...                    # ok (chunk, parser, tableutil)
TIKTOKEN_CACHE_DIR=… go test ./internal/ingestion/component/chunker/ ./internal/service/file/
# chunker: only TestPaddleOCRHighlightsThroughPipeline fails, identically on main (local environment)
go vet ./internal/parser/tableutil/ && gofmt -l internal/parser/   # clean
```
2026-10-22 15:15:07 +08:00
jay77721 9cb5539c01 docs(api): fix dataset parse_type examples and selection rules (#21333) 2026-10-22 15:14:58 +08:00
balibabu f3755211bb Fix: Admin/user login state collision causes 403s and crashes the home page #20409 (#21320) 2026-10-22 15:11:19 +08:00
Sbaaoui Idriss adaf6b1d39 fix(agent): resolve structured outputs in Message components (#21311) 2026-10-22 15:10:48 +08:00
Sbaaoui Idriss 738db83be4 fix(agent): preserve state outputs for workflow branching (#21287) 2026-10-22 15:09:35 +08:00
Sbaaoui Idriss 20fbe3b796 fix(agent): resolve single-brace query references (#21295) 2026-10-22 15:08:36 +08:00
Sbaaoui Idriss dd47152604 fix(agent): support PostgreSQL connection testing (#21229) 2026-10-22 15:04:18 +08:00
balibabu caae263668 Fix: After successfully creating an agent template, navigate to the agent details page. (#21328) 2026-10-22 15:02:32 +08:00