feat: auto-disable DCP on Desktop clients#322
feat: auto-disable DCP on Desktop clients#322malaiwah wants to merge 1 commit intoOpencode-DCP:betafrom
Conversation
DCP is incompatible with Desktop/Web clients due to breaking changes in @opencode-ai/plugin. Add automatic detection of Electron/Desktop environment and disable plugin with console message. Update README to document this known issue.
|
Are you sure this works? I thought the desktop app is built with Tauri, not electron? |
|
No, it does not work after all. I need to find the Tauri equivalent |
Update: Fix is now working! ✅The original implementation using The ProblemThe plugin runs on the server side, not the client. Client-side detection methods (checking The SolutionDesktop vs TUI is distinguished by the command in
Implementationfunction isDesktop(): boolean {
return process.argv.includes("serve")
}Testing Results✅ Desktop mode: Plugin auto-disables, I've updated the implementation with this fix on my fork and it's working perfectly! (Since this PR was closed, I'll create a new PR with the working implementation.) |
Summary
DCP is currently incompatible with Desktop/Web OpenCode clients (issue #304). This PR adds automatic detection of Electron/Desktop environments and auto-disables the plugin with a clear console message.
Changes
isDesktop()function that checks forELECTRON_RUN_AS_NODEenvironment variable (set by Electron-based clients)Testing
Tested on:
Context
I've found DCP works significantly better in TUI than Desktop - the Desktop client has breaking changes in
@opencode-ai/pluginthat weren't handled, leading to errors likeTypeError: {} is not iterablefor/dcpcommands and thediscard/extracttools.This is a temporary workaround/plugin boundary solution while the deeper compatibility issues with newer OpenCode versions get resolved. The auto-disable approach keeps DCP functional for TUI users while preventing confusing errors for Desktop users.