Mirrors test_issue2025_xiaomi_env_key.py pattern:
- _PROVIDER_ENV_VAR['neuralwatt'] == 'NEURALWATT_API_KEY'
- _provider_has_key('neuralwatt') with env var set
- _provider_has_key('neuralwatt') without env var
- model group appears in get_available_models() when config lists models
Apply the warm-review polish: parseInt radix 10, fall back to 1800 for
missing/NaN/non-positive values, and floor at 200ms so a mistyped tiny/negative
hermes-voice-silence-ms can't make the recognizer auto-send instantly. De-brittle
the source-string test to assert behavior (reads key / 1800 fallback / guards
non-positive) instead of one literal expression. Default behavior unchanged.
The voice-mode loop hardcoded SILENCE_MS=1800 and
_recognition.continuous=false, giving users no way to tune the
auto-send timing or keep the mic open across natural pauses.
Changes:
- SILENCE_MS now reads from localStorage key 'hermes-voice-silence-ms'
with 1800ms fallback — users set it from the dev console or a future
settings toggle
- _recognition.continuous reads from 'hermes-voice-continuous' (default
false) — set to 'true' to keep the mic open across pauses within an
utterance, with the silence timer remaining the sole send decision
New test file (tests/test_issue4761_voice_mode_config.py, 8 tests)
pins both localStorage reads and verifies the surrounding voice-mode
infrastructure is intact.
Refs #4761
#5201 grows startSessionStream, pushing the hidden early-return skip path to
offset ~2247; #5172's test sliced an outer 2400 window that truncated the
skip_block before _startHiddenActiveStreamPoll(sid). Widen to 2900 so the
assertion reaches it. Both production hidden-poll paths are intact (Codex
verified); test-window only.
The rebase onto current master (which carries #5172's window bumps) left the
reopen-path test window at 1600, but #5201 grows startSessionStream so the
'else if (_sessionStreamHiddenSid)' reopen assertion now lands at offset ~1741.
Widen to 2200 (matching #5201's sibling windows) so the assertion reaches the
code. Test-window only; production unchanged.
Translate settings_label_virtualize_transcript and its description into
Polish; they were still showing the English fallback. Also remove the
stray UTF-8 BOM from the top of the file.
Update the older #1432 static regression to assert the extracted reusable-empty helper owns the message-count and in-flight checks, while both New Chat entry points call the helper. This keeps the test aligned with the shared guard introduced in PR #5206.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Adds the optional regression test the gate recommended: pins that
_redact_fn_cached stays byte-identical to _redact_fn_uncached for sensitive
input, is idempotent, and that >16KB inputs which bypass the lru_cache are
still redacted identically (no cache-skip secret leak). Production code
unchanged.
The combined credential redactor (~15 regex passes per string) runs on the
full message history of every /api/session response. Under concurrent
dashboard polling of unchanged sessions this became the dominant CPU cost
and, behind the GIL in the single-process server, serialized requests to
10-44s each — surfacing as repeated 'connection lost' in the browser as
the proxy/browser timed out and the frontend retried, piling on threads.
The redactor is pure and deterministic (force=True, fixed masking), so
identical strings always map to identical output and are safe to memoize
without invalidation. Wrap it in an lru_cache(maxsize=4096), gated to
strings <=16KB so a few giant tool-output dumps can't evict the many small
recurring strings or balloon RSS. Repeated polls become O(1) cache hits
(measured 3.7ms -> 0.002ms per 3KB marker string).
_redact_fn_cached is preserved as the call-site name so the existing
monkeypatch-based redaction tests bypass the cache unchanged (69/69 pass).
Adds the test the project's contribution rules require for non-trivial logic
(AGENTS.md). Covers: posix passthrough (1 call, no sleep), Windows
retry-then-succeed, reraise after exhausting 5 attempts (no silent success on a
save path), no-retry on non-PermissionError, and the 50/100/200/400ms backoff
sequence. Production _safe_replace unchanged.
Windows locks session JSON files briefly during antivirus scans or
browser polling, causing os.replace() to raise WinError 5
(ERROR_ACCESS_DENIED). Add _safe_replace() helper that retries with
exponential backoff (50ms to 800ms, max 5 attempts) on PermissionError.
No-op on non-Windows platforms.
Replaces all 5 os.replace() call sites in models.py:
- Session.save() (main file + backup)
- _write_session_index() (full rebuild + fast path)
- prune_session_from_index()