fix: resolve 7 failing CI tests (#3936)

1. matrix voice: _on_room_message_media unconditionally overwrote
   media_urls with the image cache path (always None for non-images),
   wiping the locally-cached voice path. Now only overrides when
   cached_path is truthy.

2. cli_tools_command: /tools disable no longer prompts for confirmation
   (input() removed in earlier commit to fix TUI hang), but tests still
   expected the old Y/N prompt flow. Updated tests to match current
   behavior (direct apply + session reset).

3. slack app_mention: connect() was refactored for multi-workspace
   (creates AsyncWebClient per token), but test only mocked the old
   self._app.client path. Added AsyncWebClient and acquire_scoped_lock
   mocks.

4. website_policy: module-level _cached_policy from earlier tests caused
   fast-path return of None. Added invalidate_cache() before assertion.

5. codex 401 refresh: already passing on current main (fixed by
   intervening commit).
This commit is contained in:
Teknium
2026-03-30 08:10:14 -07:00
committed by GitHub
parent 0b0c1b326c
commit 1e896b0251
4 changed files with 45 additions and 18 deletions

View File

@@ -259,6 +259,12 @@ def test_check_website_access_uses_dynamic_hermes_home(monkeypatch, tmp_path):
monkeypatch.setenv("HERMES_HOME", str(hermes_home))
# Invalidate the module-level cache so the new HERMES_HOME is picked up.
# A prior test may have cached a default policy (enabled=False) under the
# old HERMES_HOME set by the autouse _isolate_hermes_home fixture.
from tools.website_policy import invalidate_cache
invalidate_cache()
blocked = check_website_access("https://dynamic.example/path")
assert blocked is not None