Stops the current chat from fully reloading every time you switch Connection Profiles — but still reloads when it's genuinely needed.
When you change the Connection Profile in API Connections, the Connection
Manager re-applies every setting stored in that profile, including the regex
preset. The built-in Regex extension always calls reloadCurrentChat() when a
preset is applied — even when the applied preset produces the exact same
on-screen result. That full re-render of the message list is what feels like
"the whole app reloading" on every profile switch.
A chat reload only changes what you see by re-running display-time regex. In
that pass (getRegexedString with isMarkdown = true), only scripts flagged
markdownOnly are applied. Non-markdown scripts mutate stored message text at
generation time and are not re-applied on reload.
So a profile switch needs a reload only if the set (and relevant
fields/order) of enabled markdownOnly scripts changes.
It wraps the /regex-preset slash command (what Connection Manager calls
internally) and compares the display-affecting regex scripts before vs. after:
- Display output will change → defers to the original command: full apply + reload (unchanged behavior).
- Display output won't change → applies the preset's enable/disable/order itself (so generation-only scripts are still swapped correctly) and skips the chat reload.
The guard always fails open: on any error it falls back to the original command.
In the no-reload branch, the core Regex editor's script list isn't re-rendered and its internal "unsaved changes" tracking isn't updated — both are private to the regex module and can't be invoked from an extension. This is cosmetic, only visible if you have the Regex panel open, and self-heals on the next regex operation. The actual script data and the chat remain correct.
Copy this folder into:
SillyTavern/public/scripts/extensions/third-party/SillyTavern-RegexReloadGuard/
Then enable Regex Reload Guard in the Extensions panel and refresh.
- Requires the built-in Regex extension to be enabled (it owns the
/regex-presetcommand and the engine helpers this extension imports). - No settings, no UI — it installs the guard on startup.
- Look for
[RegexReloadGuard] Installedin the browser console to confirm it loaded, andApplied "<preset>" without reloading the chat(debug level) when it skips a reload.