Skip to content

Cut the reaction frame from dialog replies instead of re-sampling - #258

Merged
iamwavecut merged 1 commit into
mainfrom
feat/dialog-reply-frame-strip
Oct 13, 2026
Merged

iamwavecut merged 1 commit into
mainfrom
feat/dialog-reply-frame-strip

Conversation

@iamwavecut

Copy link
Copy Markdown
Owner

Problem

After #257 (deployed 2026-10-13 22:43Z) the repeated-opening guard re-sampled about one turn in five, and at temperature 0.2 the second sample usually came back with the same opener («Хасн, ну ты и философ!» → «Хасн, ну ты и философ!»). With DIALOG_MODEL_OUTPUT_RETRIES=5 other validators burned up to six Gemma calls per turn before the fallback, and some turns ran out of budget. The text that reaches the chat is also what the next turn imitates, so a delivered template keeps the chat infected.

Changes

  • openplotva-dialog::reply_shape::review_reply cuts, when at least three words remain:
    • a first sentence (up to two) that only reacts or rates the person: laughter and interjections alone, «Имя, ну ты и…», «да ты…!», «ты просто…!», «Ой, всё, …!», also after a name or «Слушай,» set off by a comma;
    • a sentence that quotes a run of the current message back with a question or a gloss («это ты…», «намекаешь», «звучит как»), and a «Типа / То есть / Значит…» sentence right after it;
    • a closing promise of a generation that no call of the turn started.
  • It re-samples once only when the opening still repeats one of the bot's last eight replies, or when the reply is only a promise.
  • Custom personas are not reviewed.
  • aifarm.rs delivers the reviewed text, so the history stores it too.
  • _shared_core.prompt no_greetings: do not start a reply with the person's name.
  • DEFAULT_DIALOG_MODEL_OUTPUT_RETRIES back to 1; production env was set to 1 on 2026-10-13 23:3xZ.

Measurement

  • Review over 4000 production replies (30 h, custom personas skipped): 84% kept, 16% trimmed, 0.7% re-sampled (was ~20% re-sampled after Stop dialog replies from repeating their own openings #257). A read of 55 random trimmed replies found no broken meaning; JSON replies and «бл**ь»-style text stay as they are.
  • no_greetings replay on 122 production requests through production Gemma: replies starting with a vocative name 25% → 20%; tool calls on the 12 tool turns 10 → 10 (native 7 → 6); reply length unchanged.

Checks

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test -p openplotva-dialog, -p openplotva-llm, -p openplotva-config, -p openplotva-prompts, -p openplotva-app --lib dialog_jobs

At temperature 0.2 a re-sample repeats the rejected opener, and the prod
replies after #257 showed it: the same «ну ты и…» came back while each
re-sample cost a full Gemma call. What reaches the chat and the history
is what the next turn imitates, so the frame is now cut from the reply.

- Cut an opener that only reacts to the message or rates the person
  («Имя, ну ты и…!», «Ха-ха!», «Ой, всё, …!»), a sentence that quotes the
  user's message back with a guess at its meaning, and a closing promise
  of a generation no call started, when something else remains.
- Re-sample once only when the opening still repeats one of the bot's
  last eight replies, or when the reply is only a promise.
- Skip the review for custom personas.
- Ask the model not to start a reply with the person's name.
- Restore the default dialog model output retries to 1.
@github-actions

Copy link
Copy Markdown
Warnings
⚠️ Prompt files are cache-sensitive contracts; confirm prompt shape and role markers were preserved intentionally.
Messages
📖 Danger checked 4 changed file(s).

Generated by 🚫 dangerJS against 1d1776f

@iamwavecut

Copy link
Copy Markdown
Owner Author

Danger prompt warning: intentional. Only the text of the no_greetings element in _shared_core.prompt changed; tags, partials, role markers and template data are unchanged. Replay on 122 production requests is in the PR description.

@iamwavecut
iamwavecut merged commit d091f4f into main Oct 13, 2026
12 checks passed
@iamwavecut
iamwavecut deleted the feat/dialog-reply-frame-strip branch October 13, 2026 23:52
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