Repository navigation
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a20697241f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 90cb311faa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21fc282bf1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1a8325cef2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e961b274b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5cd0f270fb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a4591fc1e5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 46514ac3b9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c3d1d11cfe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de4d516899
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9cb21fb2cf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e4601b30d4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| /** Earlier versions persisted read-aloud audio to Cache Storage under this name, keyed by the | ||
| * message text. Audio is now held only in this tab's memory, so that cache is just deleted. */ | ||
| const LEGACY_TTS_CACHE_NAME = 'tts-responses'; | ||
| const MAX_ENTRIES = 50; |
There was a problem hiding this comment.
Bound the in-memory cache by audio size
When caching is enabled for long responses, this 50-entry limit can retain hundreds of megabytes because each entry is a complete Blob and there is no byte budget; the manual TTS path even accepts and chunks inputs beyond 4096 characters. On memory-constrained browsers this can trigger tab eviction or an out-of-memory failure despite the apparent cap. Track total blob bytes and evict against a configurable memory limit rather than bounding only the number of recordings.
AGENTS.md reference: AGENTS.md:L91-L93
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 571486e: the in-memory cache is now bounded at 32 MB of audio as well as 50 recordings (least recently used evicted), and a single recording over the budget is not kept; ttscache.spec covers both. Making the limits configurable is tracked at berry-13#326.
There was a problem hiding this comment.
💡 Codex Review
LibreChat/client/src/components/Chat/Input/StreamAudio.tsx
Lines 143 to 144 in 571486e
In a browser without MSE support, such as Safari, a TTS response that remains pending across a same-document logout and login still reaches this unconditional setter. Logout clears the atom and increments generation, but the effect neither aborts its fetch on unmount nor checks that generation before publishing the completed blob; the stale Recoil setter can therefore repopulate globalAudioURL after the next account signs in, causing its mounted autoplay element to play the departing account's audio. The fresh evidence beyond the obsolete persistent-cache threads is that this final in-memory implementation fences only setCachedTTSAudio, not response consumption; abort the stream or check the captured generation before publishing audio.
AGENTS.md reference: AGENTS.md:L45-L48
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 20b55700e8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const checkCache = useCallback(() => { | ||
| setIsCacheEmpty(!hasCachedTTSAudio()); |
There was a problem hiding this comment.
Keep the delete action available for retained legacy caches
If the startup clearTTSCache() attempt fails to delete an earlier build's tts-responses cache, this check reports the cache as empty because it inspects only the new in-memory map. The button is then disabled even though the legacy cache can still contain plaintext assistant messages; before this change, the Settings check inspected that persistent cache and allowed the user to retry deletion. Include the legacy Cache Storage state or a failed-cleanup marker when determining whether deletion is available.
AGENTS.md reference: AGENTS.md:L45-L48
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
8a0a4ec to
f957159
Compare
b7016bf to
c97c988
Compare
|
Lighthouse CI failed. The last 80 log lines contain the measured budgets and assertion failures. |
f957159 to
ff97e0d
Compare
Summary
With
cacheTTSon (the default), auto-played and external TTS persisted audio to Cache Storage (tts-responses) keyed by the full assistant message text, and no logout or account-switch path cleared it. On a shared browser the next user could read previous replies, and play the audio, from DevTools.Read-aloud audio is now cached only in the tab's memory: a small map (50 recordings or 32 MB, least recently used evicted) keyed by a SHA-256 hash of the user id, voice and spoken text, so nothing reaches disk, one account can never match another's audio, and the cache dies with the tab. Every session end empties it (logout, IdP logout, a failed logout, a rejected or empty token refresh, a failed user query, and signing in as a different account without a logout), as does the Settings "delete cache" action; a generation counter keeps a request that was in flight across a logout from writing afterwards. The
tts-responsescache that earlier versions left on disk is deleted at app startup, on logout and on the Settings clear. The voice is part of the key, so changing voice no longer replays audio from the old one.Stacked on #16997.
Type of change
Testing
Tested environments/configuration:
cacheTTSon, external TTS engine (routed in the e2e harness), desktop light, desktop dark and mobile.Automated tests:
client/src/utils/ttscache.spec.ts(hash key, user isolation, hit and miss, count and size eviction, clear, account switch, generation fence, legacy cache delete guarded), oneAuthContext.spec.tsxtest per session-end path, andStreamAudio.spec.tsx(lookup by the spoken answer): all pass.e2e/specs/mock/scenarios/tts-cache.spec.ts: a replay plays without a second TTS request, Cache Storage never holds TTS audio, logout empties the cache in the same tab, and a legacytts-responsescache is deleted at startup. All four pass in desktop light, desktop dark and mobile.Screenshots / recordings
No user-facing change
Risk / compatibility
Cached audio no longer survives a reload or carries over to other tabs, so replaying a message after a reload, in another tab, or after signing back in regenerates the audio (one more TTS request). Per-conversation eviction on delete is not included.
Checklist