Merge branch 'fix/unify-e2e-speech-bubbles' into unify/skills-20261112-night

This commit is contained in:
Kevin Veen-Birkenbach committed 2026-11-13 20:41:23 +00:00
commit 86b84bfb4e
2 files changed
+12 -4

No files matched your search

+11 -3
View File
@@ -6,6 +6,7 @@ import shutil
import sys import sys
import time import time
import unittest import unittest
from collections.abc import Callable
from pathlib import Path from pathlib import Path
from unittest import mock from unittest import mock
@@ -21,6 +22,13 @@ WIDTH, HEIGHT = 1366, 768
CUE = "front" CUE = "front"
SPEAKERS = ("Skills session", "Stage", "Docs") SPEAKERS = ("Skills session", "Stage", "Docs")
SAID = "disk almost full on the build host so rotate the logs and retry the gate before the next push" SAID = "disk almost full on the build host so rotate the logs and retry the gate before the next push"
SILENT = """() => {
try {
localStorage.setItem("kvb-orchestrator.radio", JSON.stringify({mode: "silence", classes: ["mayday", "security"], muted: []}));
} catch (error) {
return;
}
}"""
SPAWN = """ SPAWN = """
const agentChart = () => document.querySelector('#main svg.ancestry[aria-label="Ancestry: operator, chair, sessions, subagents"]'); const agentChart = () => document.querySelector('#main svg.ancestry[aria-label="Ancestry: operator, chair, sessions, subagents"]');
const agentNodes = () => all("g.ancestry-node", agentChart()).map((node) => { const agentNodes = () => all("g.ancestry-node", agentChart()).map((node) => {
@@ -166,9 +174,9 @@ class TestHubBubbleFrontAndSpawnFaces(HubCase):
}) })
self.subagents(now) self.subagents(now)
hub = self.httpd.hub hub = self.httpd.hub
hub.settings.put({**hub.settings.get(), "bubbles": True, "speech": {"on": False, "classes": ["mayday", "security"], "muted": []}}, hub.settings.get()) hub.settings.put({**hub.settings.get(), "bubbles": True}, hub.settings.get())
def synthesize(body: bytes) -> bytes: def synthesize(body: bytes, admit: Callable[[str], None]) -> bytes:
if json.loads(body)["text"] == CUE: if json.loads(body)["text"] == CUE:
rows = [{"ts": time.time(), "from": name, "to": [], "text": f"{name}: {SAID}, {SAID}", "class": "security", "v": 2} for name in SPEAKERS] rows = [{"ts": time.time(), "from": name, "to": [], "text": f"{name}: {SAID}, {SAID}", "class": "security", "v": 2} for name in SPEAKERS]
with (self.council / "news.jsonl").open("a", encoding="utf-8") as handle: with (self.council / "news.jsonl").open("a", encoding="utf-8") as handle:
@@ -222,7 +230,7 @@ class TestHubBubbleFrontAndSpawnFaces(HubCase):
self.assertNotEqual(following["speaker"], following["first"]) self.assertNotEqual(following["speaker"], following["first"])
def test_chromium_keeps_the_speaking_bubble_in_front_and_draws_faces_in_the_spawn_ancestry(self): def test_chromium_keeps_the_speaking_bubble_in_front_and_draws_faces_in_the_spawn_ancestry(self):
data = self.drive(self.steps(), None) data = self.drive(self.steps(), None, init=SILENT)
(OUT / "chromium-bubble-faces.json").write_text(json.dumps(data, indent=1), encoding="utf-8") (OUT / "chromium-bubble-faces.json").write_text(json.dumps(data, indent=1), encoding="utf-8")
self.assertEqual([error for error in data["errors"] if "/favicon.ico" not in error], []) self.assertEqual([error for error in data["errors"] if "/favicon.ico" not in error], [])
self.check(data) self.check(data)
+1 -1
View File
@@ -247,7 +247,7 @@ class TestWorkbenchBubbles(HubCase):
word = json.loads(body)["text"] word = json.loads(body)["text"]
if word == f"{CUE}-long": if word == f"{CUE}-long":
with (self.council / "news.jsonl").open("a", encoding="utf-8") as handle: with (self.council / "news.jsonl").open("a", encoding="utf-8") as handle:
handle.write(self.jsonl([{"ts": time.time(), "from": "Stage", "to": [], "text": LONG, "class": "security", "v": 2}])) handle.write(self.jsonl([{"ts": time.time(), "from": "Stage", "to": [], "text": LONG, "class": "broadcast", "v": 2}]))
elif word.startswith(CUE): elif word.startswith(CUE):
now = time.time() now = time.time()
rows = [ rows = [