-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
[Bug] “Truncate from End” variable option in Prompt Template has no effect
Description
When configuring Prompt Template variables, the Truncate from End option does not apply at runtime. The plain Truncate option works as expected, but Truncate from End leaves the text unchanged.
Both positive (e.g., 5) and negative (e.g., -5) inputs fail. Additionally, the variable editor UI does not allow users to directly type a minus sign, even though the default value is preset as -1.
Steps to Reproduce
- Open the right-side panel and click + Prompt Template.
- (Optional) Name:
Truncate and Truncate From End test prompt template
Description:When prompted, the user inputs 'hello12345' for each variable. The expected output for Truncate is 'hello' and the expected output for Truncate From End is '12345'. - Leave Custom Instructions as default.
- In the Prompt box, enter:
{{truncate}}
{{truncateFromEnd}}
{{truncateFromEndNegative}} - In Variables:
- For
truncate: enable Truncate and set to5.
→ Token becomes:{{truncate:text(truncate:5)}} - For
truncateFromEnd: enable Truncate from End and set to5.
→ Token becomes:{{truncateFromEnd:text(truncateFromEnd:5)}} - For
truncateFromEndNegative: enable Truncate from End and attempt to set to-5.- Note: the input box does not allow typing a minus sign (both the digit and minus are deleted when backspacing).
- Workaround: manually edit the Prompt box token to:
{{truncateFromEndNegative:text(truncateFromEnd:-5)}}.
- Save the template.
- Run the template; when prompted, input
hello12345for each variable.
Expected Behavior
The user’s first message (echo of filled variables) should be:
hello
12345
12345
truncate→ returns the first 5 chars (hello).truncateFromEnd→ returns the last 5 chars (12345).truncateFromEndNegative→ also returns the last 5 chars (12345).
Actual Behavior
The user’s first message is:
hello
hello12345
hello12345
truncateworks as expected.- Both Truncate from End cases (positive and negative) are ignored at runtime.
Reproducibility
- Reproduces consistently with all models tested (default was Claude 3 Haiku; also tested with other available models).
- Occurs across both Mac and PC environments, with multiple browsers.
Environment
- OS: macOS, Windows 11
- Browsers: Brave, Chrome, Firefox
Workarounds
None found.
Impact / Priority
Low priority (feature inconsistency), but it blocks use-cases that need end-truncation for safe prompt assembly or token budgeting.
Attachments
- Screenshots of the Prompt Template configuration and variable settings (see attached).

Metadata
Metadata
Assignees
Labels
No labels