@@ -20,7 +20,7 @@ const ALLOWED_BUILD_COMMANDS = new Set(['npm', 'uv', 'pip', 'pip3']);
2020 * Get command path from global cache
2121 * Falls back to /usr/bin if cache miss (should not happen after initialization)
2222 */
23- function getCommandPath ( command : string ) : string {
23+ function getCommandPath ( command : string , logger ?: Logger ) : string {
2424 // eslint-disable-next-line @typescript-eslint/no-explicit-any
2525 const cache = ( global as any ) . DEPLOYSTACK_COMMAND_CACHE as Map < string , string > | undefined ;
2626
@@ -29,7 +29,13 @@ function getCommandPath(command: string): string {
2929 }
3030
3131 // Fallback to /usr/bin (should not happen after proper initialization)
32- console . warn ( `WARNING: Command ${ command } not found in cache, using /usr/bin fallback` ) ;
32+ if ( logger ) {
33+ logger . warn ( {
34+ operation : 'command_cache_miss' ,
35+ command,
36+ fallbackPath : `/usr/bin/${ command } `
37+ } , `Command ${ command } not found in cache, using /usr/bin fallback` ) ;
38+ }
3339 return `/usr/bin/${ command } ` ;
3440}
3541
@@ -134,7 +140,7 @@ export class ProcessSpawner {
134140
135141 // Get path from runtime-resolved cache (dynamically found at startup)
136142 const normalizedCommand = command . trim ( ) . toLowerCase ( ) ;
137- const path = getCommandPath ( normalizedCommand ) ;
143+ const path = getCommandPath ( normalizedCommand , this . logger ) ;
138144
139145 if ( ! path ) {
140146 // This shouldn't happen if command cache was initialized
@@ -457,7 +463,7 @@ export class ProcessSpawner {
457463 }
458464
459465 // Get command path from runtime-resolved cache
460- const commandPath = getCommandPath ( normalizedCommand ) ;
466+ const commandPath = getCommandPath ( normalizedCommand , this . logger ) ;
461467 if ( ! commandPath ) {
462468 throw new Error ( `Command path not found for build command '${ command } '` ) ;
463469 }
0 commit comments