@@ -54,8 +54,7 @@ static bool tf_invoked_as_windows_git_module(void) {
5454 * Inspect the actual loaded module so the copied git.exe probe cannot fall
5555 * through into the ordinary test runner when argv[0] is merely "git". */
5656 wchar_t image [32768 ];
57- DWORD image_length =
58- GetModuleFileNameW (NULL , image , (DWORD )(sizeof (image ) / sizeof (image [0 ])));
57+ DWORD image_length = GetModuleFileNameW (NULL , image , (DWORD )(sizeof (image ) / sizeof (image [0 ])));
5958 if (image_length == 0 || image_length >= (DWORD )(sizeof (image ) / sizeof (image [0 ]))) {
6059 return false;
6160 }
@@ -86,8 +85,7 @@ static bool tf_invoked_as_blocking_git(const char *argv0) {
8685 base = cursor + 1 ;
8786 }
8887 }
89- return strcmp (base , "git" ) == 0 || strcmp (base , "git.exe" ) == 0 ||
90- strcmp (base , "GIT.EXE" ) == 0 ;
88+ return strcmp (base , "git" ) == 0 || strcmp (base , "git.exe" ) == 0 || strcmp (base , "GIT.EXE" ) == 0 ;
9189#endif
9290}
9391
@@ -165,6 +163,38 @@ static void tf_cleanup_cache_sentinel(void) {
165163 }
166164}
167165
166+ /* Client home overrides the CLI honours BEFORE $HOME, so redirecting HOME alone
167+ * does not isolate them: cbm_codex_config_dir() and its siblings return the
168+ * ambient path and the suite resolves against the developer's real config —
169+ * reading its state and writing to it. Same inventory the shell fixtures are
170+ * already required to neutralize (tests/test_smoke_fixture_contract.sh), kept
171+ * in one place so a new client cannot be isolated in the smoke scripts and
172+ * forgotten here. A test that exercises one of these sets it after setup. */
173+ static const char * const tf_client_home_overrides [] = {
174+ "CLAUDE_CONFIG_DIR" ,
175+ "CODEX_HOME" ,
176+ "KIRO_HOME" ,
177+ "HERMES_HOME" ,
178+ "QWEN_HOME" ,
179+ "CLINE_DATA_DIR" ,
180+ "OPENCLAW_HOME" ,
181+ "OPENCLAW_STATE_DIR" ,
182+ "OPENCLAW_PROFILE" ,
183+ "OPENCLAW_CONFIG_PATH" ,
184+ "OPENCLAW_WORKSPACE_DIR" ,
185+ "OPENCODE_CONFIG" ,
186+ "OPENCODE_CONFIG_DIR" ,
187+ "COPILOT_HOME" ,
188+ "CRUSH_GLOBAL_CONFIG" ,
189+ "VIBE_HOME" ,
190+ "GLAB_CONFIG_DIR" ,
191+ "KIMI_CODE_HOME" ,
192+ "CBM_CONTINUE_CONFIG_PATH" ,
193+ "CBM_TRAE_CONFIG_PATH" ,
194+ "CBM_ROO_CONFIG_PATH" ,
195+ "CBM_CODY_CONFIG_PATH" ,
196+ };
197+
168198static bool tf_setup_cache_sentinel (void ) {
169199 snprintf (tf_home_sentinel , sizeof (tf_home_sentinel ), "/tmp/cbm-test-home-XXXXXX" );
170200 if (!cbm_mkdtemp (tf_home_sentinel )) {
@@ -175,6 +205,10 @@ static bool tf_setup_cache_sentinel(void) {
175205 * override keeps both conventions pointed at the same isolated tree. */
176206 cbm_setenv ("HOME" , tf_home_sentinel , 1 );
177207 cbm_unsetenv ("CBM_CACHE_DIR" );
208+ for (size_t i = 0U ; i < sizeof (tf_client_home_overrides ) / sizeof (tf_client_home_overrides [0 ]);
209+ i ++ ) {
210+ cbm_unsetenv (tf_client_home_overrides [i ]);
211+ }
178212 atexit (tf_cleanup_cache_sentinel );
179213 return true;
180214}
0 commit comments