Skip to content

Docs: translate Chinese to English in agent/sandbox - #1

Closed
yuzhichang wants to merge 250 commits into
mainfrom
fix_doc_lang
Closed

yuzhichang wants to merge 250 commits into
mainfrom
fix_doc_lang

Conversation

@yuzhichang

Copy link
Copy Markdown
Owner

Summary

  • Translate Chinese text to English in the agent/sandbox directory
  • Remove Chinese comments (主账号ID) from code files
  • Translate MIGRATION_GUIDE.md completely to English
  • Translate QUICKSTART.md completely to English

Test plan

  • Verify no Chinese characters remain in agent/sandbox directory

🤖 Generated with Claude Code

JinHai-CN and others added 30 commits January 26, 2026 12:58
### What problem does this PR solve?

Improve performance slightly.

### Type of change

- [x] Refactoring
- [x] Performance Improvement

Signed-off-by: Jin Hai <[email protected]>
…ow#7322 (infiniflow#12823)

### What problem does this PR solve?

Feat: Add the history field to the agent's system variables. infiniflow#7322

### Type of change


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

Fixes parent chunking fails on DOCX files.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
… chunk saving failures. (infiniflow#12818)

### What problem does this PR solve?

Fix: Issues with metadata parameter addition failures and single-file
chunk saving failures.

### Type of change

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

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

This PR adds support to PaddleOCR-VL-1.5 interface to the PaddleOCR PDF
Parser.

### Type of change

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

Bump to infinity v0.7.0-dev2

### Type of change

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

---

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

Co-authored-by: Claude Sonnet 4.5 <[email protected]>
…lements (infiniflow#12830)

### What problem does this PR solve?

This PR updates and extends the german language support in the frontend.
Additionally two more elements are handled dynamically now. The
interactive Agent is also titled and described in german now.

### Type of change

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

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

Overlap cannot be properly applied.

### Type of change

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

Convert RAGFlow MCP server from sync to async.

### Type of change

- [x] Refactoring
- [x] Performance Improvement
### What problem does this PR solve?

If no `metadata_condition` parameter is given then don't load the
metadata of all documents into memory. Instead just pass `doc_ids` as
`None` to the `retrieval()` method, which means to use all documents of
the given datasets.

This is relevant if you have *a lot* of documents!

### Type of change

- [x] Performance Improvement
### What problem does this PR solve?
infiniflow#12674

### Type of change

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

## Description

This PR fixes issue infiniflow#12805 by adding validation to handle
whitespace-only questions in the `/retrieval` endpoint.

## Problem

Sending a single space `" "` as the `question` parameter to `/retrieval`
crashes the request with an `AssertionError`. This happens because:
1. The endpoint doesn't trim or validate the question parameter
2. A whitespace-only string is treated as valid input
3. The retrieval logic only checks for empty strings (which are falsy),
but `" "` is truthy
4. Invalid match expressions are constructed, causing an assertion
failure in the Elasticsearch layer

## Solution

- Trim whitespace from the question parameter before processing
- Return an empty result for whitespace-only or empty questions
- Prevents the AssertionError and provides expected behavior

## Changes

- Added whitespace trimming and validation in `api/apps/sdk/doc.py`
- Returns empty result early if question is empty after trimming

## Testing

- Tested with single space input - now returns empty result instead of
crashing
- Tested with empty string - returns empty result
- Tested with normal questions - works as expected

Fixes infiniflow#12805

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

Hunyuan cannot work properly

### Type of change

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

As title.

### Type of change

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

Signed-off-by: Jin Hai <[email protected]>
…nfiniflow#12855)

### What problem does this PR solve?

Added Redis port calculation and environment variable export to support
Redis service in test environment. The port is dynamically assigned
based on runner number to prevent conflicts during parallel test
execution. Removed by infiniflow#12685

### Type of change

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


### Type of change


- [x] Documentation Update
infiniflow#12845)

### What problem does this PR solve?

Refact: update description for max_token in embedding infiniflow#12792

### Type of change


- [x] Refactoring

Co-authored-by: Liu An <[email protected]>
Closes infiniflow#12803

### What problem does this PR solve?
The chat input textarea in the Chat UI (and Embed UI) has a fixed height
and cannot be resized, causing poor UX when users type messages longer
than 2 sentences. The input becomes cramped and difficult to read/edit.
**Root cause:** The `Textarea` component in
[NextMessageInput](cci:1://file:///ragflow/web/src/components/message-input/next.tsx:62:0-290:1)
had `resize-none` and `field-sizing-content` CSS classes that prevented
resizing, and the existing `autoSize` prop was not being utilized.

**Solution:** 
- Removed `resize-none` and `field-sizing-content` classes
- Added `autoSize={{ minRows: 1, maxRows: 8 }}` to enable auto-expand
- Added `max-h-40` class to limit maximum height to 160px
The textarea now auto-expands from 1 to 8 rows as users type longer
messages.

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

To notify developer use the correct release.

### Type of change

- [x] Documentation Update

Signed-off-by: Jin Hai <[email protected]>
…infiniflow#12864)

### What problem does this PR solve?

Refactor: Remove the brute-force deduplication method for agent logs.

### Type of change

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

infiniflow#12858

### Type of change

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

Add kimi-k2.5

### Type of change

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

## Summary

Implement a flexible sandbox provider system supporting both
self-managed (Docker) and SaaS (Aliyun Code Interpreter) backends for
secure code execution in agent workflows.

**Key Changes:**
- ✅ Aliyun Code Interpreter provider using official
`agentrun-sdk>=0.0.16`
- ✅ Self-managed provider with gVisor (runsc) security
- ✅ Arguments parameter support for dynamic code execution
- ✅ Database-only configuration (removed fallback logic)
- ✅ Configuration scripts for quick setup

Issue infiniflow#12479

## Features

### 🔌 Provider Abstraction Layer

**1. Self-Managed Provider** (`agent/sandbox/providers/self_managed.py`)
- Wraps existing executor_manager HTTP API
- gVisor (runsc) for secure container isolation
- Configurable pool size, timeout, retry logic
- Languages: Python, Node.js, JavaScript
- ⚠️ **Requires**: gVisor installation, Docker, base images

**2. Aliyun Code Interpreter**
(`agent/sandbox/providers/aliyun_codeinterpreter.py`)
- SaaS integration using official agentrun-sdk
- Serverless microVM execution with auto-authentication
- Hard timeout: 30 seconds max
- Credentials: `AGENTRUN_ACCESS_KEY_ID`, `AGENTRUN_ACCESS_KEY_SECRET`,
`AGENTRUN_ACCOUNT_ID`, `AGENTRUN_REGION`
- Automatically wraps code to call `main()` function

**3. E2B Provider** (`agent/sandbox/providers/e2b.py`)
- Placeholder for future integration

### ⚙️ Configuration System

- `conf/system_settings.json`: Default provider =
`aliyun_codeinterpreter`
- `agent/sandbox/client.py`: Enforces database-only configuration
- Admin UI: `/admin/sandbox-settings`
- Configuration validation via `validate_config()` method
- Health checks for all providers

### 🎯 Key Capabilities

**Arguments Parameter Support:**
All providers support passing arguments to `main()` function:
```python
# User code
def main(name: str, count: int) -> dict:
    return {"message": f"Hello {name}!" * count}

# Executed with: arguments={"name": "World", "count": 3}
# Result: {"message": "Hello World!Hello World!Hello World!"}
```

**Self-Describing Providers:**
Each provider implements `get_config_schema()` returning form
configuration for Admin UI

**Error Handling:**
Structured `ExecutionResult` with stdout, stderr, exit_code,
execution_time

## Configuration Scripts

Two scripts for quick Aliyun sandbox setup:

**Shell Script (requires jq):**
```bash
source scripts/configure_aliyun_sandbox.sh
```

**Python Script (interactive):**
```bash
python3 scripts/configure_aliyun_sandbox.py
```

## Testing

```bash
# Unit tests
uv run pytest agent/sandbox/tests/test_providers.py -v

# Aliyun provider tests
uv run pytest agent/sandbox/tests/test_aliyun_codeinterpreter.py -v

# Integration tests (requires credentials)
uv run pytest agent/sandbox/tests/test_aliyun_codeinterpreter_integration.py -v

# Quick SDK validation
python3 agent/sandbox/tests/verify_sdk.py
```

**Test Coverage:**
- 30 unit tests for provider abstraction
- Provider-specific tests for Aliyun
- Integration tests with real API
- Security tests for executor_manager

## Documentation

- `docs/develop/sandbox_spec.md` - Complete architecture specification
- `agent/sandbox/tests/MIGRATION_GUIDE.md` - Migration from legacy
sandbox
- `agent/sandbox/tests/QUICKSTART.md` - Quick start guide
- `agent/sandbox/tests/README.md` - Testing documentation

## Breaking Changes

⚠️ **Migration Required:**

1. **Directory Move**: `sandbox/` → `agent/sandbox/`
   - Update imports: `from sandbox.` → `from agent.sandbox.`

2. **Mandatory Configuration**: 
   - SystemSettings must have `sandbox.provider_type` configured
   - Removed fallback default values
- Configuration must exist in database (from
`conf/system_settings.json`)

3. **Aliyun Credentials**:
   - Requires `AGENTRUN_*` environment variables (not `ALIYUN_*`)
   - `AGENTRUN_ACCOUNT_ID` is now required (Aliyun primary account ID)

4. **Self-Managed Provider**:
   - gVisor (runsc) must be installed for security
   - Install: `go install gvisor.dev/gvisor/runsc@latest`

## Database Schema Changes

```python
# SystemSettings.value: CharField → TextField
api/db/db_models.py: Changed for unlimited config length

# SystemSettingsService.get_by_name(): Fixed query precision
api/db/services/system_settings_service.py: startswith → exact match
```

## Files Changed

### Backend (Python)
- `agent/sandbox/providers/base.py` - SandboxProvider ABC interface
- `agent/sandbox/providers/manager.py` - ProviderManager
- `agent/sandbox/providers/self_managed.py` - Self-managed provider
- `agent/sandbox/providers/aliyun_codeinterpreter.py` - Aliyun provider
- `agent/sandbox/providers/e2b.py` - E2B provider (placeholder)
- `agent/sandbox/client.py` - Unified client (enforces DB-only config)
- `agent/tools/code_exec.py` - Updated to use provider system
- `admin/server/services.py` - SandboxMgr with registry & validation
- `admin/server/routes.py` - 5 sandbox API endpoints
- `conf/system_settings.json` - Default: aliyun_codeinterpreter
- `api/db/db_models.py` - TextField for SystemSettings.value
- `api/db/services/system_settings_service.py` - Exact match query

### Frontend (TypeScript/React)
- `web/src/pages/admin/sandbox-settings.tsx` - Settings UI
- `web/src/services/admin-service.ts` - Sandbox service functions
- `web/src/services/admin.service.d.ts` - Type definitions
- `web/src/utils/api.ts` - Sandbox API endpoints

### Documentation
- `docs/develop/sandbox_spec.md` - Architecture spec
- `agent/sandbox/tests/MIGRATION_GUIDE.md` - Migration guide
- `agent/sandbox/tests/QUICKSTART.md` - Quick start
- `agent/sandbox/tests/README.md` - Testing guide

### Configuration Scripts
- `scripts/configure_aliyun_sandbox.sh` - Shell script (jq)
- `scripts/configure_aliyun_sandbox.py` - Python script

### Tests
- `agent/sandbox/tests/test_providers.py` - 30 unit tests
- `agent/sandbox/tests/test_aliyun_codeinterpreter.py` - Provider tests
- `agent/sandbox/tests/test_aliyun_codeinterpreter_integration.py` -
Integration tests
- `agent/sandbox/tests/verify_sdk.py` - SDK validation

## Architecture

```
Admin UI → Admin API → SandboxMgr → ProviderManager → [SelfManaged|Aliyun|E2B]
                                      ↓
                                  SystemSettings
```

## Usage

### 1. Configure Provider

**Via Admin UI:**
1. Navigate to `/admin/sandbox-settings`
2. Select provider (Aliyun Code Interpreter / Self-Managed)
3. Fill in configuration
4. Click "Test Connection" to verify
5. Click "Save" to apply

**Via Configuration Scripts:**
```bash
# Aliyun provider
export AGENTRUN_ACCESS_KEY_ID="xxx"
export AGENTRUN_ACCESS_KEY_SECRET="yyy"
export AGENTRUN_ACCOUNT_ID="zzz"
export AGENTRUN_REGION="cn-shanghai"
source scripts/configure_aliyun_sandbox.sh
```

### 2. Restart Service

```bash
cd docker
docker compose restart ragflow-server
```

### 3. Execute Code in Agent

```python
from agent.sandbox.client import execute_code

result = execute_code(
    code='def main(name: str) -> dict: return {"message": f"Hello {name}!"}',
    language="python",
    timeout=30,
    arguments={"name": "World"}
)

print(result.stdout)  # {"message": "Hello World!"}
```

## Troubleshooting

### "Container pool is busy" (Self-Managed)
- **Cause**: Pool exhausted (default: 1 container in `.env`)
- **Fix**: Increase `SANDBOX_EXECUTOR_MANAGER_POOL_SIZE` to 5+

### "Sandbox provider type not configured"
- **Cause**: Database missing configuration
- **Fix**: Run config script or set via Admin UI

### "gVisor not found"
- **Cause**: runsc not installed
- **Fix**: `go install gvisor.dev/gvisor/runsc@latest && sudo cp
~/go/bin/runsc /usr/local/bin/`

### Aliyun authentication errors
- **Cause**: Wrong environment variable names
- **Fix**: Use `AGENTRUN_*` prefix (not `ALIYUN_*`)

## Checklist

- [x] All tests passing (30 unit tests + integration tests)
- [x] Documentation updated (spec, migration guide, quickstart)
- [x] Type definitions added (TypeScript)
- [x] Admin UI implemented
- [x] Configuration validation
- [x] Health checks implemented
- [x] Error handling with structured results
- [x] Breaking changes documented
- [x] Configuration scripts created
- [x] gVisor requirements documented

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>

---------

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

Put document metadata in ES/Infinity.

Index name of meta data: ragflow_doc_meta_{tenant_id}

### Type of change

- [x] Refactoring
…infiniflow#12856)

### What problem does this PR solve?

When all fulltext_search_columns use explicit weight 0 (e.g. "col^0"),
weight_sum is 0 and dividing by it raises ZeroDivisionError. Use equal
weights 1/n when weight_sum <= 0 and n > 0; otherwise normalize as
before.

### Type of change

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

Fix: key error "content" infiniflow#12844

### Type of change

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

---------

Co-authored-by: Kevin Hu <[email protected]>
…mages smaller than 11px on any side during figure enhancement. (infiniflow#12868)

### What problem does this PR solve?
During figure enhancement, some cropped figure images are extremely
small. Sending these to the Image2Text/VLM provider fails with a 400
invalid_parameter_error because the image width/height must

be >10px. This aborts the enhancement step. This PR adds a minimal size
guard to skip tiny crops and continue processing.
<img width="1084" height="494" alt="image"
src="https://github.com/user-attachments/assets/ad074270-94e6-4571-91c8-37df85212639"
/>

### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
…niflow#12877)

Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.4.0 to 2.6.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/urllib3/urllib3/releases">urllib3's
releases</a>.</em></p>
<blockquote>
<h2>2.6.3</h2>
<h2>🚀 urllib3 is fundraising for HTTP/2 support</h2>
<p><a
href="https://sethmlarson.dev/urllib3-is-fundraising-for-http2-support">urllib3
is raising ~$40,000 USD</a> to release HTTP/2 support and ensure
long-term sustainable maintenance of the project after a sharp decline
in financial support. If your company or organization uses Python and
would benefit from HTTP/2 support in Requests, pip, cloud SDKs, and
thousands of other projects <a
href="https://opencollective.com/urllib3">please consider contributing
financially</a> to ensure HTTP/2 support is developed sustainably and
maintained for the long-haul.</p>
<p>Thank you for your support.</p>
<h2>Changes</h2>
<ul>
<li>Fixed a security issue where decompression-bomb safeguards of the
streaming API were bypassed when HTTP redirects were followed.
(CVE-2026-21441 reported by <a
href="https://github.com/D47A"><code>@​D47A</code></a>, 8.9 High,
GHSA-38jv-5279-wg99)</li>
<li>Started treating <code>Retry-After</code> times greater than 6 hours
as 6 hours by default. (<a
href="https://redirect.github.com/urllib3/urllib3/issues/3743">urllib3/urllib3#3743</a>)</li>
<li>Fixed <code>urllib3.connection.VerifiedHTTPSConnection</code> on
Emscripten. (<a
href="https://redirect.github.com/urllib3/urllib3/issues/3752">urllib3/urllib3#3752</a>)</li>
</ul>
<h2>2.6.2</h2>
<h2>🚀 urllib3 is fundraising for HTTP/2 support</h2>
<p><a
href="https://sethmlarson.dev/urllib3-is-fundraising-for-http2-support">urllib3
is raising ~$40,000 USD</a> to release HTTP/2 support and ensure
long-term sustainable maintenance of the project after a sharp decline
in financial support. If your company or organization uses Python and
would benefit from HTTP/2 support in Requests, pip, cloud SDKs, and
thousands of other projects <a
href="https://opencollective.com/urllib3">please consider contributing
financially</a> to ensure HTTP/2 support is developed sustainably and
maintained for the long-haul.</p>
<p>Thank you for your support.</p>
<h2>Changes</h2>
<ul>
<li>Fixed <code>HTTPResponse.read_chunked()</code> to properly handle
leftover data in the decoder's buffer when reading compressed chunked
responses. (<a
href="https://redirect.github.com/urllib3/urllib3/issues/3734">urllib3/urllib3#3734</a>)</li>
</ul>
<h2>2.6.1</h2>
<h2>🚀 urllib3 is fundraising for HTTP/2 support</h2>
<p><a
href="https://sethmlarson.dev/urllib3-is-fundraising-for-http2-support">urllib3
is raising ~$40,000 USD</a> to release HTTP/2 support and ensure
long-term sustainable maintenance of the project after a sharp decline
in financial support. If your company or organization uses Python and
would benefit from HTTP/2 support in Requests, pip, cloud SDKs, and
thousands of other projects <a
href="https://opencollective.com/urllib3">please consider contributing
financially</a> to ensure HTTP/2 support is developed sustainably and
maintained for the long-haul.</p>
<p>Thank you for your support.</p>
<h2>Changes</h2>
<ul>
<li>Restore previously removed <code>HTTPResponse.getheaders()</code>
and <code>HTTPResponse.getheader()</code> methods. (<a
href="https://redirect.github.com/urllib3/urllib3/issues/3731">#3731</a>)</li>
</ul>
<h2>2.6.0</h2>
<h2>🚀 urllib3 is fundraising for HTTP/2 support</h2>
<p><a
href="https://sethmlarson.dev/urllib3-is-fundraising-for-http2-support">urllib3
is raising ~$40,000 USD</a> to release HTTP/2 support and ensure
long-term sustainable maintenance of the project after a sharp decline
in financial support. If your company or organization uses Python and
would benefit from HTTP/2 support in Requests, pip, cloud SDKs, and
thousands of other projects <a
href="https://opencollective.com/urllib3">please consider contributing
financially</a> to ensure HTTP/2 support is developed sustainably and
maintained for the long-haul.</p>
<p>Thank you for your support.</p>
<h2>Security</h2>
<ul>
<li>Fixed a security issue where streaming API could improperly handle
highly compressed HTTP content (&quot;decompression bombs&quot;) leading
to excessive resource consumption even when a small amount of data was
requested. Reading small chunks of compressed data is safer and much
more efficient now. (CVE-2025-66471 reported by <a
href="https://github.com/Cycloctane"><code>@​Cycloctane</code></a>, 8.9
High, GHSA-2xpw-w6gg-jr37)</li>
<li>Fixed a security issue where an attacker could compose an HTTP
response with virtually unlimited links in the
<code>Content-Encoding</code> header, potentially leading to a denial of
service (DoS) attack by exhausting system resources during decoding. The
number of allowed chained encodings is now limited to 5. (CVE-2025-66418
reported by <a
href="https://github.com/illia-v"><code>@​illia-v</code></a>, 8.9 High,
GHSA-gm62-xv2j-4w53)</li>
</ul>
<blockquote>
<p>[!IMPORTANT]</p>
<ul>
<li>If urllib3 is not installed with the optional
<code>urllib3[brotli]</code> extra, but your environment contains a
Brotli/brotlicffi/brotlipy package anyway, make sure to upgrade it to at
least Brotli 1.2.0 or brotlicffi 1.2.0.0 to benefit from the security
fixes and avoid warnings. Prefer using <code>urllib3[brotli]</code> to
install a compatible Brotli package automatically.</li>
</ul>
</blockquote>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/urllib3/urllib3/blob/main/CHANGES.rst">urllib3's
changelog</a>.</em></p>
<blockquote>
<h1>2.6.3 (2026-01-07)</h1>
<ul>
<li>Fixed a high-severity security issue where decompression-bomb
safeguards of
the streaming API were bypassed when HTTP redirects were followed.
(<code>GHSA-38jv-5279-wg99
&lt;https://github.com/urllib3/urllib3/security/advisories/GHSA-38jv-5279-wg99&gt;</code>__)</li>
<li>Started treating <code>Retry-After</code> times greater than 6 hours
as 6 hours by
default. (<code>[infiniflow#3743](urllib3/urllib3#3743)
&lt;https://github.com/urllib3/urllib3/issues/3743&gt;</code>__)</li>
<li>Fixed <code>urllib3.connection.VerifiedHTTPSConnection</code> on
Emscripten.
(<code>[infiniflow#3752](urllib3/urllib3#3752)
&lt;https://github.com/urllib3/urllib3/issues/3752&gt;</code>__)</li>
</ul>
<h1>2.6.2 (2025-12-11)</h1>
<ul>
<li>Fixed <code>HTTPResponse.read_chunked()</code> to properly handle
leftover data in
the decoder's buffer when reading compressed chunked responses.
(<code>[infiniflow#3734](urllib3/urllib3#3734)
&lt;https://github.com/urllib3/urllib3/issues/3734&gt;</code>__)</li>
</ul>
<h1>2.6.1 (2025-12-08)</h1>
<ul>
<li>Restore previously removed <code>HTTPResponse.getheaders()</code>
and
<code>HTTPResponse.getheader()</code> methods.
(<code>[infiniflow#3731](urllib3/urllib3#3731)
&lt;https://github.com/urllib3/urllib3/issues/3731&gt;</code>__)</li>
</ul>
<h1>2.6.0 (2025-12-05)</h1>
<h2>Security</h2>
<ul>
<li>Fixed a security issue where streaming API could improperly handle
highly
compressed HTTP content (&quot;decompression bombs&quot;) leading to
excessive resource
consumption even when a small amount of data was requested. Reading
small
chunks of compressed data is safer and much more efficient now.
(<code>GHSA-2xpw-w6gg-jr37
&lt;https://github.com/urllib3/urllib3/security/advisories/GHSA-2xpw-w6gg-jr37&gt;</code>__)</li>
<li>Fixed a security issue where an attacker could compose an HTTP
response with
virtually unlimited links in the <code>Content-Encoding</code> header,
potentially
leading to a denial of service (DoS) attack by exhausting system
resources
during decoding. The number of allowed chained encodings is now limited
to 5.
(<code>GHSA-gm62-xv2j-4w53
&lt;https://github.com/urllib3/urllib3/security/advisories/GHSA-gm62-xv2j-4w53&gt;</code>__)</li>
</ul>
<p>.. caution::</p>
<ul>
<li>If urllib3 is not installed with the optional
<code>urllib3[brotli]</code> extra, but
your environment contains a Brotli/brotlicffi/brotlipy package anyway,
make
sure to upgrade it to at least Brotli 1.2.0 or brotlicffi 1.2.0.0 to
benefit from the security fixes and avoid warnings. Prefer using</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/urllib3/urllib3/commit/0248277dd7ac0239204889ca991353ad3e3a1ddc"><code>0248277</code></a>
Release 2.6.3</li>
<li><a
href="https://github.com/urllib3/urllib3/commit/8864ac407bba8607950025e0979c4c69bc7abc7b"><code>8864ac4</code></a>
Merge commit from fork</li>
<li><a
href="https://github.com/urllib3/urllib3/commit/70cecb27ca99d56aaaeb63ac27ee270ef2b24c5c"><code>70cecb2</code></a>
Fix Scorecard issues related to vulnerable dev dependencies (<a
href="https://redirect.github.com/urllib3/urllib3/issues/3755">#3755</a>)</li>
<li><a
href="https://github.com/urllib3/urllib3/commit/41f249abe1ef3e20768588969c4035aba060a359"><code>41f249a</code></a>
Move &quot;v2.0 Migration Guide&quot; to the end of the table of
contents (<a
href="https://redirect.github.com/urllib3/urllib3/issues/3747">#3747</a>)</li>
<li><a
href="https://github.com/urllib3/urllib3/commit/fd4dffd2fc544166b76151a2fa3d7b7c0eab540c"><code>fd4dffd</code></a>
Patch <code>VerifiedHTTPSConnection</code> for Emscripten (<a
href="https://redirect.github.com/urllib3/urllib3/issues/3752">#3752</a>)</li>
<li><a
href="https://github.com/urllib3/urllib3/commit/13f0bfd55e4468fe1ea9c6f809d3a87b0f93ebab"><code>13f0bfd</code></a>
Handle massive values in Retry-After when calculating time to sleep for
(<a
href="https://redirect.github.com/urllib3/urllib3/issues/3743">#3743</a>)</li>
<li><a
href="https://github.com/urllib3/urllib3/commit/8c480bf87bcefd321b3a1ae47f04e908b6b2ed7b"><code>8c480bf</code></a>
Bump actions/upload-artifact from 5.0.0 to 6.0.0 (<a
href="https://redirect.github.com/urllib3/urllib3/issues/3748">#3748</a>)</li>
<li><a
href="https://github.com/urllib3/urllib3/commit/4b40616e959c0a2c466e8075f2a785a9f99bb0c1"><code>4b40616</code></a>
Bump actions/cache from 4.3.0 to 5.0.1 (<a
href="https://redirect.github.com/urllib3/urllib3/issues/3750">#3750</a>)</li>
<li><a
href="https://github.com/urllib3/urllib3/commit/82b8479663d037d220c883f1584dd01a43bb273b"><code>82b8479</code></a>
Bump actions/download-artifact from 6.0.0 to 7.0.0 (<a
href="https://redirect.github.com/urllib3/urllib3/issues/3749">#3749</a>)</li>
<li><a
href="https://github.com/urllib3/urllib3/commit/34284cb01700bb7d4fdd472f909e22393e9174e2"><code>34284cb</code></a>
Mention experimental features in the security policy (<a
href="https://redirect.github.com/urllib3/urllib3/issues/3746">#3746</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/urllib3/urllib3/compare/2.4.0...2.6.3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=urllib3&package-manager=uv&previous-version=2.4.0&new-version=2.6.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/infiniflow/ragflow/network/alerts).

</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…nfiniflow#12878)

Bumps [starlette](https://github.com/Kludex/starlette) from 0.46.2 to
0.49.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/Kludex/starlette/releases">starlette's
releases</a>.</em></p>
<blockquote>
<h2>Version 0.49.1</h2>
<p>This release fixes a security vulnerability in the parsing logic of
the <code>Range</code> header in <code>FileResponse</code>.</p>
<p>You can view the full security advisory: <a
href="https://github.com/Kludex/starlette/security/advisories/GHSA-7f5h-v6xp-fcq8">GHSA-7f5h-v6xp-fcq8</a></p>
<h2>Fixed</h2>
<ul>
<li>Optimize the HTTP ranges parsing logic <a
href="https://github.com/Kludex/starlette/commit/4ea6e22b489ec388d6004cfbca52dd5b147127c5">4ea6e22b489ec388d6004cfbca52dd5b147127c5</a></li>
</ul>
<hr />
<p><strong>Full Changelog</strong>: <a
href="https://github.com/Kludex/starlette/compare/0.49.0...0.49.1">https://github.com/Kludex/starlette/compare/0.49.0...0.49.1</a></p>
<h2>Version 0.49.0</h2>
<h2>Added</h2>
<ul>
<li>Add <code>encoding</code> parameter to <code>Config</code> class <a
href="https://redirect.github.com/Kludex/starlette/pull/2996">#2996</a>.</li>
<li>Support multiple cookie headers in <code>Request.cookies</code> <a
href="https://redirect.github.com/Kludex/starlette/pull/3029">#3029</a>.</li>
<li>Use <code>Literal</code> type for <code>WebSocketEndpoint</code>
encoding values <a
href="https://redirect.github.com/Kludex/starlette/pull/3027">#3027</a>.</li>
</ul>
<h2>Changed</h2>
<ul>
<li>Do not pollute exception context in <code>Middleware</code> when
using <code>BaseHTTPMiddleware</code> <a
href="https://redirect.github.com/Kludex/starlette/pull/2976">#2976</a>.</li>
</ul>
<hr />
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/TheWesDias"><code>@​TheWesDias</code></a> made
their first contribution in <a
href="https://redirect.github.com/Kludex/starlette/pull/3017">Kludex/starlette#3017</a></li>
<li><a href="https://github.com/gmos2104"><code>@​gmos2104</code></a>
made their first contribution in <a
href="https://redirect.github.com/Kludex/starlette/pull/3027">Kludex/starlette#3027</a></li>
<li><a
href="https://github.com/secrett2633"><code>@​secrett2633</code></a>
made their first contribution in <a
href="https://redirect.github.com/Kludex/starlette/pull/2996">Kludex/starlette#2996</a></li>
<li><a
href="https://github.com/adam-sikora"><code>@​adam-sikora</code></a>
made their first contribution in <a
href="https://redirect.github.com/Kludex/starlette/pull/2976">Kludex/starlette#2976</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/Kludex/starlette/compare/0.48.0...0.49.0">https://github.com/Kludex/starlette/compare/0.48.0...0.49.0</a></p>
<h2>Version 0.48.0</h2>
<h2>Added</h2>
<ul>
<li>Add official Python 3.14 support <a
href="https://redirect.github.com/Kludex/starlette/pull/3013">#3013</a>.</li>
</ul>
<h2>Changed</h2>
<ul>
<li>Implement <a
href="https://www.rfc-editor.org/rfc/rfc9110">RFC9110</a> http status
names <a
href="https://redirect.github.com/Kludex/starlette/pull/2939">#2939</a>.</li>
</ul>
<hr />
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/yakimka"><code>@​yakimka</code></a> made
their first contribution in <a
href="https://redirect.github.com/Kludex/starlette/pull/2943">Kludex/starlette#2943</a></li>
<li><a href="https://github.com/mbeijen"><code>@​mbeijen</code></a> made
their first contribution in <a
href="https://redirect.github.com/Kludex/starlette/pull/2939">Kludex/starlette#2939</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/Kludex/starlette/compare/0.47.3...0.48.0">https://github.com/Kludex/starlette/compare/0.47.3...0.48.0</a></p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/Kludex/starlette/blob/main/docs/release-notes.md">starlette's
changelog</a>.</em></p>
<blockquote>
<h2>0.49.1 (October 28, 2025)</h2>
<p>This release fixes a security vulnerability in the parsing logic of
the <code>Range</code> header in <code>FileResponse</code>.</p>
<p>You can view the full security advisory: <a
href="https://github.com/Kludex/starlette/security/advisories/GHSA-7f5h-v6xp-fcq8">GHSA-7f5h-v6xp-fcq8</a></p>
<h4>Fixed</h4>
<ul>
<li>Optimize the HTTP ranges parsing logic <a
href="https://github.com/Kludex/starlette/commit/4ea6e22b489ec388d6004cfbca52dd5b147127c5">4ea6e22b489ec388d6004cfbca52dd5b147127c5</a></li>
</ul>
<h2>0.49.0 (October 28, 2025)</h2>
<h4>Added</h4>
<ul>
<li>Add <code>encoding</code> parameter to <code>Config</code> class <a
href="https://redirect.github.com/Kludex/starlette/pull/2996">#2996</a>.</li>
<li>Support multiple cookie headers in <code>Request.cookies</code> <a
href="https://redirect.github.com/Kludex/starlette/pull/3029">#3029</a>.</li>
<li>Use <code>Literal</code> type for <code>WebSocketEndpoint</code>
encoding values <a
href="https://redirect.github.com/Kludex/starlette/pull/3027">#3027</a>.</li>
</ul>
<h4>Changed</h4>
<ul>
<li>Do not pollute exception context in <code>Middleware</code> when
using <code>BaseHTTPMiddleware</code> <a
href="https://redirect.github.com/Kludex/starlette/pull/2976">#2976</a>.</li>
</ul>
<h2>0.48.0 (September 13, 2025)</h2>
<h4>Added</h4>
<ul>
<li>Add official Python 3.14 support <a
href="https://redirect.github.com/Kludex/starlette/pull/3013">#3013</a>.</li>
</ul>
<h4>Changed</h4>
<ul>
<li>Implement <a
href="https://www.rfc-editor.org/rfc/rfc9110">RFC9110</a> http status
names <a
href="https://redirect.github.com/Kludex/starlette/pull/2939">#2939</a>.</li>
</ul>
<h2>0.47.3 (August 24, 2025)</h2>
<h4>Fixed</h4>
<ul>
<li>Use <code>asyncio.iscoroutinefunction</code> for Python 3.12 and
older <a
href="https://redirect.github.com/Kludex/starlette/pull/2984">#2984</a>.</li>
</ul>
<h2>0.47.2 (July 20, 2025)</h2>
<h4>Fixed</h4>
<ul>
<li>Make <code>UploadFile</code> check for future rollover <a
href="https://redirect.github.com/Kludex/starlette/pull/2962">#2962</a>.</li>
</ul>
<h2>0.47.1 (June 21, 2025)</h2>
<h4>Fixed</h4>
<ul>
<li>Use <code>Self</code> in <code>TestClient.__enter__</code> <a
href="https://redirect.github.com/Kludex/starlette/pull/2951">#2951</a>.</li>
<li>Allow async exception handlers to type-check <a
href="https://redirect.github.com/Kludex/starlette/pull/2949">#2949</a>.</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/Kludex/starlette/commit/7e4b7428f273dbdc875dcd036d20804bcfc7b2ee"><code>7e4b742</code></a>
Version 0.49.1 (<a
href="https://redirect.github.com/Kludex/starlette/issues/3047">#3047</a>)</li>
<li><a
href="https://github.com/Kludex/starlette/commit/4ea6e22b489ec388d6004cfbca52dd5b147127c5"><code>4ea6e22</code></a>
Merge commit from fork</li>
<li><a
href="https://github.com/Kludex/starlette/commit/7d88ea6f8ec8aa99cdb5fc7a10b88db5aadfdfee"><code>7d88ea6</code></a>
Version 0.49.0 (<a
href="https://redirect.github.com/Kludex/starlette/issues/3046">#3046</a>)</li>
<li><a
href="https://github.com/Kludex/starlette/commit/26d66bbfb05c7bbecbbb57106c65f33682f8174e"><code>26d66bb</code></a>
Do not pollute exception context in Middleware (<a
href="https://redirect.github.com/Kludex/starlette/issues/2976">#2976</a>)</li>
<li><a
href="https://github.com/Kludex/starlette/commit/a59397db889e3a96c4f34b1406957a3b92e1e8b5"><code>a59397d</code></a>
Set encodings when reading config files (<a
href="https://redirect.github.com/Kludex/starlette/issues/2996">#2996</a>)</li>
<li><a
href="https://github.com/Kludex/starlette/commit/3b7f0cbf598be305528a498a35089ce723060372"><code>3b7f0cb</code></a>
test: add test for unknown status (<a
href="https://redirect.github.com/Kludex/starlette/issues/3035">#3035</a>)</li>
<li><a
href="https://github.com/Kludex/starlette/commit/b09ce1a99d352ee6f5b896597f03a1a57507afcd"><code>b09ce1a</code></a>
docs: fix legibility issues on sponsorship page (<a
href="https://redirect.github.com/Kludex/starlette/issues/3039">#3039</a>)</li>
<li><a
href="https://github.com/Kludex/starlette/commit/0f0edcf8007412d9536bf8714c5815ce8f5dba4b"><code>0f0edcf</code></a>
Revert &quot;Add Marcelo Trylesinski to the license (<a
href="https://redirect.github.com/Kludex/starlette/issues/3025">#3025</a>)&quot;
(<a
href="https://redirect.github.com/Kludex/starlette/issues/3044">#3044</a>)</li>
<li><a
href="https://github.com/Kludex/starlette/commit/3912d6313730cc6004dfb4436e37dbc1a81db7c8"><code>3912d63</code></a>
docs: add social icons (<a
href="https://redirect.github.com/Kludex/starlette/issues/3038">#3038</a>)</li>
<li><a
href="https://github.com/Kludex/starlette/commit/4915a9309fcad58ac08b9fa550563d3287b531ad"><code>4915a93</code></a>
Add discord to README/docs (<a
href="https://redirect.github.com/Kludex/starlette/issues/3034">#3034</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/Kludex/starlette/compare/0.46.2...0.49.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=starlette&package-manager=uv&previous-version=0.46.2&new-version=0.49.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/infiniflow/ragflow/network/alerts).

</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
lpflpf and others added 21 commits March 2, 2026 13:25
…iniflow#13306)

### What problem does this PR solve?

When using OceanBase as the document storage engine, parsing and
inserting chunks with chunk_data (e.g., table parser row data) fails
with the following error:
```
[ERROR][Exception]: Insert chunk error: ['Unconsumed column names: chunk_data']
This happens because the chunk_data column was recently introduced but was omitted from the EXTRA_COLUMNS list in 
rag/utils/ob_conn.py
```
As a result, the automatic schema migration for existing OceanBase
tables does not append the missing chunk_data column, causing the
underlying pyobvector or SQLAlchemy to raise an unconsumed column names
error during data insertion.

### Type of change

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

### What is the solution?
Added column_chunk_data to the EXTRA_COLUMNS list in 
```
rag/utils/ob_conn.py
```
This ensures that the OceanBase connection wrapper can correctly detect
the missing column and automatically alter existing chunk tables to
include the chunk_data field during initialization.
### What problem does this PR solve?

Fix: add soft limit for graph rag size infiniflow#13258 Q2

### Type of change

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

---------

Co-authored-by: Yingfeng <[email protected]>
…authentication (infiniflow#13151)

### What problem does this PR solve?

Enterprise deployments that use an external Identity Provider (e.g.,
Microsoft Entra ID, Okta, Keycloak) need the ability to enforce SSO-only
authentication by hiding the email/password login form. Currently, the
login page always shows the password form alongside OAuth buttons, with
no way to disable it.

This PR adds a `disable_password_login` configuration option under the
existing `authentication` section in `service_conf.yaml`. When set to
`true`, the login page only displays configured OAuth/SSO buttons and
hides the email/password form, "Remember me" checkbox, and "Sign up"
link.

The flag can be set via:
- `service_conf.yaml` (`authentication.disable_password_login: true`)
- Environment variable (`DISABLE_PASSWORD_LOGIN=true`)

Default behavior is unchanged (`false`).

### Behavior

| `disable_password_login` | OAuth configured | Result |
|---|---|---|
| `false` (default) | No | Standard email/password form |
| `false` | Yes | Email/password form + SSO buttons below |
| `true` | Yes | **SSO buttons only** (no form, no sign up link) |
| `true` | No | Empty card (admin should configure OAuth first) |

### Type of change

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

### Files changed (5)

1. `docker/service_conf.yaml.template` — added `disable_password_login:
false` under authentication
2. `common/settings.py` — added `DISABLE_PASSWORD_LOGIN` global variable
and loader in `init_settings()`
3. `common/config_utils.py` — fixed `TypeError` in `show_configs()` when
authentication section contains non-dict values (e.g., booleans)
4. `api/apps/system_app.py` — exposed `disablePasswordLogin` flag in
`/config` endpoint
5. `web/src/pages/login/index.tsx` — conditionally render password form
based on config flag; OAuth buttons always render when channels exist

---------

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

Summary:
This PR addresses critical indexing issues in
deepdoc/parser/pdf_parser.py that occur when parsing long PDFs with
chunk-based pagination:

Normalize rotated table page numbering: Rotated-table re-OCR now writes
page_number in chunk-local 1-based form, eliminating double-addition of
page_from offset that caused misalignment between table positions and
document boxes.
Convert absolute positions to chunk-local coordinates: When inserting
tables/figures extracted via _extract_table_figure, positions are now
converted from absolute (0-based) to chunk-local indices before distance
matching and box insertion. This prevents IndexError and out-of-range
accesses during paged parsing of long documents.

Root Cause:
The parser mixed absolute (0-based, document-global) and relative
(1-based, chunk-local) page numbering systems. Table/figure positions
from layout extraction carried absolute page numbers, but insertion
logic expected chunk-local coordinates aligned with self.boxes and
page_cum_height.


Testing(I do):

Manual verification: Parse a 200+ page PDF with from_page > 0 and table
rotation enabled. Confirm that:

Tables and figures appear on correct pages
No IndexError or position mismatches occur
Page numbers in output match expected chunk-local offsets


Automated testing: 我没做


## Separate Discussion: Memory Optimization Strategy(from codex-5.2-max
and claude 4.5 opus and me)

### Context

The current implementation loads entire page ranges into memory
(`__images__`, `page_chars`, intermediates), which can cause RAM
exhaustion on large documents. While the page numbering fix resolves
correctness issues, scalability remains a concern.

### Proposed Architecture

**Pipeline-Driven Chunking with Explicit Resource Management:**

1. **Authoritative chunk planning**: Accept page-range specifications
from upstream pipeline as the single source of truth. The parser should
be a stateless worker that processes assigned chunks without making
independent pagination decisions.

2. **Granular memory lifecycle**:
   ```python
   for chunk_spec in chunk_plan:
       # Load only chunk_spec.pages into __images__
       page_images = load_page_range(chunk_spec.start, chunk_spec.end)
       
       # Process with offset tracking
       results = process_chunk(page_images, offset=chunk_spec.start)
       
       # Explicit cleanup before next iteration
       del page_images, page_chars, layout_intermediates
       gc.collect()  # Force collection of large objects
   ```

3. **Persistent lightweight state**: Keep model instances (layout
detector, OCR engine), document metadata (outlines, PDF structure), and
configuration across chunks to avoid reinitialization overhead (~2-5s
per chunk for model loading).

4. **Adaptive fallback**: Provide `max_pages_per_chunk` (default: 50)
only when pipeline doesn't supply a plan. Never exceed
pipeline-specified ranges to maintain predictable memory bounds.

5. **Optional: Dynamic budgeting**: Expose a memory budget parameter
that adjusts chunk size based on observed image dimensions and format
(e.g., reduce chunk size for high-DPI scanned documents).

### Benefits

- **Predictable memory footprint**: RAM usage bounded by `chunk_size ×
avg_page_size` rather than total document size
- **Horizontal scalability**: Enables parallel chunk processing across
workers
- **Failure isolation**: Page extraction errors affect only current
chunk, not entire document
- **Cloud-friendly**: Works within container memory limits (e.g., 2-4GB
per worker)

### Trade-offs

- **Increased I/O**: Re-opening PDF for each chunk vs. keeping file
handle (mitigated by page-range seeks)
- **Complexity**: Requires careful offset tracking and stateful
coordination between pipeline and parser
- **Warmup cost**: Model initialization overhead amortized across chunks
(acceptable for documents >100 pages)

### Implementation Priority

This optimization should be **deferred to a separate PR** after the
current correctness fix is merged, as:
1. It requires broader architectural changes across the pipeline
2. Current fix is critical for correctness and can be backported
3. Memory optimization needs comprehensive benchmarking on
representative document corpus


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
…eocr parsers (infiniflow#13234)

## Summary

When using MinerU, docling, TCADP, or paddleocr as the PDF parser with
the General (naive) chunk method, the user-configured `chunk_token_num`
is **unconditionally overwritten to 0** at
[rag/app/naive.py#L858-L859](https://github.com/infiniflow/ragflow/blob/main/rag/app/naive.py#L858-L859),
effectively disabling chunk merging regardless of what the user sets in
the UI.

### Problem

A user sets `chunk_token_num = 2048` in the dataset configuration UI,
expecting small parser blocks to be merged into larger chunks. However,
this line:

```python
if name in ["tcadp", "docling", "mineru", "paddleocr"]:
    parser_config["chunk_token_num"] = 0
```

silently overrides the user's setting. As a result, every MinerU output
block becomes its own chunk. For short documents (e.g. a 3-page PDF fund
factsheet parsed by MinerU), this produces **47 tiny chunks** — some as
small as 11 characters (`"July 2025"`) or 15 characters (`"CIES
Eligible"`).

This severely degrades retrieval quality: vector embeddings of such
short fragments have minimal semantic value, and keyword search produces
excessive noise.

### Fix

Only apply the `chunk_token_num = 0` override when the user has **not**
explicitly configured a positive value:

```python
if name in ["tcadp", "docling", "mineru", "paddleocr"]:
    if int(parser_config.get("chunk_token_num", 0)) <= 0:
        parser_config["chunk_token_num"] = 0
```

This preserves the original default behavior (no merging) while
respecting the user's explicit configuration.

### Before / After (MinerU, 3-page PDF, chunk_token_num=2048)

| | Before | After |
|---|---|---|
| Chunks produced | 47 | ~8 (merged by token limit) |
| Smallest chunk | 11 chars | ~500 chars |
| User setting respected | No | Yes |

## Test plan

- [ ] Parse a PDF with MinerU and `chunk_token_num = 2048` → verify
chunks are merged up to token limit
- [ ] Parse a PDF with MinerU and `chunk_token_num = 0` (or default) →
verify original behavior (no merging)
- [ ] Parse a PDF with DeepDOC parser → verify no change in behavior
(not affected by this code path)
- [ ] Repeat with docling/paddleocr if available
### What problem does this PR solve?

Feat: add more models for siliconflow and tongyi-qwen

### Type of change


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

Feat: Support siliconflow.com

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
…nsole errors. (infiniflow#13314)

### What problem does this PR solve?

Feat: Modify the style of the classification operator and fix some
console errors.

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
…rtResume Pipeline) (infiniflow#13255)

Core optimizations (refer to arXiv:2510.09722):

1. PDF text fusion: Metadata + OCR dual-path extraction and fusion

2. Page-aware reconstruction: YOLOv10 page segmentation + hierarchical
sorting + line number indexing

3. Parallel task decomposition: Basic information/work
experience/educational background three-way parallel LLM extraction

4. Index pointer mechanism: LLM returns a range of line numbers instead
of generating the full text, reducing the illusion of full text.

---------

Co-authored-by: Aron.Yao <[email protected]>
Co-authored-by: Aron.Yao <[email protected]>
Co-authored-by: Yingfeng <[email protected]>
…ation (infiniflow#13315)

### What problem does this PR solve?

This PR adds end-to-end Arabic support in production. It also adds a
full Arabic README

### Type of change

 - [x] New Feature (non-breaking change which adds functionality)
 - [x] Documentation Update
…g sanitization (infiniflow#13318)

Potential fix for
[https://github.com/infiniflow/ragflow/security/code-scanning/71](https://github.com/infiniflow/ragflow/security/code-scanning/71)

In general, instead of using `String.prototype.includes` on the entire
URL string, parse the URL and make decisions based on its `host` (or
`hostname`) field. This avoids cases where the trusted domain appears in
the path, query, or as part of a different hostname.

Here, `payload.source_fid` is set to `'siliconflow_intl'` if
`postBody.base_url` “contains” `api.siliconflow.com`. To keep behavior
for correct inputs but close the hole, we should:

1. Safely parse `postBody.base_url` using the standard `URL` class.
2. Extract the hostname (`url.hostname`).
3. Compare it appropriately:
- If we only want the exact host `api.siliconflow.com`, use strict
equality.
- If international endpoints may include subdomains like
`foo.api.siliconflow.com`, allow those via suffix check on the hostname.
4. Fall back to `LLMFactory.SILICONFLOW` if parsing fails or the host
does not match.

Concretely, in `web/src/pages/user-setting/setting-model/hooks.tsx`, in
the `onApiKeySavingOk` callback where `payload.source_fid` is set,
replace the `toLowerCase().includes('api.siliconflow.com')` logic with a
small block that:

- Initializes a local `let sourceFid = LLMFactory.SILICONFLOW;`
- If `postBody.base_url` is present, attempts `new
URL(postBody.base_url)` inside a `try/catch`, lowercases `url.hostname`,
and checks whether it equals `api.siliconflow.com` or ends with
`.api.siliconflow.com`.
- Assigns `payload.source_fid = sourceFid`.

No new external dependencies are required; `URL` is available in modern
browsers and Node, and TypeScript understands it.


_Suggested fixes powered by Copilot Autofix. Review carefully before
merging._

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
### What problem does this PR solve?

Fix: Fixed some errors in the console
### Type of change

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

### What problem does this PR solve?

Fix AttributeError when calling llm.chat() in resume parser. LLMBundle
only has async_chat method, not chat method. Use `_run_coroutine_sync`
wrapper to call async_chat synchronously.

### Type of change

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

Fix: pipeline canvas category

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
…of a large model to a file. infiniflow#13321 (infiniflow#13326)

### What problem does this PR solve?

Fix: The document generation node cannot generate the output content of
a large model to a file. infiniflow#13321
### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
…d remove duplicate text (infiniflow#13323)

Cross-verify project experience and work experience, and remove
duplicate text

---------

Co-authored-by: Aron.Yao <[email protected]>
Co-authored-by: Aron.Yao <[email protected]>
### What problem does this PR solve?

Refactored documentation. 

### Type of change

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

Refactored the document architecture.

### Type of change

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

Playwright tests previously depended on cross-file execution order
(`auth -> provider -> dataset -> chat`).
This change makes setup explicit and idempotent via fixtures so tests
can run independently.

- Added/standardized prerequisite fixtures in
`test/playwright/conftest.py`:
- `ensure_auth_context`, `ensure_model_provider_configured`,
`ensure_dataset_ready`, `ensure_chat_ready`
- Made provisioning reusable/idempotent with `RUN_ID`-based resource
naming.
- Synced auth envs (`E2E_ADMIN_EMAIL`, `E2E_ADMIN_PASSWORD`) into seeded
creds.
- Fixed provider cache freshness (`auth_header`/`page` refresh on cache
hit).

Also included minimal stability fixes:
- dataset create stale-element click handling,
- search wait logic for results/empty-state,
- agent create-menu handling,
- agent run-step retry when run UI doesn’t open first click.

### Type of change

- [x] Test fix
- [x] Refactoring

---------

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

_Briefly describe what this PR aims to solve. Include background context
that will help reviewers understand the purpose of the PR._

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
For helm deployment, there is also requirement to enable the Admin
Service for administrative operations.
So expose the ability of enable/disable this function by helm
configuration.
        When it's enabled (by default),
<img width="486" height="190" alt="image"
src="https://github.com/user-attachments/assets/4db0dc3d-bd94-4ad9-bb5d-a240aac5e1c5"
/>
        Admin access and operations would be feasible like below,
<img width="2530" height="876" alt="image"
src="https://github.com/user-attachments/assets/3e948e1b-7522-4f8d-8dc0-c80a22242022"
/>
Something like 'user management' is very much important for Ragflow
User/Owner to control their clients.
Translate Chinese text to English in the agent/sandbox directory:
- Remove Chinese comments (主账号ID) from code files
- Translate MIGRATION_GUIDE.md completely to English
- Translate QUICKSTART.md completely to English

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@yuzhichang yuzhichang closed this Mar 4, 2026
yuzhichang pushed a commit that referenced this pull request Jun 1, 2026
…infiniflow#14849)

## What problem does this PR solve?

Closes infiniflow#12582.

When a Retrieval component sits inside an Iteration with a **manual**
metadata filter that references the iteration variable (e.g.
`{IterationItem:abc@item}`), every iteration reuses the value resolved
on the **first** pass.

Root cause: [`_resolve_manual_filter` in
`agent/tools/retrieval.py`](https://github.com/infiniflow/ragflow/blob/main/agent/tools/retrieval.py#L144-L171)
mutated `flt["value"]` in place. The `filters` list passed in is the
live `self._param.meta_data_filter["manual"]` (see
[`apply_meta_data_filter` in
`common/metadata_utils.py:257-261`](https://github.com/infiniflow/ragflow/blob/main/common/metadata_utils.py#L257-L261)),
so after the first iteration the param dict permanently held the
resolved string instead of the original variable reference.

```text
iter #1: flt["value"] = "{IterationItem:abc@item}"  →  resolved to "AI"
         after mutation: flt["value"] = "AI"        ← written back into _param

iter infiniflow#2: flt["value"] = "AI"                         ← no {…} matches
         retrieval keeps filtering by "AI" forever
```

This PR returns a shallow copy with the resolved value instead, leaving
the original filter (and its variable reference) intact for the next
iteration.

## Type of change

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

## Test plan

- [ ] Build an agent: `Agent (structured output → list of areas) →
Iteration → Retrieval (manual filter: Area = {IterationItem/Item}) →
Message`. Run with a multi-area query and confirm each iteration's
Retrieval result matches its own item, not the first item.
- [ ] Regression: Retrieval with a manual metadata filter outside an
Iteration still resolves the variable correctly on each request.
- [ ] Regression: Retrieval with no metadata filter and with `auto` /
`semi_auto` filters behave unchanged.
yuzhichang added a commit that referenced this pull request Jun 14, 2026
三个 review 修:

1. **High: v1 export → re-import drops components**.
   use-export-json.ts 之前用
   `pick(buildDslData(), ['graph','globals','variables'])`,把所有 mode
   都把 `components` 字段剥掉。v2 重导入从 graph 重建 components
   是 OK 的,但 v1 没有 graph、components 是 source of truth,所以
   v1 文件再导回时 `buildV1DslFromImport` 走 `raw.components ?? seed.components`,
   seed 只剩 Begin 节点,3 个组件全丢。
   修:use-export-json.ts 不再 pick,直接用 `exportDsl` 输出(它已经
   按 mode 返回正确 shape: v1 含 components + _layout + retrieval
   + history + path + variables + globals;v2 含 graph + components
   + globals + variables)。

2. **High: v1 import drops _layout**.
   buildV1DslFromImport 没把 `raw._layout` 复制到返回的 DSL。
   即便 #1 修了 export 包含 _layout,re-import 时也丢,用户拖
   拽过的节点位置全失。
   修:buildV1DslFromImport 现在 `_layout: raw._layout` 一并拷回。

3. **Medium: launch_backend_service.sh 没起 admin_server.py**。
   hybrid 模式下,vite proxy 把
   `/api/v1/admin/sandbox\|roles\|roles_with_permission\|whitelist\|variables`
   路由到 9381,但 launcher 只起 9380 (ragflow_server.py) 与可选的
   Go admin,Python admin (admin/server/admin_server.py) 没人监听。
   修:新增 `run_admin_server` 函数,按 `ENABLE_ADMIN_SERVER=1` 起
   admin_server.py,与 entrypoint.sh:308-315 行为对齐。

测试:
- 加 2 个 round-trip case (`v1 export → importDsl` 与
  `v2 export → importDsl`),确保 export/import 闭环在两种
  mode 下都保留 components、_layout(或 graph)。
- 仓库 jest infra 仍坏,case ship,等 npm 依赖补齐。

验证:
- npx tsc --noEmit: 0 errors in my files
yuzhichang added a commit that referenced this pull request Jun 14, 2026
…n the canvas

The front-end renders the agent canvas from data.dsl.graph.nodes/edges
(via useFetchDataOnMount -> useSetGraphInfo). Three DSL shapes can be
stored in user_canvas.dsl and only one of them already has the graph
block populated:

  1. Front-end v2 - {graph: {nodes, edges}, components: {...}}. No-op.
  2. Python v1    - {components: {"Name:UUID": {downstream, upstream,
                    obj: {component_name, params}}}}. No graph; the
                    v1 DSL upload path in use-import-json.ts used to
                    silently drop the components because the front-end
                    treated the whole v1 object as a graph (no
                    nodes/edges keys) and never invoked
                    buildDslComponentsByGraph.
  3. Go v2        - {version: 2, components: {name_id: {id, name,
                    downstream, params}}}. Components live but the
                    React-Flow-shaped graph is missing.

Without a graph block, useSetGraphInfo destructures nodes=[] / edges=[]
from the missing key and short-circuits, so the canvas is blank; any
subsequent auto-save (useWatchAgentChange, 20s debounce) or manual
save (open debug drawer) overwrites the stored DSL with empty
components/graph.

NormalizeForCanvas in internal/agent/dsl/normalize.go is the single
entry point. It is idempotent and never mutates its input:

  - nil in, nil out
  - already-renderable (graph.nodes non-empty): no-op
  - empty / components={}: no-op
  - v1 or Go-v2: synthesise nodes (id, type from component_name,
    position 50+350i, data.label/data.name/data.form) and edges
    (source/target from downstream), plus a flat normalized components
    map for downstream consumers

Wired on both the write path (service.AgentService.CreateAgent /
UpdateAgent) and the read path (handler.AgentHandler.GetAgent) so
historical v1 / Go-v2-only rows in user_canvas.dsl become renderable
on the next GET without a migration.

Tests:
  - normalize_test.go: 16 cases covering nil/empty/already-renderable
    no-op, Go-v2, v1 round-trip via testdata/v1_examples/exesql.json
    (3 nodes, 3 edges, cycle preserved), purity (no input mutation),
    and every v1 fixture (7 files) must end up with one node per
    component.
  - go test ./internal/agent/... ./internal/service/... ./internal/handler/...
    1364 passed in 14 packages.

feat(agent): front-end v1/v2 mode switch by API_PROXY_SCHEME

front-end 现在按 `API_PROXY_SCHEME` 严格二选一:
- python → 仅 v1 (no graph, components + _layout round-trip)
- hybrid|go|空|自定义 → 仅 v2 (no _layout, graph + components)

核心: `web/src/pages/agent/utils/dsl-bridge.ts` 编译时常量
`DSL_MODE` 把所有 v1/v2 模式判定与转换集中到一个模块;消费者
文件不再分支 API_PROXY_SCHEME,统一调 bridge。

consumer 重构 (6 file):
- use-import-json.ts: 删手工拼装 → bridge.inferIsAgentFromImport +
  bridge.importDsl
- use-fetch-data.ts: data.dsl.graph → bridge.dslToGraph
- use-build-dsl.ts: 整段拼装 → bridge.graphToDsl
- use-export-json.ts: pick buildDslData() → pick bridge.exportDsl()
- use-create-agent.ts: EmptyDsl/DataflowEmptyDsl → bridge.initialEmptyDsl

v1 模式承载画布位置:
- 用 `dsl._layout` 字段随 components 一起发 server;Python server
  不解析 _ 前缀字段,经 Peewee JSONField 透传 round-trip
- 读路径优先 dsl._layout,没有时回退到 v1ComponentsToGraph
  (Go internal/agent/dsl/normalize.go 的 TS 移植,~60 行)

DSL interface 加 `_layout?: IGraph` 字段;EmptyDsl/EmptyDslV1
/DataflowEmptyDslV1 仍走隐式 literal type,bridge 入口用
as unknown as DSL 收口。

Docker entrypoint 修复 (3 处):
- L302: bin/server_main → bin/ragflow_server
- L297/L317: `if [[ API_PROXY_SCHEME == "hybrid" ]]` 扩为
  `hybrid || go`,让 go 模式启动 Go main + Go admin
- docker/launch_backend_service.sh: 新增 run_go_servers 段,
  hybrid|go 模式下起 bin/ragflow_server + bin/admin_server
- docker/nginx/ragflow.conf.golang: `^/(v1|api)` 代理从 9382
  (Python MCP) 改到 9384 (Go main)

测试:
- web/src/pages/agent/utils/tests/dsl-bridge.test.ts: 13 个 jest
  case 覆盖 python/hybrid/go/''/undefined 五种 scheme
- 仓库 jest 基础设施坏 (jest.config.ts 引用缺失的 umi/test,
  @babel/preset-* 也未装),测试无法本地跑,先 ship 文件

验证:
- npx tsc --noEmit: 0 errors in my files
- npm run build: 0 errors,12 069 modules transformed

fix(agent): v1 export/import round-trip + admin_server.py startup

三个 review 修:

1. **High: v1 export → re-import drops components**.
   use-export-json.ts 之前用
   `pick(buildDslData(), ['graph','globals','variables'])`,把所有 mode
   都把 `components` 字段剥掉。v2 重导入从 graph 重建 components
   是 OK 的,但 v1 没有 graph、components 是 source of truth,所以
   v1 文件再导回时 `buildV1DslFromImport` 走 `raw.components ?? seed.components`,
   seed 只剩 Begin 节点,3 个组件全丢。
   修:use-export-json.ts 不再 pick,直接用 `exportDsl` 输出(它已经
   按 mode 返回正确 shape: v1 含 components + _layout + retrieval
   + history + path + variables + globals;v2 含 graph + components
   + globals + variables)。

2. **High: v1 import drops _layout**.
   buildV1DslFromImport 没把 `raw._layout` 复制到返回的 DSL。
   即便 #1 修了 export 包含 _layout,re-import 时也丢,用户拖
   拽过的节点位置全失。
   修:buildV1DslFromImport 现在 `_layout: raw._layout` 一并拷回。

3. **Medium: launch_backend_service.sh 没起 admin_server.py**。
   hybrid 模式下,vite proxy 把
   `/api/v1/admin/sandbox\|roles\|roles_with_permission\|whitelist\|variables`
   路由到 9381,但 launcher 只起 9380 (ragflow_server.py) 与可选的
   Go admin,Python admin (admin/server/admin_server.py) 没人监听。
   修:新增 `run_admin_server` 函数,按 `ENABLE_ADMIN_SERVER=1` 起
   admin_server.py,与 entrypoint.sh:308-315 行为对齐。

测试:
- 加 2 个 round-trip case (`v1 export → importDsl` 与
  `v2 export → importDsl`),确保 export/import 闭环在两种
  mode 下都保留 components、_layout(或 graph)。
- 仓库 jest infra 仍坏,case ship,等 npm 依赖补齐。

验证:
- npx tsc --noEmit: 0 errors in my files

test(agent): add go-mode v2 DSL E2E pytest + tolerate Python/Go error message variants

After the front-end v1/v2 mode split (288c32e), end-to-end coverage of the
go-mode code path was missing — only manual curl + the dsl-bridge jest tests
(which don't even run because the jest config is broken) existed.

This commit closes that gap with two changes, both relying on existing
fixtures (register/login/auth/token/rest_client) that already speak the
RSA-encrypted-password + itsdangerous-signed-token contract the Go server
requires — zero fixture changes needed.

* New test/testcases/restful_api/test_agents_go_mode.py (~50 lines, p2)
  - Skipped unless API_PROXY_SCHEME=go
  - Hits the real bin/ragflow_server on 9384 via HOST_ADDRESS override
  - Round-trips a v2 DSL (graph + components, NO _layout) and asserts the
    moved begin-node position (777, 888) is preserved through POST → GET →
    PUT → GET

* test_agents.py: test_agents_crud_validation_contract now accepts either
  the Python server's 'Only the owner of the agent is authorized...' or
  the Go server's 'Make sure you have permission to access the agent.' for
  code=103. Code remains the source of truth.

* .github/workflows/tests.yml: new 'Run go-mode v2 DSL E2E against Go main
  server' step at the end of ragflow_tests. Reuses the already-built Go
  server, the already-up docker-compose stack, and the existing pytest
  fixtures. Pointed at GO_HTTP_PORT (not SVR_HTTP_PORT) and explicitly sets
  API_PROXY_SCHEME=go. Also re-runs the existing test_agents.py against
  the Go server to catch any other shared-contract regressions.

For local repro:
  API_PROXY_SCHEME=go HOST_ADDRESS=http://127.0.0.1:9384 \
    pytest -s --tb=short test/testcases/restful_api/test_agents_go_mode.py

Verified locally with bin/ragflow_server + bin/admin_server running and
web/.env.development switched to API_PROXY_SCHEME=go; both files pass.
yuzhichang added a commit that referenced this pull request Jun 16, 2026
…ase 4.4 V2 step 1)

Phase 4.4 V2 wiring begins. This commit lands the two foundational
pieces (decoder + option injection) that the V2 RunFunc will
compose in commit 2 (real canvas.Compile / Workflow.Invoke).

What's wired:

  decodeCanvasFromDSL (internal/service/canvas_decode.go)
    Converts the normalised DSL map (top-level 'components' /
    'path' / 'globals') into a *canvas.Canvas via JSON round-trip.
    All failure modes (empty DSL, malformed JSON, no components)
    wrap ErrAgentStorageError so mapAgentError classifies them as
    CodeServerError (500) with a sanitized message — no raw
    decoder-string leak to the client.

    Decoder strategy: JSON round-trip rather than hand-rolled
    mapstructure walker. Trade-off documented in the file: one
    extra encode/decode pass per RunAgent call, but unmarshal is
    the source of truth for field-name drift between Python's
    emitter and Go's struct, and hand-rolled mapping is the #1
    source of drift regressions in this codebase. Profile-driven
    swap to direct mapstructure can land in Phase 4.4 V2.1.

  AgentService option injection (internal/service/agent.go)
    Adds 3 optional fields to AgentService:
      - checkpointStore canvas.CheckPointStore
      - stateSerializer canvas.StateSerializer
      - runTracker *canvas.RunTracker
    Plus a new NewAgentServiceWithOptions(cp, ser, rt) constructor
    that injects them. The zero-arg NewAgentService() is preserved
    as a thin wrapper that calls NewAgentServiceWithOptions(nil,
    nil, nil) — every existing call site (cmd/server_main.go, all
    service + handler tests) keeps compiling.

    nil options = in-memory / no-tracking test path. Production
    boot wiring (cmd/server_main.go wiring the Redis-backed
    stores) is deferred to v3.6.0 so this commit stays
    CI-deterministic; the injection seam is in place so v3.6.0 is
    a 5-line boot change.

Tests added (8 sub-tests, all pass):
  TestDecodeCanvasFromDSL_EmptyDSL           — nil map -> ErrAgentStorageError
  TestDecodeCanvasFromDSL_EmptyMapSameAsNil  — empty map -> ErrAgentStorageError
  TestDecodeCanvasFromDSL_SingleComponent    — happy path, 1 component
  TestDecodeCanvasFromDSL_MultiComponent     — Begin→Retrieval→Message round-trip
  TestDecodeCanvasFromDSL_NoComponents       — non-empty map w/o components -> ErrAgentStorageError
  TestDecodeCanvasFromDSL_GlobalsPreserved   — top-level metadata keys survive
  TestNewAgentServiceWithOptions_NilOptions  — nil options produce usable service
  TestNewAgentService_DefaultsToNilOptions   — legacy zero-arg == explicit nil

Driver type was already *canvas.Runner (commit af2ac2e-era
merge). Field rename (s.driver -> s.runner) is cosmetic noise —
deferred.

Stale 'orchestrator' comments in agent_test.go and
agent_wait_for_user_test.go updated to refer to canvas.Runner.

Plan: .claude/plans/runagent-phase-4.4-v2.md §10 commit 2.
Build: clean. Test del: 295 -> 303 passed in internal/service/.

Co-Authored-By: Claude <[email protected]>
yuzhichang added a commit that referenced this pull request Jun 16, 2026
…done

Records the v3.6.1 implementation pass (4 commits, 21 new tests,
0 regressions). §11.8.5 v3.6.1 closing section + revision-history
v3.6.1 entry + §11.9 test count summary updated to reflect:

  - Gap infiniflow#2: RunTracker.AttachCheckpoint call-sequence test
  - Gap infiniflow#3: Phase 8b real TTS model-provider dispatch
  - Gap infiniflow#4: Phase 6 OQ infiniflow#6 per-class timeout integration
  - Gap infiniflow#5: LLM retry normal-absolute-count semantics

Item #1 (Resume e2e run-2 message production) deferred to v3.6.2
— eino UserFillUp second-pass is genuinely an eino-internal
concern, not a Go-side bug. Plumbing is fully verified by the
existing TestRunAgent_RealCanvas_WaitForUserResume run-1.

Test count: 1381 → 1402 passed (4 affected packages).
Build: clean across cmd/..., internal/agent/...,
internal/service/..., internal/handler/....

Co-Authored-By: Claude <[email protected]>
yuzhichang added a commit that referenced this pull request Jun 16, 2026
…eino's InternalSerializer

Closes the last v3.6.1 §11.8.4 item (Resume e2e run-2 message
production). The v3.5.2 / v3.6.0 / v3.6.1 gap analyses
misclassified this as an "eino UserFillUp second-pass limitation";
the actual cause was a RAGFlow wrapper incompatibility.

  Root cause:
    cmd/server_main.go:buildAgentRunOptions wired a plain-JSON
    CanvasStateSerializer via compose.WithSerializer. eino's
    default InternalSerializer uses a tagged envelope with a
    type registry (sonic + _eino_* tags) and is the only
    implementation that round-trips eino's internal checkpoint
    state (which includes unexported channel types). RAGFlow's
    json.Marshal/Unmarshal cannot produce bytes the InternalSerializer
    can decode back — run 2's load-checkpoint path errors with
    "cannot unmarshal object into Go struct field
    checkpoint.Channels of type compose.channel". The symptom
    manifests as a fresh interrupt on run 2 instead of a
    resume, because the checkpoint state is never restored.

  Fix (3 changes):

  1. cmd/server_main.go: buildAgentRunOptions leaves
     stateSerializer as nil. eino's default InternalSerializer
     already knows about runtime.CanvasState via
     compose.RegisterSerializableType[CanvasState] (registered in
     runtime/state.go:init in commit 617f375), so the default
     is correct and compatible with the checkpoint format.

  2. service.AgentService.buildRunFunc: decouples
     WithCheckPointStore from WithStateSerializer. Previously
     the condition was "store != nil && serializer != nil";
     now it's a 3-way switch (both / store only / neither) so
     production deployments that pass a store without a
     serializer get the checkpoint wiring without overriding
     the eino default.

  3. internal/service/runagent_phase_4_4_v2_test.go:
     TestRunAgent_RealCanvas_WaitForUserResume now wires a real
     Redis-backed checkpoint store + tracker (same pattern as
     the AttachCheckpoint test from commit c86bc45) and
     passes nil for the serializer. The test now exercises the
     full two-node resume cycle:

       Run 1: UserFillUp interrupts → waiting_for_user SSE.
       Run 2: UserFillUp is the resume target → returns the
              resume data as output → downstream Message
              renders "got: my follow-up".

     The previous v3.6.0 test tolerated run-2 producing 0
     messages and a fresh waiting_for_user; both expectations
     are now strict. The test can no longer pass against the
     broken serializer or the v3.5.2 / v3.6.0 misconfiguration.

  Evidence: /tmp/eino-repro/repro_test.go (NOT committed —
  left in /tmp for future re-verification) is a minimal
  eino-only repro of the same two-node pattern with the SAME
  eino library version. That test passes without any
  RAGFlow-side code, proving eino's resume API is correct
  when given a real CheckPointStore + CheckPointID. The
  difference between that test and the production test is
  exactly the CanvasStateSerializer override.

  v3.6.1 §11.8.4 net status: 5 of 5 items closed.

Test count delta: 1402 → 1403 passed (1 new assertion: the
strict run-2 message count). No regressions.

Co-Authored-By: Claude <[email protected]>
yuzhichang added a commit that referenced this pull request Jun 17, 2026
…orts, sandbox admin-panel reader, and design-doc cleanup

This squashes 31 commits into one. It closes the agent canvas Phase 4.4
V2 (eino interrupt + check-pointing), the v3.5 implementation pass that
ported all 21 Python agent components + cycle handling to Go, the v3.5.1
production-wiring audit, the v3.5.2 silent-regression sweep, the v3.6
runtime/boot goals, the v3.6.1 next-round gap closures, the §14 admin-
panel sandbox gap, and the design-doc hygiene pass.

================================================================================
1. v3.5 — DSL convergence + 5 implementation items (cb608f0b3, b66a9738f)
================================================================================

refactor(agent): converge Go/Web DSL to single wire shape, drop v1/v2
  - `internal/agent/dsl/`: single wire shape consumed by both Go and
    React; replaces the divergent v1 (raw `dsl` map) and v2 (wrapped
    `graph` envelope) shapes that the two sides had drifted into.
  - `web/src/pages/agent/utils/dsl-bridge.ts`: 223 lines of bridge
    helpers (forward + reverse); 373-line Jest pinning both directions.
  - `web/src/pages/agent/hooks/use-build-dsl.ts`, `use-export-json.ts`,
    `use-import-json.ts`, `use-fetch-data.ts`: dropped the legacy
    branches.
  - `web/src/utils/canvas-util.tsx`, `file-util.ts`: call-site cleanup.
  - `internal/agent/component/v1_stubs.go` → `fixture_stubs.go` (rename
    reflects new role as the test-only fixture registry, not a v1
    parser).
  - `tools/migrate-canvas/` (185 LOC) and `tools/gen-component-parity/`
    (175 LOC) added as standalone binaries; parity-generator ships as a
    placeholder per OQ infiniflow#3 — no live migration of legacy canvases is
    expected from the tool.

feat(agent): v3.5 implementation pass — close P0-blocker + 4 P1 items
  (closes §11.5 of .claude/plans/agent-go-port-gap-analysis.md)
  - **P0 — Phase 4.4 orchestrator side**: `internal/agent/orchestrator/`
    added — `Driver` (in-memory `(canvasID, sessionID)` persistence),
    `Run` (folds `userInput` into prior root via
    `canvas.MergeUserInput`, inspects with `canvas.IsWaitForUser`),
    `RunEvent` (typed SSE events). `service.AgentService.RunAgent`
    signature extended to `(ctx, userID, canvasID, sessionID, version,
    userInput) -> <-chan orchestrator.RunEvent`. `handler/agent.go`
    `RunAgent` reads `?session_id=` and `?user_input=`, emits one SSE
    frame per event plus a `[DONE]` tail. **This is the last P0-
    blocker on the plan.**
  - **P1 — Retrieval agent tool**: `internal/agent/tool/retrieval_nlp.go`
    + `tool.SetRetrievalService` interface; `cmd/server_main.go:240`
    wires `NewNLPRetrievalAdapter(retrievalService)` at boot. The
    `NLPRetrievalAdapter` bridges `Search(*RetrievalSearchRequest)` to
    `Search(RetrievalRequest)`. Net effect: `RetrievalTool` /
    `RetrievalComponent` paths now hit the real nlp service, not the
    loud-fail stub.
  - **P1 — SearchMyDataset alias**: `fixture_stubs.go:486-491`
    registers `SearchMyDataset` → `NewRetrievalStub` (covered by
    `search_my_dataset_alias_test.go`).
  - **P1 — gonja direct import**: `internal/agent/runtime/template/`
    promotes `github.com/nikolalohinski/gonja v1.5.3` from indirect to
    direct (Jinja2 migration; Phase 8a).
  - **P1 — Phase 5a Universe A wrappers**: `universe_a_wrappers.go`
    adds `newRetrievalComponent`, `newTavilySearchComponent`,
    `newExeSQLComponent` all delegating to Universe B tools.
  - 4 new tests in `handler/agent_wait_for_user_test.go` (470 LOC);
    157 handler tests pass.

================================================================================
2. v3.5.1 — production-chain false-positive closures (829598f8f)
================================================================================

feat(agent): v3.5.1 — close the production-chain false positives
  - **Item 1 — orchestrator side (production)**: v3.5's `Driver` test
    used a fake `waitFakeAgentService` that drove the driver directly.
    Production `service.AgentService.RunAgent` still returned
    `<-chan string` and emitted the `"Phase 5 wiring pending"` literal;
    `handler/agent.go:RunAgent` called the old 4-arg signature and SSE-
    wrapped every event as `event: "message"`, dropping
    `RunEvent.Type`. v3.5.1 fixes the signature, the SSE frame type,
    and the channel shape so the handler actually exercises the driver.
  - **Item 2 — Retrieval agent tool (production)**: `cmd/server_main.go`
    now also wires KG retrieval (`SetKGRetrievalService`); the
    `NLPRetrievalAdapter` is registered on the real
    `internal/service/nlp/retrieval.go` (1079 LOC), not a fake.
  - **Item 3 — SearchMyDataset (production)**: registry primary
    swapped from `RetrievalStub` to `newRetrievalComponent` (the v3.5
    delegation wrapper).
  - **Item 4 — Production wiring fix**: 5-line `cmd/server_main.go`
    TTS boot wiring change (TTS engine + dispatcher).
  - **Item 5 — Universe A primary registry swap**: same as Item 3
    (one diff, two log entries).
  - 4 additional false-positive closures uncovered while re-running the
    suite (canvas timeouts, etc.).

================================================================================
3. v3.5.2 — silent production regressions (082c63472)
================================================================================

feat(agent): v3.5.2 — close 4 silent production regressions from v3.5.1
  - All four regressions were test-pass / production-still-broken pairs
    that the v3.5.1 audit intentionally scoped to the user's two
    items but uncovered while re-running the suite. Each got a real-
    path test (not a fake) + a real code-path fix.
  - `internal/service/agent_run_e2e_test.go` (629 LOC): production
    RunAgent end-to-end via miniredis + real HTTP fixtures.
  - `internal/handler/agent_test.go`: 49 lines of fixups.

================================================================================
4. Test cleanup + security hardening
================================================================================

fix(canvas): delete dead TestDSLExamples_* tests (4b3efc62c)
  - The `internal/agent/canvas/dsl_examples_e2e_test.go` (438 LOC)
    tested the v1 IMPORT-format parser that was removed in v3.5's DSL
    convergence. Dead code, deleted.

fix(agent): RunAgent version IDOR + DAO error visibility (1017ebb0f)
  - RunAgent now pins the requested `version` against the canvas
    owner's stored version (no cross-tenant read). DAO errors surface
    to logs (previously swallowed).

fix(agent): map DAO storage errors to 500, not raw data error (828f8f644)
  - `agent.go:loadCanvasForUser`: storage layer errors → HTTP 500 with
    a sanitized message. The old path returned a `data_error` string
    with the raw exception text, which leaked driver internals.

fix(agent): sanitise DAO errors in loadCanvasForUser (286082264)
  - Final pass on the same code path: scrub the message before
    logging, ensure no PII leak via error string.

================================================================================
5. Cycle wait-for-user — eino interrupt refactor (d6e8c9cf2)
================================================================================

refactor(agent): replace wait_for_user sentinel chain with eino interrupt
  - The v3.5 orchestrator Driver used a `__wait_for_user__` boolean
    field plumbed through root. eino v0.9.4 supports
    `compose.Interrupt` / `compose.Resume` natively, which is cleaner.
  - `internal/agent/canvas/interrupt_resume.go` (242 LOC): canonical
    interrupt/resume helpers; `IsWaitForUser` / `MergeUserInput`
    re-exported as thin adapters for back-compat with the orchestrator
    Driver.
  - `canvas/interrupt_resume_test.go` (230 LOC): pins the new
    semantics.
  - `internal/agent/canvas/cycle_wrap.go` (374 LOC) deleted; the
    cycle-handling logic moved into `cycle_wrap.go`'s replacement path
    inside `compile.go` (no separate file).

================================================================================
6. Phase 4.4 V2 — real canvas Compile/Invoke (12424be7d, 47630945e)
================================================================================

feat(service): canvas DSL decoder + AgentService option injection
  - `internal/service/canvas_decode.go` (164 LOC): the decoder that
    turns the raw DB-stored canvas bytes into a `*canvas.Canvas`
    ready for compile.
  - `canvas_decode_test.go` (258 LOC): decoder round-trip + malformed
    input handling.
  - `service.AgentService` now takes a `WithCanvasDecoder` option
    (dependency-injected instead of package-global).

feat(service): real canvas Compile/Invoke in buildRunFunc
  - `service.buildRunFunc` previously returned a stub. It now
    actually compiles the canvas (via `canvas.Compile`), invokes it
    via the orchestrator Driver, and propagates the typed event
    channel.
  - `service/agent.go` (475 LOC delta).

docs(gap-analysis): Phase 4.4 V2 closing + v3.6 next round
  - `.claude/plans/agent-go-port-gap-analysis.md` §11.7 captures the
    Phase 4.4 V2 closure (commits 0c62184 + 0bb5c94) and §11.8
    records the v3.6 next round.

fix(service,handler): review-driven hardening of Phase 4.4 V2
  - `service.RunAgent` now populates `root["tenant_id"]` from the
    user-tenant lookup (best-effort; falls back to the empty string
    if the user lookup fails).
  - `handler/agent.go`: SSE tail is `[DONE]\n\n` regardless of event
    payload — no more dangling SSE frames.
  - `internal/service/agent_test.go` (346 LOC) + `agent_run_e2e_test.go`
    (629 LOC) pin the new contract.

================================================================================
7. v3.6 — runtime + boot goals (5b06f8728, bd841ce2e, 40469d628)
================================================================================

feat(runtime): MarshalJSON/UnmarshalJSON + eino type registration
  - `CanvasState` (the in-flight canvas state checkpoint) implements
    `json.Marshaler` / `json.Unmarshaler` so the eino checkpoint
    serializer can round-trip it through Redis without losing
    channel/edge metadata.
  - Eino type registration: `internal/agent/runtime/register.go` —
    the `Register` calls that eino needs at startup to recognize
    custom node types.
  - `state_test.go`, `state_bench_test.go`: round-trip + bench
    (Go side: ~2× Python JSON round-trip; eino-internal numbers not
    measured here).
  - **Goal 2 closed.**

feat(agent): wire runID as canvas checkpoint id + RunTracker.AttachCheckpoint
  - `canvas.RunTracker` (10 LOC delta) gets `AttachCheckpoint(id string)`
    so the boot-side `RunTracker` can register the Redis-backed
    checkpoint before the canvas starts running.
  - Goal 7 closed.

feat(boot): Redis-backed run infra + TTS service wire-up in cmd/server_main
  - `cmd/server_main.go` (100 LOC delta) — `StartRunTracker`,
    `StartRedisCheckpointStore`, `configureTTSSynthesizer` wired at
    boot.
  - `internal/service/memory_message_service.go` (281 LOC): real
    `MemoryMessageService` impl for Phase 8b.
  - Goals 8 + 9 closed.

docs(gap-analysis): record v3.6 Goal 2/7/8/9 closing + v3.6.1 next round
  - `.claude/plans/agent-go-port-gap-analysis.md` §11.8 captures all
    four v3.6 goals closing in one place; §11.8.4 lists the v3.6.1
    next-round items.

================================================================================
8. v3.6.1 — closing 4 of 5 next-round items (Gaps #1–infiniflow#5)
================================================================================

feat(service,canvas): v3.6.1 Gap infiniflow#2 AttachCheckpoint call-sequence test
  - `service.RunAgent` populates `root["tenant_id"]` from the user-
    tenant lookup (best-effort).
  - `agent_run_e2e_test.go` pinned: Start → AttachCheckpoint →
    MarkSucceeded sequence via miniredis-backed `RunTracker`.
  - Closes Gap infiniflow#2.

feat(audio,boot): v3.6.1 Gap infiniflow#3 — real TTS model-provider dispatch
  - `audio.NewTTSDispatchFunc` + `TTSDispatcher` interface extracted.
  - `cmd/server_main.go:configureTTSSynthesizer` wires the real
    dispatch instead of the v3.6.0 placeholder.
  - `audio.ErrSynthesizeEmpty` sentinel.
  - `audio/tts_design.md` (154 LOC) — design rationale.
  - `audio/{tts,model_provider_synthesizer,tts_dispatch}*.go` (180+
    131 + 149 LOC) — the three-way split between TTS engine, model
    provider, and dispatcher.
  - `tts_dispatch_test.go` (223 LOC), `model_provider_synthesizer_test.go`
    (110 LOC), `tts_test.go` (119 LOC).
  - Closes Gap infiniflow#3.

feat(canvas): v3.6.1 Gap infiniflow#4 — wire per-class timeout into realComponentBody
  - `canvas/node_body.go` `realComponentBody` now calls
    `resolveTimeout(componentClass)` (was the uniform
    `componentTimeout()`).
  - `canvas/timeout.go` (135 LOC) — the `componentDefaults` map (10
    Python parity defaults + env-override) and the 4-level resolution
    table.
  - `node_body_timeout_test.go` (173 LOC) +
    `node_body_per_class_timeout_integration_test.go` (280 LOC):
    4 end-to-end tests pin ExeSQL 3s / TavilySearch 12s / uniform-
    fallback / per-class env override.
  - Closes Gap infiniflow#4.

feat(llm): v3.6.1 Gap infiniflow#5 — normal-absolute-count retry semantics
  - `internal/agent/component/llm_retry.go` (150 LOC) +
    `llm_retry_test.go` (387 LOC).
  - `retryInvoker.Unwrap()` + `unwrapChatInvoker` walk: param-
    override branch now wraps the **unwrapped** invoker so the
    absolute count is `MaxRetries+1` instead of
    `(MaxRetries+1) × (boot+1)`.
  - 6 tests pin the fix (3 unwrap unit + 1 absolute-count + 1 no-
    override back-compat + the existing
    TestLLM_RetryStackingSemantics stays green).
  - Closes Gap infiniflow#5.

docs(gap-analysis): v3.6.1 closing — 4 of 5 §11.8.4 next-round items
  - `.claude/plans/agent-go-port-gap-analysis.md` §11.8.5 records
    the v3.6.1 closure (4 of 5 items).
  - **Item #1 (Resume e2e run-2 message production)** deferred to
    v3.6.2 — eino UserFillUp second-pass is genuinely an eino-
    internal concern, not a Go-side bug; plumbing is fully verified.
  - Test count delta: 1381 → 1402 (+21 across 4 packages).

fix(canvas): v3.6.1 Gap #1 — wire CheckPointStore without overriding
eino's InternalSerializer
  - `canvas/checkpoint_store.go` (9 LOC delta) wires the Redis-backed
    `CheckpointStore` into the canvas builder.
  - Key change: we DO NOT override eino's `InternalSerializer` — we
    plug our `CanvasState` `MarshalJSON`/`UnmarshalJSON` (from
    Goal 2) and let eino use its built-in serializer over those
    primitives. Earlier draft overrode the serializer, which broke
    eino's resume semantics.
  - Closes Gap #1.

================================================================================
9. Tests + renames + CodeRabbit feedback
================================================================================

refactor(service): rename runagent_phase_4_4_v2_test.go →
agent_run_e2e_test.go (8cd5b008d)
  - Test filename was misleading (the test exercises the Phase 4.4
    V2 *contract*, not a phase marker). Renamed to reflect scope.

fix: address all CodeRabbit review comments on PR infiniflow#16035 (c7ce6504b)
  - Final review pass on the eino interrupt + check-pointing PR.
  - Touched: `cmd/server_main.go`, `docker/.env`, `docker/entrypoint.sh`,
    `docker/launch_backend_service.sh`, `docker/nginx/ragflow.conf.golang`,
    `.github/workflows/tests.yml`, `.gitignore`, `go.mod`, `go.sum`,
    `web/package.json`, `web/jest.config.ts`.

================================================================================
10. Design-doc cleanup + sandbox admin-panel reader
================================================================================

docs(design): drop historical version markers from design doc and Go
code (055752a48)
  - `docs/develop/agent-go-port-design.md` and `internal/agent/`: the
    doc and the Go comments still carried `v3.5`, `v3.6.1`, etc.
    annotation tags from the planning rounds. Dropped them; the
    current state lives in `.claude/plans/agent-go-port-gap-analysis.md`.

docs(design): remove stale status file; fix Driver.Run → Runner.Run
(af9bd0939)
  - `docs/develop/agent-go-port-status.md` (last touched 2026-06-15,
    per its line 3) is fully superseded by §16 of the design doc.
    Deleted.
  - The design doc still had ~12 `Driver.Run` references — the
    class is `Runner.Run` post-eino refactor. Fixed.

docs(design): delete sandbox-python-go-diff.md; integrate sandbox
gaps into §14 (23777f5c7)
  - `docs/develop/sandbox-python-go-diff.md` (21.2K) tracked the
    per-provider behavior diff between Python and Go sandboxes. The
    gaps are now closed (Aliyun SDK excepted) and the items
    migrated into `agent-go-port-design.md` §14 as the canonical
    tracking spot. File deleted.

docs(design): consolidate Aliyun SDK gaps; add effort estimates to
sandbox gaps (1893951db)
  - The Aliyun gaps were spread across 3 separate sub-items in §14.
    Consolidated into a single "blocked on upstream aliyun SDK" entry
    with the two specific blockers (TemplateName + execute-raw-HTTP).
  - Added effort estimates to each of the 7 remaining §14 sandbox
    items.

feat(sandbox): wire admin panel settings reader (close §14 gap 998)
  - `internal/agent/sandbox/config.go` — type-safe `configString` /
    `configInt` / `configDuration` helpers that accept any JSON shape
    (string, float64, int, bool, json.Number) and coerce to target.
  - Each provider (`self_managed.go`, `aliyun.go`, `e2b.go`,
    `local.go`, `ssh.go`) gets a `xxxConfigFromEnv()` + a
    `newXxxProviderFromConfig(cfg)` pair. `xxxProviderFromEnv` is
    refactored to delegate to `xxxProviderFromConfig(xxxConfigFromEnv())`,
    eliminating duplication and giving env-driven and settings-
    driven init semantically identical providers.
  - `internal/agent/sandbox/manager.go`:
    - `SystemSetting = entity.SystemSettings` type alias.
    - `SettingsReader` interface (`GetByName(name)`) — DAO seam.
    - `LoadFromSettings(ctx)` / `LoadFromSettingsWithReader(ctx, r)` —
      reads `sandbox.provider_type` and `sandbox.{type}` from the
      `system_settings` MySQL table, JSON-decodes the per-provider
      config, builds the provider via `FromConfig`. Soft-falls back
      to env on missing / malformed / unknown-type / DAO-error.
    - `ReloadFromSettings(ctx)` / `ReloadFromSettingsWithReader(ctx, r)`.
    - `errSettingsNotConfigured`, `errSettingsMalformed` sentinels.
    - `buildProviderFromConfig` parallel to `buildProvider`.
  - `internal/agent/sandbox/config_test.go` — 3 test funcs covering
    `configString` / `configInt` / `configDuration`.
  - `internal/agent/sandbox/manager_test.go` — `TestNew*FromConfig_*`
    for all 5 providers, `TestBuildProviderFromConfig_UnknownType`,
    `_HappyPath`, `TestLoadFromSettingsWithReader_*` (7 cases:
    HappyPath, EmptyFallback, DAOErrorFallback, MalformedJSONFallback,
    UnknownProviderType, AlreadyLoaded_NoOp), `TestReloadFromSettingsWithReader`.

docs(design): remove closed gap from §14 Future Work (2f1d84947)
  - The admin-panel reader item was closed by `feat(sandbox): wire
    admin panel settings reader (close §14 gap 998)` but still
    appeared in §14 with a ✅ annotation. Per the "Future Work only
    carries open items" principle, removed it entirely and tightened
    the §14 sandbox lead-in paragraph to point at the commit history.
  - The §14 sandbox subsection is now exactly the 7 open items
    (Aliyun SDK + LocalProvider rlimits + SSH SFTP + Windows build
    + e2b community SDK + OTel spans + the lead-in itself).

================================================================================
Stats
================================================================================

  234 files changed, 35413 insertions(+), 6111 deletions(-)

  Build: clean (`go build ./...`)
  Tests: 1402 across 4 packages (+21 from v3.6)
  Plan: .claude/plans/agent-go-port-gap-analysis.md v3.6.1 (single
        P0-blocker — Phase 4.4 orchestrator side — closed; remaining
        open items: 5d CodeExec full feature parity, 5c DB2,
        4.5 DSL parity corpus, Aliyun SDK gaps — all P2).

Co-Authored-By: Claude <[email protected]>
yuzhichang added a commit that referenced this pull request Jun 17, 2026
Phase 4.4 V2 — real canvas Compile/Invoke via eino interrupt + check-pointing (closes the last P0-blocker, Phase 4.4 orchestrator side). v3.5 — 21 component ports + 5 implementation items incl. Retrieval agent tool wire-up, SearchMyDataset alias, gonja direct import, Universe A delegation wrappers. v3.5.1 — production-chain false-positive closures (the orchestrator, Retrieval, SearchMyDataset, TTS). v3.5.2 — 4 silent production regressions. v3.6 — CanvasState JSON round-trip + eino type registration, RunTracker.AttachCheckpoint, Redis-backed run infra + TTS boot wire. v3.6.1 Gaps #1–infiniflow#5 — CheckPointStore wire (without overriding eino's InternalSerializer), AttachCheckpoint call-sequence test + tenant_id, real TTS dispatch, per-class component timeouts, LLM retry normal-absolute-count. Plus 4 production-security fixes (RunAgent IDOR, DAO error visibility + sanitization + 500 mapping), CodeRabbit review pass, and §14 sandbox admin-panel reader (gap 998 closure).

Stats: 234 files / +35413 / -6111 / 1402 tests (+21). Plan: .claude/plans/agent-go-port-gap-analysis.md v3.6.1.

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.