Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes sandbox logger-related environment configuration/validation and stops injecting the shared log env block into the code-sandbox service in the production docker-compose template.
Changes:
- Removed logger environment keys from the sandbox
envSchema. - Removed
*x-log-configinheritance from thecode-sandboxservice indocker-compose.prod.yml.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| projects/sandbox/src/env.ts | Drops logger env vars from sandbox env validation. |
| deploy/templates/docker-compose.prod.yml | Stops passing shared log env config into the code-sandbox container. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| restart: always | ||
| environment: | ||
| <<: [*x-log-config] | ||
| LOG_OTEL_SERVICE_NAME: fastgpt-code-sandbox |
There was a problem hiding this comment.
code-sandbox no longer inherits *x-log-config, but the sandbox app still configures @fastgpt-sdk/logger from env. With the log config removed, the SDK defaults to console logging enabled at trace level, which can significantly increase log volume in prod. Either keep *x-log-config for this service, or explicitly set LOG_ENABLE_CONSOLE/LOG_CONSOLE_LEVEL (or remove logger initialization + related env vars if the intent is to remove logging entirely).
| LOG_OTEL_SERVICE_NAME: fastgpt-code-sandbox | |
| LOG_OTEL_SERVICE_NAME: fastgpt-code-sandbox | |
| LOG_ENABLE_CONSOLE: 'false' | |
| LOG_CONSOLE_LEVEL: info |
|
|
||
| // Logger | ||
| LOG_ENABLE_CONSOLE: z.boolean().default(true), | ||
| LOG_CONSOLE_LEVEL: LogLevelSchema.default('debug'), | ||
| LOG_ENABLE_OTEL: z.boolean().default(false), | ||
| LOG_OTEL_LEVEL: LogLevelSchema.default('info'), | ||
| LOG_OTEL_SERVICE_NAME: z.string().default('fastgpt-code-sandbox'), | ||
| LOG_OTEL_URL: z.url().optional(), | ||
|
|
||
| // ===== 进程池 ===== | ||
| /** 进程池大小(预热 worker 数量) */ | ||
| SANDBOX_POOL_SIZE: int(20).pipe(z.number().min(1).max(100)), |
There was a problem hiding this comment.
The logger env block was removed from envSchema, but LogLevelSchema is still declared above and is now unused. Please remove LogLevelSchema (and any other now-unused logger-related declarations/imports) to avoid dead code and potential unused-symbol lint/TS errors.
|
✅ Build Successful - Preview sandbox Image for this PR: |
|
✅ Build Successful - Preview fastgpt Image for this PR: |
|
✅ Build Successful - Preview mcp_server Image for this PR: |
No description provided.