Skip to content

fix: improve CDP detection by checking actual port connection#1

Open
l1veIn wants to merge 1 commit intoImL1s:mainfrom
l1veIn:main
Open

fix: improve CDP detection by checking actual port connection#1
l1veIn wants to merge 1 commit intoImL1s:mainfrom
l1veIn:main

Conversation

@l1veIn
Copy link

@l1veIn l1veIn commented Feb 2, 2026

Problem

The extension was checking process.argv to determine if CDP was enabled, but VSCode extension host process doesn't receive the Electron main process arguments. This caused the extension to always show 'CDP not enabled' warning even when CDP was actually working.

Solution

  1. Changed CDP detection logic - Now actually tries to connect to CDP port 9000 instead of checking process.argv
  2. Added verifyCDPConnection() method - Async method that verifies CDP by HTTP request to /json/version
  3. Fixed VSIX packaging - Include ws module which is a required runtime dependency (was being excluded by .vscodeignore)

Changes

  • lib/relauncher.js: Updated isCDPEnabled() and added verifyCDPConnection()
  • extension.js: Changed startup flow to try connecting first, only show warning if connection fails
  • .vscodeignore: Only exclude devDependencies, keep node_modules/ws
  • package.json: Lowered engines.vscode to ^1.100.0 for broader compatibility

Testing

Tested on macOS with Antigravity IDE 1.104.0:

  • Launch with /Applications/Antigravity.app/Contents/MacOS/Electron --remote-debugging-port=9000
  • Extension now correctly detects CDP and shows 'CDP: Enabled' in menu

- Changed isCDPEnabled() to verify by connecting to CDP port instead of checking process.argv
- Extension now tries to connect to CDP on startup and shows warning only if connection fails
- Include ws module in vsix package (required runtime dependency)
- Updated .vscodeignore to exclude only devDependencies
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.

1 participant