mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-16 13:00:55 +00:00
* ⚡ perf: Throttle Code Highlighting While a Message Streams * fix: harden streamed code highlight throttling * test: cover wall clock changes during highlighting * style: tidy highlight regression test * fix: restart highlight work across lifecycle changes * style: avoid nested highlight timing ternary * fix: propagate highlight throttle to startup config * fix: share and validate highlight throttle * fix: keep streamed code visible during highlighting * test: stream highlight tool arguments * fix: preserve highlights when cadence config resolves * fix: reschedule highlights when cadence changes * test: preserve default fake tool chunking * fix: prevent stale streamed highlights * test: open the tool pane before asserting streamed highlights Every scenario in this file waited for highlight tokens without opening the card. Dev's #16143 stopped passing a closed pane any code at all, so the four runs polled a card that renders raw text and had nothing to find: the failed traces show the disclosure at aria-expanded="false" for the whole run, with no click against it and no tokens in the code element. Highlighting is now asserted through the card's disclosure, which ProgressText owns and which carries an aria-expanded state only once the card has input to show, so waiting on it also waits for the first streamed argument chunk. The open happens inside expectHighlightedCode, so a scenario cannot assert tokens without it, and it lands while arguments are still streaming, which is the only window where the throttle is under test at all. * test: reopen the rebuilt card for the settled highlight Opening the pane got the streaming assertions passing and the traces show 240 highlight spans mid-stream, so the throttle itself lands. The settled check still failed because persisting the streamed message rebuilds the card, and a rebuilt card starts closed while autoExpandTools is off: the disclosure goes back to aria-expanded="false" and a closed pane renders raw text. The settled and cancelled states now assert through the same open-then-wait helper, so each one measures the card the reader would actually be looking at instead of the tokens the streaming card happened to leave behind. * test: leave a window to cancel a streaming highlight With the settled assertions fixed, the cancellation scenario timed out on the Stop button instead: it waited for a highlight before stopping, and the ~40 argument chunks it streams at 35 ms are gone in under two seconds, so the run had already finished and there was nothing left to cancel. It failed on all three attempts. The card is now opened and the run stopped before any token is awaited, since tokens after cancellation are what the scenario is about, and the cancel variant streams its arguments at a wider cadence so the window does not depend on how loaded the runner is. Only that label changes cadence; every other scenario keeps the timing it had. * fix: preserve initial highlights and honor shared-page cadence --------- Co-authored-by: Lia <lia@librechat.ai> |
||
|---|---|---|
| .. | ||
| agent-management.ts | ||
| authenticate.ts | ||
| cleanupUser.ts | ||
| dynamic-mcp-tools.js | ||
| env.ts | ||
| fake-assistants-server.js | ||
| fake-code-server.js | ||
| fake-label-server.js | ||
| fake-mcp-dynamic-network-server.js | ||
| fake-mcp-http-server.js | ||
| fake-mcp-oauth-server.js | ||
| fake-mcp-server.js | ||
| fake-model.js | ||
| fake-rag-server.js | ||
| global-setup.local.ts | ||
| global-setup.ts | ||
| global-teardown.local.ts | ||
| global-teardown.mock.ts | ||
| global-teardown.ts | ||
| model-replay.js | ||
| record-model.js | ||
| record.js | ||
| run-files-lifecycle-model.js | ||
| run-files-model.js | ||
| runtimeEnv.ts | ||
| start-server-cluster.js | ||
| start-server.js | ||
| tool-approval-hook.js | ||
| user.ts | ||
| users.mock.ts | ||