Repository navigation
Conversation
Author
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved session-isolation and submission-state bugs can send queued prompts and attachments to the wrong session or silently discard submitted prompts.
7 open issues
Clear or isolate queued prompts when switching sessions · New Do not fall back to legacy modes when config options are present · New Restore temporary clipboard contents without clobbering user changes · New Preserve prompts rejected while another submission is pending · New Persist pending attachments with drafts · New Avoid serializing large attachments on every keystroke · New Enforce the attachment limit before reading files · New
What changed in this PR
This PR expands the ACP chat experience with code-block actions, preferred execution modes, queued follow-ups, and capability-aware attachments. Agent presets remain unchanged, separate from #81.
Changes:
- Add code-block Copy and terminal-paste actions, editable input during turns, and a persistent prompt queue.
- Resolve default or remembered modes and persist selections per agent.
- Build attachment-aware prompts, support image paste/drop and file selection, and add helper tests.
| File | Description |
|---|---|
src/ui/ChatWebviewProvider.ts |
Adds code actions, queuing, draft persistence, attachment handling, and previews. |
src/test/extension.test.ts |
Tests mode defaults, mode resolution, and attachment content construction. |
src/extension.ts |
Wires preference storage, configuration updates, and multi-file selection. |
src/core/SessionManager.ts |
Applies preferred modes and sends capability-aware attachment prompts. |
src/core/PromptBuilder.ts |
Converts text and attachments into ACP content blocks. |
src/config/ModeResolver.ts |
Resolves preferred modes across configuration options and legacy modes. |
README.md |
Documents the new chat features and mode settings. |
package.json |
Registers default-mode and remembered-mode settings. |
Review effort: Balanced
Comment on lines
+2842
to
+2848
| hasActiveSession && | ||
| !isLoadingSession | ||
| ) { | ||
| const nextItem = queuedPrompts.shift(); | ||
| saveState(); | ||
| renderQueuedPrompts(); | ||
| dispatchPrompt(nextItem); |
| return ci ? ci.value : null; | ||
| } | ||
|
|
||
| const available = modes?.availableModes; |
Comment on lines
+155
to
+158
| if (previousClipboard) { | ||
| setTimeout(() => { | ||
| void vscode.env.clipboard.writeText(previousClipboard); | ||
| }, 150); |
Comment on lines
+211
to
+212
| if (this.isPromptRunning) { | ||
| return; |
Comment on lines
+1533
to
+1535
| draftText: promptInput ? promptInput.value : '', | ||
| queuedPrompts, | ||
| promptCapabilities, |
| }); | ||
|
|
||
| promptInput.addEventListener('input', () => { | ||
| saveState(); |
| const MAX_TEXT_BYTES = 256 * 1024; | ||
| const attachments: PromptAttachment[] = []; | ||
|
|
||
| for (const uri of uris) { |
…fs, and debounce draft saves
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.




Summary
<pre><code>blocks with language header, Copy (vscode.env.clipboard.writeText), and Paste to Terminal (workbench.action.terminal.pastebracketed paste with clipboard save/restore so multi-line snippets do not auto-execute).acp.defaultMode(default"auto", applied when supported by agent) andacp.rememberMode(defaulttrue, persisted per agent inglobalState).#promptInputeditable during active turns/compaction, queue onEnter/ Queue button instead of cancelling, persist draft/queue across view switches, and auto-dispatch queued items on non-cancelled/non-errorpromptEnd.agentCapabilities.promptCapabilities(image,embeddedContext), update webview CSP (img-src data:), fixacp.attachFile(attachmentsAdded), support clipboard image paste + drag-and-drop, and render user attachment previews anduser_message_chunkreplay blocks.Evidence
npm test: 3 baseline tests passing; noModeResolverorPromptBuildertests;file-attachedhad no webview listener;#promptInputlocked during turns (promptInput.disabled = true).npm run pretest(tsc -p . --outDir out,webpack,eslint src --max-warnings 0): exited0(0 warnings).npm test(VS Code 1.146.0 Electron Mocha runner):8 passing:Extension should be presentShould activate extensionShould register ACP commandsDefault mode configuration defaultsresolvePreferredModeId handles flat and grouped configOptionsresolvePreferredModeId handles legacy modesgetImageMimeType detects supported image extensionsbuildPromptContentBlocks enforces image capability and resource fallbackMerge Danger
Door: Two-way
Additive UX/protocol features and settings (
acp.defaultMode,acp.rememberMode); settingacp.defaultMode: ""disables automatic mode selection while keeping per-agent mode memory optional.Blast Radius: Low
Scoped to
ChatWebviewProvider,SessionManager,extension.ts, two new pure helper modules (ModeResolver,PromptBuilder),package.json,README.md, andsrc/test/extension.test.ts. Does not alteracp.agentsdefaults (kept independent of #81).