plugins() runs per request; loadConfig() does filesystem work (data dir, secret key resolution) that should not ride the request path. The env read is the same computation loadConfig makes for the flag.
Unified · Split
| @@ -44,7 +44,10 @@ export const SelfHostPluginsProvider: Layer.Layer<PluginsProvider> = Layer.succe · 43 unmodified lines | |||
| 44 | executorConfig.plugins({ | 44 | executorConfig.plugins({ |
| 45 | activeToolkitSlug: | 45 | activeToolkitSlug: |
| 46 | context?.mcpResource?.kind === "toolkit" ? context.mcpResource.slug : undefined, | 46 | context?.mcpResource?.kind === "toolkit" ? context.mcpResource.slug : undefined, |
| 47 | allowLocalNetwork: loadConfig().allowLocalNetwork, | 47 | // Read the env directly (same computation as loadConfig().allowLocalNetwork): |
| 48 | // plugins() runs per request, and loadConfig does filesystem work | ||
| 49 | // (data dir, secret key) that must not ride the request path. | ||
| 50 | allowLocalNetwork: process.env.EXECUTOR_ALLOW_LOCAL_NETWORK === "true", | ||
| 48 | }), | 51 | }), |
| 49 | }, | 52 | }, |
| 50 | ); | 53 | ); |