History

selfhost: read the local-network posture from env in the plugins seam

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.

Rhys Sullivan committed 4 months ago

Commit 210857d1 parent 8d308e41 file · +4 −1Browse files

Showing the changes to apps (1 of 1 file). Show all

Unified · Split

apps/host-selfhost/src/execution.ts+4−1
@@ -44,7 +44,10 @@ export const SelfHostPluginsProvider: Layer.Layer<PluginsProvider> = Layer.succe · 43 unmodified lines
4444 executorConfig.plugins({
4545 activeToolkitSlug:
4646 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",
4851 }),
4952 },
5053 );

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t