From 8b79254143b681a34bc9c3864af68d98e803f153 Mon Sep 17 00:00:00 2001 From: Yordis Prieto Date: Sat, 7 Nov 2026 17:04:02 -0500 Subject: [PATCH] feat(provider-core): expand ~ in CLAUDE_SECURESTORAGE_CONFIG_DIR - Spawned processes lack shell expansion, so a ~ path in this Claude home variable reached the CLI as a relative path - It names a Claude config directory like CLAUDE_CONFIG_DIR, so it should expand the same way Signed-off-by: Yordis Prieto --- .../provider-core/src/server/instanceEnvironment.test.ts | 4 ++++ packages/provider-core/src/server/pathExpansion.ts | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/provider-core/src/server/instanceEnvironment.test.ts b/packages/provider-core/src/server/instanceEnvironment.test.ts index f5dc3a3a915a5..6c9a905de88b8 100644 --- a/packages/provider-core/src/server/instanceEnvironment.test.ts +++ b/packages/provider-core/src/server/instanceEnvironment.test.ts @@ -26,12 +26,14 @@ describe("mergeProviderInstanceEnvironment", () => { const baseEnv = { CODEX_HOME: "~/.inherited-codex", CLAUDE_CONFIG_DIR: "~/.inherited-claude", + CLAUDE_SECURESTORAGE_CONFIG_DIR: "~/.inherited-claude-secure", GROK_HOME: "~/.inherited-grok", }; const environment = yield* mergeProviderInstanceEnvironment( [ { name: "CODEX_HOME", value, sensitive: false }, { name: "CLAUDE_CONFIG_DIR", value, sensitive: false }, + { name: "CLAUDE_SECURESTORAGE_CONFIG_DIR", value, sensitive: false }, { name: "GROK_HOME", value, sensitive: false }, { name: "CUSTOM_VALUE", value, sensitive: false }, ], @@ -41,6 +43,7 @@ describe("mergeProviderInstanceEnvironment", () => { expect(environment).toEqual({ CODEX_HOME: path.join("/home/ada", tail), CLAUDE_CONFIG_DIR: path.join("/home/ada", tail), + CLAUDE_SECURESTORAGE_CONFIG_DIR: path.join("/home/ada", tail), GROK_HOME: path.join("/home/ada", tail), CUSTOM_VALUE: value, OTEL_RESOURCE_ATTRIBUTES: LAUNCHED, @@ -48,6 +51,7 @@ describe("mergeProviderInstanceEnvironment", () => { expect(baseEnv).toEqual({ CODEX_HOME: "~/.inherited-codex", CLAUDE_CONFIG_DIR: "~/.inherited-claude", + CLAUDE_SECURESTORAGE_CONFIG_DIR: "~/.inherited-claude-secure", GROK_HOME: "~/.inherited-grok", }); }).pipe( diff --git a/packages/provider-core/src/server/pathExpansion.ts b/packages/provider-core/src/server/pathExpansion.ts index 6c5eab795000e..1aaef6e0903d0 100644 --- a/packages/provider-core/src/server/pathExpansion.ts +++ b/packages/provider-core/src/server/pathExpansion.ts @@ -11,7 +11,12 @@ export function expandHomePath(value: string, home: string): string { return value; } -const HOME_PATH_VARIABLES = new Set(["CODEX_HOME", "CLAUDE_CONFIG_DIR", "GROK_HOME"]); +const HOME_PATH_VARIABLES = new Set([ + "CODEX_HOME", + "CLAUDE_CONFIG_DIR", + "CLAUDE_SECURESTORAGE_CONFIG_DIR", + "GROK_HOME", +]); export function expandHomeVariable(name: string, value: string, home: string): string { return HOME_PATH_VARIABLES.has(name) ? expandHomePath(value, home) : value;