Skip to content

feat(host-proxy): add targetClientId support to HostFileProxy and HostProxyBase#29394

Merged
credence-the-bot[bot] merged 1 commit into
Credence/targeted-host-proxy-phase2from
Credence/targeted-host-proxy-phase2-pr1
May 3, 2026
Merged

feat(host-proxy): add targetClientId support to HostFileProxy and HostProxyBase#29394
credence-the-bot[bot] merged 1 commit into
Credence/targeted-host-proxy-phase2from
Credence/targeted-host-proxy-phase2-pr1

Conversation

@credence-the-bot
Copy link
Copy Markdown
Contributor

@credence-the-bot credence-the-bot Bot commented May 3, 2026

Summary

  • Adds targetClientId resolution to HostFileProxy.request(): auto-resolves when exactly one host_file-capable client is connected, validates explicit targetClientId against the hub, and leaves undefined for untargeted broadcast (existing behaviour for 0 or >1 clients)
  • Threads targetClientId through HostProxyBase.dispatchRequest() and PendingEntry, covering HostCuProxy via inheritance — both request, abort-cancel, and dispose-cancel broadcast paths now forward the target
  • Adds targetClientId?: string to HostFileReadRequest, HostFileWriteRequest, HostFileEditRequest, HostFileCancelRequest, HostCuRequest, and HostCuCancelRequest message types
  • Updates assistant-event-hub.ts registerPendingInteraction to forward targetClientId for host_file_request and host_cu_request interactions (matching the existing host_bash_request pattern)

Test plan

  • TypeScript compiles clean (only pre-existing unrelated stemmer module error)
  • Verify HostFileProxy auto-resolves single connected client (no explicit targetClientId needed)
  • Verify explicit targetClientId validation returns error message when client not found or lacks capability
  • Verify host_cu_request / host_file_request interactions in pendingInteractions include targetClientId
  • Verify cancel messages on abort and dispose include targetClientId and route correctly

🤖 Generated with Claude Code


Open in Devin Review

…tProxyBase

- Add targetClientId to HostFileReadRequest, HostFileWriteRequest, HostFileEditRequest, HostFileCancelRequest
- Add targetClientId to HostCuRequest and HostCuCancelRequest
- HostFileProxy.request() resolves target client (auto-resolve single, validate explicit, undefined for untargeted)
- Thread targetClientId through all broadcastMessage calls (request, abort cancel, dispose cancel)
- Add targetClientId to HostProxyBase.PendingEntry and dispatchRequest (covers HostCuProxy via inheritance)
- Update broadcastDynamic to accept and forward targetClientId as options to broadcastMessage
- Register targetClientId in assistant-event-hub.ts for host_file and host_cu pending interactions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@credence-the-bot credence-the-bot Bot merged commit 67b2df3 into Credence/targeted-host-proxy-phase2 May 3, 2026
11 of 12 checks passed
@credence-the-bot credence-the-bot Bot deleted the Credence/targeted-host-proxy-phase2-pr1 branch May 3, 2026 13:14
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9865c539fc

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines 627 to +630
pendingInteractions.register(msg.requestId, {
conversationId,
kind: "host_file",
targetClientId,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Enforce target client on host_file result submissions

Now that host_file_request stores targetClientId in pending interactions, /v1/host-file-result should verify the submitting client matches that target (as host-bash-result already does). handleHostFileResult currently accepts any authenticated submitter with a requestId, so a different connected client can resolve a targeted file request and inject/override the result if it learns the ID.

Useful? React with 👍 / 👎.

Comment on lines 632 to +636
} else if (msg.type === "host_cu_request") {
pendingInteractions.register(msg.requestId, {
conversationId,
kind: "host_cu",
targetClientId,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Enforce target client on host_cu result submissions

The same targeting gap exists for CU: this change records targetClientId for host_cu_request, but /v1/host-cu-result does not check x-vellum-client-id against that stored target before resolving. That means any authenticated client that can post a known requestId can complete another client’s targeted computer-use action, defeating the new per-client routing guarantee.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

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.

0 participants