Skip to content

fix(vscode): reuse IPC server port across restarts#256

Merged
backnotprop merged 1 commit intomainfrom
fix/vscode-stale-port
Mar 9, 2026
Merged

fix(vscode): reuse IPC server port across restarts#256
backnotprop merged 1 commit intomainfrom
fix/vscode-stale-port

Conversation

@backnotprop
Copy link
Owner

Summary

  • Persist the IPC server port in workspaceState and try to rebind to it on extension activation
  • Falls back to a random port if the preferred one is taken (e.g., another VS Code window claimed it)
  • Fixes restored terminals having a stale PLANNOTATOR_VSCODE_PORT after VS Code restart

Closes #252

Test plan

  • Install extension, open terminal, note echo $PLANNOTATOR_VSCODE_PORT
  • Close and reopen VS Code — verify the same port is reused
  • Trigger plannotator in a restored terminal — verify it opens in a webview panel
  • Open two VS Code windows on different workspaces — verify no port collision

🤖 Generated with Claude Code

Persist the IPC port in workspaceState and try to rebind to it on
activation so restored terminals still have a valid PLANNOTATOR_VSCODE_PORT.
Falls back to a random port if the preferred one is taken.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@backnotprop
Copy link
Owner Author

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

@backnotprop backnotprop merged commit 8201fe3 into main Mar 9, 2026
3 checks passed
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.

VS Code extension uses stale port when terminal is restored on reopen

1 participant