From 4b4e2c43be08623d094aec285908519014f529c8 Mon Sep 17 00:00:00 2001 From: Kit Langton Date: Tue, 11 Aug 2026 23:20:34 -0400 Subject: [PATCH] refactor: drop the speculative OPENCODE_GLOBAL_ROOT escape hatch The workerd tmp-rooting is what the profile needs; an env override with no consumer can return when something wants it. --- packages/util/src/global.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/util/src/global.ts b/packages/util/src/global.ts index 7d9e74a6dfa..9b071d39c44 100644 --- a/packages/util/src/global.ts +++ b/packages/util/src/global.ts @@ -8,10 +8,9 @@ import { makeGlobalNode } from "./effect/app-node.js" const app = "opencode" // workerd has no home directory or XDG base dirs and only tmp is writable, so -// root every global path under one directory there. OPENCODE_GLOBAL_ROOT -// overrides the root on any runtime. +// root every global path under one directory there. const workerd = (globalThis as { navigator?: { userAgent?: string } }).navigator?.userAgent === "Cloudflare-Workers" -const root = process.env.OPENCODE_GLOBAL_ROOT ?? (workerd ? path.join(os.tmpdir(), app) : undefined) +const root = workerd ? path.join(os.tmpdir(), app) : undefined const data = root ? path.join(root, "data") : path.join(xdgData!, app) const cache = root ? path.join(root, "cache") : path.join(xdgCache!, app) const config = root ? path.join(root, "config") : path.join(xdgConfig!, app)