Repository navigation
Conversation
…der says
A paste of three lines or more, or over 150 characters, always became
"[Pasted ~N lines]", which says nothing about what was pasted; only the
global toggle could change it.
prompt.paste_summary in tui.json sets the line and character
thresholds and the placeholder format, with {lines}, {characters},
{bytes} and an {excerpt} of the paste's start, whose length is
configurable. pasteSummary (src/prompt/paste.ts) builds it and keeps it
on one line. The defaults reproduce the previous rule and label
exactly; the toggle still turns summarizing off.
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
This was referenced Oct 11, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note: I'm aware v1 is now the maintenance branch and new features go to v2 only. This PR is here for others to use, and I'll submit the v2 version once I've migrated my whole plugin system to it.
Issue for this PR
Related: #15767, #8501.
Type of change
What does this PR do?
A paste of three lines or more, or over 150 characters, always becomes
[Pasted ~N lines]. The label says nothing about what was pasted, and the only control is the global toggle.This adds
prompt.paste_summarytotui.json:{ "prompt": { "paste_summary": { "lines": 10, "characters": 2000, "format": "[Pasted {lines} lines, {bytes} B: {excerpt}]", "excerpt": 40 } } }lines/characters: the thresholds (defaults3and150).format: the placeholder, with{lines},{characters},{bytes}(UTF-8) and{excerpt}, the paste's start with line breaks and repeated spaces collapsed. The placeholder is kept on one line.excerpt: characters{excerpt}shows before…(default30).The defaults reproduce today's rule and label exactly, and Disable paste summary still turns summarizing off. Documented in
tui.mdxunder "Paste summary".How did you verify your code works?
test/prompt/paste.test.ts: the default thresholds and label, configured thresholds, counts in the format, the excerpt (whitespace, cut, surrogate pairs) and the one-line rule.test/config.test.tsx: the schema accepts the options and rejects bad values.bun typecheckandbun testinpackages/tui.Checklist
This PR is AI generated, but under direct supervision and on request of @Nowaker.