@@ -139,21 +139,21 @@ export async function syncModelsToCodex(
139139
140140 if ( externalProvider ) {
141141 if ( catalogEvenWhenNotInjected ) {
142- // External providers own config.toml, so the injection below is only a
143- // courtesy. The catalog is still refreshed: the side profile consumes it.
142+ // External providers own config.toml, and the injector removes the OpenCodex
143+ // journal for external providers (inject.ts). This explicit catalog-only sync
144+ // must not touch config, journal, or history, so refresh the catalog/cache and
145+ // return without injection.
144146 applyProxyEnv ( config ) ;
145147 const refreshed = await refreshCatalogForSync ( config , deps , undefined , log ) ;
146- const result = await deps . injectCodexConfig ( p , config , { } ) ;
147- if ( result . success ) log ?. log ( result . message ) ;
148- else log ?. error ( result . message ) ;
149- reportCodexHomeTarget ( log , deps . collectCodexHomeDiagnostic ?? collectOrcaCodexHomeDiagnostic ) ;
148+ const message = refreshed . catalogWritten || refreshed . cacheSynced
149+ ? "External provider owns config.toml; catalog and models cache refreshed, Codex config/journal untouched."
150+ : "External provider owns config.toml; catalog refresh skipped, Codex config/journal untouched." ;
150151 return {
151- status : "applied " ,
152- ok : result . success ,
152+ status : "catalog-only " ,
153+ ok : true ,
153154 ...refreshed ,
154- message : result . message ,
155+ message,
155156 ...( refreshed . comboOmissions . length > 0 ? { comboOmissions : refreshed . comboOmissions } : { } ) ,
156- ...( result . nativeSubagentDefaultsWarning ? { nativeSubagentDefaultsWarning : result . nativeSubagentDefaultsWarning } : { } ) ,
157157 } ;
158158 }
159159 const result = await deps . injectCodexConfig ( p , config , { } ) ;
0 commit comments