fix: proxy race condition + IPC discovery for VS Code SSH Remote (#321)#322
Merged
Merged
Conversation
…acknotprop#321) When opening plannotator over VS Code SSH Remote, the webview could show a "proxy error" because the cookie proxy connected before the upstream Bun server was ready. Two layers of defense: 1. Retry with exponential backoff (200/400/800ms) in the cookie proxy, buffering the request body so retries can replay it 2. Silent iframe auto-reload in the webview wrapper if no "ready" signal is received within 3 seconds (max 1 reload to prevent loops) Bump vscode extension to 0.5.2.
…prop#321) VS Code's environmentVariableCollection only injects PLANNOTATOR_BROWSER into interactive terminal shells — background processes spawned by Claude Code hooks don't inherit it. In SSH Remote sessions this meant openBrowser() was never called (handleServerReady skipped it when isRemote=true and PLANNOTATOR_BROWSER was unset). - Extension writes IPC port to ~/.plannotator/vscode-ipc.json keyed by workspace path; cleans up on deactivate - openBrowser() falls back to IPC registry when shell-based open fails, using longest-prefix workspace match for multi-window support - handleServerReady() always calls openBrowser() since the IPC fallback handles the remote case
Owner
Code reviewNo 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 👎. |
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.
Links
Closes #321
Summary
When running plannotator over VS Code SSH Remote, two issues prevented the webview from loading reliably:
Proxy race condition: The cookie proxy connected to the upstream Bun server before it was ready, showing "proxy error". Fixed with retry + exponential backoff (200/400/800ms) in the proxy, plus a silent auto-reload fallback in the webview wrapper (3s timeout, max 1 reload).
Webview not opening at all: VS Code's
environmentVariableCollectioninjectsPLANNOTATOR_BROWSERinto terminal shells, but background processes spawned by Claude Code hooks don't inherit it. In remote sessions,handleServerReady()skippedopenBrowser()entirely. Fixed with a file-based IPC registry (~/.plannotator/vscode-ipc.json) — the extension writes its IPC port keyed by workspace path, andopenBrowser()reads it as a fallback. Multi-window support via longest-prefix workspace matching.Validation
/plannotator-reviewfrom a Claude Code terminal🤖 Generated with Claude Code