Skip to content

feat(types): add targetClientId to HostBashRequest and PendingInteraction#29309

Merged
credence-the-bot[bot] merged 1 commit into
Credence/targeted-host-proxyfrom
targeted-host-proxy/pr-2-targetclientid-types
May 3, 2026
Merged

feat(types): add targetClientId to HostBashRequest and PendingInteraction#29309
credence-the-bot[bot] merged 1 commit into
Credence/targeted-host-proxyfrom
targeted-host-proxy/pr-2-targetclientid-types

Conversation

@credence-the-bot
Copy link
Copy Markdown
Contributor

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

Summary

  • Add optional targetClientId?: string to HostBashRequest message type
  • Add optional targetClientId?: string to PendingInteraction interface
  • Pure type additions, no runtime behaviour changes

Part of plan: targeted-host-proxy.md (PR 2 of 8)


Open in Devin 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 3 potential issues.

Open in Devin Review

Comment on lines +54 to +55
/** When set, the host_bash request should be routed to this specific client. */
targetClientId?: string;
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.

🟡 registerPendingInteraction does not propagate targetClientId from HostBashRequest to PendingInteraction

The PR adds targetClientId to both HostBashRequest (message type) and PendingInteraction (tracker type), but the bridge code in registerPendingInteraction at assistant/src/runtime/assistant-event-hub.ts:584-588 constructs the PendingInteraction without copying msg.targetClientId. When a host_bash_request message with targetClientId set is broadcast, the corresponding pending interaction will always have targetClientId: undefined, making the field on PendingInteraction permanently ineffective.

Bridge code that omits the field
} else if (msg.type === "host_bash_request") {
    pendingInteractions.register(msg.requestId, {
      conversationId,
      kind: "host_bash",
      // targetClientId is missing here
    });
Prompt for agents
The registerPendingInteraction function in assistant/src/runtime/assistant-event-hub.ts (around line 584-588) needs to propagate targetClientId from the message to the pending interaction. The host_bash_request branch currently constructs the PendingInteraction with only conversationId and kind, but should also include targetClientId: msg.targetClientId (or equivalent). This is the bridge between the HostBashRequest message type and the PendingInteraction tracker type -- both types now have the targetClientId field, but the bridge code doesn't copy it across.
Open in Devin Review

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

Comment on lines +16 to +17
/** When set, route this request only to the client with this ID. */
targetClientId?: string;
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.

🚩 Swift client HostBashRequest struct does not include targetClientId

The Swift HostBashRequest struct at clients/shared/Network/MessageTypes.swift:1532-1551 has explicit CodingKeys and does not include a targetClientId property. When the daemon sends a host_bash_request with targetClientId set, the Swift client will silently ignore it during JSON decoding (since Decodable skips unknown keys by default). If the client needs to act on this field (e.g., to check whether it's the intended target before executing), the struct and its CodingKeys will need updating in a follow-up PR.

Open in Devin Review

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

Comment on lines +16 to +17
/** When set, route this request only to the client with this ID. */
targetClientId?: string;
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.

🚩 broadcastMessage routing does not use targetClientId for client-specific delivery

The broadcastMessage function at assistant/src/runtime/assistant-event-hub.ts:473-528 routes host-proxy messages by targetCapability (sending to all subscribers with host_bash capability), but has no mechanism to restrict delivery to a single client by ID. Even if targetClientId is set on the HostBashRequest, the message will fan out to every subscriber with the host_bash capability. The assistantEventHub.publish method (assistant/src/runtime/assistant-event-hub.ts:255) accepts only { targetCapability } in its options — there is no targetClientId filtering. This is expected for a preparatory type change, but the actual routing logic will need to be added for the feature to work.

Open in Devin Review

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

@credence-the-bot credence-the-bot Bot merged commit 955bf7b into Credence/targeted-host-proxy May 3, 2026
13 checks passed
@credence-the-bot credence-the-bot Bot deleted the targeted-host-proxy/pr-2-targetclientid-types branch May 3, 2026 02:21
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