fix: complete IPC auth for broadcast and SSH-forwarded sockets#3410
Merged
Conversation
… token for SSH-forwarded sockets - broadcast() now iterates over authenticatedSockets instead of connectedSockets, preventing unauthenticated connections from receiving broadcast messages during the 5-second auth window. - CLI connect() now gracefully handles missing session token when VELLUM_DAEMON_SOCKET is set (SSH-forwarded socket), instead of hard-failing before the IPC exchange. Addresses feedback from #3375. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 14fb6d6cd4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Contributor
Author
|
Addressed in #3431 |
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.
Summary
Addresses two remaining issues from the IPC auth implementation in #3375:
broadcast() leaked messages to unauthenticated sockets — During the 5-second auth timeout window,
broadcast()iterated over allconnectedSockets, sending messages (likedaemon_statuswithhttpPort, session info, etc.) to sockets that hadn't authenticated yet. Fixed by iterating overauthenticatedSocketsinstead.CLI hard-failed when session token was missing for SSH-forwarded sockets — The CLI's
connect()immediately rejected and destroyed the socket whenreadSessionToken()returned null, breaking the SSH-forwarded socket workflow where the token file exists on the remote host, not locally. Fixed by detectingVELLUM_DAEMON_SOCKEToverride and proceeding without auth in that case.Note: The Swift DaemonClient auth (issue #1 from the feedback) was already implemented —
authenticate()andAuthMessagesend are present inDaemonClient.swift.Files Changed
assistant/src/daemon/server.ts—broadcast()usesauthenticatedSocketsinstead ofconnectedSocketsassistant/src/cli.ts— Graceful fallback when token missing + socket override is setTest Plan
VELLUM_DAEMON_SOCKET=~/.vellum/remote.sock vellumconnects without crashing