The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
refactor(plugins/google_meet): AudioBridge — drop redundant _torn_down flag (module id list already encodes it)
Tekniume1f145538e18
diff --git a/plugins/google_meet/audio_bridge.py b/plugins/google_meet/audio_bridge.pyindex c69513e94ae..9ba3483fe41 100644--- a/plugins/google_meet/audio_bridge.py+++ b/plugins/google_meet/audio_bridge.py@@ -30,7 +30,6 @@ class AudioBridge:self._device_name: Optional[str] = Noneself._write_target: Optional[str] = Noneself._module_ids: list[int] = []- self._torn_down = Falsedef _ready(self, value: Optional[str]) -> str:if not value:@@ -47,27 +46,20 @@ class AudioBridge:return self._setup_linux()if system == "Darwin":return self._setup_darwin()- if system == "Windows":- raise RuntimeError("windows not supported in v2")- raise RuntimeError(f"unsupported platform: {system}")+ raise RuntimeError("windows not supported in v2" if system == "Windows" else f"unsupported platform: {system}")def teardown(self) -> None:"""Release the virtual audio device. Idempotent; never raises."""- if self._torn_down:- return- if self._platform == "linux":- for mod_id in reversed(self._module_ids): # virtual-source before null-sink- with contextlib.suppress(Exception):- _pactl("unload-module", str(mod_id), check=False)- self._module_ids = []- self._torn_down = True+ for mod_id in reversed(self._module_ids): # linux only; virtual-source before null-sink+ with contextlib.suppress(Exception):+ _pactl("unload-module", str(mod_id), check=False)+ self._module_ids = []def _finish(self, tag: str, device: str, write_target: str, module_ids: list[int]) -> dict:self._platform = tagself._device_name = deviceself._write_target = write_targetself._module_ids = module_ids- self._torn_down = Falsereturn {"platform": tag, "device_name": device, "sample_rate": 48000, "channels": 2,"module_ids": list(module_ids), "write_target": write_target}