Skip to content

chat: Remove line requirement for paste attachments - #335100

Merged
Logan Ramos (lramos15) merged 1 commit into
mainfrom
lramos15/agents/remove-arbitrary-line-paste-requirement
Sep 8, 2026
Merged

Logan Ramos (lramos15) merged 1 commit into
mainfrom
lramos15/agents/remove-arbitrary-line-paste-requirement

Conversation

@lramos15

Copy link
Copy Markdown
Member

Chat now turns long pasted text into an attachment regardless of how many lines it has. Updates the help text and tests.

Fixes #333601

Fixes #333601

Co-authored-by: Copilot <[email protected]>
Copilot-Session: d97a91fa-04a7-4d55-9eb7-cec3da622372
Copilot AI balanced review requested due to automatic review settings September 8, 2026 16:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The setting description incorrectly states that pasted text must exceed a threshold that is implemented inclusively.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: 1 Low severity

New issues introduced by this change (1)
Severity Finding
Low severity src/​vs/​workbench/​contrib/​chat/​browser/​chat.shared.contribution.ts — The implementation accepts a paste when its trimmed length equals the threshold, and the new…
What changed in this PR

Removes the line-count requirement for pasted-text attachments.

Changes:

  • Uses character count regardless of line count.
  • Updates accessibility help and tests.
File Description
chatPasteProviders.ts Removes minimum-line enforcement.
chatPasteProviders.test.ts Tests single-line and threshold behavior.
chat.shared.contribution.ts Updates setting documentation.
chatAccessibilityHelp.ts Clarifies single-line attachment behavior.
chatAccessibilityHelp.test.ts Verifies updated help text.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

},
[ChatConfiguration.PasteAsAttachmentThreshold]: {
markdownDescription: nls.localize('chat.pasteAsAttachmentThreshold', "The number of characters a paste must exceed before it is added to the chat input as an attachment instead of being inserted inline. A paste must also span several lines, so a long single-line paste is always inserted inline. Set this to a very large number to always paste inline."),
markdownDescription: nls.localize('chat.pasteAsAttachmentThreshold', "The number of characters a paste must exceed before it is added to the chat input as an attachment instead of being inserted inline. Set this to a very large number to always paste inline."),
@lramos15
Logan Ramos (lramos15) enabled auto-merge (squash) September 8, 2026 16:41
@lramos15
Logan Ramos (lramos15) merged commit 36053db into main Sep 8, 2026
34 checks passed
@lramos15
Logan Ramos (lramos15) deleted the lramos15/agents/remove-arbitrary-line-paste-requirement branch September 8, 2026 16:53
@vs-code-engineering vs-code-engineering Bot added this to the 1.138.0 milestone Sep 8, 2026
Abdullah Atrash (abdullahatrash) added a commit to abdullahatrash/flowleap-agent-v2 that referenced this pull request Sep 20, 2026
* port(chat-ui): preserve #file reference when editing text before it (#394)

Upstream d750fe2 (microsoft#333965), applied clean with its tests.
Typing before an existing #file attachment silently deleted the attachment.
Adds touchesReference and findReferenceRangeForNonOverlappingEdit.

* port(chat-ui): highlight generic tool output by content type (#394)

Upstream 63acf08 (microsoft#333923). chatInputOutputMarkdownProgressPart.ts
applied clean; the chatToolOutputContentSubPart.ts hunk was hand-applied because the
fork's adjacent-code-part loop predates upstream's refactor. The agentHost
stateToProgressAdapter.ts hunk and its test are dropped (Agent Host only).
Our patent tools return large JSON payloads into exactly this part.

* port(chat-ui): fix IME handling in the chat find widget (#394)

Upstream b9861ad (microsoft#332950), applied clean with its tests.
Composition input (CJK) broke search in the transcript find widget.

* port(chat-ui): fix transcript Find keybindings (#394)

Upstream cefc831 (microsoft#333135). chatFindActions.ts, chatFindWidget.ts,
chatListWidget.ts and the find tests applied clean; the chatListWidget.test.ts hunk was
hand-applied because that test file is diverged. Enter/Escape/F3 inside the transcript
find widget went to the generic tree find instead of chat Find.

* port(chat-ui): configurable paste-to-attachment threshold and Insert in Prompt (#394)

Upstream e1801a0 (microsoft#331978). chatPasteProviders.ts, chatCopyActions.ts,
constants.ts, chatAccessibilityHelp.ts, the chat.shared.contribution.ts configuration
registration and the paste tests all applied clean. The src/vs/sessions hunks are left
out: the fork has no caller of createPastedTextArtifact there, and sessions files belong
to the deferred wave W.

* port(chat-ui): remove the line requirement for paste attachments (#394)

Upstream 36053db (microsoft#335100), hand-applied: the fork's
chatPasteProviders.ts lacks the GitHub-URL pattern that surrounds the hunk, and its
chatAccessibilityHelp.ts and both test files are behind upstream's base. A short paste
now becomes an attachment on character count alone, so pasting a single-line claim
works like pasting a multi-line one.

* port(chat-ui): reuse text buffers for checkpoint replay (#394)

Upstream 903d0d0 (microsoft#336095), applied clean with its tests.
Checkpoint restore rebuilt a text model per replayed edit.

* port(chat-ui): constrain symbol tools to the active workspace (#394)

Upstream d8cfdc7 (microsoft#333144), applied clean with its tests.
renameTool and usagesTool no longer reach outside the active workspace folder.
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Oct 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chat.pasteAsAttachmentThreshold is confusing with requiring some arbitrary number of lines

3 participants