Skip to content

[RSDK-13658] Expose force_relay/force_p2p/turn_uri DialOptions#1208

Open
danielbotros wants to merge 4 commits intomainfrom
APP-coturn-dial-options
Open

[RSDK-13658] Expose force_relay/force_p2p/turn_uri DialOptions#1208
danielbotros wants to merge 4 commits intomainfrom
APP-coturn-dial-options

Conversation

@danielbotros
Copy link
Copy Markdown
Member

@danielbotros danielbotros commented Apr 28, 2026

Summary

  • Add force_relay, force_p2p, and turn_uri kwargs to DialOptions so SDK callers can drive the ICE relay/P2P testing and TURN-server filtering knobs that rust-utils now exposes through viam_dial.
  • Switch _Runtime to the viam_*-prefixed FFI symbols (viam_init_rust_runtime, viam_dial, viam_free_string, viam_free_rust_runtime). The previously called functions are already #[deprecated] upstream — this just stops asking for the deprecation warning and lets us pass the new args.
  • Won't merge until rust-utils tagged release with the new 10-arg viam_dial is published.

Test plan

  • Loaded a locally built rust-utils dylib from rust-utils PR #176 and confirmed _Runtime() resolves all four viam_* symbols and init/release runs cleanly
  • Verify force_relay actually pins to relay candidates against coturn server and force_p2p pins to reflexive or local candidates using new rust-utils dylib.

🤖 Generated with Claude Code

Add the matching Python kwargs for the rust-utils FFI flags landed in
viamrobotics/rust-utils#176 so SDK callers can drive ICE relay/P2P
testing and TURN-server filtering without reaching into the C ABI.

Switches `_Runtime` to the `viam_*`-prefixed FFI symbols
(viam_init_rust_runtime / viam_dial / viam_free_string /
viam_free_rust_runtime). The previously called functions were already
`#[deprecated]` upstream; this just stops asking for the deprecation
warning and lets us pass the new args.

Mirrors rust-utils' two pre-flight conflict warnings (force_relay +
force_p2p, force_p2p + turn_uri) on the Python side so callers see them
before the FFI hop.

Compatibility: requires a rust-utils release that ships PR #176. Once
that release is out, `etc/postinstall.sh` will pull a dylib whose
viam_dial accepts the new 10-arg signature; older dylibs do not, and
calling this code against them is undefined behavior. **Do not merge
this PR until that rust-utils release is cut.**

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@danielbotros danielbotros requested a review from a team as a code owner April 28, 2026 17:46
@danielbotros danielbotros requested review from lia-viam and njooma April 28, 2026 17:46
@danielbotros danielbotros marked this pull request as draft April 28, 2026 17:47
@danielbotros danielbotros marked this pull request as ready for review May 4, 2026 19:49
Copy link
Copy Markdown
Member

@stuqdog stuqdog left a comment

Choose a reason for hiding this comment

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

lgtm! note though that this shouldn't be merged until the corresponding rust-utils feature is.

@viamrobotics-overwatch
Copy link
Copy Markdown

Hey @danielbotros — this PR has been approved and CI has been green for 3+ business days. Ready to merge?

Auto-comment from overwatch. Will not re-nudge for 7 days.

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