Skip to content

fix(ocap-kernel): add allowedWsHosts to initRemoteComms RPC params#858

Merged
sirtimid merged 1 commit intomainfrom
sirtimid/init-remote-comms-allowed-ws-hosts
Feb 27, 2026
Merged

fix(ocap-kernel): add allowedWsHosts to initRemoteComms RPC params#858
sirtimid merged 1 commit intomainfrom
sirtimid/init-remote-comms-allowed-ws-hosts

Conversation

@sirtimid
Copy link
Copy Markdown
Contributor

@sirtimid sirtimid commented Feb 27, 2026

Summary

Test plan

  • yarn workspace @metamask/ocap-kernel test:dev:quiet — existing tests pass
  • ocap daemon exec initRemoteComms '{"relays":["/ip4/1.2.3.4/tcp/9001/ws/p2p/..."],"allowedWsHosts":["1.2.3.4"]}' — no longer rejected

🤖 Generated with Claude Code


Note

Low Risk
Low risk: adds a new optional RPC param and passes it through to existing remote comms initialization, with validation limited to a string array.

Overview
Fixes the initRemoteComms RPC handler to accept an optional allowedWsHosts array in its superstruct params validation.

When provided, the handler now threads allowedWsHosts into RemoteCommsOptions passed to kernel.initRemoteComms, preventing callers from being rejected due to unknown params.

Written by Cursor Bugbot for commit 4085270. This will update automatically on new commits. Configure here.

PR #857 added allowedWsHosts to RemoteCommsOptions and the transport
layer but not to the RPC handler's superstruct validation. Daemon
callers passing allowedWsHosts get a validation error because the
params struct rejects the unknown field.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sirtimid sirtimid requested a review from a team as a code owner February 27, 2026 14:02
@github-actions
Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 76.05%
🟰 ±0%
6589 / 8664
🔵 Statements 75.94%
🟰 ±0%
6695 / 8816
🔵 Functions 73.88%
🟰 ±0%
1647 / 2229
🔵 Branches 75.31%
⬇️ -0.02%
2453 / 3257
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/ocap-kernel/src/rpc/kernel-control/init-remote-comms.ts 93.75%
⬇️ -6.25%
90%
⬇️ -10.00%
100%
🟰 ±0%
93.75%
⬇️ -6.25%
74
Generated in workflow #3839 for commit 4085270 by the Vitest Coverage Report Action

@sirtimid sirtimid enabled auto-merge February 27, 2026 14:19
@sirtimid sirtimid added this pull request to the merge queue Feb 27, 2026
Merged via the queue into main with commit c11e52c Feb 27, 2026
29 checks passed
@sirtimid sirtimid deleted the sirtimid/init-remote-comms-allowed-ws-hosts branch February 27, 2026 18:25
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.

2 participants