Skip to content

chore: require OpenSandbox credentials#6994

Merged
c121914yu merged 1 commit into
labring:mainfrom
c121914yu:codex/opensandbox-config-check
May 26, 2026
Merged

chore: require OpenSandbox credentials#6994
c121914yu merged 1 commit into
labring:mainfrom
c121914yu:codex/opensandbox-config-check

Conversation

@c121914yu
Copy link
Copy Markdown
Collaborator

@c121914yu c121914yu commented May 26, 2026

Summary

  • Require OpenSandbox provider config to include both base URL and API key before creating adapters.
  • Treat OpenSandbox as configured only when both base URL and API key are explicitly present, so the sandbox feature is not exposed with incomplete credentials.
  • Update provider config tests to cover missing OpenSandbox base URL/API key and the new required-key behavior.

Tests

  • pnpm -C packages/service exec vitest run test/core/ai/sandbox/provider/config.test.ts --coverage=false
  • pnpm exec eslint packages/service/env.ts packages/service/core/ai/sandbox/provider/config.ts packages/service/test/core/ai/sandbox/provider/config.test.ts
  • git diff --check

Copilot AI review requested due to automatic review settings May 26, 2026 14:48
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 26, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 13.9% 1135 / 8161
🔵 Statements 13.89% 1190 / 8564
🔵 Functions 12.52% 246 / 1964
🔵 Branches 11.82% 531 / 4489
File CoverageNo changed files found.
Generated in workflow #445 for commit ee10431 by the Vitest Coverage Report Action

@github-actions
Copy link
Copy Markdown

Docs Preview Deployed!

🔗 👀 Click here to visit preview

ghcr.io/labring/fastgpt-docs-pr:dd78d893fd05d5fab23177f87a329765cb278bd8

🕒 Time: 2026-05-26 22:53:23 (UTC+8)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR tightens Agent Sandbox configuration by requiring OpenSandbox to be explicitly configured with both a base URL and an API key before the feature is enabled/usable, and updates deployment docker-compose templates to ship OpenSandbox + volume-manager services wired to a shared initial API key.

Changes:

  • Require opensandbox provider configs to include apiKey (and base URL) during validation and adapter config building.
  • Update env parsing/gating so opensandbox is only considered “configured” when both AGENT_SANDBOX_OPENSANDBOX_BASEURL and AGENT_SANDBOX_OPENSANDBOX_API_KEY are set.
  • Restore/add OpenSandbox + volume-manager services and related env/config blocks in main docker-compose templates (global + cn variants), including a shared SANDBOX_API_KEY-driven key.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/service/test/core/ai/sandbox/provider/config.test.ts Updates unit tests to assert OpenSandbox now requires apiKey and still validates base URL/runtime.
packages/service/env.ts Changes sandbox-feature gating for OpenSandbox to require base URL + API key; makes OpenSandbox base URL env optional in schema.
packages/service/core/ai/sandbox/provider/config.ts Enforces OpenSandbox apiKey requirement in validateSandboxConfig; normalizes missing base URL to '' before validation.
document/public/deploy/docker/main/global/docker-compose.zilliz.yml Adds OpenSandbox + volume-manager services and wires FastGPT env to OpenSandbox credentials (global zilliz variant).
document/public/deploy/docker/main/global/docker-compose.seekdb.yml Same as above for global seekdb variant.
document/public/deploy/docker/main/global/docker-compose.pg.yml Same as above for global pg variant.
document/public/deploy/docker/main/global/docker-compose.opengauss.yml Same as above for global opengauss variant.
document/public/deploy/docker/main/global/docker-compose.oceanbase.yml Same as above for global oceanbase variant (incl. configs block merge).
document/public/deploy/docker/main/global/docker-compose.milvus.yml Same as above for global milvus variant.
document/public/deploy/docker/main/cn/docker-compose.zilliz.yml Adds OpenSandbox + volume-manager services and wires FastGPT env to OpenSandbox credentials (cn zilliz variant, registry.cn images).
document/public/deploy/docker/main/cn/docker-compose.seekdb.yml Same as above for cn seekdb variant.
document/public/deploy/docker/main/cn/docker-compose.pg.yml Same as above for cn pg variant.
document/public/deploy/docker/main/cn/docker-compose.opengauss.yml Same as above for cn opengauss variant.
document/public/deploy/docker/main/cn/docker-compose.oceanbase.yml Same as above for cn oceanbase variant (incl. configs block merge).
document/public/deploy/docker/main/cn/docker-compose.milvus.yml Same as above for cn milvus variant.
deploy/version/main/docker-compose.template.yml Updates the main compose template to include OpenSandbox + volume-manager services, a shared SANDBOX_API_KEY, and related FastGPT env wiring.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/service/env.ts
process.env.AGENT_SANDBOX_OPENSANDBOX_BASEURL && process.env.AGENT_SANDBOX_OPENSANDBOX_API_KEY
);
}

Comment on lines +14 to +17
# OpenSandbox API key. Override with SANDBOX_API_KEY before running docker compose.
x-opensandbox-api-key: &x-opensandbox-api-key ${SANDBOX_API_KEY:-fastgpt-opensandbox-api-key}
# volume manager auth token
x-volume-manager-auth-token: &x-volume-manager-auth-token 'vmtoken'
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 26, 2026

Build Successful - Preview fastgpt Image for this PR:

ghcr.io/labring/fastgpt-pr:fastgpt_ee104316c56096ababd4cce995fb7beb6ef1403e

🕒 Time: 2026-05-27 00:06:08 (UTC+8)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 26, 2026

Admin Preview Image Ready!

ghcr.io/labring/fastgpt-pr:admin_ee104316c56096ababd4cce995fb7beb6ef1403e

🕒 Time: 2026-05-27 00:06:14 (UTC+8)

@c121914yu c121914yu force-pushed the codex/opensandbox-config-check branch from dd78d89 to ee10431 Compare May 26, 2026 16:04
@c121914yu c121914yu merged commit 484a765 into labring:main May 26, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants