-
Notifications
You must be signed in to change notification settings - Fork 90
feat(macos): decode targetClientId from HostBashRequest and accept targeted non-local requests #29315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(macos): decode targetClientId from HostBashRequest and accept targeted non-local requests #29315
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -365,6 +365,15 @@ extension AppDelegate { | |
| self.featureFlagStore.reloadFromGateway() | ||
| // Host tool execution — run locally and post results back | ||
| case .hostBashRequest(let msg): | ||
| // Accept if this conversation is locally owned, OR if the request | ||
| // is explicitly targeted at this client (cross-client proxy routing). | ||
| let localClientId = DeviceIdStore.getOrCreate() | ||
| let isLocalConversation = self.mainWindow?.conversationManager | ||
| .conversations.contains(where: { $0.conversationId == msg.conversationId }) ?? false | ||
| let isTargeted = msg.targetClientId == localClientId | ||
| guard isLocalConversation || isTargeted else { | ||
| break | ||
| } | ||
|
Comment on lines
+368
to
+376
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Upstream SSE filter drops cross-client proxy bash requests before targetClientId guard can evaluate The new Upstream filter that blocks the message
case .hostBashRequest(let msg):
if locallyOwnedConversationIds.contains(msg.conversationId) { return false }
log.warning("Ignoring host_bash_request for non-local conversation ...")
return trueThis needs to also pass through messages where Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback. |
||
| HostToolExecutor.executeHostBashRequest(msg) | ||
| case .hostFileRequest(let msg): | ||
| HostToolExecutor.executeHostFileRequest(msg) | ||
|
Comment on lines
378
to
379
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚩 Inconsistent cross-client routing guard across host tool types The new (Refers to lines 378-412) Was this helpful? React with 👍 or 👎 to provide feedback. |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This acceptance guard cannot make cross-client host bash work by itself, because
EventStreamClient.shouldIgnoreHostToolRequeststill drops everyhost_bash_requestwhoseconversationIdis not locally owned before this switch ever runs (clients/shared/Network/EventStreamClient.swift,case .hostBashRequest). In the targeted-proxy path, the conversation is intentionally non-local, so the message is filtered out andisTargetedis never evaluated, leaving targeted host bash requests non-functional.Useful? React with 👍 / 👎.