Skip to content

Start replies with the substance; deliver text beside a lone reaction - #261

Merged
iamwavecut merged 1 commit into
mainfrom
feat/reply-opening-ab
Oct 14, 2026
Merged

iamwavecut merged 1 commit into
mainfrom
feat/reply-opening-ab

Conversation

@iamwavecut

Copy link
Copy Markdown
Owner

Summary

  • Last-message note. It asks for a text reply that starts with the substance, without a reaction, rating, agreement, acknowledgment, interjection, name or lead-in. It also lists the opening words of the bot's last eight replies so the model avoids them. A custom persona gets no list, the same rule as for re-sampling.
  • shared_core.
    • No name or greeting up front.
    • No short lead-in sentence before the point.
    • Past replies are context, not a template.
    • The anti-repeat window matches the code guard (eight replies).
    • Explicit translation requests always use translate_text.
    • Strong emotions on a message go to react_to_message.
  • system_contract. Native tool calls come first, and the final text has no report of the tool call. turn_boundary and tool_contract state the reaction exception.
  • Tool descriptions. draw_image and generate_song no longer suggest text beside the call; the session never published that text. react_to_message says that text returned with it is delivered.
  • Re-sample note. For a repeated opening, the note now asks for a different first-sentence construction without quoting the rejected words.
  • Session. Text returned together with react_to_message alone is the final reply. The session delivers it without a second model call. The text passes the same leak guard and reply-shape review as any final answer. Text beside any other tool call is still dropped.

Prompt replay

The replay used 131 production requests without tool calls and 20 requests with tool calls, all with untrimmed history. The new prompt was compared with the deployed one.

deployed this PR
short intro sentence before the answer 39% 22%
reaction openers 11% 8%
opening repeats one of the last 8 replies 3.1% 1.6%
copies of history markup 2/131 1/131
native tool calls 8/20 12/20
executable tool calls 19/20 19/20

On the 16 replies whose opening repeated a recent one, the re-sample started the same way in 7 cases with the old note. With the new note it did so in 1 case.

Checks

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

Prompt changes chosen by an A/B replay of production dialog requests:
- The last-message note asks for a text reply that starts with the
  substance and lists the openings of the bot's last eight replies to
  avoid (none for a custom persona).
- shared_core: no name or greeting up front, no lead-in, agreement or
  acknowledgment before the point, past replies are context and not a
  template, explicit translation requests always go through
  translate_text.
- system_contract: native tool calls first, no report of the tool call
  before the answer.
- draw_image and generate_song no longer suggest text beside the call.
- The repeated-opening re-sample note asks for a different first
  sentence without quoting the rejected one.

Replay (131 history + 20 tool requests): short intro sentence 39% -> 22%,
reaction openers 11% -> 8%, repeated opening 3.1% -> 1.6%, native tool
calls 8 -> 12 of 20, executable calls unchanged at 19 of 20. The new
re-sample note repeats the rejected opening in 1 of 16 cases instead of 7.

Text the model returns together with react_to_message alone is now the
final reply: the session delivers it without asking the model again.
@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 9 changed file(s).

Generated by 🚫 dangerJS against f25dcef

Comment thread crates/openplotva-llm/src/aifarm.rs
Comment thread crates/openplotva-app/src/dialog_turn/session.rs
@iamwavecut

Copy link
Copy Markdown
Owner Author

Danger prompt warning: the prompt changes are intentional and keep the existing shape. system.prompt and _shared_core.prompt keep every tag and the partial; only the text inside the tags changed. last_message_wrapper.prompt keeps the element, the attributes and the {{{message}}} slot. The note text changes and gains an optional {{recent_openings}} list. resample_note.prompt changes two repeated_opening sentences. None of these files has role markers.

@iamwavecut
iamwavecut merged commit 3dc8a98 into main Oct 14, 2026
12 checks passed
@iamwavecut
iamwavecut deleted the feat/reply-opening-ab branch October 14, 2026 12:42
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