[PR #3] Fix bug where {{customPrompt}} didn't get resolved and models couldn't generate a new greeting #2

Open
opened 2026-10-15 18:03:04 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/SillyTavern/SillyTavern-GreetingTools/pull/3
Author: @julez122
Created: 9/1/2026
Status: 🔄 Open

Base: main ← Head: main


📝 Commits (1)

  • 1f8e68b Resolve GreetingTools macros before substitution

📊 Changes

1 file changed (+61 additions, -5 deletions)

View changed files

📝 src/generator.js (+61 -5)

📄 Description

Pull Request Summary

When generating a new alternative greeting for a character, the custom scenario was never seen by the LLM and it always added in OOC, that {{customPrompt}} wasnt filled out, although it was, therefore resulting in the LLM generating a Greeting Message based on the Character only. This issue persisted when the experimental Macro feature was on as well. This pull request fixes this issue.

Original Commit Description, autogenerated by CoPilot:

Add resolveGreetingToolsMacros to pre-process GreetingTools-specific macros ({{key}} and {{#if key}}...{{/if}}), using safe replacements to avoid accidental interpretation of $-sequences. Update generator to run this resolver on system and generation templates before calling substituteParams so SillyTavern's own macros (e.g. {{char}}, {{user}}) are still handled by substituteParams. Minor variable renames (rawPromptTemplate/systemPromptTemplate) to reflect the two-stage processing.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/SillyTavern/SillyTavern-GreetingTools/pull/3 **Author:** [@julez122](https://github.com/julez122) **Created:** 9/1/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`1f8e68b`](https://github.com/SillyTavern/SillyTavern-GreetingTools/commit/1f8e68b01d5f4b437ec2a3185a9ffb3e1ad5b1cd) Resolve GreetingTools macros before substitution ### 📊 Changes **1 file changed** (+61 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/generator.js` (+61 -5) </details> ### 📄 Description # Pull Request Summary When generating a new alternative greeting for a character, the custom scenario was never seen by the LLM and it always added in OOC, that {{customPrompt}} wasnt filled out, although it was, therefore resulting in the LLM generating a Greeting Message based on the Character only. This issue persisted when the experimental Macro feature was on as well. This pull request fixes this issue. Original Commit Description, autogenerated by CoPilot: ``` Add resolveGreetingToolsMacros to pre-process GreetingTools-specific macros ({{key}} and {{#if key}}...{{/if}}), using safe replacements to avoid accidental interpretation of $-sequences. Update generator to run this resolver on system and generation templates before calling substituteParams so SillyTavern's own macros (e.g. {{char}}, {{user}}) are still handled by substituteParams. Minor variable renames (rawPromptTemplate/systemPromptTemplate) to reflect the two-stage processing. ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
SillyTavern/SillyTavern-GreetingTools#2
No description provided.