* feat: add Cloudflare Workers AI provider
Adds support for Cloudflare Workers AI using its OpenAI-compatible API.
Workers AI-specific stuff includes:
- Model list fetching and capabilities detection
- Tokenizer auto-detection for typical hosted model families
- Streaming not supported when using structured output
Closes#5305
* Make the entire header clickable
* Add missing samplers
* Fix non-streaming reasoning parsing
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* Add unit tests for prompt-converters.js
* fix: add type annotation for prompt-converters module
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* Skip TTS for voices explicitly set to disabled (fixes#4970)
* Always show disabled message in commands and fix restoring voice map UI
* Always show a message on manual TTS trigger
* Fix null current job on disabled
* Adjust type annotation
* Force update worker when disabled play is attempted
* Treat audio control queue as manual
* Update TTS message processing to include manual flag
* Don't show toast if was already shown by manual playback
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* Use custom init script instead of postinstall
* Revert changes to start scripts in src\electron
* Add global data to content manager
* Add migration for public overrides and user.css location update
* Update npm publish workflow to use 'omit=dev' flag in npm ci commands
* Rename user.css readme file
* Fix indentation in userCssMiddleware function
* Add directory creation for content target
* Restore template compile location
* Move stylesheet up in index.json
* Use path.resolve for user.css file path in userCssMiddleware
* Correct capitalization in "Not Found" error page title and heading
* Remove init run from startup scripts
* Simplify user CSS file path resolution
* Update userCssMiddleware comment
* Use custom init script instead of postinstall
* Revert changes to start scripts in src\electron
* feat: add --ignore-scripts flag to npm install commands in batch and shell scripts
* feat: add --ignore-scripts flag to npm ci in Dockerfile
* fix: require long press to open swipe picker on phones
* fix: clarify parameter description in assignLorebookToChat function
* fix: update event parameter type in onSwipeCounterClick to include TouchEvent
* fix: update event parameter types in onSwipeCounterClick and addLongPressEvent
* fix: return Error objects from invokeFunctionTool and create error invocations
invokeFunctionTool previously called .toString() on caught errors,
converting them to plain strings. This made the instanceof Error
check in invokeFunctionTools dead code.
Changes:
- Return Error objects directly from invokeFunctionTool
- Create error invocations with error: true flag when tools fail
- Record failed stealth tools in stealthCalls
- Preserve signature/reasoning on error invocations
- Add error field to ToolInvocation typedef
* fix: use Error.toString to avoid behavioral changes
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* feat(secrets): update readSecret function to accept optional secret ID
* add secret_id to ConnectionManagerRequestService payload
* fix: pass secret_id for Text Completion types
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
The delete handler had a missing `return` before `sendStatus(400)`,
causing execution to fall through to `sendStatus(200)`, a double-send
that triggers ERR_HTTP_HEADERS_SENT, which the catch block then
compounds by attempting a third `sendStatus(500)`.
Both the delete and download handlers used callback-based `fs.unlink()`
without awaiting completion. In the download handler, this caused a race
with `createWriteStream({ flags: 'wx' })` (which fails if the file
still exists). In both handlers, `throw err` inside the callback was an
unhandled exception that could never be caught by the outer try/catch.
Replace callback-based `fs.unlink()` with `await fs.promises.unlink()`
and add missing `return` statements to prevent response cascades.
* fix: conditionally include secrets in user data backup
* feat: add full data backup toggle
* 418 -> 403
I'm not a teapot
* Distinguish fails from disabled
* feat(ui): add popup to jump to a specific swipe
Adds a new "Jump to swipe history" button to message actions and makes
the swipe counter clickable on the latest message. This opens a
searchable popup allowing users to quickly find and jump to a
specific alternate swipe without having to click through them
sequentially.
- Adds a searchable swipe picker popup menu
- Makes the swipe counter interactive when multiple swipes exist
- Adds a dedicated swipe picker button to message controls
* fix(ui): hide swipe picker when there are no swipes
Ensures the newly added swipe picker button is only shown when a
message has multiple swipes available. It explicitly hides the
button for non-swipeable messages or messages with a single swipe.
* feat(ui): redesign swipe picker with direct id input
Replace text-based search with a numeric input for direct swipe navigation.
Update popup layout with a sticky header and improved scrolling behavior.
Sync input value with the currently selected swipe in the list.
Refactor styling to align with chat selection components.
* feat(ui): allow branching from specific swipes via picker
- Enable swipe picker for historical messages to inspect alternate swipes
- Add branch button to picker entries to create new chats from specific swipes
- Update saveChat and createBranch to accept chat snapshots
- Restrict swipe jumping to the active message only
* refactor(logic): consolidate swipe sync logic and simplify helpers
Update `syncSwipeToMes` to accept a target message object, enabling its
use in the bookmarks module and removing the duplicate
`applySwipeToSnapshot` function.
Also simplify `canOpenSwipePickerForMessage` and
`canJumpToSwipeForMessage` signatures by removing the redundant message
parameter.
* refactor(a11y): support dynamic roles via classes
Introduce a managed role system in the accessibility script to handle
elements that dynamically gain or lose interactive states. The mutation
observer now watches for class attribute changes and automatically
applies or clears roles (e.g., `role="button"`) using active selectors.
Updated the swipe counter to rely on this centralized system by toggling
an `.interactable` class instead of manually modifying tabindex and role
attributes. Removed the redundant 'Enter' keydown handler for the swipe
counter to prevent duplicate trigger events.
* fix(ui): compute missing token counts in swipe picker
Update renderSwipeList to asynchronously calculate token counts when
missing from swipe metadata. Introduce SWIPE_SOURCE.SWIPE_PICKER to
correctly identify swipes triggered from the picker and bypass
generation checks.
* feat(ui): enable deleting specific swipes via swipe picker
- Adds a delete button to swipe picker entries, allowing removal of specific message versions.
- Refactors deletion logic to handle removing non-current swipes without triggering animations and correctly updates indices.
- Includes confirmation dialogs and improves input focus behavior.
* refactor:Delete process inline to button click processor
* feat: universal swipe inspection and picker improvements
- Permit opening the swipe browser on any chat entry to review past generations.
- Parallelize the retrieval of token statistics to speed up list rendering.
- Format message metrics (length and tokens) into a single, concise string.
- Update the `getBranchChatSnapshot` API to accept an options object.
- Register swipe list items as interactable elements for keyboard control.
- Apply styling to prevent text highlighting on picker entries.
* fix:remove unused CSS
* fix: fix disabled styling for swipe delete button
Remove tooltips and prevent hover animations or glow effects when the
delete button is disabled in the swipe picker. Update CSS to enforce
default cursor and fixed opacity on hover for the disabled state.
* remove: Unused CSS
* Extract swipe-picker.js module
* Revert to manual ARIA role management
* Avoid scrollIntoView and scroll on open
* Fix keyboard interaction in past chats menu
* Fix a11y attribute
* fix: call refreshSwipeButtons when deleting not selected swipe
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* feat: add finalizeIntermediaryMessage for streaming tool call chains
Add a lighter finalization method on StreamingProcessor that runs
before tool invocation. This ensures CHARACTER_MESSAGE_RENDERED is
emitted for streamed text messages before the tool call chain
continues, allowing extensions (TTS, image forwarding, etc.) to
process intermediary messages.
finalizeIntermediaryMessage performs essential processing:
- Code block styling (addCopyToCodeBlocks)
- Reasoning handler finalization
- Logprobs saving
- Image attachment processing
- Reasoning signature storage
- MESSAGE_RECEIVED and CHARACTER_MESSAGE_RENDERED events
Without the heavier onFinishStreaming operations:
- UI unlock (markUIGenStopped)
- Auto-swipe
- Sound playback
- Chat saving
- Swipe counter update
* fix: return Error objects from invokeFunctionTool and create error invocations
invokeFunctionTool previously called .toString() on caught errors,
converting them to plain strings. This made the 'instanceof Error'
check in invokeFunctionTools dead code - errors silently became
successful invocations, showToolCallError never fired, and the
result.errors array was always empty.
Changes:
- Return Error objects directly from invokeFunctionTool
- Create error invocations with error: true flag when tools fail
- Add error field to ToolInvocation typedef
* fix: record failed stealth tools in stealthCalls and preserve signature/reasoning on error invocations
When a stealth tool errors, its name was not added to stealthCalls, causing
shouldStopGeneration to evaluate as false. This led to an incorrect recursive
Generate('normal') call instead of stopping generation as the stealth tool
contract requires ('no follow-up generation').
Also preserve toolCall.signature and reasoningText on error invocations to
match the success path, preventing Gemini/OpenRouter multi-turn tool context
from breaking when a tool call fails.
* Clarify method comments
* fix: initialize error property in ToolInvocation to false
* Apply review suggestions
* Make options object required
* fix: remove unnecessary return statement in updateSwipeCounter method
* refactor: split tool call error handling into separate PR (#5351)
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* renaming a lorebook prompts to update existing links
* used suggested api and logic
* add world property to shallow function
* Fix type error in assignLorebookToChat invoke
* Remove debug console logs
* Fix activeCharacterUpdated
* Extract updateWorldInfoLinks into a func
* Invert if for an early return
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* Handle port conflicts during server startup
* Fix return type of startHTTPorHTTPS
* Update language in getAddressInUseMessage
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* feat(popup): add allowEscapeClose option to override default escape key behavior
Add `allowEscapeClose` parameter to PopupOptions to explicitly control whether Escape key closes the popup, overriding the default logic that checks for visible cancel/close buttons. When null (default), uses existing behavior; when true, allows escape even without buttons; when false, prevents escape even with buttons present.
* feat(popup): enable Escape key closing for informational popups
Add `allowEscapeClose: true` option to TEXT-type popups in export preset, persona lore, sampler select, stats, and world info assignment dialogs to allow users to dismiss these informational popups with the Escape key.
* Improve Escape key interaction in popups
* Adjust jsdoc for allowEscapeClose
* Always return CANCELLED on Escape
* fix(popup): correct jsdoc for allowEscapeClose property description
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* Fix missing model name in tokenize requests for llama.cpp (fixes#4962)
The new router mode of llama.cpp allows to switch models on the fly,
what is already supported by SillyTavern. The call to the `/tokenize`
endpoint did not contain the model name, and failed in router mode.
This patch adds the `model` parameter similar to the implementation
for other backends.
* fix: migrate vllm and aphrodite to new payload field
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* Refactor loader.js to use action-loader system and move overlay management into action-loader module
- Deprecate showLoader() and hideLoader() in favor of action-loader API
- Implement legacy functions as thin wrappers around ActionLoaderHandle
- Move overlay management (showOverlay, hideOverlay, isOverlayDisplayed) into action-loader.js
- Move Popup-based loader implementation and preloader cleanup to action-loader
- Add loader.isBlocking() method to check for active blocking overlays
* Migrate from legacy loader functions to action-loader API throughout codebase
- Replace showLoader()/hideLoader() imports with loader from action-loader.js
- Update firstLoadInit() to use loader.show() with title, message, and ToastMode.STATIC
- Pass initLoaderHandle to getSettings() for early hide during onboarding flow
- Refactor renameGroupOrCharacterChat() to use loader.show() instead of boolean flag
- Wrap handleDeleteChat() with loader.show() and proper error handling
- Update BulkEditOver...
* Update loader titles and remove redundant reload notification
- Change bookmark loader title from "Bookmark" to "Chat History" for clarity
- Remove loader notification before extensions reload (redundant with browser reload)
* lint fix
* Add splash screen support to action loader with custom overlay content
- Add `overlayContent` option to ActionLoaderOptions for custom HTML in overlay
- Implement splash screen styles with centered logo, spinner, and message
- Update firstLoadInit() to use custom splash screen instead of static toast
- Pass custom content through showOverlay() to replace default spinner
- Adjust non-blocking loader warning to account for custom overlay content
* Refactor loader overlay to use DOM elements instead of HTML strings
- Add createDefaultLoaderOverlay() function to generate fresh loader overlay elements
- Export createOverlay() method on loader utility API for external use
- Change overlayContent parameter type from string-only to string|HTMLElement|null
- Add getOverlayContent() helper to normalize custom content for Popup
- Update firstLoadInit() to build splash screen using DOM manipulation instead of template literals
- Add splash-logo class and
* Use a true ellipsis
* Adjust sizing for desktop
* Even truer ellipsis
* Add transition to splash screen and fix blur animation on hideOverlay (#5338)
* Initial plan
* Blur entire splash screen on hideOverlay, not just spinner
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/eee6c06d-7c9d-4363-bc8f-2647ed390368
* Add transition to splash-screen and fix transition detection
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
Agent-Logs-Url: https://github.com/SillyTavern/SillyTavern/sessions/9368bc36-31a0-4a58-aebd-7b569696ff2e
---------
Co-authored-by: anthropic-code-agent[bot] <242468646+Claude@users.noreply.github.com>
Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>
* Add translations to supported locales
* Localize logo alt on welcome screen
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
Co-authored-by: Claude <242468646+Claude@users.noreply.github.com>
* Stop strings apply to Chat Completions and should not be greyed out.
* Revert "Stop strings apply to Chat Completions and should not be greyed out."
This reverts commit 51e5cfee41e1298b0005ff9df5d783c08820ed9a.
* Stopping strings should only apply to Text Completions https://github.com/SillyTavern/SillyTavern/pull/5337#pullrequestreview-3987164461
* Custom stop strings still apply
* Also apply to non-streaming message clean-up
* This comment is now misplaced
* Oops, wrong file
* Revert package-lock change
---------
Co-authored-by: user <user@exmaple.com>
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* feat: add SiliconFlow.cn endpoint support and embedding vectors
Chat completion:
- Add endpoint selection dropdown (Global/.com vs China/.cn) to existing
SiliconFlow provider, following the Z.AI endpoint pattern
- Backend switches API URL based on selected endpoint
- Add /api-url slash command support for endpoint switching
Embeddings:
- Add SiliconFlow as a vector/embedding source (OpenAI-compatible)
- Support both .com and .cn endpoints via siliconflow_endpoint setting
borrowed from the main connection panel (Vertex AI pattern)
- Superset model list with platform attribution (.cn) markers
- Models: Qwen3-Embedding (0.6B/4B/8B) + BGE/BCE models (.cn only)
* Add filter by models type
* Load embedding models from endpoint
* Improve api-url command declaration
* Support endpoint override in custom-request service
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* fix(popup): prevent Escape key from closing popups when both cancel and close buttons are hidden
Add validation in cancel listener to check visibility of cancel and close buttons before allowing Escape key to close popup. Set isClosingPrevented flag to block subsequent close events when neither button is visible.
* feat(popup): add double-escape force-close mechanism for blocking popups
Add double-escape detection (within 500ms) to allow force-closing blocking popups that have both cancel and close buttons hidden. Show confirmation dialog warning about potential inconsistent state before allowing force-close. Track last escape press timestamp and confirmation popup state to prevent duplicate dialogs. Gracefully cancel force-close confirmation if main popup closes naturally.
The grok-2-image-1212 model was deprecated on 2026-02-24 and is no
longer available. Only grok-imagine-image and grok-imagine-image-pro
remain as valid xAI image generation models.
* feat: add placeholder and tooltip support to popup system with icon buttons
Add `placeholder` and `tooltip` options to main popup configuration. For INPUT type popups, placeholder applies to input field; for other types, tooltip applies to content area. Enhance custom buttons with optional `icon` parameter for Font Awesome icons and `tooltip` for hover text. Add tooltip support to custom inputs (placeholder for text/textarea, tooltip icon for checkboxes).
* fix: preserve default toastClass when applying custom cssClass in /echo command
Modify cssClass argument handling in echoCallback to append custom class to existing toastClass instead of replacing it. Use filter(Boolean).join(' ') to combine default and custom classes while handling undefined values.
* feat: add placeholder, tooltip, and icon support to popup system slash commands
Add `placeholder` and `tooltip` named arguments to /input command for input field customization. Add `tooltip` argument to /popup command for content area hover text. Enhance /buttons command to support button objects with `text`, `tooltip`, and `icon` (Font Awesome) properties alongside simple string labels. Update help text and examples for all three commands. Normalize button labels to ButtonLabel format internally
* Fix jsdoc wording
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* fix: add validation for button labels in /buttons command
Add validation check to ensure each button entry is either a string or an object with a non-empty string `text` property. Return empty string and log warning if validation fails. Fix capitalization of 'Popup' in /popup command return value description.
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Add action loader utility with stoppable toast notifications
* Add slash commands for action loader control (/loader-wrap, /loader-show, /loader-hide, /loader-stop)
* Refactor action loader to support stacking multiple loaders with individual toast management
- Convert action loader from singleton to class-based handle system (ActionLoaderHandle)
- Support multiple concurrent loaders with single overlay and stacked toasts
- Add unique ID generation and tracking for each loader instance
- Implement onHide callback alongside existing onStop callback
- Add getActiveLoaderHandles() and getLoaderHandleById() utility functions
- Refactor hideActionLoader() to accept...
* Improve action loader overlay and toast handling with better state checks and cleanup timing
- Check isLoaderDisplayed() before showing overlay to prevent conflicts with existing loaders
- Use toastr.options.hideDuration for toast removal timing instead of hardcoded 250ms
- Simplify hideActionLoader() by using getActiveLoaderHandles() helper
- Remove redundant empty check in hideActionLoader()
- Add clarifying comment for intentional error throw in createClosureHandler()
- Remove redundant 'onStop' default
* fix stop button toast removal issue by using toastr.clear force option instead of manual removal with timeout
* Fix isLoaderDisplayed() by using double negation operator instead of null comparison
* Add non-blocking loader support with `blocking` parameter for toast-only action loaders
- Add `blocking` option to ActionLoaderHandle (default: true)
- Implement hasBlockingLoaders() helper to check for active blocking loaders
- Show/hide overlay only when blocking loaders are active
- Add `blocking` named argument to /loader-wrap and /loader-show commands
- Update help strings with non-blocking usage examples
- Import commonEnumProviders for boolean enum and isFalseBoolean utility
* Add optional title parameter to action loader toast notifications and reorder constructor parameters for consistency
- Add `title` parameter to ActionLoaderOptions and ActionLoaderHandle constructor
- Pass title to toastr.info() for toast notifications
- Reorder parameters: blocking, toastMode, message, title, stopTooltip (grouped by importance)
- Add warning when creating non-blocking loader without toast (invisible to user)
- Update /loader-wrap and /loader-show commands with title argument
* Add loader utility API to action-loader and expose it in ST context for convenient programmatic access
- Create `loader` object with show/hide/active/get methods and ToastMode/Handle exports
- Add JSDoc examples for basic usage, non-blocking tasks, and hiding all loaders
- Import and expose `loader` in ST context alongside existing loader functions
* Split slash command and functional modules
* Create abort controller on app init
* Remove HTML tags from "returns" declaration
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>