different-ai/openwork · warning · Error
settings.environment.apply_unavailable
Error message
settings.environment.apply_unavailable
What it means
handleApplyEnvironmentChanges only supports applying environment changes in the desktop runtime, where the app can mutate the local environment and reload the server. In the web runtime the i18n key settings.environment.apply_unavailable is thrown to signal the operation is not supported there.
Source
Thrown at apps/app/src/react-app/shell/settings-route.tsx:2209
notifyAlert({
kind: "system",
title: notFoundRouteError,
dedupeKey: "workspace-not-found",
});
}
}, [notFoundRouteError]);
const routeOpenworkCapabilities: OpenworkServerCapabilities | null = openworkClient
? ROUTE_OPENWORK_CAPABILITIES
: null;
const environmentRuntimeKey = buildOpenworkEnvRuntimeKey({
baseUrl: openworkServerSnapshot.openworkServerBaseUrl || openworkServerSnapshot.openworkServerUrl,
pid: openworkServerSnapshot.openworkServerHostInfo?.pid ?? null,
port: openworkServerSnapshot.openworkServerHostInfo?.port ?? null,
});
const handleApplyEnvironmentChanges = async () => {
if (!isDesktopRuntime()) {
throw new Error(t("settings.environment.apply_unavailable"));
}
if (activeReloadBlockingSessions.length > 0) {
throw new Error(t("settings.environment.apply_blocked_active_tasks"));
}
if (!selectedWorkspaceRoot) {
throw new Error(t("settings.environment.apply_no_local_workspace"));
}
const workspacePaths = Array.from(
new Set(
workspaces.flatMap((workspace) => {
const path = workspace.workspaceType !== "remote" ? workspace.path?.trim() ?? "" : "";
return path ? [path] : [];
}),
),
);
const workspacePathSet = new Set(workspacePaths);
if (!workspacePathSet.has(selectedWorkspaceRoot)) {
workspacePaths.unshift(selectedWorkspaceRoot);View on GitHub (pinned to 2b7df46e8a)
Solutions
- Use the OpenWork desktop app to apply environment changes.
- In web deployments, hide/disable the apply-environment control instead of invoking it.
- Set environment variables directly on the web server host and restart it.
Example fix
// before
const handleApplyEnvironmentChanges = async () => {
if (!isDesktopRuntime()) throw new Error(t("settings.environment.apply_unavailable"));
// after
const handleApplyEnvironmentChanges = async () => {
if (!isDesktopRuntime()) { toast(t("settings.environment.apply_unavailable")); return; } Defensive patterns
Strategy: validation
Validate before calling
if (!isDesktopRuntime()) {
showNotice(t("settings.environment.apply_unavailable"));
return; // do not call handleApplyEnvironmentChanges
} Type guard
const isDesktop = (): boolean => isDesktopRuntime(); // narrow runtime before enabling apply UI
Try / catch
try {
await handleApplyEnvironmentChanges();
} catch (e) {
if (e instanceof Error && e.message === t("settings.environment.apply_unavailable")) {
// desktop-only: hide the control in web builds
} else throw e;
} Prevention
- Render the apply-environment control only when isDesktopRuntime() is true.
- Document that environment mutation is desktop-only.
- Add a runtime check in tests covering the web path.
- Prefer disabling UI over throwing from handlers.
When it happens
Trigger: Clicking 'Apply environment changes' in Settings while the app runs in the browser (isDesktopRuntime() === false).
Common situations: Using the web/headless deployment and expecting desktop-only environment mutation; testing the settings UI without the Electron shell.
Related errors
- OpenWork-managed MCP OAuth is currently available for local
- Missing Google OAuth configuration: ${missing.join(", ")}
- github_connector_app_not_configured
- settings.environment.apply_blocked_active_tasks
- settings.environment.apply_no_local_workspace
AI-assisted analysis of different-ai/openwork@2b7df46e8a (2026-09-01).
Data as JSON: /api/errors/2ef18e895fcbec30.
Report an issue: GitHub.