Skip to content

feat(host-proxy): add targetClientId support to HostTransferProxy and message envelopes#29431

Merged
credence-the-bot[bot] merged 2 commits into
Credence/targeted-host-proxy-phase3from
run-plan/host-transfer-xc/pr-1
May 3, 2026
Merged

feat(host-proxy): add targetClientId support to HostTransferProxy and message envelopes#29431
credence-the-bot[bot] merged 2 commits into
Credence/targeted-host-proxy-phase3from
run-plan/host-transfer-xc/pr-1

Conversation

@credence-the-bot
Copy link
Copy Markdown
Contributor

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

Summary

  • Add targetClientId? to HostTransferToHostRequest, HostTransferToSandboxRequest, HostTransferCancelRequest envelopes
  • Wire upfront targetClientId validation and auto-resolution into requestToHost() and requestToSandbox() before Promise entry
  • Thread targetClientId through all 4 cancel sites and pending registration; add getTargetClientIdForTransfer() helper
  • Add targeted proxy tests + regression cases in host-transfer-proxy-targeted.test.ts

Part of plan: targeted-host-proxy-phase3.md (PR 1 of 3)


Open in Devin Review

@credence-the-bot
Copy link
Copy Markdown
Contributor Author

@codexbot review

@credence-the-bot
Copy link
Copy Markdown
Contributor Author

@devin-ai-integration[bot] please review

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 found 1 potential issue.

View 3 additional findings in Devin Review.

Open in Devin Review

Comment on lines +571 to +578
/**
* Look up the targetClientId for a given transferId without consuming the entry.
* Routes call this to verify ownership without affecting the transfer state.
* Returns null when untargeted (no validation needed).
*/
getTargetClientIdForTransfer(transferId: string): string | null {
return this.transfers.get(transferId)?.targetClientId ?? null;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚩 Host-transfer routes lack targetClientId validation on inbound endpoints

The host-bash (host-bash-routes.ts:53-64), host-file (host-file-routes.ts:46-56), and host-cu (host-cu-routes.ts:67-77) result routes all validate that the submitting client (via X-Vellum-Client-Id header) matches the targetClientId from the pending interaction. The host-transfer routes (host-transfer-routes.ts:117-151) do not perform this check on any of the three endpoints (GET content, PUT content, POST result). This means a non-targeted client could submit results or download/upload content for a transfer intended for a specific client. The getTargetClientIdForTransfer method was added at host-transfer-proxy.ts:576 with doc comment "Routes call this to verify ownership" but no route actually calls it. This is likely planned for a follow-up but creates an inconsistency with the other host proxy routes.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

ℹ️ 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".

@credence-the-bot credence-the-bot Bot merged commit 719e453 into Credence/targeted-host-proxy-phase3 May 3, 2026
13 checks passed
@credence-the-bot credence-the-bot Bot deleted the run-plan/host-transfer-xc/pr-1 branch May 3, 2026 18:19
noanflaherty pushed a commit that referenced this pull request May 3, 2026
…sfer (#29440)

* feat(host-proxy): add targetClientId support to HostTransferProxy and message envelopes (#29431)

* feat(host-proxy): add targetClientId support to HostTransferProxy and message envelopes

* fix(tests): add listClientsByCapability and getClientById to host-transfer-proxy mock

---------

Co-authored-by: credence-the-bot <credence@vellum.ai>

* feat(routes): enforce x-vellum-client-id ownership on host-transfer routes; add target_client_id to tool (#29434)

* feat(routes): enforce x-vellum-client-id ownership on host-transfer routes; add target_client_id to tool

* fix(tests): await .rejects assertions; guard executeLocal fallthrough on targetClientId

---------

Co-authored-by: credence-the-bot <credence@vellum.ai>

* feat(macos): targetClientId acceptance guard and x-vellum-client-id headers for host_transfer (#29435)

* feat(macos): targetClientId acceptance guard and x-vellum-client-id headers for host_transfer

* fix(swift): use setValue (not addValue) for extraHeaders in GatewayHTTPClient.get

---------

Co-authored-by: credence-the-bot <credence@vellum.ai>

---------

Co-authored-by: credence-the-bot[bot] <277301654+credence-the-bot[bot]@users.noreply.github.com>
Co-authored-by: credence-the-bot <credence@vellum.ai>
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