Skip to content

chat: preserve pasted attachments in side chats - #330542

Merged
Connor Peet (connor4312) merged 5 commits into
mainfrom
connor4312/btw-pasted-attachments
Aug 13, 2026
Merged

chat: preserve pasted attachments in side chats#330542
Connor Peet (connor4312) merged 5 commits into
mainfrom
connor4312/btw-pasted-attachments

Conversation

@connor4312

Copy link
Copy Markdown
Member

chat: preserve pasted attachments in side chats

Carry explicit composer attachments into side chats and store pasted text as session-backed files.

  • Forward attached context through silent slash commands and side-chat request orchestration.
  • Snapshot pasted text as .txt resources before reducing Agent Host state.
  • Allow chats to read attachments owned by their Agent Host session without another prompt.
  • Cover MIME lookup, attachment forwarding, materialization, and permission boundaries.

(Commit message generated by Copilot)

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Carry explicit composer attachments into side chats and store pasted text as session-backed files.

- Forward attached context through silent slash commands and side-chat request orchestration.
- Snapshot pasted text as .txt resources before reducing Agent Host state.
- Allow chats to read attachments owned by their Agent Host session without another prompt.
- Cover MIME lookup, attachment forwarding, materialization, and permission boundaries.

(Commit message generated by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 12, 2026 20:44
@connor4312
Connor Peet (connor4312) enabled auto-merge (squash) August 12, 2026 20:44

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.

Pull request overview

Preserves composer attachments when creating side chats and stores pasted text as session-backed resources.

Changes:

  • Forwards side-chat attachment context through slash-command orchestration.
  • Materializes pasted text as .txt session attachments.
  • Adds attachment permission-boundary and MIME tests.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/test/browser/chatWidgetSlashCommand.test.ts Tests slash-command attachment forwarding.
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.ts Tests embedded paste conversion.
src/vs/workbench/contrib/chat/browser/widget/chatWidget.ts Passes context to silent slash commands.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts Embeds pasted text as resources.
src/vs/sessions/SESSIONS.md Documents side-chat attachment behavior.
src/vs/sessions/contrib/chat/test/browser/btwSlashCommandContribution.test.ts Tests /btw context forwarding.
src/vs/sessions/contrib/chat/browser/sideChatProvider.contribution.ts Adopts request-options orchestration.
src/vs/sessions/contrib/chat/browser/sideChatOrchestration.ts Forwards complete request options.
src/vs/sessions/contrib/chat/browser/responseSelectionSideChatController.ts Adopts updated helper API.
src/vs/sessions/contrib/chat/browser/btwSlashCommand.contribution.ts Sends attachments into side chats.
src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts Tests session attachment permissions.
src/vs/platform/agentHost/test/node/agentService.test.ts Tests text materialization and state rewriting.
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts Shares attachment access across peer chats.
src/vs/platform/agentHost/node/agentService.ts Uses session-scoped attachment storage.
src/vs/platform/agentHost/common/sessionDataService.ts Updates attachment documentation.
src/vs/base/test/common/mime.test.ts Tests plain-text extension lookup.
src/vs/base/common/mime.ts Supports text MIME extensions.

Review details

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

  • Files reviewed: 17/17 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread src/vs/workbench/contrib/chat/browser/widget/chatWidget.ts Outdated
Tighten side chat attachment handling after review and CI feedback.

- Forward only explicit composer attachments through concurrent slash commands.
- Keep draft paste attachments in their compatible semantic representation.
- Share session attachment path checks between Copilot and Claude permission handling.
- Add Claude access coverage and restore the remote draft clear regression.

(Commit message generated by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vs-code-engineering

vs-code-engineering Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Tyler James Leonhardt (@TylerLeonhardt)

Matched files:

  • src/vs/platform/agentHost/node/claude/claudeAgent.ts

Move session attachment read approval into the shared permission manager.

- Resolve the owning session from each exact chat channel.
- Auto-approve only files contained by that session's attachment directory.
- Remove duplicate Copilot and Claude provider checks.
- Cover peer-chat access and cross-session denial in the central permission suite.

(Commit message generated by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
roblourens
roblourens previously approved these changes Aug 12, 2026
Resolve the session permission test imports while retaining upstream edit-rule coverage and the
owning-session attachment boundary test.

(Commit message generated by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@connor4312
Connor Peet (connor4312) merged commit b9831f0 into main Aug 13, 2026
78 of 81 checks passed
@connor4312
Connor Peet (connor4312) deleted the connor4312/btw-pasted-attachments branch August 13, 2026 05:00
@vs-code-engineering vs-code-engineering Bot added this to the 1.134.0 milestone Aug 13, 2026
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.

3 participants