Skip to content

Feat/persistent chunk metadata 15725 - #15732

Closed
dale053 wants to merge 253 commits into
infiniflow:mainfrom
dale053:feat/persistent-chunk-metadata-15725
Closed

dale053 wants to merge 253 commits into
infiniflow:mainfrom
dale053:feat/persistent-chunk-metadata-15725

Conversation

@dale053

@dale053 dale053 commented Jun 7, 2026 •

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Closes #15725.

Currently, metadata in RAGFlow only exists at the document level. This forces developers who need structural or contextual information attached to individual chunks to resort to workarounds such as over-applying parent-child chunking strategies. There is no first-class way to store arbitrary key-value metadata alongside a specific chunk and have it persist through the storage and retrieval cycle.

This PR introduces a chunk_metadata field — a free-form JSON dictionary — that can be set per chunk at creation or update time, is stored in the document store (Elasticsearch / Infinity), and is returned in all chunk retrieval responses.

Type of change

  • New Feature (non-breaking change which adds functionality)

Changes

File Change
conf/mapping.json Added chunk_metadata_kwd as an explicit keyword property in the Elasticsearch index schema
conf/infinity_mapping.json Added chunk_metadata_kwd as a varchar column in the Infinity schema
api/apps/restful_apis/chunk_api.py Added chunk_metadata to the Pydantic model; wired read/write/deserialize logic in add_chunk, update_chunk, list_chunks, and get_chunk
rag/utils/infinity_conn.py Added serialization for chunk_metadata_kwd on the Infinity write path (dict → JSON string), consistent with the existing extra field pattern
sdk/python/ragflow_sdk/modules/chunk.py Added chunk_metadata = {} so the field survives the SDK key-filter
web/src/interfaces/database/dataset.ts Added chunk_metadata?: Record<string, unknown> to the IChunk TypeScript interface

API

Create a chunk with metadata

POST /api/v1/datasets/{dataset_id}/documents/{document_id}/chunks
Content-Type: application/json

{
  "content": "Alice founded the company in 2012.",
  "chunk_metadata": {
    "author": "Alice",
    "section": "introduction",
    "reviewed": true,
    "priority": 1
  }
}

Update chunk metadata

PATCH /api/v1/datasets/{dataset_id}/documents/{document_id}/chunks/{chunk_id}
Content-Type: application/json

{
  "chunk_metadata": {
    "reviewed": false,
    "reviewer": "Bob"
  }
}

Response — chunk with metadata

{
  "id": "abc123",
  "content": "Alice founded the company in 2012.",
  "chunk_metadata": {
    "author": "Alice",
    "section": "introduction",
    "reviewed": true,
    "priority": 1
  },
  ...
}

Screen Shot

image

Haruko386 and others added 30 commits May 21, 2026 20:57
### What problem does this PR solve?

implement rerank, asr, tts for TogetherAI

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
### What problem does this PR solve?

Updated v0.25.5 release notes.

### Type of change


- [x] Documentation Update
### What problem does this PR solve?

Fixed a docusaurus deployment issue.

### Type of change

- [x] Documentation Update
### What problem does this PR solve?

guard missing task language

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
### What problem does this PR solve?

Closes infiniflow#15089.

Adds PPIO support to the Go model-provider layer so PPIO instances can
be routed through the Go API server with the same OpenAI-compatible
chat, streaming, model listing, and connection-check flow used by other
SaaS providers.

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

## Summary

- Added a PPIO Go model driver.
- Added the PPIO provider catalog and default OpenAI-compatible API URL.
- Registered PPIO in the model factory.
- Added focused provider and provider-manager tests.

## What changed

- Implemented chat completions, SSE streaming, ListModels, and
CheckConnection for PPIO.
- Covered request shape, stream termination, reasoning fallback, model
listing, custom base URLs, safe transport setup, unsupported methods,
and provider config loading.
- Kept the provider catalog aligned with the existing RAGFlow PPIO
factory model set.
- Cleaned up pre-existing Go model package validation blockers so the
scoped provider tests can run normally with vet enabled.

## Why

The existing Python/provider catalog path includes PPIO, but the Go
model-provider layer did not have a PPIO driver, so the Go API server
could not instantiate or use PPIO as requested in infiniflow#15089.
### What problem does this PR solve?

This PR implements ASR and TTS support for the ZhipuAI Go driver.

The ZhipuAI model config already advertises `glm-asr-2512` as an ASR
model, but the Go driver returned `zhipu, no such method` from
`TranscribeAudio`. This adds the documented audio transcription endpoint
suffix and sends multipart transcription requests with `model`,
`stream=false`, and `file` fields.

Per maintainer review, this also adds the ZhipuAI TTS endpoint suffix
and implements `AudioSpeech` / `AudioSpeechWithSender` for `glm-tts`.

Closes infiniflow#15133

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
- [x] New Feature (non-breaking change which adds functionality)
…low#14868)

### What problem does this PR solve?

Closes infiniflow#14865

`download_img` in `common/misc_utils.py` is used for OAuth avatar URLs.
The previous implementation called `async_request` from
`common.http_client`, which followed redirects without re-validating
each hop and did not apply the same SSRF protections as this path needs.
That made it possible to reach non-public or disallowed targets (for
example via redirects or unsafe URLs) when fetching avatars.

This change replaces that flow with an explicit, bounded fetch: each URL
(including every redirect target) is checked with
`common.ssrf_guard.assert_url_is_safe`, DNS is pinned with
`pin_dns_global`, `httpx` streams the body with `follow_redirects=False`
and a manual redirect loop (capped by
`RAGFLOW_OAUTH_AVATAR_MAX_REDIRECTS`), and total response size is capped
(`RAGFLOW_OAUTH_AVATAR_MAX_BYTES`). Timeouts, proxy, and user agent
align with `HTTP_CLIENT_*` env vars without importing `http_client`, so
lightweight tests stay simple.

Unit tests cover empty/None URLs, loopback, cloud metadata-style
addresses, and disallowed schemes so SSRF regressions are caught early.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

---------

Co-authored-by: Kevin Hu <[email protected]>
… and retrieval (infiniflow#4310) (infiniflow#14208)

Closes infiniflow#4310

### What problem does this PR solve?

Issue infiniflow#4310 requests practical examples for the RAGFlow SDK and HTTP API
to help developers get started faster. The existing `example/sdk/`
folder only contains `dataset_example.py`. This PR fills the remaining
gaps by adding examples for three key API areas not yet covered in
`main` or by other open PRs (infiniflow#13904, infiniflow#13284):

- **Chunk management** — add, list, update, delete, and retrieve chunks
within a dataset
- **Chat assistant** — create a chat assistant, open a session, send
messages (streaming and non-streaming), and clean up
- **Retrieval** — perform semantic retrieval across one or multiple
datasets

### Type of change

- [x] Documentation Update
- [x] New Feature (non-breaking change which adds functionality)
### What problem does this PR solve?

1. Enhance retry and timeout, and adjust the default timeout
2. NER: spacy do not batch chunks
3. extract _has_cancel_and_exit
4. enhance log messages

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
- [x] Refactoring
### What problem does this PR solve?

Refactor: enahnce CI

### Type of change

- [x] Refactoring
…iniflow#14792)

Closes infiniflow#14789

### What problem does this PR solve?

User API endpoints (`login`, `user_profile`, `user_add`,
`forget_reset_password`) were returning full user objects via
`to_json()` / `to_dict()`, which included sensitive fields like
`password` and `access_token` in the response body. This leaks
credentials to the client.

This PR adds a `to_safe_dict()` method on the `User` model that strips
sensitive fields (`password`, `access_token`) and replaces all affected
call sites to use it.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
…flow#14542)

### What problem does this PR solve?

The agent API currently does not pass chat_template_kwargs to the
underlying LLM call path, so clients cannot control template-level model
behavior (such as thinking-mode toggles) when invoking
/agents/chat/completion. This PR adds passthrough support for
chat_template_kwargs across agent execution flows (session and
non-session, streaming and non-streaming) by propagating it through
canvas runtime state and into LLM invocation kwargs. This addresses the
feature gap raised in [Issue
infiniflow#14182](infiniflow#14182).

Closes infiniflow#14182 

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
### What problem does this PR solve?

Fixes infiniflow#15066

OpenRouter now exposes an official speech-to-text endpoint at `POST
/api/v1/audio/transcriptions`, but the Go model driver still returned
`openrouter, no such method` from `TranscribeAudio`. This left
OpenRouter ASR models unavailable through the Go API server even though
the provider already has OpenRouter audio support for TTS.

Related provider-tracking context: infiniflow#14736

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

Co-authored-by: Jin Hai <[email protected]>
…#13487)

## Summary

Implements the TODO in `evaluation_service.py`: **Track token usage** in
evaluation results.

## Changes

- **Import** `num_tokens_from_string` from `common.token_utils`
- **Prompt tokens**: Use the full prompt returned by `async_chat` when
available (includes system prompt + knowledge base + query), otherwise
fall back to the question token count
- **Completion tokens**: Count tokens in the generated answer
- **Storage**: Store `token_usage` as `{prompt_tokens,
completion_tokens, total_tokens}` in each `EvaluationResult` instead of
`None`

## Why

The evaluation pipeline previously saved `token_usage: None` for every
result. This change allows downstream consumers (e.g. evaluation
dashboards, cost tracking) to see approximate token usage per test case
using the same tokenizer (tiktoken cl100k_base) used elsewhere in
RAGFlow.

## Testing

- No new tests added; existing evaluation flow unchanged
- Token counting uses existing `num_tokens_from_string` utility

---------

Co-authored-by: kiannidev <[email protected]>
## Summary
- Adds a `TokenPony` Go driver so the new API server can route TokenPony
chat instances, matching the existing Python `TokenPonyChat`
(`rag/llm/chat_model.py:1210`). Follows the same SaaS-driver shape used
for Astraflow, Avian, Novita, TogetherAI, Replicate, DeepInfra, Upstage,
and LongCat.

Closes infiniflow#15086

---------

Co-authored-by: Jin Hai <[email protected]>
### What problem does this PR solve?

move agent attachment download api to the correct route and update
frontend callers

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

### Notes

- Move the attachment download endpoint from document routes to agent
routes.
- Update frontend download callers to use the agent attachment endpoint.
- Reuse the shared file response header helper instead of duplicating it
in `agent_api.py`.
### What problem does this PR solve?

Add model_type into llm_setting

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
### What problem does this PR solve?

Closes infiniflow#15088.

Adds Groq support to the Go model-provider layer so Groq instances can
be routed through the Go API server with the same OpenAI-compatible
chat, streaming, model listing, and connection-check flow used by other
SaaS providers.

### Type of change

- [x] New Feature (non-breaking change which adds functionality)

## Summary

- Added a Groq Go model driver.
- Added the Groq provider catalog and default OpenAI-compatible API URL.
- Registered Groq in the model factory.
- Added focused provider tests.

## What changed

- Implemented chat completions, SSE streaming, ListModels, and
CheckConnection for Groq.
- Covered request shape, stream termination, reasoning fallback, model
listing, custom base URLs, safe transport setup, and unsupported
methods.
- Kept the provider catalog scoped to current Groq chat-capable model
IDs.
- Cleaned up pre-existing Go model package validation blockers so the
package can be tested normally with vet enabled.

## Why

The existing Python/provider catalog path includes Groq, but the Go
model-provider layer did not have a Groq driver, so the Go API server
could not instantiate or use Groq as requested in infiniflow#15088.

## Notes

The model package now validates without disabling vet.

---------

Co-authored-by: Jin Hai <[email protected]>
### What problem does this PR solve?

Fix search vector_similarity_weight

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
### What problem does this PR solve?

How to ingest messages from your Discord server.

### Type of change

- [x] Documentation Update
### What problem does this PR solve?

implement embed, rerank, tts for AstraFlow

**Verify from CLI**

```
# Astraflow
RAGFlow(user)> tts with 'IndexTeam/IndexTTS-2@test3@astraflow' text 'hello? show yourself' play format 'wav' param '{"voice": "jack_cheng"}'
SUCCESS

RAGFlow(user)> rerank query 'what is rag' document 'rag is retrieval augment generation' 'rag need llm' 'famous rag project includes ragflow' with 'bge-reranker-v2-m3@test3@astraflow' top 3;
+-------+---------------------+
| index | relevance_score     |
+-------+---------------------+
| 0     | 0.9837390184402466  |
| 2     | 0.06322699040174484 |
| 1     | 0.04663187265396118 |
+-------+---------------------+

RAGFlow(user)> embed text 'walkerwhat' 'jumperwho' with 'text-embedding-3-large@test3@astraflow' dimension 16
+-----------+-------+
| dimension | index |
+-----------+-------+
| 3072      | 0     |
| 3072      | 1     |
+-----------+-------+

# Xinference


```

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
- [x] Refactoring
### What problem does this PR solve?

Go: implement reasoning_chat, TTS, ASR for Groq

**Verify from CLI**
```
RAGFlow(user)> think chat with 'qwen/qwen3-32b@test@groq' message 'who r u'
Thinking: Okay, the user asked, who r u. I need to determine what the user is asking. They may be asking about my identity. I should introduce my name and basic functions. The user might want to know what I can do, so I should list some common use cases, such as answering questions, creating writing, coding, and expressing opinions. The user may be curious about how they can interact with me, so they can be advised to ask any questions or provide instructions. Keep your answers conversational, avoid overly technical terms, keep answers concise, and encourage further interaction. Check if there's any ambiguity in the answer and make sure it's accurate and meets the user's needs. Also consider if there are other aspects the user may be interested in, such as my training data or performance. But since the question is basic, I'll focus on the essentials first and invite the user to ask more. In summary, respond to the user's questions by introducing yourself, your functions, and encouraging further interaction.

Answer: Hello! I'm Qwen. I am a large-scale language model developed by Tongyi Lab, designed to assist you in various ways, such as answering questions, creating text, logical reasoning, programming, and more. I aim to provide clear, accurate, and helpful information and support. How can I assist you today? Feel free to ask any questions or give me tasks! 😊
Time: 2.199908


RAGFlow(user)> stream think chat with 'openai/gpt-oss-20b@test@groq' message 'who r u'
Thinking:  to respond politely.
Answer: ’m ChatGPT—an AI language model created by OpenAI. I’m here to answer questions, offer explanations, and help with a wide range of topics. How can I assist you today?


RAGFlow(user)> tts with 'canopylabs/orpheus-arabic-saudi@test@groq' text 'hello? show yourself' play format 'wav' param '{"voice": "fahad"}'
SUCCESS


RAGFlow(user)> asr with 'whisper-large-v3-turbo@test@groq' audio './internal/test.wav' param '{"language": "en"}'
+----------------------------------------------------------------------------------------------------------------------+
| text                                                                                                                 |
+----------------------------------------------------------------------------------------------------------------------+
|  The examination and testimony of the experts enabled the Commission to conclude that five shots may have been fired |
+----------------------------------------------------------------------------------------------------------------------+
```

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
…niflow#15155)

### What problem does this PR solve?

Fix: /openai/<chat_id>/chat/completions not aware of session_id

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
### What problem does this PR solve?

Closes infiniflow#15102.

OpenAI's Go provider config advertises `whisper-1` as ASR and `tts-1` as
TTS, but the Go driver returned `openai, no such method` for both audio
paths and did not define `url_suffix.asr` / `url_suffix.tts`.

This PR:

- adds OpenAI audio URL suffixes for `audio/transcriptions` and
`audio/speech`
- implements non-streaming `TranscribeAudio` using multipart form
uploads
- implements non-streaming `AudioSpeech` using the OpenAI speech JSON
request shape
- keeps streaming TTS explicitly unsupported instead of sending binary
audio through the text SSE sender
- adds focused tests for config coverage, ASR/TTS request shape,
required TTS voice validation, and unsupported streaming TTS


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

---------

Co-authored-by: Jin Hai <[email protected]>
…iniflow#15192)

## Summary

- Brings the French locale (`web/src/locales/fr.ts`) to full parity with
the English reference
- Adds ~1400 missing translation keys across **all sections**: `common`,
`chat`, `header`, `login`, `admin`, `setting`, `flow`,
`knowledgeDetails`, `knowledgeConfiguration`, `memory`, `skills`,
`skillSearch`, `chunk`, `mcp`, `fileManager`, `search`,
`dataflowParser`, `datasetOverview`, `deleteModal`, `empty`, `explore`,
`memories`, `pagination`, `language`, `knowledgeList`
- All strings containing French apostrophes use double-quote delimiters
(prevents JS syntax errors)

## Test plan

- [ ] `npx esbuild src/locales/fr.ts --bundle=false` — no errors
- [ ] `npx eslint src/locales/fr.ts` — no errors
- [ ] Switch UI language to French and verify key sections render
correctly (chat, knowledge base, admin panel, agent flow)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
### What problem does this PR solve?

Fix /chat/completions not aware of conversation_id

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
## Summary
- Adds a `Hunyuan` Go driver so the new API server can route Tencent
Hunyuan chat instances (registered in `conf/llm_factories.json:3830` as
`Tencent Hunyuan`). Follows the same SaaS-driver shape used for
Astraflow, Avian, Novita, TogetherAI, Replicate, DeepInfra, Upstage, and
LongCat.

Closes infiniflow#15087

---------

Co-authored-by: Jin Hai <[email protected]>
### What problem does this PR solve?

Go: implement provider: PaddleOCR_Local

**Verified from CLI**

```
RAGFlow(user)> ocr with 'PaddleOCR-VL@test@paddleocr_local' file './internal/test1.jpg'
+----------------------+
| text                 |
+----------------------+
| ## Parallel to these |
+----------------------+
```

### Type of change

- [X] Bug Fix (non-breaking change which fixes an issue)
- [X] New Feature (non-breaking change which adds functionality)
- [X] Refactoring
wangq8 and others added 5 commits June 5, 2026 17:45
…ry_rewrite, community) (infiniflow#15690)

## Summary

`KGSearchRetrieval` composes entity search, type search, relation
search, N-hop analysis, score fusion, LLM-based query\_rewrite, and
community reports into a single synthetic chunk for KG-enhanced
retrieval.

### Components

| Component | Source | Status |
|-----------|--------|--------|
| Entity/relation/community search | Direct `DocEngine.Search` calls | ✅
|
| N-hop analysis + score fusion | `common.AnalyzeNHopPaths` /
`DoubleHitBoost` / `FuseRelationScores` | ✅ infiniflow#15666 |
| Query rewrite prompt + parser | `common.BuildQueryRewritePrompt` /
`ParseQueryRewriteResponse` | ✅ infiniflow#15669 |
| Token budget | `common.BuildKGContent` + `NumTokensFromString` | ✅
infiniflow#15666 |
| LLM query rewrite integration | `queryRewrite` function with fallback
| ✅ |

### Testing

11 tests (pure function + mock engine):

```
=== RUN   TestKgEntityFromChunk_Basic          --- PASS
=== RUN   TestKgEntityFromChunk_ScoreFallback  --- PASS
=== RUN   TestKgEntityFromChunk_MissingFields  --- PASS
=== RUN   TestKgRelationFromChunk_Basic        --- PASS
=== RUN   TestKgRelationFromChunk_MissingFrom  --- PASS
=== RUN   TestSearchKGTypeSamples_Success      --- PASS
=== RUN   TestSearchKGTypeSamples_Empty        --- PASS
=== RUN   TestKGSearchRetrieval_Basic          --- PASS
=== RUN   TestKGSearchRetrieval_NoEntities     --- PASS
=== RUN   TestQueryRewrite_Fallback            --- PASS
=== RUN   TestQueryRewrite_EmptyQuestion       --- PASS
```

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
…ically pop up (infiniflow#15685)

### What problem does this PR solve?

Fix: When adding a chat in the main interface, a warning will
automatically pop up (even if embedding and LLM model have already been
configured).
### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
…imension (infiniflow#15631)

## Summary

  This PR improves the Go CLI in two areas:

1. It adds batch model management support, allowing multiple models to
be added or removed in a single command.
2. It makes the `dimension` argument optional for the `embed text`
command.

These changes keep the existing single-model and explicit-dimension
behaviors compatible while making the CLI more convenient for common
workflows.

  ## What Changed

  ### 1. Batch model add/remove support

The CLI now supports operating on multiple model names provided in a
single quoted string.

  Supported commands include:

```
add model 'x1 x2 x3' to provider 'vllm' instance 'test' with tokens 1024 chat think vision, token 2048 chat, token 1024 think vision;

drop model 'x1 x2 x3' from 'vllm' 'test';

remove model 'x1 x2 x3' from 'vllm' 'test';

```

For add model, each config segment after with is matched to the
corresponding model name by position.

  Example mapping:

  - x1 -> tokens 1024, chat + vision, thinking=true
  - x2 -> tokens 2048, chat
  - x3 -> tokens 1024, vision, thinking=true

  The existing single-model syntax remains supported.

  ### 2. Optional embedding dimension

Previously, the Go CLI required dimension to be explicitly provided for
embed text.

  Before:

embed text 'what is rag' 'who are you' with 'model@test@provider'
dimension 8192;

  Now both forms are supported:

embed text 'what is rag' 'who are you' with 'model@test@provider'
dimension 8192;

  embed text 'what is rag' 'who are you' with 'model@test@provider';

When omitted, the CLI leaves dimension unset and relies on
provider/backend behavior.


  ## Tests

  Added parser tests covering:

  - Multiple models with multiple config segments
  - Model type deduplication
  - Model/config count mismatch
  - Drop/remove multiple models
  - Optional embedding dimension parsing
## Summary

Dify-compatible retrieval API for external knowledge base integration.

## Changes

- **New handler**: DifyRetrievalHandler with POST/GET
/api/v1/dify/retrieval
- **Health check**: GET /api/v1/dify/retrieval/health
- **Full pipeline**: KB validation -> permission check -> embedding ->
metadata filter -> chunk retrieval -> child chunk aggregation ->
optional KG search -> response assembly
- **12 tests** covering all paths (success, errors, metadata filter, KG
mode)
- **Testability**: Handler dependencies defined as interfaces
(KBServiceIface, ModelServiceIface, etc.)

## Files

| File | Type |
|------|------|
| internal/handler/dify_retrieval_handler.go | New — handler +
interfaces |
| internal/handler/dify_retrieval_handler_test.go | New — 12 tests |
| internal/router/router.go | Modified — route registration |
| cmd/server_main.go | Modified — handler wiring |
| internal/service/kg/pipeline.go | Modified — SetChatModel/SetEmbModel
|
| internal/service/kg/retrieval.go | New — helper functions |
| internal/service/kg/scoring.go | Moved from service package |
| internal/service/kg/search.go | New — KG search functions |
| internal/service/kg/types.go | New — type definitions |

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. 🌈 python Pull requests that update Python code 💞 feature Feature request, pull request that fullfill a new feature. labels Jun 7, 2026
@coderabbitai

coderabbitai Bot commented Jun 7, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds end-to-end persistent chunk-level metadata: API accepts/returns chunk_metadata dict, deserializes stored chunk_metadata_kwd, persists metadata via Infinity/Elasticsearch mappings and InfinityConnection JSON serialization; SDK and web types updated; docs screenshot refreshed.

Changes

Chunk Metadata Support End-to-End

Layer / File(s) Summary
Chunk model, SDK and TS types, json import
api/apps/restful_apis/chunk_api.py, web/src/interfaces/database/dataset.ts, sdk/python/ragflow_sdk/modules/chunk.py
Adds json import; API Chunk model gains chunk_metadata: dict; IChunk adds optional chunk_metadata?: Record<string, unknown>; SDK Chunk initializes chunk_metadata to {}.
Deserialize stored metadata
api/apps/restful_apis/chunk_api.py
New _deserialize_chunk_metadata and integration into _strip_chunk_runtime_fields to parse chunk_metadata_kwd (JSON string or dict) into chunk_metadata with {} fallback and remove chunk_metadata_kwd from responses.
list_chunks: include chunk_metadata
api/apps/restful_apis/chunk_api.py
Single-chunk and search-results paths parse per-hit chunk_metadata_kwd into chunk_metadata dict and include it in output objects.
add_chunk & update_chunk metadata handling
api/apps/restful_apis/chunk_api.py
add_chunk and update_chunk accept optional chunk_metadata (validated dict), serialize to chunk_metadata_kwd for storage, and responses deserialize it back with {} fallback.
Index and DB mapping additions
conf/infinity_mapping.json, conf/mapping.json
Adds chunk_metadata_kwd varchar field to Infinity mapping (default "") and chunk_metadata_kwd keyword mapping in ES (store: true, index: false).
InfinityConnection serialization for metadata
rag/utils/infinity_conn.py
Excludes chunk_metadata_kwd from keyword-list conversion and serializes dict inputs to JSON (ensure_ascii=False) in insert(), writing "" for falsey values.
Docs update
docs/guides/agent/agent_quickstarts/sandbox_quickstart.md
Replaces admin sandbox screenshot and fixes nearby heading placement.

Sequence Diagram (high-level flow):

sequenceDiagram
  participant Client
  participant ChunkAPI
  participant InfinityConnection
  participant Elasticsearch
  participant SDK
  Client->>ChunkAPI: add_chunk / update_chunk / list_chunks (with chunk_metadata)
  ChunkAPI->>InfinityConnection: persist/read chunk_metadata_kwd
  InfinityConnection->>Elasticsearch: index/store chunk_metadata_kwd
  Elasticsearch-->>InfinityConnection: return stored/search hits (chunk_metadata_kwd)
  InfinityConnection-->>ChunkAPI: raw chunk with chunk_metadata_kwd
  ChunkAPI->>ChunkAPI: _deserialize_chunk_metadata -> chunk_metadata
  ChunkAPI-->>Client: response includes chunk_metadata
  ChunkAPI-->>SDK: SDK reads chunk with chunk_metadata
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

🐖api, size:L

Suggested reviewers

  • yuzhichang
  • JinHai-CN
  • KevinHuSh
  • yingfeng

Poem

🐰
A tiny chunk with secrets tucked inside,
Now finds its metadata safe on every ride.
From SDK to index its little keys roam,
API brings them home where they belong.
Hooray — the chunk's new tale has found a home!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.40% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is vague and overly generic, using 'Feat/persistent chunk metadata 15725' which includes issue number but lacks clarity about the feature being implemented. Consider a more descriptive title like 'Add persistent chunk-level metadata support' or similar to better convey the feature's purpose without relying on issue numbers.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR addresses all objectives from issue #15725: provides persistent chunk-level metadata, ensures storage/retrieval in Elasticsearch/Infinity, exposes API endpoints for CRUD operations, and eliminates workaround patterns.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing persistent chunk metadata as specified in issue #15725; the documentation update to sandbox quickstart is a minimal incidental change.
Description check ✅ Passed The PR description comprehensively addresses the problem statement, clearly identifies the change type as a new feature, and provides detailed implementation details with API examples.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dale053
dale053 force-pushed the feat/persistent-chunk-metadata-15725 branch from 6380ef5 to 1b9ada6 Compare June 7, 2026 11:16
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Jun 7, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
agent/sandbox/providers/self_managed.py (1)

50-67: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Docstring default value is outdated.

Line 59 documents pool_size: Container pool size for info (default: 10) but the actual default is now 3.

📝 Proposed fix
                 - endpoint: HTTP endpoint (default: "http://sandbox-executor-manager:9385")
                 - timeout: Request timeout in seconds (default: 30)
                 - max_retries: Maximum retry attempts (default: 3)
-                - pool_size: Container pool size for info (default: 10)
+                - executor_manager_pool_size: Container pool size (default: 3)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@agent/sandbox/providers/self_managed.py` around lines 50 - 67, The docstring
for initialize incorrectly states the default pool_size is 10; update the
docstring so the "pool_size: Container pool size for info (default: 10)" line
reflects the actual default of 3 (or mention the config key
"executor_manager_pool_size" fallback). Modify the initialize method's docstring
to show the default as 3 and/or note that the value comes from
executor_manager_pool_size (falling back to pool_size) so maintainers can find
the correct config keys; refer to the initialize function and the self.pool_size
assignment.
agent/sandbox/providers/local.py (1)

256-266: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Outdated error messages reference removed environment variables.

The error messages in _validate_limits() still reference environment variable names (e.g., SANDBOX_LOCAL_TIMEOUT) even though the provider no longer reads from environment variables. These should reference the config field names instead.

📝 Proposed fix to update error messages
     def _validate_limits(self) -> None:
         if self.timeout <= 0:
-            raise SandboxProviderConfigError("SANDBOX_LOCAL_TIMEOUT must be greater than 0.")
+            raise SandboxProviderConfigError("timeout must be greater than 0.")
         if self.max_memory_mb <= 0:
-            raise SandboxProviderConfigError("SANDBOX_LOCAL_MAX_MEMORY_MB must be greater than 0.")
+            raise SandboxProviderConfigError("max_memory_mb must be greater than 0.")
         if self.max_output_bytes <= 0:
-            raise SandboxProviderConfigError("SANDBOX_LOCAL_MAX_OUTPUT_BYTES must be greater than 0.")
+            raise SandboxProviderConfigError("max_output_bytes must be greater than 0.")
         if self.max_artifacts < 0:
-            raise SandboxProviderConfigError("SANDBOX_LOCAL_MAX_ARTIFACTS must be greater than or equal to 0.")
+            raise SandboxProviderConfigError("max_artifacts must be greater than or equal to 0.")
         if self.max_artifact_bytes <= 0:
-            raise SandboxProviderConfigError("SANDBOX_LOCAL_MAX_ARTIFACT_BYTES must be greater than 0.")
+            raise SandboxProviderConfigError("max_artifact_bytes must be greater than 0.")
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@agent/sandbox/providers/local.py` around lines 256 - 266, The error messages
in _validate_limits() still reference removed environment variables; update each
SandboxProviderConfigError message in the _validate_limits method to mention the
provider config fields instead of env var names—e.g., change
"SANDBOX_LOCAL_TIMEOUT must be greater than 0." to "timeout must be greater than
0.", "SANDBOX_LOCAL_MAX_MEMORY_MB must be greater than 0." to "max_memory_mb
must be greater than 0.", "SANDBOX_LOCAL_MAX_OUTPUT_BYTES must be greater than
0." to "max_output_bytes must be greater than 0.", "SANDBOX_LOCAL_MAX_ARTIFACTS
must be greater than or equal to 0." to "max_artifacts must be greater than or
equal to 0.", and "SANDBOX_LOCAL_MAX_ARTIFACT_BYTES must be greater than 0." to
"max_artifact_bytes must be greater than 0." while keeping the same validation
logic in _validate_limits.
🧹 Nitpick comments (7)
agent/sandbox/providers/ssh.py (1)

158-165: 💤 Low value

Type hint says int but code handles None.

The timeout parameter is typed as int with default 10, but line 186 checks if timeout is None. If None is a valid input, update the type hint to Optional[int].

     def execute_code(
         self,
         instance_id: str,
         code: str,
         language: str,
-        timeout: int = 10,
+        timeout: Optional[int] = 10,
         arguments: Optional[Dict[str, Any]] = None,
     ) -> ExecutionResult:
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@agent/sandbox/providers/ssh.py` around lines 158 - 165, The execute_code
signature declares timeout: int but the implementation checks for timeout is
None, so change the type hint to Optional[int] to reflect that None is valid;
update the function signature for execute_code (and any related overloads or
stubs) to use Optional[int], and run a quick search for callers of execute_code
to ensure any places passing None are valid or adjust callers accordingly.
docs/guides/agent/agent_quickstarts/sandbox_quickstart.md (1)

107-109: ⚡ Quick win

Clarify the guidance for modifying deployment defaults.

The phrase "Keep the self-managed deployment defaults in .env if you need to change..." is ambiguous. It's unclear whether "keep" means "retain as-is" or "include these variables."

Since these variables are commented out by default in .env, users who need to customize them should uncomment and modify. Consider rewording for clarity.

📝 Suggested rewording
-- Keep the self-managed deployment defaults in `.env` if you need to change the
-  sandbox-executor-manager image, pool size, base images, seccomp, memory, or
-  timeout.
+- To customize the self-managed deployment defaults (executor-manager image,
+  pool size, base images, seccomp, memory, or timeout), uncomment and modify
+  the corresponding variables in `.env`.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/agent/agent_quickstarts/sandbox_quickstart.md` around lines 107 -
109, The sentence "Keep the self-managed deployment defaults in `.env` if you
need to change the sandbox-executor-manager image, pool size, base images,
seccomp, memory, or timeout." is ambiguous; update that line in
sandbox_quickstart.md to clearly instruct users to uncomment and modify the
commented variables in `.env` when they need to customize the
sandbox-executor-manager image, pool size, base images, seccomp, memory, or
timeout (e.g., replace the word "Keep" with explicit guidance like "Uncomment
and set" or "Uncomment and modify" so it's clear those defaults are provided as
commented variables to be changed).
api/apps/restful_apis/chunk_api.py (2)

100-112: ⚡ Quick win

Add logging on the new chunk-metadata parse/write branches.

These new branches currently coerce malformed values to {} or empty-string paths without telemetry, which will make storage/parse regressions hard to diagnose in production.

As per coding guidelines, **/*.py: "Add logging for new flows".

Also applies to: 186-195, 295-299, 335-341, 451-455

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/apps/restful_apis/chunk_api.py` around lines 100 - 112, The
_deserialize_chunk_metadata function silently coerces malformed or unexpected
chunk["chunk_metadata_kwd"] values to {} and drops the raw key; update the
function to emit structured warning logs whenever (a) json.loads fails (include
the exception and the raw string), (b) a non-dict non-string value is
encountered, and (c) an empty string is treated as missing — include identifying
fields from the chunk (e.g. chunk.get("id") or chunk.get("chunk_id")) in the log
so operators can trace the offending record; apply the same logging additions to
the other similar branches referenced (around the other ranges) so all
parse/write fallback paths record telemetry.

Source: Coding guidelines


295-299: 🏗️ Heavy lift

Move new chunk_metadata request validation into a Pydantic request model/service boundary.

The new field is validated inline in route handlers. In this RESTful API module, this should follow the existing Pydantic request-validation + service-layer pattern to keep validation centralized and reusable.

As per coding guidelines, api/apps/restful_apis/**/*.py: "Use Pydantic request validation with service layer pattern in newer RESTful APIs under api/apps/restful_apis/".

Also applies to: 451-455

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/apps/restful_apis/chunk_api.py` around lines 295 - 299, The inline
validation for "chunk_metadata" in the route handler should be moved into the
Pydantic request model and the service boundary: add an optional chunk_metadata:
Dict[str, Any] field (with a validator that ensures it's a dict) to the
endpoint's Pydantic request model, remove the inline isinstance check and
get_error_data_result call from the handler, and have the handler pass the
validated chunk_metadata to the service; perform the json.dumps(serialization)
of chunk_metadata in the service layer (setting d["chunk_metadata_kwd"]) so the
route stays thin. Apply the same refactor for the other occurrence referenced
(lines 451-455).

Source: Coding guidelines

agent/sandbox/client.py (1)

181-188: 💤 Low value

Simplify redundant fallback expression

The getattr(provider, "__class__", type(provider)) is unnecessary—every Python object has __class__, so the fallback never triggers. Using type(provider).__name__ directly is clearer.

♻️ Suggested simplification
-    provider_name = provider_manager.get_provider_name() or getattr(provider, "__class__", type(provider)).__name__
+    provider_name = provider_manager.get_provider_name() or type(provider).__name__
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@agent/sandbox/client.py` around lines 181 - 188, The fallback using
getattr(provider, "__class__", type(provider)) is redundant because every object
has __class__; replace that expression with type(provider).__name__ for clarity:
compute provider_name = provider_manager.get_provider_name() or
type(provider).__name__ and keep the existing logger.info call that references
provider_name, language, and timeout so behavior is unchanged (references:
provider_manager.get_provider_name, provider, provider_name, logger.info).
agent/tools/code_exec.py (1)

371-377: ⚖️ Poor tradeoff

Consider caching provider instead of reloading on every execution.

Calling reload_provider() on every _execute_code invocation ensures configuration changes take effect immediately but resets and re-initializes the provider manager each time. For high-throughput scenarios, this could introduce latency.

Consider checking if configuration has changed before reloading, or documenting this as intentional behavior for immediate config propagation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@agent/tools/code_exec.py` around lines 371 - 377, The current _execute_code
flow always calls reload_provider() before getting provider_info which
reinitializes the provider every run; change this to cache the provider manager
and only call reload_provider() when configuration has changed (e.g., track a
config_version or checksum and compare before reloading) or make the reload
behavior explicit in docs. Modify the logic around reload_provider(),
get_provider_info(), and provider_type resolution so you first check a cached
provider instance and a cached config fingerprint, call reload_provider() only
on mismatch, and otherwise use the cached provider_info to avoid repeated
re-initialization and reduce latency.
web/src/pages/admin/sandbox-settings.tsx (1)

587-880: 💤 Low value

Hardcoded English strings should use i18n.

Several user-facing strings are not internationalized:

  • "Runtime Settings" (line 591)
  • "Authentication" (line 655)
  • "Choose one authentication method..." (line 658-659)
  • "Password" / "Private Key" (lines 675, 678)
  • "Execution" (line 779)
  • "Deployment Defaults" (line 874)

These should use the t() function with translation keys like t('admin.sandboxSettingsPage.runtimeSettings').

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/admin/sandbox-settings.tsx` around lines 587 - 880, Replace the
hardcoded English UI strings in the sandbox settings Collapsible blocks with
i18n t() calls: update the "Runtime Settings" heading in the CollapsibleTrigger,
the "Authentication" h4 and its helper paragraph, the TabsTrigger labels
"Password" and "Private Key", the "Execution" h4, and the "Deployment Defaults"
heading to use t(...) keys (e.g.,
t('admin.sandboxSettingsPage.runtimeSettings'),
t('admin.sandboxSettingsPage.authentication'),
t('admin.sandboxSettingsPage.authenticationHelp'),
t('admin.sandboxSettingsPage.password'),
t('admin.sandboxSettingsPage.privateKey'),
t('admin.sandboxSettingsPage.execution'),
t('admin.sandboxSettingsPage.deploymentDefaults')). Locate these strings around
the CollapsibleTrigger, CollapsibleContent, TabsList/TabsTrigger and the
relevant h4/p elements and replace the literal text with the t(...) calls so all
user-facing strings are internationalized.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@agent/sandbox/providers/ssh.py`:
- Around line 79-117: Add structured logging to the SSH provider initialize
flow: at the start of initialize(...) log an INFO message that initialization is
beginning with non-sensitive config summary (include host, port, username,
python_bin, node_bin, work_dir, timeout, max_output_bytes, max_artifacts,
max_artifact_bytes) while redacting password/private_key/passphrase; when
validate_config returns is_valid == False log an ERROR with the validation error
and then raise SandboxProviderConfigError(error_message); wrap the call to
_assert_connectivity() to catch exceptions and log an ERROR with the exception
details (stack/exception string) and re-raise; and finally log an INFO on
successful initialization (after setting _initialized=True) indicating
connectivity and readiness. Use the class logger (self.logger) if available,
falling back to the module logger, and ensure all logs include identifying
context (class name / method initialize).
- Around line 435-456: The SSH client currently uses paramiko.AutoAddPolicy()
which blindly trusts host keys; update _create_ssh_client to accept a
configurable host_key_policy option (e.g., values "reject", "auto_add",
"warning") on the provider class, call client.load_system_host_keys() and/or
client.load_host_keys(...) when policy is "reject" or to prefer known_hosts
verification, and only set AutoAddPolicy when the policy is explicitly
"auto_add" while emitting a clear warning log when AutoAddPolicy is used; ensure
existing behavior for key/password loading via _load_private_key remains
unchanged and that the logic references self.host_key_policy and
paramiko.AutoAddPolicy/RejectPolicy appropriately.

In `@conf/mapping.json`:
- Around line 23-25: The mapping for the field chunk_metadata_kwd is currently
typed as "keyword" and will attempt to index arbitrarily large JSON strings;
update the mapping for chunk_metadata_kwd to make it retrieval-only by setting
"index": false while keeping "store": true, or if you must index short values
add an "ignore_above" threshold (e.g. 32766) to the keyword definition to
prevent indexing oversized terms; locate the chunk_metadata_kwd entry in the
mapping.json and replace or augment its properties accordingly.

In `@rag/llm/chat_model.py`:
- Around line 1506-1510: The Base._verbose_tool_use method wasn't updated to
handle Exception objects during JSON serialization like
LiteLLMBase._verbose_tool_use; update Base._verbose_tool_use to convert
Exception results to strings before json.dumps (e.g., use the same pattern: use
str(res) if isinstance(res, Exception) else res) so when callers pass err (the
Exception) via the tool call site (the code using "err if err else result") the
JSON encoding won't fail; ensure the log format and ensure_ascii/indent behavior
mirrors LiteLLMBase._verbose_tool_use.

In `@rag/utils/infinity_conn.py`:
- Around line 451-456: The branch that serializes chunk_metadata_kwd to JSON
never runs because self.field_keyword(k) matches first; update the logic so
chunk_metadata_kwd is handled explicitly before keyword matching (or alter the
field_keyword handling to skip/avoid matching "chunk_metadata_kwd"), ensuring
that in the function where d, k, v are processed the chunk_metadata_kwd branch
runs and dict values are json.dumps(..., ensure_ascii=False) while
empty/non-dict values become ""; keep the rest of keyword handling unchanged.

---

Outside diff comments:
In `@agent/sandbox/providers/local.py`:
- Around line 256-266: The error messages in _validate_limits() still reference
removed environment variables; update each SandboxProviderConfigError message in
the _validate_limits method to mention the provider config fields instead of env
var names—e.g., change "SANDBOX_LOCAL_TIMEOUT must be greater than 0." to
"timeout must be greater than 0.", "SANDBOX_LOCAL_MAX_MEMORY_MB must be greater
than 0." to "max_memory_mb must be greater than 0.",
"SANDBOX_LOCAL_MAX_OUTPUT_BYTES must be greater than 0." to "max_output_bytes
must be greater than 0.", "SANDBOX_LOCAL_MAX_ARTIFACTS must be greater than or
equal to 0." to "max_artifacts must be greater than or equal to 0.", and
"SANDBOX_LOCAL_MAX_ARTIFACT_BYTES must be greater than 0." to
"max_artifact_bytes must be greater than 0." while keeping the same validation
logic in _validate_limits.

In `@agent/sandbox/providers/self_managed.py`:
- Around line 50-67: The docstring for initialize incorrectly states the default
pool_size is 10; update the docstring so the "pool_size: Container pool size for
info (default: 10)" line reflects the actual default of 3 (or mention the config
key "executor_manager_pool_size" fallback). Modify the initialize method's
docstring to show the default as 3 and/or note that the value comes from
executor_manager_pool_size (falling back to pool_size) so maintainers can find
the correct config keys; refer to the initialize function and the self.pool_size
assignment.

---

Nitpick comments:
In `@agent/sandbox/client.py`:
- Around line 181-188: The fallback using getattr(provider, "__class__",
type(provider)) is redundant because every object has __class__; replace that
expression with type(provider).__name__ for clarity: compute provider_name =
provider_manager.get_provider_name() or type(provider).__name__ and keep the
existing logger.info call that references provider_name, language, and timeout
so behavior is unchanged (references: provider_manager.get_provider_name,
provider, provider_name, logger.info).

In `@agent/sandbox/providers/ssh.py`:
- Around line 158-165: The execute_code signature declares timeout: int but the
implementation checks for timeout is None, so change the type hint to
Optional[int] to reflect that None is valid; update the function signature for
execute_code (and any related overloads or stubs) to use Optional[int], and run
a quick search for callers of execute_code to ensure any places passing None are
valid or adjust callers accordingly.

In `@agent/tools/code_exec.py`:
- Around line 371-377: The current _execute_code flow always calls
reload_provider() before getting provider_info which reinitializes the provider
every run; change this to cache the provider manager and only call
reload_provider() when configuration has changed (e.g., track a config_version
or checksum and compare before reloading) or make the reload behavior explicit
in docs. Modify the logic around reload_provider(), get_provider_info(), and
provider_type resolution so you first check a cached provider instance and a
cached config fingerprint, call reload_provider() only on mismatch, and
otherwise use the cached provider_info to avoid repeated re-initialization and
reduce latency.

In `@api/apps/restful_apis/chunk_api.py`:
- Around line 100-112: The _deserialize_chunk_metadata function silently coerces
malformed or unexpected chunk["chunk_metadata_kwd"] values to {} and drops the
raw key; update the function to emit structured warning logs whenever (a)
json.loads fails (include the exception and the raw string), (b) a non-dict
non-string value is encountered, and (c) an empty string is treated as missing —
include identifying fields from the chunk (e.g. chunk.get("id") or
chunk.get("chunk_id")) in the log so operators can trace the offending record;
apply the same logging additions to the other similar branches referenced
(around the other ranges) so all parse/write fallback paths record telemetry.
- Around line 295-299: The inline validation for "chunk_metadata" in the route
handler should be moved into the Pydantic request model and the service
boundary: add an optional chunk_metadata: Dict[str, Any] field (with a validator
that ensures it's a dict) to the endpoint's Pydantic request model, remove the
inline isinstance check and get_error_data_result call from the handler, and
have the handler pass the validated chunk_metadata to the service; perform the
json.dumps(serialization) of chunk_metadata in the service layer (setting
d["chunk_metadata_kwd"]) so the route stays thin. Apply the same refactor for
the other occurrence referenced (lines 451-455).

In `@docs/guides/agent/agent_quickstarts/sandbox_quickstart.md`:
- Around line 107-109: The sentence "Keep the self-managed deployment defaults
in `.env` if you need to change the sandbox-executor-manager image, pool size,
base images, seccomp, memory, or timeout." is ambiguous; update that line in
sandbox_quickstart.md to clearly instruct users to uncomment and modify the
commented variables in `.env` when they need to customize the
sandbox-executor-manager image, pool size, base images, seccomp, memory, or
timeout (e.g., replace the word "Keep" with explicit guidance like "Uncomment
and set" or "Uncomment and modify" so it's clear those defaults are provided as
commented variables to be changed).

In `@web/src/pages/admin/sandbox-settings.tsx`:
- Around line 587-880: Replace the hardcoded English UI strings in the sandbox
settings Collapsible blocks with i18n t() calls: update the "Runtime Settings"
heading in the CollapsibleTrigger, the "Authentication" h4 and its helper
paragraph, the TabsTrigger labels "Password" and "Private Key", the "Execution"
h4, and the "Deployment Defaults" heading to use t(...) keys (e.g.,
t('admin.sandboxSettingsPage.runtimeSettings'),
t('admin.sandboxSettingsPage.authentication'),
t('admin.sandboxSettingsPage.authenticationHelp'),
t('admin.sandboxSettingsPage.password'),
t('admin.sandboxSettingsPage.privateKey'),
t('admin.sandboxSettingsPage.execution'),
t('admin.sandboxSettingsPage.deploymentDefaults')). Locate these strings around
the CollapsibleTrigger, CollapsibleContent, TabsList/TabsTrigger and the
relevant h4/p elements and replace the literal text with the t(...) calls so all
user-facing strings are internationalized.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f08a1c3f-f982-4905-aecf-8e8981d8f0ef

📥 Commits

Reviewing files that changed from the base of the PR and between 5a04ac0 and 6380ef5.

⛔ Files ignored due to path filters (2)
  • uv.lock is excluded by !**/*.lock
  • web/src/assets/admin-sandbox-settings.png is excluded by !**/*.png
📒 Files selected for processing (24)
  • admin/server/services.py
  • agent/sandbox/client.py
  • agent/sandbox/providers/__init__.py
  • agent/sandbox/providers/local.py
  • agent/sandbox/providers/self_managed.py
  • agent/sandbox/providers/ssh.py
  • agent/tools/base.py
  • agent/tools/code_exec.py
  • api/apps/restful_apis/chunk_api.py
  • conf/infinity_mapping.json
  • conf/llm_factories.json
  • conf/mapping.json
  • docker/.env
  • docs/guides/agent/agent_quickstarts/sandbox_quickstart.md
  • pyproject.toml
  • rag/llm/chat_model.py
  • rag/utils/infinity_conn.py
  • sdk/python/ragflow_sdk/modules/chunk.py
  • test/unit_test/agent/sandbox/test_local_provider.py
  • test/unit_test/agent/sandbox/test_sandbox_client.py
  • test/unit_test/agent/sandbox/test_ssh_provider.py
  • web/src/interfaces/database/dataset.ts
  • web/src/pages/admin/sandbox-settings.tsx
  • web/src/services/admin.service.d.ts
💤 Files with no reviewable changes (1)
  • conf/llm_factories.json

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
agent/sandbox/providers/self_managed.py (1)

50-67: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Docstring default value is outdated.

Line 59 documents pool_size: Container pool size for info (default: 10) but the actual default is now 3.

📝 Proposed fix
                 - endpoint: HTTP endpoint (default: "http://sandbox-executor-manager:9385")
                 - timeout: Request timeout in seconds (default: 30)
                 - max_retries: Maximum retry attempts (default: 3)
-                - pool_size: Container pool size for info (default: 10)
+                - executor_manager_pool_size: Container pool size (default: 3)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@agent/sandbox/providers/self_managed.py` around lines 50 - 67, The docstring
for initialize incorrectly states the default pool_size is 10; update the
docstring so the "pool_size: Container pool size for info (default: 10)" line
reflects the actual default of 3 (or mention the config key
"executor_manager_pool_size" fallback). Modify the initialize method's docstring
to show the default as 3 and/or note that the value comes from
executor_manager_pool_size (falling back to pool_size) so maintainers can find
the correct config keys; refer to the initialize function and the self.pool_size
assignment.
agent/sandbox/providers/local.py (1)

256-266: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Outdated error messages reference removed environment variables.

The error messages in _validate_limits() still reference environment variable names (e.g., SANDBOX_LOCAL_TIMEOUT) even though the provider no longer reads from environment variables. These should reference the config field names instead.

📝 Proposed fix to update error messages
     def _validate_limits(self) -> None:
         if self.timeout <= 0:
-            raise SandboxProviderConfigError("SANDBOX_LOCAL_TIMEOUT must be greater than 0.")
+            raise SandboxProviderConfigError("timeout must be greater than 0.")
         if self.max_memory_mb <= 0:
-            raise SandboxProviderConfigError("SANDBOX_LOCAL_MAX_MEMORY_MB must be greater than 0.")
+            raise SandboxProviderConfigError("max_memory_mb must be greater than 0.")
         if self.max_output_bytes <= 0:
-            raise SandboxProviderConfigError("SANDBOX_LOCAL_MAX_OUTPUT_BYTES must be greater than 0.")
+            raise SandboxProviderConfigError("max_output_bytes must be greater than 0.")
         if self.max_artifacts < 0:
-            raise SandboxProviderConfigError("SANDBOX_LOCAL_MAX_ARTIFACTS must be greater than or equal to 0.")
+            raise SandboxProviderConfigError("max_artifacts must be greater than or equal to 0.")
         if self.max_artifact_bytes <= 0:
-            raise SandboxProviderConfigError("SANDBOX_LOCAL_MAX_ARTIFACT_BYTES must be greater than 0.")
+            raise SandboxProviderConfigError("max_artifact_bytes must be greater than 0.")
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@agent/sandbox/providers/local.py` around lines 256 - 266, The error messages
in _validate_limits() still reference removed environment variables; update each
SandboxProviderConfigError message in the _validate_limits method to mention the
provider config fields instead of env var names—e.g., change
"SANDBOX_LOCAL_TIMEOUT must be greater than 0." to "timeout must be greater than
0.", "SANDBOX_LOCAL_MAX_MEMORY_MB must be greater than 0." to "max_memory_mb
must be greater than 0.", "SANDBOX_LOCAL_MAX_OUTPUT_BYTES must be greater than
0." to "max_output_bytes must be greater than 0.", "SANDBOX_LOCAL_MAX_ARTIFACTS
must be greater than or equal to 0." to "max_artifacts must be greater than or
equal to 0.", and "SANDBOX_LOCAL_MAX_ARTIFACT_BYTES must be greater than 0." to
"max_artifact_bytes must be greater than 0." while keeping the same validation
logic in _validate_limits.
🧹 Nitpick comments (7)
agent/sandbox/providers/ssh.py (1)

158-165: 💤 Low value

Type hint says int but code handles None.

The timeout parameter is typed as int with default 10, but line 186 checks if timeout is None. If None is a valid input, update the type hint to Optional[int].

     def execute_code(
         self,
         instance_id: str,
         code: str,
         language: str,
-        timeout: int = 10,
+        timeout: Optional[int] = 10,
         arguments: Optional[Dict[str, Any]] = None,
     ) -> ExecutionResult:
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@agent/sandbox/providers/ssh.py` around lines 158 - 165, The execute_code
signature declares timeout: int but the implementation checks for timeout is
None, so change the type hint to Optional[int] to reflect that None is valid;
update the function signature for execute_code (and any related overloads or
stubs) to use Optional[int], and run a quick search for callers of execute_code
to ensure any places passing None are valid or adjust callers accordingly.
docs/guides/agent/agent_quickstarts/sandbox_quickstart.md (1)

107-109: ⚡ Quick win

Clarify the guidance for modifying deployment defaults.

The phrase "Keep the self-managed deployment defaults in .env if you need to change..." is ambiguous. It's unclear whether "keep" means "retain as-is" or "include these variables."

Since these variables are commented out by default in .env, users who need to customize them should uncomment and modify. Consider rewording for clarity.

📝 Suggested rewording
-- Keep the self-managed deployment defaults in `.env` if you need to change the
-  sandbox-executor-manager image, pool size, base images, seccomp, memory, or
-  timeout.
+- To customize the self-managed deployment defaults (executor-manager image,
+  pool size, base images, seccomp, memory, or timeout), uncomment and modify
+  the corresponding variables in `.env`.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/agent/agent_quickstarts/sandbox_quickstart.md` around lines 107 -
109, The sentence "Keep the self-managed deployment defaults in `.env` if you
need to change the sandbox-executor-manager image, pool size, base images,
seccomp, memory, or timeout." is ambiguous; update that line in
sandbox_quickstart.md to clearly instruct users to uncomment and modify the
commented variables in `.env` when they need to customize the
sandbox-executor-manager image, pool size, base images, seccomp, memory, or
timeout (e.g., replace the word "Keep" with explicit guidance like "Uncomment
and set" or "Uncomment and modify" so it's clear those defaults are provided as
commented variables to be changed).
api/apps/restful_apis/chunk_api.py (2)

100-112: ⚡ Quick win

Add logging on the new chunk-metadata parse/write branches.

These new branches currently coerce malformed values to {} or empty-string paths without telemetry, which will make storage/parse regressions hard to diagnose in production.

As per coding guidelines, **/*.py: "Add logging for new flows".

Also applies to: 186-195, 295-299, 335-341, 451-455

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/apps/restful_apis/chunk_api.py` around lines 100 - 112, The
_deserialize_chunk_metadata function silently coerces malformed or unexpected
chunk["chunk_metadata_kwd"] values to {} and drops the raw key; update the
function to emit structured warning logs whenever (a) json.loads fails (include
the exception and the raw string), (b) a non-dict non-string value is
encountered, and (c) an empty string is treated as missing — include identifying
fields from the chunk (e.g. chunk.get("id") or chunk.get("chunk_id")) in the log
so operators can trace the offending record; apply the same logging additions to
the other similar branches referenced (around the other ranges) so all
parse/write fallback paths record telemetry.

Source: Coding guidelines


295-299: 🏗️ Heavy lift

Move new chunk_metadata request validation into a Pydantic request model/service boundary.

The new field is validated inline in route handlers. In this RESTful API module, this should follow the existing Pydantic request-validation + service-layer pattern to keep validation centralized and reusable.

As per coding guidelines, api/apps/restful_apis/**/*.py: "Use Pydantic request validation with service layer pattern in newer RESTful APIs under api/apps/restful_apis/".

Also applies to: 451-455

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/apps/restful_apis/chunk_api.py` around lines 295 - 299, The inline
validation for "chunk_metadata" in the route handler should be moved into the
Pydantic request model and the service boundary: add an optional chunk_metadata:
Dict[str, Any] field (with a validator that ensures it's a dict) to the
endpoint's Pydantic request model, remove the inline isinstance check and
get_error_data_result call from the handler, and have the handler pass the
validated chunk_metadata to the service; perform the json.dumps(serialization)
of chunk_metadata in the service layer (setting d["chunk_metadata_kwd"]) so the
route stays thin. Apply the same refactor for the other occurrence referenced
(lines 451-455).

Source: Coding guidelines

agent/sandbox/client.py (1)

181-188: 💤 Low value

Simplify redundant fallback expression

The getattr(provider, "__class__", type(provider)) is unnecessary—every Python object has __class__, so the fallback never triggers. Using type(provider).__name__ directly is clearer.

♻️ Suggested simplification
-    provider_name = provider_manager.get_provider_name() or getattr(provider, "__class__", type(provider)).__name__
+    provider_name = provider_manager.get_provider_name() or type(provider).__name__
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@agent/sandbox/client.py` around lines 181 - 188, The fallback using
getattr(provider, "__class__", type(provider)) is redundant because every object
has __class__; replace that expression with type(provider).__name__ for clarity:
compute provider_name = provider_manager.get_provider_name() or
type(provider).__name__ and keep the existing logger.info call that references
provider_name, language, and timeout so behavior is unchanged (references:
provider_manager.get_provider_name, provider, provider_name, logger.info).
agent/tools/code_exec.py (1)

371-377: ⚖️ Poor tradeoff

Consider caching provider instead of reloading on every execution.

Calling reload_provider() on every _execute_code invocation ensures configuration changes take effect immediately but resets and re-initializes the provider manager each time. For high-throughput scenarios, this could introduce latency.

Consider checking if configuration has changed before reloading, or documenting this as intentional behavior for immediate config propagation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@agent/tools/code_exec.py` around lines 371 - 377, The current _execute_code
flow always calls reload_provider() before getting provider_info which
reinitializes the provider every run; change this to cache the provider manager
and only call reload_provider() when configuration has changed (e.g., track a
config_version or checksum and compare before reloading) or make the reload
behavior explicit in docs. Modify the logic around reload_provider(),
get_provider_info(), and provider_type resolution so you first check a cached
provider instance and a cached config fingerprint, call reload_provider() only
on mismatch, and otherwise use the cached provider_info to avoid repeated
re-initialization and reduce latency.
web/src/pages/admin/sandbox-settings.tsx (1)

587-880: 💤 Low value

Hardcoded English strings should use i18n.

Several user-facing strings are not internationalized:

  • "Runtime Settings" (line 591)
  • "Authentication" (line 655)
  • "Choose one authentication method..." (line 658-659)
  • "Password" / "Private Key" (lines 675, 678)
  • "Execution" (line 779)
  • "Deployment Defaults" (line 874)

These should use the t() function with translation keys like t('admin.sandboxSettingsPage.runtimeSettings').

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/admin/sandbox-settings.tsx` around lines 587 - 880, Replace the
hardcoded English UI strings in the sandbox settings Collapsible blocks with
i18n t() calls: update the "Runtime Settings" heading in the CollapsibleTrigger,
the "Authentication" h4 and its helper paragraph, the TabsTrigger labels
"Password" and "Private Key", the "Execution" h4, and the "Deployment Defaults"
heading to use t(...) keys (e.g.,
t('admin.sandboxSettingsPage.runtimeSettings'),
t('admin.sandboxSettingsPage.authentication'),
t('admin.sandboxSettingsPage.authenticationHelp'),
t('admin.sandboxSettingsPage.password'),
t('admin.sandboxSettingsPage.privateKey'),
t('admin.sandboxSettingsPage.execution'),
t('admin.sandboxSettingsPage.deploymentDefaults')). Locate these strings around
the CollapsibleTrigger, CollapsibleContent, TabsList/TabsTrigger and the
relevant h4/p elements and replace the literal text with the t(...) calls so all
user-facing strings are internationalized.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@agent/sandbox/providers/ssh.py`:
- Around line 79-117: Add structured logging to the SSH provider initialize
flow: at the start of initialize(...) log an INFO message that initialization is
beginning with non-sensitive config summary (include host, port, username,
python_bin, node_bin, work_dir, timeout, max_output_bytes, max_artifacts,
max_artifact_bytes) while redacting password/private_key/passphrase; when
validate_config returns is_valid == False log an ERROR with the validation error
and then raise SandboxProviderConfigError(error_message); wrap the call to
_assert_connectivity() to catch exceptions and log an ERROR with the exception
details (stack/exception string) and re-raise; and finally log an INFO on
successful initialization (after setting _initialized=True) indicating
connectivity and readiness. Use the class logger (self.logger) if available,
falling back to the module logger, and ensure all logs include identifying
context (class name / method initialize).
- Around line 435-456: The SSH client currently uses paramiko.AutoAddPolicy()
which blindly trusts host keys; update _create_ssh_client to accept a
configurable host_key_policy option (e.g., values "reject", "auto_add",
"warning") on the provider class, call client.load_system_host_keys() and/or
client.load_host_keys(...) when policy is "reject" or to prefer known_hosts
verification, and only set AutoAddPolicy when the policy is explicitly
"auto_add" while emitting a clear warning log when AutoAddPolicy is used; ensure
existing behavior for key/password loading via _load_private_key remains
unchanged and that the logic references self.host_key_policy and
paramiko.AutoAddPolicy/RejectPolicy appropriately.

In `@conf/mapping.json`:
- Around line 23-25: The mapping for the field chunk_metadata_kwd is currently
typed as "keyword" and will attempt to index arbitrarily large JSON strings;
update the mapping for chunk_metadata_kwd to make it retrieval-only by setting
"index": false while keeping "store": true, or if you must index short values
add an "ignore_above" threshold (e.g. 32766) to the keyword definition to
prevent indexing oversized terms; locate the chunk_metadata_kwd entry in the
mapping.json and replace or augment its properties accordingly.

In `@rag/llm/chat_model.py`:
- Around line 1506-1510: The Base._verbose_tool_use method wasn't updated to
handle Exception objects during JSON serialization like
LiteLLMBase._verbose_tool_use; update Base._verbose_tool_use to convert
Exception results to strings before json.dumps (e.g., use the same pattern: use
str(res) if isinstance(res, Exception) else res) so when callers pass err (the
Exception) via the tool call site (the code using "err if err else result") the
JSON encoding won't fail; ensure the log format and ensure_ascii/indent behavior
mirrors LiteLLMBase._verbose_tool_use.

In `@rag/utils/infinity_conn.py`:
- Around line 451-456: The branch that serializes chunk_metadata_kwd to JSON
never runs because self.field_keyword(k) matches first; update the logic so
chunk_metadata_kwd is handled explicitly before keyword matching (or alter the
field_keyword handling to skip/avoid matching "chunk_metadata_kwd"), ensuring
that in the function where d, k, v are processed the chunk_metadata_kwd branch
runs and dict values are json.dumps(..., ensure_ascii=False) while
empty/non-dict values become ""; keep the rest of keyword handling unchanged.

---

Outside diff comments:
In `@agent/sandbox/providers/local.py`:
- Around line 256-266: The error messages in _validate_limits() still reference
removed environment variables; update each SandboxProviderConfigError message in
the _validate_limits method to mention the provider config fields instead of env
var names—e.g., change "SANDBOX_LOCAL_TIMEOUT must be greater than 0." to
"timeout must be greater than 0.", "SANDBOX_LOCAL_MAX_MEMORY_MB must be greater
than 0." to "max_memory_mb must be greater than 0.",
"SANDBOX_LOCAL_MAX_OUTPUT_BYTES must be greater than 0." to "max_output_bytes
must be greater than 0.", "SANDBOX_LOCAL_MAX_ARTIFACTS must be greater than or
equal to 0." to "max_artifacts must be greater than or equal to 0.", and
"SANDBOX_LOCAL_MAX_ARTIFACT_BYTES must be greater than 0." to
"max_artifact_bytes must be greater than 0." while keeping the same validation
logic in _validate_limits.

In `@agent/sandbox/providers/self_managed.py`:
- Around line 50-67: The docstring for initialize incorrectly states the default
pool_size is 10; update the docstring so the "pool_size: Container pool size for
info (default: 10)" line reflects the actual default of 3 (or mention the config
key "executor_manager_pool_size" fallback). Modify the initialize method's
docstring to show the default as 3 and/or note that the value comes from
executor_manager_pool_size (falling back to pool_size) so maintainers can find
the correct config keys; refer to the initialize function and the self.pool_size
assignment.

---

Nitpick comments:
In `@agent/sandbox/client.py`:
- Around line 181-188: The fallback using getattr(provider, "__class__",
type(provider)) is redundant because every object has __class__; replace that
expression with type(provider).__name__ for clarity: compute provider_name =
provider_manager.get_provider_name() or type(provider).__name__ and keep the
existing logger.info call that references provider_name, language, and timeout
so behavior is unchanged (references: provider_manager.get_provider_name,
provider, provider_name, logger.info).

In `@agent/sandbox/providers/ssh.py`:
- Around line 158-165: The execute_code signature declares timeout: int but the
implementation checks for timeout is None, so change the type hint to
Optional[int] to reflect that None is valid; update the function signature for
execute_code (and any related overloads or stubs) to use Optional[int], and run
a quick search for callers of execute_code to ensure any places passing None are
valid or adjust callers accordingly.

In `@agent/tools/code_exec.py`:
- Around line 371-377: The current _execute_code flow always calls
reload_provider() before getting provider_info which reinitializes the provider
every run; change this to cache the provider manager and only call
reload_provider() when configuration has changed (e.g., track a config_version
or checksum and compare before reloading) or make the reload behavior explicit
in docs. Modify the logic around reload_provider(), get_provider_info(), and
provider_type resolution so you first check a cached provider instance and a
cached config fingerprint, call reload_provider() only on mismatch, and
otherwise use the cached provider_info to avoid repeated re-initialization and
reduce latency.

In `@api/apps/restful_apis/chunk_api.py`:
- Around line 100-112: The _deserialize_chunk_metadata function silently coerces
malformed or unexpected chunk["chunk_metadata_kwd"] values to {} and drops the
raw key; update the function to emit structured warning logs whenever (a)
json.loads fails (include the exception and the raw string), (b) a non-dict
non-string value is encountered, and (c) an empty string is treated as missing —
include identifying fields from the chunk (e.g. chunk.get("id") or
chunk.get("chunk_id")) in the log so operators can trace the offending record;
apply the same logging additions to the other similar branches referenced
(around the other ranges) so all parse/write fallback paths record telemetry.
- Around line 295-299: The inline validation for "chunk_metadata" in the route
handler should be moved into the Pydantic request model and the service
boundary: add an optional chunk_metadata: Dict[str, Any] field (with a validator
that ensures it's a dict) to the endpoint's Pydantic request model, remove the
inline isinstance check and get_error_data_result call from the handler, and
have the handler pass the validated chunk_metadata to the service; perform the
json.dumps(serialization) of chunk_metadata in the service layer (setting
d["chunk_metadata_kwd"]) so the route stays thin. Apply the same refactor for
the other occurrence referenced (lines 451-455).

In `@docs/guides/agent/agent_quickstarts/sandbox_quickstart.md`:
- Around line 107-109: The sentence "Keep the self-managed deployment defaults
in `.env` if you need to change the sandbox-executor-manager image, pool size,
base images, seccomp, memory, or timeout." is ambiguous; update that line in
sandbox_quickstart.md to clearly instruct users to uncomment and modify the
commented variables in `.env` when they need to customize the
sandbox-executor-manager image, pool size, base images, seccomp, memory, or
timeout (e.g., replace the word "Keep" with explicit guidance like "Uncomment
and set" or "Uncomment and modify" so it's clear those defaults are provided as
commented variables to be changed).

In `@web/src/pages/admin/sandbox-settings.tsx`:
- Around line 587-880: Replace the hardcoded English UI strings in the sandbox
settings Collapsible blocks with i18n t() calls: update the "Runtime Settings"
heading in the CollapsibleTrigger, the "Authentication" h4 and its helper
paragraph, the TabsTrigger labels "Password" and "Private Key", the "Execution"
h4, and the "Deployment Defaults" heading to use t(...) keys (e.g.,
t('admin.sandboxSettingsPage.runtimeSettings'),
t('admin.sandboxSettingsPage.authentication'),
t('admin.sandboxSettingsPage.authenticationHelp'),
t('admin.sandboxSettingsPage.password'),
t('admin.sandboxSettingsPage.privateKey'),
t('admin.sandboxSettingsPage.execution'),
t('admin.sandboxSettingsPage.deploymentDefaults')). Locate these strings around
the CollapsibleTrigger, CollapsibleContent, TabsList/TabsTrigger and the
relevant h4/p elements and replace the literal text with the t(...) calls so all
user-facing strings are internationalized.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f08a1c3f-f982-4905-aecf-8e8981d8f0ef

📥 Commits

Reviewing files that changed from the base of the PR and between 5a04ac0 and 6380ef5.

⛔ Files ignored due to path filters (2)
  • uv.lock is excluded by !**/*.lock
  • web/src/assets/admin-sandbox-settings.png is excluded by !**/*.png
📒 Files selected for processing (24)
  • admin/server/services.py
  • agent/sandbox/client.py
  • agent/sandbox/providers/__init__.py
  • agent/sandbox/providers/local.py
  • agent/sandbox/providers/self_managed.py
  • agent/sandbox/providers/ssh.py
  • agent/tools/base.py
  • agent/tools/code_exec.py
  • api/apps/restful_apis/chunk_api.py
  • conf/infinity_mapping.json
  • conf/llm_factories.json
  • conf/mapping.json
  • docker/.env
  • docs/guides/agent/agent_quickstarts/sandbox_quickstart.md
  • pyproject.toml
  • rag/llm/chat_model.py
  • rag/utils/infinity_conn.py
  • sdk/python/ragflow_sdk/modules/chunk.py
  • test/unit_test/agent/sandbox/test_local_provider.py
  • test/unit_test/agent/sandbox/test_sandbox_client.py
  • test/unit_test/agent/sandbox/test_ssh_provider.py
  • web/src/interfaces/database/dataset.ts
  • web/src/pages/admin/sandbox-settings.tsx
  • web/src/services/admin.service.d.ts
💤 Files with no reviewable changes (1)
  • conf/llm_factories.json
🛑 Comments failed to post (5)
agent/sandbox/providers/ssh.py (2)

79-117: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Add logging for SSH provider initialization and connectivity.

This new flow has no logging statements. Add appropriate logging for initialization success/failure and connectivity checks to aid debugging and operational monitoring.

Based on learnings: "Add logging for new flows" per coding guidelines.

Example logging additions
+import logging
+
+logger = logging.getLogger(__name__)
+
 class SSHProvider(SandboxProvider):
     ...
     def initialize(self, config: Dict[str, Any]) -> bool:
         ...
         self._assert_connectivity()
+        logger.info("SSH provider initialized: %s@%s:%d", self.username, self.host, self.port)
         self._initialized = True
         return True
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@agent/sandbox/providers/ssh.py` around lines 79 - 117, Add structured logging
to the SSH provider initialize flow: at the start of initialize(...) log an INFO
message that initialization is beginning with non-sensitive config summary
(include host, port, username, python_bin, node_bin, work_dir, timeout,
max_output_bytes, max_artifacts, max_artifact_bytes) while redacting
password/private_key/passphrase; when validate_config returns is_valid == False
log an ERROR with the validation error and then raise
SandboxProviderConfigError(error_message); wrap the call to
_assert_connectivity() to catch exceptions and log an ERROR with the exception
details (stack/exception string) and re-raise; and finally log an INFO on
successful initialization (after setting _initialized=True) indicating
connectivity and readiness. Use the class logger (self.logger) if available,
falling back to the module logger, and ensure all logs include identifying
context (class name / method initialize).

Source: Coding guidelines


435-456: ⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

AutoAddPolicy accepts unknown SSH host keys without verification.

Using AutoAddPolicy automatically trusts any host key, making the connection vulnerable to man-in-the-middle attacks. For production use, consider:

  1. Adding a host_key_policy config option (e.g., reject, auto_add, warning)
  2. Supporting known_hosts file verification via load_system_host_keys() or load_host_keys()
  3. At minimum, logging a warning when AutoAddPolicy is in effect
Suggested approach
 def _create_ssh_client(self) -> paramiko.SSHClient:
     paramiko = _get_paramiko_module()
     client = paramiko.SSHClient()
-    client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
+    # TODO: Consider making host key policy configurable for production security
+    # Options: load_system_host_keys(), load_host_keys(path), or RejectPolicy()
+    client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
+    logger.warning(
+        "SSH connection to %s:%d uses AutoAddPolicy - host key verification disabled",
+        self.host,
+        self.port,
+    )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@agent/sandbox/providers/ssh.py` around lines 435 - 456, The SSH client
currently uses paramiko.AutoAddPolicy() which blindly trusts host keys; update
_create_ssh_client to accept a configurable host_key_policy option (e.g., values
"reject", "auto_add", "warning") on the provider class, call
client.load_system_host_keys() and/or client.load_host_keys(...) when policy is
"reject" or to prefer known_hosts verification, and only set AutoAddPolicy when
the policy is explicitly "auto_add" while emitting a clear warning log when
AutoAddPolicy is used; ensure existing behavior for key/password loading via
_load_private_key remains unchanged and that the logic references
self.host_key_policy and paramiko.AutoAddPolicy/RejectPolicy appropriately.
conf/mapping.json (1)

23-25: ⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

For the Elasticsearch version used by this repository, what is the maximum indexed term length for keywordfields, and what happens when akeyword value exceeds that limit? Also confirm best practice for storing large JSON blobs that are returned but not searched.

💡 Result:

In Elasticsearch, the absolute technical limit for a term in a Lucene index is 32,766 UTF-8 encoded bytes [1][2]. If a value exceeds this limit, Elasticsearch will reject the document entirely [1][3]. For keyword fields, the ignore_above mapping parameter is used to manage this limitation [2][4]. When a keyword value exceeds the ignore_above threshold: * The field is not indexed, meaning it cannot be used for searches, aggregations, or sorting [2][4]. * The value remains available in the _source field (assuming it is enabled) and can be retrieved, but the field itself acts as if it does not exist for indexing-dependent operations [2][4][5]. * Setting ignore_above to 8,191 characters or less is considered a best practice to ensure you never hit the underlying 32,766-byte Lucene limit, as UTF-8 characters can consume up to 4 bytes each [2][3][4]. For storing large JSON blobs that are returned but not searched, the best practice is to keep them in the _source field [6][7]. Since _source is stored by default and is not indexed, it does not contribute to the term-length limits or the mapping explosion risks associated with indexed fields [7]. To optimize storage, consider the following: * If disk space is a concern, do not disable _source (which would break reindexing and update capabilities), but rather use index.mapping.source.mode: "synthetic" to reconstruct the source on the fly, or increase the index compression level [7]. * Avoid mapping these large blobs as specific types (like text or keyword) unless you explicitly need to search them [8]. If you only need to store them for retrieval, they can exist in the document without an explicit mapping, keeping the cluster state clean [8].

Citations:


Stop indexing chunk_metadata_kwd as a keyword when it can contain arbitrary/large JSON strings.

Elasticsearch/Lucene enforces an absolute 32,766 UTF-8 byte limit for indexed terms; without an ignore_above guard (not present in the mapping shown), oversized values can cause the write to fail. If the field is retrieval-only, set index: false (keep store: true), or add an ignore_above threshold to prevent indexing when the value is too large.

⚙️ Suggested mapping adjustment
       "chunk_metadata_kwd": {
         "type": "keyword",
-        "store": true
+        "store": true,
+        "index": false
       }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

      "chunk_metadata_kwd": {
        "type": "keyword",
        "store": true,
        "index": false
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@conf/mapping.json` around lines 23 - 25, The mapping for the field
chunk_metadata_kwd is currently typed as "keyword" and will attempt to index
arbitrarily large JSON strings; update the mapping for chunk_metadata_kwd to
make it retrieval-only by setting "index": false while keeping "store": true, or
if you must index short values add an "ignore_above" threshold (e.g. 32766) to
the keyword definition to prevent indexing oversized terms; locate the
chunk_metadata_kwd entry in the mapping.json and replace or augment its
properties accordingly.
rag/llm/chat_model.py (1)

1506-1510: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Base._verbose_tool_use not updated for Exception handling.

LiteLLMBase._verbose_tool_use now converts Exception results to strings for JSON serialization, but the equivalent method in Base (line 296-297) was not updated. When a tool call fails, the err (an Exception object) is passed to _verbose_tool_use (e.g., line 411: err if err else result), which will cause json.dumps to fail in the Base class.

Proposed fix for Base._verbose_tool_use
 def _verbose_tool_use(self, name, args, res):
-    return "<tool_call>" + json.dumps({"name": name, "args": args, "result": res}, ensure_ascii=False, indent=2) + "</tool_call>"
+    return "<tool_call>" + json.dumps(
+        {"name": name, "args": args, "result": str(res) if isinstance(res, Exception) else res},
+        ensure_ascii=False,
+        indent=2,
+    ) + "</tool_call>"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

def _verbose_tool_use(self, name, args, res):
    return "<tool_call>" + json.dumps(
        {"name": name, "args": args, "result": str(res) if isinstance(res, Exception) else res},
        ensure_ascii=False,
        indent=2,
    ) + "</tool_call>"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rag/llm/chat_model.py` around lines 1506 - 1510, The Base._verbose_tool_use
method wasn't updated to handle Exception objects during JSON serialization like
LiteLLMBase._verbose_tool_use; update Base._verbose_tool_use to convert
Exception results to strings before json.dumps (e.g., use the same pattern: use
str(res) if isinstance(res, Exception) else res) so when callers pass err (the
Exception) via the tool call site (the code using "err if err else result") the
JSON encoding won't fail; ensure the log format and ensure_ascii/indent behavior
mirrors LiteLLMBase._verbose_tool_use.
rag/utils/infinity_conn.py (1)

451-456: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

chunk_metadata_kwd serialization branch is dead code due earlier field_keyword() match.

This block never runs because chunk_metadata_kwd is already handled by elif self.field_keyword(k) above. That prevents the intended dict→JSON serialization here and also keeps chunk_metadata_kwd in keyword-list semantics, which can break round-trip metadata shape.

🛠️ Targeted fix direction
 def field_keyword(field_name: str):
-    if field_name == "source_id" or (
+    if field_name == "source_id" or (
         field_name.endswith("_kwd") and field_name not in ["knowledge_graph_kwd", "docnm_kwd", "important_kwd",
-                                                           "question_kwd"]):
+                                                           "question_kwd", "chunk_metadata_kwd"]):
         return True
-                elif self.field_keyword(k):
+                elif k == "chunk_metadata_kwd":
+                    if isinstance(v, dict):
+                        d[k] = json.dumps(v, ensure_ascii=False)
+                    else:
+                        d[k] = v if v else ""
+                elif self.field_keyword(k):
                     if isinstance(v, list):
                         d[k] = "###".join(v)
                     else:
                         d[k] = v
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rag/utils/infinity_conn.py` around lines 451 - 456, The branch that
serializes chunk_metadata_kwd to JSON never runs because self.field_keyword(k)
matches first; update the logic so chunk_metadata_kwd is handled explicitly
before keyword matching (or alter the field_keyword handling to skip/avoid
matching "chunk_metadata_kwd"), ensuring that in the function where d, k, v are
processed the chunk_metadata_kwd branch runs and dict values are json.dumps(...,
ensure_ascii=False) while empty/non-dict values become ""; keep the rest of
keyword handling unchanged.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
api/apps/restful_apis/chunk_api.py (2)

457-466: 💤 Low value

DRY: Inline deserialization duplicates _deserialize_chunk_metadata logic.

This block replicates the same parsing logic from lines 146-158. Consider extracting a pure helper function that both paths can share:

♻️ Suggested refactor

Extract a pure parsing function:

def _parse_chunk_metadata(raw) -> dict:
    """Parse chunk_metadata_kwd value into a dict, returning {} on failure."""
    if isinstance(raw, str) and raw:
        try:
            return json.loads(raw)
        except (json.JSONDecodeError, ValueError):
            return {}
    elif isinstance(raw, dict):
        return raw
    return {}

Then use it in both places:

  • _deserialize_chunk_metadata: chunk["chunk_metadata"] = _parse_chunk_metadata(raw)
  • Search results loop: chunk_metadata = _parse_chunk_metadata(raw_meta)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/apps/restful_apis/chunk_api.py` around lines 457 - 466, The parsing logic
for chunk metadata is duplicated; extract a pure helper (e.g.,
_parse_chunk_metadata(raw) -> dict) that implements the
JSON-or-dict-with-fallback behavior and return {} on error, then replace the
duplicated code in _deserialize_chunk_metadata and the search results loop
(where raw_meta is read and assigned to chunk_metadata) to call this helper
instead.

146-158: ⚡ Quick win

Consider logging a warning when deserialization fails.

When json.loads() fails (line 151-152), the code silently falls back to an empty dict. This defensive behavior is good, but silent failures can mask data corruption issues in production.

🔧 Suggested fix
 def _deserialize_chunk_metadata(chunk):
     raw = chunk.get("chunk_metadata_kwd")
     if isinstance(raw, str) and raw:
         try:
             chunk["chunk_metadata"] = json.loads(raw)
         except (json.JSONDecodeError, ValueError):
+            logging.warning("Failed to deserialize chunk_metadata_kwd: %r", raw[:200] if len(raw) > 200 else raw)
             chunk["chunk_metadata"] = {}
     elif isinstance(raw, dict):
         chunk["chunk_metadata"] = raw
     else:
         chunk["chunk_metadata"] = {}
     chunk.pop("chunk_metadata_kwd", None)

As per coding guidelines: "Add logging for new flows" applies to **/*.py files.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/apps/restful_apis/chunk_api.py` around lines 146 - 158, The
_deserialize_chunk_metadata function currently swallows JSON decode errors and
silently sets chunk["chunk_metadata"] = {}, so update it to log a warning when
json.loads(raw) fails: inside the except block for
json.JSONDecodeError/ValueError, call the module logger (e.g.,
logger.warning(...)) and include identifying context such as the chunk (or
chunk.get("id")/chunk key), the raw value (or a truncated snippet) and the
caught exception message, then continue to set chunk["chunk_metadata"] = {} and
pop "chunk_metadata_kwd" as before; ensure a module-level logger is used or
created if absent.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@api/apps/restful_apis/chunk_api.py`:
- Around line 457-466: The parsing logic for chunk metadata is duplicated;
extract a pure helper (e.g., _parse_chunk_metadata(raw) -> dict) that implements
the JSON-or-dict-with-fallback behavior and return {} on error, then replace the
duplicated code in _deserialize_chunk_metadata and the search results loop
(where raw_meta is read and assigned to chunk_metadata) to call this helper
instead.
- Around line 146-158: The _deserialize_chunk_metadata function currently
swallows JSON decode errors and silently sets chunk["chunk_metadata"] = {}, so
update it to log a warning when json.loads(raw) fails: inside the except block
for json.JSONDecodeError/ValueError, call the module logger (e.g.,
logger.warning(...)) and include identifying context such as the chunk (or
chunk.get("id")/chunk key), the raw value (or a truncated snippet) and the
caught exception message, then continue to set chunk["chunk_metadata"] = {} and
pop "chunk_metadata_kwd" as before; ensure a module-level logger is used or
created if absent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0f711846-c924-4088-9da1-3ec7ea27ae03

📥 Commits

Reviewing files that changed from the base of the PR and between 6380ef5 and 1b9ada6.

📒 Files selected for processing (4)
  • api/apps/restful_apis/chunk_api.py
  • conf/infinity_mapping.json
  • conf/mapping.json
  • docs/guides/agent/agent_quickstarts/sandbox_quickstart.md
💤 Files with no reviewable changes (1)
  • docs/guides/agent/agent_quickstarts/sandbox_quickstart.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • conf/mapping.json
  • conf/infinity_mapping.json

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
rag/utils/infinity_conn.py (1)

454-459: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add logging for the new chunk_metadata_kwd serialization flow.

The coding guidelines require logging for new flows in rag/**/*.py. This new serialization path for chunk_metadata_kwd lacks logging for cases where the value is unexpectedly not a dict or when serialization might fail. While the API layer validates inputs, this defensive branch may be reached by non-API callers (background jobs, migrations), and observability would help diagnose issues.

As per coding guidelines, add logging for new flows.

📊 Suggested logging addition
 elif k == "chunk_metadata_kwd":
     # chunk_metadata_kwd is a varchar column; serialize dicts to JSON.
     if isinstance(v, dict):
+        self.logger.debug(f"Serializing chunk_metadata_kwd as JSON for chunk {d.get('id', 'unknown')}")
         d[k] = json.dumps(v, ensure_ascii=False)
     else:
+        if v and not isinstance(v, str):
+            self.logger.warning(f"chunk_metadata_kwd has unexpected type {type(v).__name__} for chunk {d.get('id', 'unknown')}; using as-is")
         d[k] = v if v else ""
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rag/utils/infinity_conn.py` around lines 454 - 459, Add defensive logging
around the new chunk_metadata_kwd serialization: in rag/utils/infinity_conn.py
update the branch that handles "chunk_metadata_kwd" so that if v is not a dict
you log a warning with the key name and the unexpected value, and when
serializing (json.dumps) wrap it in try/except to catch and log exceptions
(including the exception message and the offending value) before falling back to
the existing d[k] = "" or d[k] = v behavior; use the module logger (e.g.
logging.getLogger(__name__) or the existing logger variable) and include
identifying context (key name "chunk_metadata_kwd" and the value) in the logs.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@rag/utils/infinity_conn.py`:
- Around line 454-459: Add defensive logging around the new chunk_metadata_kwd
serialization: in rag/utils/infinity_conn.py update the branch that handles
"chunk_metadata_kwd" so that if v is not a dict you log a warning with the key
name and the unexpected value, and when serializing (json.dumps) wrap it in
try/except to catch and log exceptions (including the exception message and the
offending value) before falling back to the existing d[k] = "" or d[k] = v
behavior; use the module logger (e.g. logging.getLogger(__name__) or the
existing logger variable) and include identifying context (key name
"chunk_metadata_kwd" and the value) in the logs.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3e3c9255-858c-4d52-8992-f1eda16afe4e

📥 Commits

Reviewing files that changed from the base of the PR and between 1b9ada6 and 6fa82e6.

📒 Files selected for processing (3)
  • api/apps/restful_apis/chunk_api.py
  • conf/mapping.json
  • rag/utils/infinity_conn.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • conf/mapping.json
  • api/apps/restful_apis/chunk_api.py

@dale053
dale053 force-pushed the feat/persistent-chunk-metadata-15725 branch from 77d4a91 to b782b37 Compare June 7, 2026 16:35
@yingfeng
yingfeng requested a review from KevinHuSh June 8, 2026 08:48
@KevinHuSh

Copy link
Copy Markdown
Contributor

Appreciations!
I've noticed you've change UI too.
Could you paste screen shot here to demostrate the scenario?

@dale053

dale053 commented Jun 8, 2026 •

Copy link
Copy Markdown
Contributor Author

Hi,@KevinHuSh.
This PR don't include UI changes.I have just pasted screen shot for it.
When you have a moment, could you please review this PR again?

@JinHai-CN

Copy link
Copy Markdown
Member

@dale053 would you please resolve the conflicts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💞 feature Feature request, pull request that fullfill a new feature. 🌈 python Pull requests that update Python code size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: persistent metadata for chunks