Files
rea/tests/fixtures/clientEnvironment.ts
gensokyo-dev c77735fa83 fix(setup)!: bind managed registrations to selected installation
Use one command owner for setup, client writers, Gemini policy and CLI defaults.
Migrate recognized runner registrations with backups and remove runner prewarm.
Retain unknown identities and exercise real offline npm, CLI and MCP workflows.

Fixes #7757

BREAKING CHANGE: managed MCP registrations use the selected absolute runtime
and REA entry script, including package-runner cache paths. Keep that installation
available or restore it before setup; unknown registrations require confirmed
manual repair. Setup no longer returns prewarm or emits its progress events.

Assisted-by: Reimu (gensokyo-skills:reimu-incident-triage)
Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
Assisted-by: Yukari (gensokyo-skills:yukari-boundary-analysis)
2026-10-28 11:34:28 +00:00

42 lines
1.1 KiB
TypeScript

import { vi } from "vitest";
/** Environment variables that redirect where supported clients keep config. */
export const CLIENT_LOCATION_ENVIRONMENT = [
"APPDATA",
"CLAUDE_CONFIG_DIR",
"CODEX_HOME",
"DSH_HOME",
"DSH_AGENTS_HOME",
"COPILOT_HOME",
"FACTORY_HOME_OVERRIDE",
"GROK_HOME",
"GEMINI_CLI_HOME",
"GEMINI_CLI_TRUST_WORKSPACE",
"GEMINI_RESTRICTED_MODE",
"GEMINI_CLI_TRUSTED_FOLDERS_PATH",
"GEMINI_CLI_SYSTEM_SETTINGS_PATH",
"GEMINI_CLI_SYSTEM_DEFAULTS_PATH",
"HERMES_DATA_DIR_SUFFIX",
"HERMES_HOME",
"KIMI_CODE_HOME",
"LOCALAPPDATA",
"OMP_PROFILE",
"OPENCODE_CONFIG",
"OPENCODE_CONFIG_DIR",
"PI_CODING_AGENT_DIR",
"PI_CONFIG_DIR",
"PI_PROFILE",
"QODER_CONFIG_DIR",
"QWEN_HOME",
"SAND_DATA_ROOT",
"VSCODE_APPDATA",
"VSCODE_CWD",
"VSCODE_PORTABLE",
"XDG_CONFIG_HOME",
] as const;
/** Clear the developer's client locations so tests resolve only their temporary homes. */
export const clearClientLocationEnvironment = (): void => {
for (const name of CLIENT_LOCATION_ENVIRONMENT) vi.stubEnv(name, undefined);
};