chore(host-tool): cleanup dead WS path + cross-client drain-path tests#30163
Merged
Conversation
The chrome extension migrated to HTTP POST in PR #29829. There is no /v1/browser-relay WebSocket endpoint in the current runtime — no WS handler calls HostBrowserProxy.resolveResult. Removing the public method eliminates the foot-gun of a future WS handler bypassing the kind-check and same-actor guard that the HTTP route enforces. The route now inlines pendingInteractions.resolve() + rpcResolve directly. Tests are updated to use a local resolveResult helper that mirrors the same call sequence. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PR #30154 enabled web/iOS turns to drive host_app_control and host_cu on a connected macOS client (cross-client routing). The existing drain-path tests cover macOS-native + chrome-extension + slack; this adds the missing cross-client cases: - web source + listClientsByCapability returns 1 macOS client → both app-control and computer-use skills re-added - web source + listClientsByCapability returns [] → neither re-added Introduces a per-test mockCapabilityClients variable (with afterEach reset) so hub state doesn't bleed across tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
@codex please review |
|
Codex Review: Didn't find any major issues. Bravo. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
Contributor
Author
wrapBoth bots gave clean reviews:
No findings to address. All CI checks green (Lint, Type Check, Test, OpenAPI Spec Check all pass). Summary of changes:
This PR is merge-ready. |
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.
What
Two small tech-debt cleanups bundled:
1. Remove dead daemon-side WS
resolveResultpathThe chrome extension migrated to HTTP POST in PR #29829. Preflight findings:
grep -rn "resolveResult" assistant/src/confirms the only production caller ishost-browser-routes.ts:163(HTTP route). Tests call it directly for simulation./v1/browser-relayWebSocket endpoint in the currenthttp-server.ts. The WS handler described in the stale NOTE comment does not exist.resultTransport: "ws"option, but since the endpoint doesn't exist, the default"http"transport is used by all tests.Decision: delete.
HostBrowserProxy.resolveResultwas public, making it callable from a hypothetical future WS handler without the kind-check + same-actor guard thatresolveHostBrowserResultByRequestIdenforces. The HTTP route now inlines thependingInteractions.resolve()+rpcResolve()call directly, and the stale NOTE comment +HostBrowserProxyimport are removed from the route file.2. Cross-client drain-path tests for
app-control+computer-usePR #30154 enabled web/iOS turns to drive
host_app_controlandhost_cuon a connected macOS client. Existing drain-path tests cover macOS-native, chrome-extension, and slack cases. This adds the missing cross-client cases:websource +listClientsByCapabilityreturns 1 macOS client → bothapp-controlandcomputer-useskills re-addedwebsource +listClientsByCapabilityreturns[]→ neither re-addedUses a per-test
mockCapabilityClientsvariable withafterEachcleanup to prevent state bleed.Why
(1) Removes the unguarded public API surface — no live WS caller exists, eliminating the foot-gun before someone adds one. (2) Closes the test-coverage gap noted in PR #30154's design doc as deferred.
Out of scope
Validation
bun test(56 tests across 3 files, 0 fail) +bun typecheckclean.