Skip to content

Instruct dialog replies instead of cutting them; translate with our LLM - #260

Merged
iamwavecut merged 1 commit into
mainfrom
feat/reply-body-first-and-rates
Oct 14, 2026
Merged

iamwavecut merged 1 commit into
mainfrom
feat/reply-body-first-and-rates

Conversation

@iamwavecut

Copy link
Copy Markdown
Owner

Summary

  • Reply shape. Drop the deterministic cutting of reaction openers, read-back quotes and unstarted promises from delivered replies. The last-message note now asks the model for a first sentence that goes straight to the substance, without a reaction to the message, its rating or the person's name. reply_shape only re-samples once: when the opening repeats one of the last eight replies, or when the reply announces a generation that no call started. Custom personas are never re-sampled.
  • Rates. The $ / ; command uses the deterministic table handler again. A rates request in conversation calls currency_rates, which now sends the same rich table as the reply and ends the turn.
  • Draw API. The % shortcut intent and the draw_api tool work for global admins only. Other users get a failure that points the model to draw_image.
  • Translation. translate_text uses a routed LLM request (new translation workflow, migration 207, same chain as dialog) behind the existing Redis translation cache, instead of DeepL.

Prompt replay

120 production dialog requests with untrimmed history, plus 19 requests that call tools, replayed against the dialog model:

deployed prompt this PR
short intro sentence before the answer 51% 30%
laughter / "ну ты и" / "ого" openers 22% 9%
opening repeats one of the last 8 replies (re-sample rate) 4.7% 3.1%
tool requests that end in an executable call 17/19 18/19

Migration notes

207_translation_workflow inserts the translation workflow (lane priority 1). It creates the primary and fallback assignments only when the primary model exists and the workflow has no assignments yet. The down migration deletes the workflow, and the delete cascades to its assignments. Fresh installs also seed a primary at boot.

Checks

  • cargo fmt --all
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test -p openplotva-dialog -p openplotva-llm -p openplotva-prompts -p openplotva-storage -p openplotva-app

Reply shape: the deterministic cutting of reaction openers, read-back
quotes and unstarted promises is gone. The model is told to start with the
substance instead: the last-message note now asks for a first sentence
without a reaction to the message, its rating or the person's name. The
guard only re-samples once for an opening repeated from the last eight
replies or a generation announced without a call.

Rates: the `$` / `;` command is the deterministic table handler again.
A rates request in conversation calls currency_rates, which now sends the
same table as the reply and ends the turn.

Draw API: the `%` shortcut and the draw_api tool work for global admins
only; others are pointed to draw_image.

Translation: translate_text calls the routed `translation` workflow
(migration 207: GPU0 Gemma, then GPU2 Qwen, then GPT Luna) behind the
existing Redis cache instead of DeepL.
@github-actions

Copy link
Copy Markdown
Warnings
⚠️ Migration changes should explain forward/down compatibility, rollback/no-op behavior, or why rollback is impossible.
⚠️ Prompt files are cache-sensitive contracts; confirm prompt shape and role markers were preserved intentionally.
⚠️ Large PR (1195 changed lines). Consider splitting unless this is generated/mechanical.
Messages
📖 Danger checked 20 changed file(s).

Generated by 🚫 dangerJS against 7e574aa

@iamwavecut

Copy link
Copy Markdown
Owner Author

Danger warnings:

  • Migration 207. The forward migration only adds data: one workflows row (ON CONFLICT DO NOTHING) and up to three workflow_assignments rows. It adds them only when the primary model exists and the workflow has no assignments yet. The previous release ignores the translation workflow, so a rollback of the code without the down migration is safe. The down migration deletes the workflow, and the delete cascades to its assignments and triggers.
  • Prompt files. The prompt changes are intentional and keep the existing shape. last_message_wrapper.prompt keeps the same element, attributes and {{{message}}} slot; only the note text changes. This text sits after the cached system prefix. _shared_core.prompt changes two sentences and keeps all tags. translate/system.prompt is new and has no role markers.
  • Size. The PR is large because it removes the reply-trimming code and its tests (about 430 deleted lines) and adds the LLM translator module with its tests.

@iamwavecut
iamwavecut merged commit dd273ed into main Oct 14, 2026
12 checks passed
@iamwavecut
iamwavecut deleted the feat/reply-body-first-and-rates branch October 14, 2026 10:21
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.

1 participant