Repository navigation
fix(desktop): surface token on WS + CLI; harden pull/cleanup/health - #255
Merged
Merged
Conversation
…p/health Addresses a code review of the desktop surface-token gate + robustness: P1 (WS omit surface token): the surface gate wasn't propagated to WebSocket URL builders, so terminal streaming, live collaboration, and session-control WS all 401 on desktop (WS can't send the header). Append ?surface= (+ user_id for the control WS, which had no params). Fixes desktop terminals/collaboration. P1 (CLI): cp_call and open_pty_ws now send the surface token (header) like apply_auth already did — CLI/TUI commands were 401ing under the gate. P2 (pull symlink): route the pull write through an O_NOFOLLOW open (new safe_write), mirroring the folder-import path, so a pre-planted terminal-component symlink can't be written through (safe_workspace_dest already guards ancestors). P2 (PID reuse): cleanup_stale_processes verifies a PID's command line is actually ours (data-dir/bundle/binary markers) before SIGTERM/SIGKILL — no longer kills an unrelated process that recycled the PID after a crash. P3 (health): wait_for_health now requires a real HTTP response (any status — the d1-shim/frontend legitimately 404), not just a TCP connect, so a stray listener isn't mistaken for readiness. Both bins + frontend typecheck clean. Revision markers bumped. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_014t8Ukp4NPWtqJ55X261wMZ
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.
No description provided.