Skip to content

[Web runtime] Add action capability dispatch to the Web Runtime - #1585

Open
minggangw wants to merge 1 commit into
RobotWebTools:developfrom
minggangw:fix-1579
Open

[Web runtime] Add action capability dispatch to the Web Runtime#1585
minggangw wants to merge 1 commit into
RobotWebTools:developfrom
minggangw:fix-1579

Conversation

@minggangw

@minggangw minggangw commented Sep 3, 2026

Copy link
Copy Markdown
Member
  • Add allow-listed action capabilities with goal, feedback, result, and cancellation support.
  • Support actions over WebSocket and HTTP/SSE in the browser SDK, including typed action APIs.
  • Add --action support to the rclnodejs-web CLI and runtime declarations.
  • Safely manage pending goals, duplicate IDs, disconnects, and action-client cleanup.
  • Handle truncated and CRLF-framed SSE streams.
  • Add WebSocket, HTTP, CLI, cancellation, lifecycle, and error-path tests.

Fix: #1579

Copilot AI lite review requested due to automatic review settings September 3, 2026 06:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new HTTP SSE action stream pump has an unhandled-rejection risk (errors can throw before the try/catch), which should be fixed to avoid potential crashes.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds ROS 2 action capability dispatch support to the rclnodejs Web Runtime, enabling clients using rclnodejs/web to send action goals and receive feedback/results over WebSocket, and over HTTP via SSE (with HTTP cancel explicitly unsupported).

Changes:

  • Extend runtime capability registry/types to include action and route kind: 'action' frames in the dispatcher.
  • Implement WebSocket and HTTP(SSE) action goal execution flows, including feedback/result streaming and goal cancellation (WebSocket only).
  • Add integration + protocol-level tests covering WebSocket and HTTP action behavior, plus update existing runtime tests for the new action handling.
File summaries
File Description
web/index.d.ts Adds action-related SDK typings (ActionName, wire types, ActionHandle, RosClient.action overloads).
web/client.js Implements SDK-side action goal dispatch over WS and HTTP(SSE), feedback routing, and cancellation (WS-only).
lib/runtime/capability_registry.js Adds action capability kind storage, exposure, resolution, and listing.
lib/runtime/index.d.ts Extends runtime types to include action capability kind and action frame fields (op, goalId).
lib/runtime/dispatcher.js Implements action goal send/cancel handling and feedback/result emission on the wire.
lib/runtime/transports/http.js Adds SSE-based HTTP action transport (HttpActionConnection) and enables action over HTTP.
test/test-web-action.js New end-to-end tests for action wire protocol and SDK over WS and HTTP(SSE).
test/test-runtime.js Updates/extends runtime tests to cover action registry and wire behavior changes.
Review details
  • Files reviewed: 6/8 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread web/client.js
Comment on lines +589 to +593
const reader = body.getReader();
const decoder = new TextDecoder();
let buffer = '';
try {
for (;;) {
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 90.777% (-0.3%) from 91.068% — minggangw:fix-1579 into RobotWebTools:develop

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.

Add action capability dispatch

3 participants