Skip to content

The agent that grows with you

test(google_meet): pin late Join button, mic unmute and stdin-fed PCM pump; document caption-derived input

teknium1eb02bec6440a
diff --git a/plugins/google_meet/README.md b/plugins/google_meet/README.md
index 53049a58464..97badcf7637 100644
--- a/plugins/google_meet/README.md
+++ b/plugins/google_meet/README.md
@@ -8,7 +8,7 @@ in it, and do the followup work afterwards.
| Version | What | Status |
|---|---|---|
| v1 | Transcribe-only: Playwright joins Meet, scrapes captions to transcript file | ✓ ships by default |
-| v2 | Realtime duplex audio: bot speaks in-call via OpenAI Realtime + BlackHole/PulseAudio null-sink | ✓ opt in with `mode='realtime'` |
+| v2 | Realtime speech out: bot speaks in-call via OpenAI Realtime + BlackHole/PulseAudio null-sink; input stays caption-derived | ✓ opt in with `mode='realtime'` |
| v3 | Remote node host: run the bot on a different machine than the gateway | ✓ opt in with `node='<name>'` |
## Architecture
@@ -96,6 +96,13 @@ On macOS, hermes will **not** switch your system audio input automatically — t
user has to do it. This is deliberate: switching default input on a whim would
be a surprising side effect.
+Realtime mode is **speak-only**: `speaker.pcm` is streamed into the virtual mic by a
+stdin-fed `paplay` / `ffmpeg` pump that follows the file as Realtime appends audio.
+Incoming speech is still the caption scrape (v1) — meeting audio is never sent to the
+Realtime session, so there is no barge-in on raw audio and no STT billing. After
+admission the bot unmutes itself if Meet seated it muted; `status.json` / `hermes meet
+status` report the result as `micState` (`unmuted`, `unmuted_clicked`, `unknown`).
+
## Remote node host
On the node machine (e.g. user's Mac with a signed-in Chrome):
@@ -129,3 +136,4 @@ hermes meet node ping my-mac
- **Multi-tenant node sharing** — a node serves one gateway at a time.
- **Windows** — audio bridging isn't tested; `register()` no-ops on Windows.
- **System audio input switching on macOS** — user responsibility, not the bot's.
+- **Meeting-audio ingestion into Realtime** — input is caption-derived; true bidirectional audio is a separate feature.
diff --git a/tests/plugins/test_google_meet_plugin.py b/tests/plugins/test_google_meet_plugin.py
index d12ea77d43f..391b5af9be5 100644
--- a/tests/plugins/test_google_meet_plugin.py
+++ b/tests/plugins/test_google_meet_plugin.py
@@ -270,6 +270,85 @@ def test_detect_admission_returns_false_on_error():
assert _probe(_FakePage(), _ADMISSION_PROBE_JS) is False
+# ---------------------------------------------------------------------------
+# Realtime join path: late Join button, muted mic, PCM pump fed after start-up (#80875)
+# ---------------------------------------------------------------------------
+
+class _Toggle:
+ """Playwright-locator stand-in: visible when *present*, records clicks on *page*."""
+
+ def __init__(self, page, present, label):
+ self.page, self.present, self.label = page, present, label
+
+ first = property(lambda self: self)
+ def count(self): return 1 if self.present() else 0
+ def is_visible(self): return self.present()
+ def click(self, timeout=None): self.page.clicked.append(self.label)
+
+
+def test_join_polls_for_late_button_and_admission_unmutes_mic(tmp_path):
+ """Meet renders Join now / the mic toggle asynchronously; a one-shot click missed it (#80875)."""
+ import time
+
+ from plugins.google_meet.meet_bot import _BotConfig, _BotState, _ensure_mic_on, _join
+
+ class _Page:
+ def __init__(self, ready_at, mic_muted):
+ self.ready_at, self.mic_muted, self.clicked = ready_at, mic_muted, []
+
+ def locator(self, sel):
+ muted = "Turn on microphone" in sel
+ return _Toggle(self, lambda: self.mic_muted == muted, sel)
+
+ def get_by_role(self, role, name=None, exact=False):
+ return _Toggle(self, lambda: name == "Join now" and time.time() >= self.ready_at, name)
+
+ state = _BotState(tmp_path, "abc-defg-hij", "https://meet.google.com/abc-defg-hij")
+ page = _Page(ready_at=time.time() + 0.6, mic_muted=True)
+ _join(page, _BotConfig(guest_name="Bot"), state, timeout=5.0)
+ assert page.clicked == ["Join now"]
+
+ assert _ensure_mic_on(page) == "unmuted_clicked"
+ assert any("Turn on microphone" in c for c in page.clicked)
+ # Control: an already-live mic is reported, never toggled off.
+ live = _Page(ready_at=0, mic_muted=False)
+ assert _ensure_mic_on(live) == "unmuted" and live.clicked == []
+
+
+def test_pcm_pump_receives_audio_appended_after_start(tmp_path, monkeypatch):
+ """The pump used to read the empty speaker.pcm to EOF and exit before Realtime spoke (#80875)."""
+ import subprocess
+ import time
+
+ from plugins.google_meet import meet_bot
+
+ pcm, sink = tmp_path / "speaker.pcm", tmp_path / "device.bin"
+ pcm.write_bytes(b"")
+ real_popen = subprocess.Popen
+
+ def cat_popen(cmd, **kw): # `cat` stands in for paplay: same stdin / file-EOF semantics
+ assert cmd[0] == "paplay" and cmd[-1] == "-"
+ kw["stdout"] = open(sink, "wb")
+ return real_popen(["cat"], **kw)
+
+ monkeypatch.setattr(meet_bot.subprocess, "Popen", cat_popen)
+ rt, stop = {}, {"stop": False}
+ state = meet_bot._BotState(tmp_path, "abc-defg-hij", "https://meet.google.com/abc-defg-hij")
+ meet_bot._start_pcm_pump(rt, {"platform": "linux", "write_target": "sink"}, pcm, state, stop)
+ time.sleep(0.2)
+ with open(pcm, "ab") as f:
+ f.write(b"\x01\x02" * 2000)
+ deadline = time.time() + 5
+ while time.time() < deadline and sink.stat().st_size < 4000:
+ time.sleep(0.05)
+ assert rt["pcm_pump"].poll() is None
+ assert sink.stat().st_size == 4000
+ stop["stop"] = True
+ meet_bot._teardown_realtime({**rt, "speaker_thread": None, "session": None, "bridge": None})
+ assert not rt["pcm_tail_thread"].is_alive()
+ assert state.mic_state is None and "micState" in state.status_path.read_text(encoding="utf-8")
+
+
# ---------------------------------------------------------------------------
# Realtime session counters + cancel_response (barge-in)
# ---------------------------------------------------------------------------
diff --git a/website/docs/user-guide/features/built-in-plugins.md b/website/docs/user-guide/features/built-in-plugins.md
index ad5663f2075..b9391ebe45d 100644
--- a/website/docs/user-guide/features/built-in-plugins.md
+++ b/website/docs/user-guide/features/built-in-plugins.md
@@ -273,7 +273,7 @@ Lets the agent **join, transcribe, and participate in Google Meet calls** — ta
**What it adds:**
- A headless virtual participant that joins a Meet URL using browser automation
-- Live transcription of the meeting audio via the configured STT provider
+- Live transcription derived from Meet's own live captions (the bot never decodes the meeting audio, so no STT billing — and captions are lossy and English-biased)
- A `meet_join` / `meet_status` / `meet_transcript` / `meet_leave` / `meet_say` toolset the agent invokes to join calls, poll the live transcript, and act on what it heard
- Post-meeting artifacts (transcript, status) saved under `~/.hermes/workspace/meetings/<meeting_id>/`
@@ -293,6 +293,8 @@ Usage from chat:
The agent kicks off the meeting join, streams the transcription back into its context as the call proceeds, and produces a structured summary when the meeting ends (or when you tell it to stop).
+**Realtime mode (`mode='realtime'`) is speak-only on the audio side.** The bot's replies are synthesized by OpenAI Realtime and played into the call through a virtual microphone; what it *hears* is still the caption stream, not the meeting audio — nothing from the call is sent to the Realtime session. `meet_status` reports `micState` (`unmuted`, `unmuted_clicked` when the bot had to unmute itself after admission, or `unknown` when Meet's toggle was not found) so a silent bot can be diagnosed.
+
**When to use it:** recurring standups where you want a bot to transcribe + summarize for async attendees; deposition-style interviews where you want structured notes; any case where you'd otherwise need Fireflies / Otter / Grain. When you'd rather not have an AI listening in — don't enable it.
**Disabling:** `hermes plugins disable google_meet`. Any saved transcripts stay in `~/.hermes/workspace/meetings/` until you remove them.