Repository: LMCache/LMCache
File: lmcache/v1/plugin/plugin_launcher.py (Python)

Code before:
            ).start()
        except Exception as e:
            logger.error(f"Failed to launch plugin {file}: {e}")

    def _get_interpreter(self, file: Path) -> str:
        """Get interpreter from first line comment"""
        interpreters = []
        try:
            with open(file, "r", encoding="utf-8") as f:
                first_line = f.readline().strip()
                if first_line.startswith("#!"):
                    # Extract interpreter path from shebang
                    return first_line[2:].strip()
        except Exception as e:
            logger.error(f"Error reading plugin file {file}: {e}")
            pass

        # Fallback to default interpreters
        if file.suffix == ".py":
            interpreters.append("python")
            interpreters.append("python3")
        elif file.suffix == ".sh":
            interpreters.append("bash")

        # Try each interpreter until we find one that exists
        for interp in interpreters:
            interp = interp.strip()
            resolved_interp = shutil.which(interp)
            if resolved_interp:
                return resolved_interp

        raise ValueError(f"No valid interpreter found for {file} from {interpreters}")

    def _capture_plugin_output(self, proc: subprocess.Popen, plugin_name: str):
        """Continuously capture and log plugin output"""
        try:
            assert proc.stdout is not None, "The plugin subprocess does not have stdout"
            while True:
                line = proc.stdout.readline()
                if not line:
                    break
                logger.info(f"[{plugin_name}] {line.strip()}")

            proc.wait()
            logger.info(f"Plugin {plugin_name} exited with code {proc.returncode}")
        except Exception as e:
            logger.error(f"Error capturing output for {plugin_name}: {e}")

    def stop_plugins(self):
        """Terminate all plugin processes"""
        for proc in self.plugin_processes:

Review comment (suggestion):
```suggestion
            else:
                raise ValueError(f"Plugin type {file.suffix} not supported ")
```

Code after:
            ).start()
        except Exception as e:
            logger.error(f"Failed to launch plugin {file}: {e}")

    def _get_interpreter(self, file: Path) -> str:
        """Get interpreter from first line comment"""
        interpreters = []
        try:
            with open(file, "r", encoding="utf-8") as f:
                first_line = f.readline().strip()
                if first_line.startswith("#!"):
                    # Extract interpreter path from shebang
                    return first_line[2:].strip()
        except Exception as e:
            logger.error(
                f"Error reading interpreter from plugin file {file} - "
                f"using default interpreters: {e}"
            )
            pass

        # Fallback to default interpreters
        if file.suffix == ".py":
            interpreters.append("python")
            interpreters.append("python3")
        elif file.suffix == ".sh":
            interpreters.append("bash")
        else:
            raise ValueError(f"Plugin type {file.suffix} not supported ")

        # Try each interpreter until we find one that exists
        for interpreter in interpreters:
            interpreter = interpreter.strip()
            resolved_interpreter = shutil.which(interpreter)
            if resolved_interpreter:
                return resolved_interpreter

        raise ValueError(f"No valid interpreter found for {file} from {interpreters}")

    def _capture_plugin_output(self, proc: subprocess.Popen, plugin_name: str):
        """Continuously capture and log plugin output"""
        try:
            assert proc.stdout is not None, "The plugin subprocess does not have stdout"
            while True:
                line = proc.stdout.readline()
                if not line:
                    break
                logger.info(f"[{plugin_name}] {line.strip()}")

            proc.wait()
            logger.info(f"Plugin {plugin_name} exited with code {proc.returncode}")
        except Exception as e: