Skip to content

feat: add Tenki sandbox provider - #17305

Merged
yuzhichang merged 11 commits into
infiniflow:mainfrom
learnprogram2:feat/tenki-sandbox-provider
Jul 28, 2026
Merged

yuzhichang merged 11 commits into
infiniflow:mainfrom
learnprogram2:feat/tenki-sandbox-provider

Conversation

@learnprogram2

@learnprogram2 learnprogram2 commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a tenki sandbox provider that runs each agent code execution in a disposable Tenki (https://tenki.cloud) microVM (create → exec → destroy, no volumes or snapshots).
Registration mirrors PR #15039, configure api_key and project_id in Admin > Sandbox Settings.

Both runtimes are covered:

  • Python: agent/sandbox/providers/tenki.py (structured results + artifact collection).
  • Go: internal/agent/sandbox/tenki.go, mirroring the e2b provider and wired into the provider manager.

tenki-sandbox is an optional dependency (it requires protobuf>=6.31, which differs from RAGFlow's pinned gRPC stack), lazily imported with a clear error when missing; installation is documented in the sandbox quickstart.

Unit tests cover execution, structured results, artifacts (symlink/size/extension limits), non-zero exit, timeout, error mapping, and idempotent destroy.

yiming.wang added 4 commits July 23, 2026 16:43
Add a Tenki provider to the agent code-execution sandbox, alongside the
existing local, self_managed, ssh, aliyun_codeinterpreter, and e2b providers.
Each execution runs in a disposable Tenki microVM: the provider creates a
session, runs the wrapped script over the SDK's exec, collects the structured
result and artifacts, and terminates the session.

- agent/sandbox/providers/tenki.py: TenkiProvider implementing SandboxProvider,
  using only the SDK's create/exec/destroy path (no volumes or snapshots).
- Register the provider in the providers package, the client factory, and the
  admin Sandbox Settings (registry + config schema).
- web: add the provider icon in admin sandbox settings.
- test: unit tests covering execution, structured result, artifacts, non-zero
  exit, timeout, quota errors, idempotent destroy, and config schema.
Add unit tests for the auth-failure path (initialize maps UnauthorizedError to
SandboxProviderConfigError) and for concurrent instances being independent
(distinct sessions; destroying one leaves the other running).
Add Tenki to the provider lists in the sandbox quickstart and a short section
covering its configuration (api_key, project_id, optional image/resources),
supported languages, artifact handling, and that it is cloud-hosted with no
local sandbox services required.
- Reject symlink artifacts via stat mode bits: fs.list does not populate
  is_symlink, so the previous check was dead; add a directory recursion depth
  cap to bound untrusted nested trees.
- Make outbound network access configurable (allow_outbound, default true)
  instead of hardcoded, and expose it in the config schema.
- Map SessionTerminated/SessionNotFound during exec to RuntimeError per the
  base contract instead of leaking SDK exception types.
- Clarify that tenki-sandbox is an optional dependency (its protobuf
  requirement differs from RAGFlow's gRPC stack); document installing it.
- Add tests for the JavaScript path, symlink rejection, output-size limit,
  disallowed artifact extension, and configurable outbound network.
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. 🌈 python Pull requests that update Python code 💞 feature Feature request, pull request that fullfill a new feature. labels Jul 23, 2026
@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

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

Use the following commands to manage reviews:

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

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 181edf5f-36a5-43b9-8cef-3dce2fdc5e61

📥 Commits

Reviewing files that changed from the base of the PR and between 1ed2064 and 3bd0535.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (6)
  • agent/sandbox/providers/tenki.py
  • go.mod
  • internal/agent/sandbox/tenki.go
  • internal/agent/sandbox/tenki_test.go
  • internal/common/environments.go
  • test/unit_test/agent/sandbox/test_tenki_provider.py
💤 Files with no reviewable changes (1)
  • internal/common/environments.go
🚧 Files skipped from review as they are similar to previous changes (4)
  • internal/agent/sandbox/tenki_test.go
  • internal/agent/sandbox/tenki.go
  • test/unit_test/agent/sandbox/test_tenki_provider.py
  • agent/sandbox/providers/tenki.py

📝 Walkthrough

Walkthrough

This PR adds Tenki as a disposable microVM sandbox provider across Go and Python implementations, including lifecycle management, code execution, artifact handling, configuration, admin integration, documentation, UI metadata, dependencies, and tests.

Changes

Tenki Provider Support

Layer / File(s) Summary
Provider contracts and configuration
internal/agent/sandbox/provider.go, internal/common/environments.go, go.mod, agent/sandbox/providers/__init__.py
Adds the Tenki provider identifier, environment settings, SDK dependency, and Python package export.
Go Tenki lifecycle and execution
internal/agent/sandbox/tenki.go
Implements initialization, session creation, Python and Node execution, result mapping, destruction, and health checks.
Python Tenki execution and artifact safety
agent/sandbox/providers/tenki.py
Implements configuration validation, execution wrappers, output limits, result extraction, safe termination, and constrained artifact collection.
Runtime and admin integration
internal/agent/sandbox/manager.go, agent/sandbox/client.py, admin/server/services.py
Constructs Tenki providers and registers them in sandbox loading, configuration, connection testing, and provider metadata flows.
Admin presentation and documentation
web/src/pages/admin/sandbox-settings.tsx, docs/guides/agent/agent_quickstarts/sandbox_quickstart.md
Adds the Tenki icon and documents installation, configuration, supported languages, artifacts, and execution behavior.
Provider validation
internal/agent/sandbox/tenki_test.go, test/unit_test/agent/sandbox/test_tenki_provider.py
Tests configuration, lifecycle, execution, error mapping, result handling, instance isolation, and artifact safety limits.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AdminUI as Admin UI
  participant SandboxMgr
  participant TenkiProvider
  participant TenkiSDK

  AdminUI->>SandboxMgr: Configure Tenki provider
  SandboxMgr->>TenkiProvider: Validate and initialize
  TenkiProvider->>TenkiSDK: Create client and check connectivity
  TenkiSDK-->>TenkiProvider: Connectivity result
  AdminUI->>SandboxMgr: Test connection
  SandboxMgr->>TenkiProvider: Create and execute sandbox
  TenkiProvider->>TenkiSDK: Create session and execute wrapper
  TenkiSDK-->>TenkiProvider: Execution result
  TenkiProvider-->>SandboxMgr: Return test result
Loading

Suggested reviewers: yuzhichang

Poem

A rabbit hops through microVM skies,
Tenki sandboxes rise and rise, 🌩️
Code runs safely, artifacts bright,
Tests guard each path with care and might,
Hop, hop, Tenki flies! 🐇

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: adding the Tenki sandbox provider.
Description check ✅ Passed The description includes the required Summary section and explains purpose, context, implementation, dependency, and tests.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (2)
test/unit_test/agent/sandbox/test_tenki_provider.py (1)

192-214: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add tests for session-terminated/session-not-found mapping and remaining limit paths.

SessionTerminatedError/SessionNotFoundError → RuntimeError mapping (tenki.py lines 211-214) has no dedicated test, despite being called out in the PR as covered ("session error mapping"). Similarly, max_artifacts, max_artifact_bytes, and MAX_ARTIFACT_DEPTH enforcement, and RateLimitedError mapping in create_instance, aren't exercised here even though "directory-depth restrictions" and "size ... limits" are listed as tested in the PR summary.

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

In `@test/unit_test/agent/sandbox/test_tenki_provider.py` around lines 192 - 214,
Add focused tests alongside test_tenki_provider_propagates_timeout and
test_tenki_provider_create_maps_quota_error covering SessionTerminatedError and
SessionNotFoundError mapping to RuntimeError, RateLimitedError mapping in
create_instance, and enforcement of max_artifacts, max_artifact_bytes, and
MAX_ARTIFACT_DEPTH. Reuse _FakeSandbox, _build_provider, and the existing
provider APIs, asserting the documented exception types and messages for each
path.
agent/sandbox/providers/tenki.py (1)

490-494: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use contextlib.suppress per Ruff SIM105.

♻️ Proposed refactor
+import contextlib
+
     def _safe_terminate(self, sandbox) -> None:
-        try:
-            sandbox.terminate()
-        except Exception:
-            pass
+        with contextlib.suppress(Exception):
+            sandbox.terminate()
Based on static analysis: Ruff SIM105 "Use `contextlib.suppress(Exception)` instead of `try`-`except`-`pass`".
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@agent/sandbox/providers/tenki.py` around lines 490 - 494, Update
_safe_terminate to use contextlib.suppress(Exception) around
sandbox.terminate(), replacing the try/except/pass pattern while preserving the
current behavior of ignoring termination exceptions.

Source: Linters/SAST tools

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

Inline comments:
In `@agent/sandbox/providers/tenki.py`:
- Around line 87-120: Add structured logging throughout the Tenki provider
lifecycle methods initialize, create_instance, execute_code, and
destroy_instance, including startup/connectivity, instance creation and
destruction, execution success, timeouts, and error-mapping branches for quota,
authentication, and terminated sessions. Use the project’s existing logger
conventions, include useful sanitized context such as operation,
instance/session identifiers, and outcomes, and never log api_key, project_id,
raw code, or stdout content.
- Around line 144-151: Update create_instance’s Tenki client call and
execute_code’s execution call to catch any remaining tenki_sandbox SDK exception
after their specific handlers, then wrap it in RuntimeError while preserving the
original exception as the cause. Keep the existing specialized mappings for
quota, rate-limit, authentication, timeout, and session-terminated errors
unchanged so both methods satisfy the base-class RuntimeError contract.
- Line 145: Update the Tenki call sites in initialize/create_instance, including
who_am_i() and self._client.create(**create_kwargs), to enforce an explicit HTTP
request timeout when callers do not provide one. Use the SDK-supported default
request-timeout mechanism or pass a caller-side deadline, while preserving any
explicitly configured timeout values.

---

Nitpick comments:
In `@agent/sandbox/providers/tenki.py`:
- Around line 490-494: Update _safe_terminate to use
contextlib.suppress(Exception) around sandbox.terminate(), replacing the
try/except/pass pattern while preserving the current behavior of ignoring
termination exceptions.

In `@test/unit_test/agent/sandbox/test_tenki_provider.py`:
- Around line 192-214: Add focused tests alongside
test_tenki_provider_propagates_timeout and
test_tenki_provider_create_maps_quota_error covering SessionTerminatedError and
SessionNotFoundError mapping to RuntimeError, RateLimitedError mapping in
create_instance, and enforcement of max_artifacts, max_artifact_bytes, and
MAX_ARTIFACT_DEPTH. Reuse _FakeSandbox, _build_provider, and the existing
provider APIs, asserting the documented exception types and messages for each
path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3c3f6ae7-26f0-431c-9f5d-0c23c7af0895

📥 Commits

Reviewing files that changed from the base of the PR and between d4a8c91 and de355e3.

📒 Files selected for processing (7)
  • admin/server/services.py
  • agent/sandbox/client.py
  • agent/sandbox/providers/__init__.py
  • agent/sandbox/providers/tenki.py
  • docs/guides/agent/agent_quickstarts/sandbox_quickstart.md
  • test/unit_test/agent/sandbox/test_tenki_provider.py
  • web/src/pages/admin/sandbox-settings.tsx

Comment thread agent/sandbox/providers/tenki.py Resolved
Comment thread agent/sandbox/providers/tenki.py Resolved
Comment thread agent/sandbox/providers/tenki.py Resolved
@yingfeng

Copy link
Copy Markdown
Member

Thanks, could you please provide a Go implementation? RAGFlow will be fully migrating to Go starting in August.

@yingfeng yingfeng added the ci Continue Integration label Jul 23, 2026
yiming.wang added 2 commits July 24, 2026 09:06
- Add lifecycle logging (init, create, destroy, timeout, terminate failure)
  using the module logger; never log api_key, project_id, code, or stdout.
- Wrap any remaining SDK exception from create/exec in RuntimeError to honor
  the base-class contract.
- Bound control-plane calls (who_am_i, create) with an explicit client request
  timeout so an unreachable API cannot block indefinitely.
- Log terminate failures instead of silently ignoring them.
- Add tests for session-terminated/rate-limit/unexpected-error mapping and
  max_artifacts / max_artifact_bytes enforcement.
Port the tenki provider to the Go sandbox subsystem, mirroring the
existing e2b provider: create/exec/destroy against a disposable Tenki
microVM via the TenkiCloud Go SDK, with the shared __RAGFLOW_RESULT__
wrapper protocol. Wire it into the provider manager and add TENKI_*
env vars. Covered by unit tests plus a key-gated live E2E test.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🧹 Nitpick comments (1)
internal/agent/sandbox/tenki.go (1)

17-32: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove migration-oriented provider documentation.

Describe the current sandbox.TenkiProvider behavior directly; remove “Go port” and cross-provider migration comparisons. As per coding guidelines, “keep package and documentation comments aligned with the current runtime path rather than migration history.”

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

In `@internal/agent/sandbox/tenki.go` around lines 17 - 32, Update the file-level
documentation describing sandbox.TenkiProvider to state its current runtime
behavior directly. Remove migration-history language such as “Go port,”
references to Python or other providers, and cross-provider comparisons, while
retaining only accurate details about Tenki’s create/execute/destroy flow,
wrapping protocol, artifact behavior, SDK, and configuration.

Source: Coding guidelines

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

Inline comments:
In `@internal/agent/sandbox/tenki_test.go`:
- Around line 35-41: Update the test around SupportedLanguages to validate both
directions: retain rejection of unexpected languages and also assert every entry
in the want map appears in the returned langs collection. Ensure missing Python,
JavaScript, or Node.js causes the test to fail.
- Line 256: Update the deferred cleanup around DestroyInstance to use a fresh
bounded cleanup context instead of the test context, capture its returned error,
and fail or report the E2E test when cleanup fails. Preserve cleanup execution
even if the test context is canceled and ensure the cleanup context is released.

In `@internal/agent/sandbox/tenki.go`:
- Around line 90-93: Update the allowOutbound configuration in the sandbox setup
to default to false and enable outbound networking only when ALLOW_OUTBOUND is
explicitly affirmative. Preserve the existing configuration lookup while
ensuring omitted, false, and other non-affirmative values keep networking
disabled.
- Around line 71-100: Update newTenkiProviderFromConfig and TenkiProvider to
retain the configured API key and API URL from cfg, then have Initialize pass
those provider fields to tenkisdk.New instead of requiring process-level
environment values. Keep tenkiConfigFromEnv as the separate environment-backed
path, including its current exclusion of credentials.
- Around line 235-239: Update the transport-error return in the command
execution flow around the visible err check to stop formatting cmd and runArgs
into the error; return a generic tenki transport/session error while preserving
the original err as the wrapped cause.
- Around line 276-280: Update the sess.Close error handling to include
tenkisdk.ErrSessionExpired in the errors.Is checks alongside ErrSessionNotFound
and ErrSessionTerminated, returning nil for all three conditions while
preserving the existing wrapped error for other failures.

---

Nitpick comments:
In `@internal/agent/sandbox/tenki.go`:
- Around line 17-32: Update the file-level documentation describing
sandbox.TenkiProvider to state its current runtime behavior directly. Remove
migration-history language such as “Go port,” references to Python or other
providers, and cross-provider comparisons, while retaining only accurate details
about Tenki’s create/execute/destroy flow, wrapping protocol, artifact behavior,
SDK, and configuration.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f28e7519-a1b5-4dc4-9835-82dc9c5790b7

📥 Commits

Reviewing files that changed from the base of the PR and between de355e3 and 0b1b0a9.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (8)
  • agent/sandbox/providers/tenki.py
  • go.mod
  • internal/agent/sandbox/manager.go
  • internal/agent/sandbox/provider.go
  • internal/agent/sandbox/tenki.go
  • internal/agent/sandbox/tenki_test.go
  • internal/common/environments.go
  • test/unit_test/agent/sandbox/test_tenki_provider.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • agent/sandbox/providers/tenki.py

Comment thread internal/agent/sandbox/tenki_test.go Resolved
Comment thread internal/agent/sandbox/tenki_test.go Resolved
Comment thread internal/agent/sandbox/tenki.go Resolved
Comment thread internal/agent/sandbox/tenki.go Resolved
Comment thread internal/agent/sandbox/tenki.go Resolved
Comment thread internal/agent/sandbox/tenki.go Resolved
@learnprogram2

Copy link
Copy Markdown
Contributor Author

Thanks, could you please provide a Go implementation? RAGFlow will be fully migrating to Go starting in August.

Added a Go implementation in internal/agent/sandbox/tenki.go, mirroring the e2b provider and wired into the provider manager.

yiming.wang added 2 commits July 24, 2026 15:13
- Read API key/URL from admin config, not just process env
- Default outbound network to opt-in, matching the self_managed
  sandbox which treats network access as unauthorized by default
- Drop wrapped code/args from exec transport-error messages
- Treat an expired session as already destroyed on cleanup
- Assert the full supported-language set; fail E2E on cleanup error

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

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

⚠️ Outside diff range comments (1)
docs/guides/agent/agent_quickstarts/sandbox_quickstart.md (1)

45-47: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Document project_id as a required prerequisite.

The provider also rejects initialization without project_id, which is listed as required below on Line 56. Update this sentence so users do not configure only an API key and then receive an initialization failure.

Suggested wording
-... only outbound network access and an API key.
+... only outbound network access, an API key, and a project ID.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/guides/agent/agent_quickstarts/sandbox_quickstart.md` around lines 45 -
47, Update the Tenki prerequisite sentence near the tenki-sandbox installation
guidance to state that both an API key and project_id are required before
selecting the provider. Keep the existing dependency and runtime-installation
instructions unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@docs/guides/agent/agent_quickstarts/sandbox_quickstart.md`:
- Around line 45-47: Update the Tenki prerequisite sentence near the
tenki-sandbox installation guidance to state that both an API key and project_id
are required before selecting the provider. Keep the existing dependency and
runtime-installation instructions unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9be51576-38b3-4f88-b46c-215230c739d6

📥 Commits

Reviewing files that changed from the base of the PR and between 0b1b0a9 and 6994645.

📒 Files selected for processing (5)
  • agent/sandbox/providers/tenki.py
  • docs/guides/agent/agent_quickstarts/sandbox_quickstart.md
  • internal/agent/sandbox/tenki.go
  • internal/agent/sandbox/tenki_test.go
  • test/unit_test/agent/sandbox/test_tenki_provider.py
🚧 Files skipped from review as they are similar to previous changes (4)
  • internal/agent/sandbox/tenki.go
  • internal/agent/sandbox/tenki_test.go
  • agent/sandbox/providers/tenki.py
  • test/unit_test/agent/sandbox/test_tenki_provider.py

@yingfeng
yingfeng requested a review from yuzhichang July 24, 2026 07:34
Comment thread internal/agent/sandbox/tenki.go Outdated
"sync"
"time"

tenkisdk "github.com/TenkiCloud/tenki-sdk-go/sandbox"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@learnprogram2 learnprogram2 Jul 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Migrated to github.com/LuxorLabs/tenki-sdk-go/sandbox v0.5.2.

Comment thread internal/agent/sandbox/tenki.go Outdated
// SupportedLanguages returns the languages the default Tenki image can
// run. The default image ships with python3 and node.
func (p *TenkiProvider) SupportedLanguages() []string {
return []string{"python", "nodejs", "javascript"}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

return []string{"python", "javascript"}

@learnprogram2 learnprogram2 Jul 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done, SupportedLanguages now returns ["python", "javascript"] on both the Go and Python sides.

@codecov

codecov Bot commented Jul 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.65%. Comparing base (8af2467) to head (3bd0535).
⚠️ Report is 116 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #17305   +/-   ##
=======================================
  Coverage   90.65%   90.65%           
=======================================
  Files          10       10           
  Lines         717      717           
  Branches      118      118           
=======================================
  Hits          650      650           
  Misses         39       39           
  Partials       28       28           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yuzhichang
yuzhichang self-requested a review July 28, 2026 03:13
@yuzhichang

Copy link
Copy Markdown
Member

LGTM

@yuzhichang
yuzhichang merged commit dcadd8d into infiniflow:main Jul 28, 2026
5 checks passed
buua436 pushed a commit to buua436/ragflow that referenced this pull request Jul 29, 2026
### Summary

Adds a `tenki` sandbox provider that runs each agent code execution in a
disposable Tenki (https://tenki.cloud) microVM (create → exec → destroy,
no volumes or snapshots).
Registration mirrors PR infiniflow#15039, configure `api_key` and `project_id` in
Admin > Sandbox Settings.

Both runtimes are covered:
- Python: `agent/sandbox/providers/tenki.py` (structured results +
artifact collection).
- Go: `internal/agent/sandbox/tenki.go`, mirroring the e2b provider and
wired into the provider manager.

`tenki-sandbox` is an optional dependency (it requires `protobuf>=6.31`,
which differs from RAGFlow's pinned gRPC stack), lazily imported with a
clear error when missing; installation is documented in the sandbox
quickstart.

Unit tests cover execution, structured results, artifacts
(symlink/size/extension limits), non-zero exit, timeout, error mapping,
and idempotent destroy.

---------

Co-authored-by: yiming.wang <[email protected]>
@coderabbitai coderabbitai Bot mentioned this pull request Aug 10, 2026
opencolin added a commit to LuxorLabs/cookbook that referenced this pull request Aug 14, 2026
Walkthrough for RAGFlow's tenki code-execution provider
(infiniflow/ragflow#17305): pip install tenki-sandbox, the Admin >
Sandbox Settings keys, the ephemeral create/exec/destroy lifecycle, and
the artifacts/ contract. verify.py proves the Tenki surface the provider
is built on -- who_am_i health check, outbound-off sandbox, python and
node execution paths, artifacts/ read-back, terminate -- against the
live API, without running RAGFlow.

Co-Authored-By: Claude Fable 5 <[email protected]>
opencolin added a commit to LuxorLabs/cookbook that referenced this pull request Oct 14, 2026
Walkthrough for RAGFlow's tenki code-execution provider
(infiniflow/ragflow#17305): pip install tenki-sandbox, the Admin >
Sandbox Settings keys, the ephemeral create/exec/destroy lifecycle, and
the artifacts/ contract. verify.py proves the Tenki surface the provider
is built on -- who_am_i health check, outbound-off sandbox, python and
node execution paths, artifacts/ read-back, terminate -- against the
live API, without running RAGFlow.

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

Labels

ci Continue Integration 💞 feature Feature request, pull request that fullfill a new feature. 🌈 python Pull requests that update Python code size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants