Skip to content

Align Rust SDK public surface#1212

Merged
stephentoub merged 2 commits intomainfrom
stephentoub/sdk-surface-audit
May 6, 2026
Merged

Align Rust SDK public surface#1212
stephentoub merged 2 commits intomainfrom
stephentoub/sdk-surface-audit

Conversation

@stephentoub
Copy link
Copy Markdown
Collaborator

@stephentoub stephentoub commented May 6, 2026

This follow-up from the cross-language SDK surface audit keeps Rust aligned with the established C#, Go, Python, and TypeScript public APIs before the new SDK surface settles.

Summary

  • Remove Rust-only high-level autoModeSwitch, exitPlanMode, and disabled_mcp_servers surfaces while leaving generated protocol event types untouched.
  • Add Rust ResumeSessionConfig parity for available_tools and disabled_skills.
  • Expand Rust tool results with binary payloads, tool telemetry, and an MCP CallToolResult conversion helper to match the richer tool-result support in the other SDKs.
  • Update Rust README examples to use only valid high-level methods or generated session.rpc() calls, and fix Go permission handler comments.

Remove Rust-only auto mode switch and exit-plan-mode handler surfaces, align resume tool filtering config, add richer Rust tool result support, and update documentation/comments.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 6, 2026 17:24
@stephentoub stephentoub requested a review from a team as a code owner May 6, 2026 17:24
@stephentoub stephentoub requested a review from tclem May 6, 2026 17:27
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Cross-SDK Consistency Review ✅

This PR does an excellent job aligning the Rust SDK with the other four implementations. Here's my cross-SDK analysis:

Features Added to Match Other SDKs (Parity Improvements)

Feature Node.js Python Go .NET Rust (this PR)
ResumeSessionConfig available_tools availableTools available_tools AvailableTools AvailableTools ✅ added
ResumeSessionConfig disabled_skills disabledSkills disabled_skills DisabledSkills DisabledSkills ✅ added
ToolBinaryResult + binary_results_for_llm ✅ added
tool_telemetry in ToolResultExpanded toolTelemetry tool_telemetry ToolTelemetry ToolTelemetry ✅ added
MCP CallToolResult converter convertMcpCallToolResult convert_mcp_call_tool_result ConvertMCPCallToolResult ❌ missing ✅ added

Rust-Only Surfaces Correctly Removed

The following features had no equivalents in any other SDK and are correctly removed:

  • HandlerEvent::AutoModeSwitch / HandlerResponse::AutoModeSwitch / AutoModeSwitchResponse / request_auto_mode_switch — other SDKs expose auto_mode_switch.requested only as a generated session event type, not as a high-level handler callback
  • HandlerEvent::ExitPlanMode / HandlerResponse::ExitPlanMode / ExitPlanModeResult / ExitPlanModeData / request_exit_plan_mode — same pattern
  • SessionConfig::disabled_mcp_servers — not present in any other SDK

Minor Follow-Up Opportunity

The table above shows the .NET SDK is missing a public ConvertMcpCallToolResult() helper (Node, Python, Go, and now Rust all have it). This gap was pre-existing and is not introduced by this PR, but it may be worth a separate follow-up to bring .NET to parity.

Go documentation change

The comment update on OnPermissionRequest in both SessionConfig and ResumeSessionConfig is accurate and more actionable. No consistency concern.

Overall, this PR is well-scoped and moves the multi-SDK surface in the right direction. 👍

Generated by SDK Consistency Review Agent for issue #1212 · ● 2.3M ·

@stephentoub stephentoub added this pull request to the merge queue May 6, 2026
@stephentoub
Copy link
Copy Markdown
Collaborator Author

Thanks, @tclem.

Merged via the queue into main with commit f39d370 May 6, 2026
34 checks passed
@stephentoub stephentoub deleted the stephentoub/sdk-surface-audit branch May 6, 2026 18:22
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