Skip to content

serving: unwrap {"method":"infer","obs":...} client payloads - #2

Open
anthony-liang-tri wants to merge 1 commit into
isaac-lbm-yamfrom
serve-unwrap-infer-payload
Open

serving: unwrap {"method":"infer","obs":...} client payloads#2
anthony-liang-tri wants to merge 1 commit into
isaac-lbm-yamfrom
serve-unwrap-infer-payload

Conversation

@anthony-liang-tri

Copy link
Copy Markdown
Collaborator

What

Unwrap {"method": "infer", "obs": {...}}-wrapped payloads in WebsocketPolicyServer before handing them to policy.infer().

Why

openpi-client's WebsocketClientPolicy sends the inference request wrapped as {"method": "infer", "obs": {...}} (with an optional top-level "noise"), but the server passed the raw unpacked message straight to policy.infer(), which expects the bare obs dict. Without unwrapping, inference gets a malformed obs. This unwraps it (preserving noise) so both the yam_eval eval client and deployment/openpi_bridge.py work against this server.

This has been running as a local patch on the russet YAM rig; upstreaming so it isn't lost on a clean checkout.

Note

+9 lines, backward-compatible (only unwraps when the method:infer envelope is present; bare-obs clients unaffected).

openpi-client's WebsocketClientPolicy sends the inference payload wrapped as
{"method": "infer", "obs": {...}} (+ optional "noise"), but the server passed the
raw unpacked message straight to policy.infer(), which expects the bare obs dict.
Unwrap it (preserving noise) so both the yam_eval eval client and
deployment/openpi_bridge.py work against this server.
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.

1 participant