ACP to ChatUse OpenCode in VS Code's native Chat through the Agent Client Protocol (ACP). The extension, OpenCode Native Chat, connects the editor to your local
Features
OpenCode manages models, agents, skills, MCP servers, permissions, and conversation history. The extension supplies the native editor interface. Requirements
A Copilot subscription is not required by the extension. VS Code's native Chat infrastructure must still be available. Quick start1. Build the extension
2. Launch a development windowRun this from the extension directory. Replace the final path with the project you want OpenCode to work on:
Use Alternatively, open the extension directory in VS Code and press F5 with the OpenCode Native Chat launch configuration. It builds the extension automatically. Open your target project in the resulting Extension Development Host window. 3. Start a conversation
Creating a session does not generate a response; generation starts on Send. The top + in OpenCode Chat uses the same New Session action. ConfigurationIf VS Code cannot find OpenCode, set its executable path:
This setting accepts an executable path, not a shell command or arguments. The extension adds Model / Agent / Reasoning: current implementationThe inline selectors use values confirmed by OpenCode for the current session. Reasoning is hidden when the backend offers no effort choices. Selectors are locked while a response or configuration change is pending. The standard VS Code model entry OpenCode (configured) is a compatibility bridge, not the actual backend model selector. If VS Code reports Generic empty drafts remain lazy and use backend defaults until the first Send. Use OpenCode: New Native Chat Session when you want selectors before sending a message. See session configuration details and the native verification checklist. Slash commands: dynamic suggestionsType The extension currently expands supported local Markdown, JSON, and JSONC text templates before sending them. This works around an OpenCode ACP command-streaming issue; it is not equivalent to every OpenCode command source. Unknown commands, missing templates, and unsupported metadata are rejected rather than silently executed. Additional Markdown template directories can be configured with See supported template sources, substitutions, and restrictions. Limitations and safety
Transport and limitsThe extension launches a private OpenCode process over stdio. One process can serve multiple sessions, with one active request per session. A transport timeout or forced shutdown of a hung cancellation can interrupt other sessions in that process. Only session metadata is stored in VS Code workspace state; OpenCode stores conversation history. Process diagnostics appear in the OpenCode Native Chat Output channel. Review logs for secrets before sharing them. See transport policy and resource limits. DevelopmentChecks
These commands build the extension, run fixture-based unit tests, and check strict TypeScript, syntax, and editor configuration files. Tests do not require a model, API keys, or an installed OpenCode. The VS Code API is replaced by a test double; native UI checks are separate. After changing source files, rebuild and run Developer: Reload Window in the development host. Contract sourcesThe integration targets public VS Code 1.140.0 proposed API declarations and ACP v1. Proposed APIs can change between editor releases.
Do not publish this proposed-API extension to Marketplace. Packaging and distribution, including bundled dependency license notices, still require separate verification. |