Merge main into bb/gui.

Resolve merge conflicts while preserving bb/gui dashboard paths and STT provider support.
This commit is contained in:
Brooklyn Nicholson
2026-05-15 15:33:28 -05:00
415 changed files with 38391 additions and 20402 deletions
@@ -181,7 +181,15 @@ class TestTranscribeCallSitesReadDotenv:
assert seen_keys == ["mistral-dotenv-key"]
def test_transcribe_xai_forwards_dotenv_key(self):
"""xAI STT now resolves credentials through ``tools.xai_http`` so the
OAuth bearer wins when present and ``XAI_API_KEY`` is the fallback.
Patch the resolver's ``get_env_value`` to simulate a dotenv-only key
and confirm it reaches the HTTP call. The per-call-site
``transcription_tools.get_env_value`` is still consulted for the
``XAI_STT_BASE_URL`` override (covered by ``test_custom_base_url``).
"""
from tools import transcription_tools as tt
from tools import xai_http
captured: dict = {}
@@ -194,15 +202,12 @@ class TestTranscribeCallSitesReadDotenv:
response.json.return_value = {"text": "hello"}
return response
# get_env_value is consulted for both XAI_API_KEY and XAI_STT_BASE_URL.
# Return the key for the first call, None for base-url override
# (so it defaults to the module-level XAI_STT_BASE_URL).
def fake_get_env_value(name, default=None):
if name == "XAI_API_KEY":
return "xai-dotenv-key"
return None
with patch.object(tt, "get_env_value", side_effect=fake_get_env_value), \
with patch.object(xai_http, "get_env_value", side_effect=fake_get_env_value), \
patch("requests.post", side_effect=fake_post), \
patch("builtins.open", MagicMock()):
result = tt._transcribe_xai("/tmp/fake.mp3", "grok-stt")