Skip to content

fix: make auto suggestions follow the conversation's language - #1697

Open
Suixinlei wants to merge 3 commits into
kwaroran:mainfrom
Suixinlei:fix/auto-suggest-language
Open

Suixinlei wants to merge 3 commits into
kwaroran:mainfrom
Suixinlei:fix/auto-suggest-language

Conversation

@Suixinlei

@Suixinlei Suixinlei commented Oct 25, 2026 •

Copy link
Copy Markdown

Problem

The default auto suggestion prompt hardcodes print it out in English only, so auto suggestions are always generated in English regardless of what language the roleplay is written in. Non-English users either get suggestions in the wrong language or have to enable the translate toggle and pay an extra translation request per suggestion.

Changes

  • The default prompt now asks for output in the language of the conversation instead of hardcoded English, which also covers users whose UI language differs from their chat language (thanks @deveworld for the suggestion).
  • Since setDatabase copies the default into autoSuggestPrompt on existing databases, a migration replaces the stored legacy default with the new default when it matches verbatim; customized prompts are untouched (thanks @deveworld for catching this).

@deveworld deveworld left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setDatabase copies the default into autoSuggestPrompt (database.svelte.ts:354), so existing users keep the English-only prompt. Also, UI language can differ from chat language. "the conversation's language" might be safer.

@Suixinlei
Suixinlei force-pushed the fix/auto-suggest-language branch from d05dc7f to 6696a0e Compare October 26, 2026 03:49
@Suixinlei Suixinlei changed the title fix: make auto suggestions follow the app language fix: make auto suggestions follow the conversation's language Oct 26, 2026
@Suixinlei

Copy link
Copy Markdown
Author

Thanks for the review @deveworld! Both points addressed (history rewritten into two commits):

  1. Added a migration that replaces the stored prompt with the new default when it matches the legacy default verbatim, so existing non-customized users get the fix while customized prompts are left untouched.
  2. The default prompt now follows the conversation's language instead of the UI language. The {{language}} placeholder from the initial commit was dropped to keep the change minimal.

P.S. Risu is really great to use — I'll keep contributing. Feel free to reach out anytime if anything comes up!

@deveworld deveworld left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
nit: presets also store autoSuggestPrompt, so switching to an older preset brings the legacy prompt back. Migrating it in the botPresets loop in setDatabase would cover that.

@Suixinlei

Copy link
Copy Markdown
Author

Thanks for the thorough review! All the requested changes are in now — if there's anything else, just let me know and I'll fix it right away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants