Skip to content

Add custom agent handoff metadata to Rust SDK - #2476

Draft
pierceboggan wants to merge 1 commit into
mainfrom
pierceboggan-agent-handoff-metadata
Draft

Add custom agent handoff metadata to Rust SDK#2476
pierceboggan wants to merge 1 commit into
mainfrom
pierceboggan-agent-handoff-metadata

Conversation

@pierceboggan

Copy link
Copy Markdown

Summary

  • Add generated CustomAgentHandoff with required label and agent, plus optional prompt, send, and model fields.
  • Expose optional ordered handoffs on generated AgentInfo, covering agents.discover and session agent RPC results.
  • Add matching CustomAgentConfig.handoffs support and a with_handoffs builder that reuse the generated handoff type.

Schema and compatibility

The generated contract matches the canonical runtime schema from github/copilot-agent-runtime@396e626c. The CustomAgentHandoff definition and AgentInfo.handoffs property were checked for exact schema equality.

Option<Vec<CustomAgentHandoff>> preserves missing handoff metadata for older runtimes and authored display order when present. Each optional item field remains omitted on serialization when unset. Existing AgentInfo payloads without handoffs continue to deserialize.

Testing

  • cargo +nightly-2026-04-14 fmt --check
  • COPILOT_SKIP_CLI_DOWNLOAD=1 cargo clippy --all-features --all-targets -- -D warnings
  • COPILOT_SKIP_CLI_DOWNLOAD=1 cargo test --all-features --lib (243 passed)
  • COPILOT_SKIP_CLI_DOWNLOAD=1 cargo test --all-features --test api_types_test (13 passed)
  • COPILOT_SKIP_CLI_DOWNLOAD=1 COPILOT_CLI_PATH=/opt/homebrew/bin/copilot cargo test --all-features --test e2e rpc_agent:: (7 passed)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pierceboggan
pierceboggan requested a review from a team as a code owner September 2, 2026 04:16
Copilot AI balanced review requested due to automatic review settings September 2, 2026 04:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The generated Rust additions are not reproducible from the repository’s pinned schema dependency and would fail the codegen check.

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

Review tier: Balanced
Findings: None

What changed in this PR

Adds custom-agent handoff metadata and configuration support to the Rust SDK.

Changes:

  • Adds generated handoff and agent metadata types.
  • Adds CustomAgentConfig::with_handoffs.
  • Tests serialization, ordering, omission, and RPC exposure.
File Description
rust/​tests/​api_types_test.rs Tests handoff serialization and RPC payloads.
rust/​src/​types.rs Exposes handoffs through custom-agent configuration.
rust/​src/​generated/​api_types.rs Adds generated handoff protocol types.

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

@SteveSandersonMS
SteveSandersonMS marked this pull request as draft September 2, 2026 11:59
@SteveSandersonMS

Copy link
Copy Markdown
Contributor

Thanks for the work here. I verified this handoff metadata is not yet present in the runtime schema currently consumed by this repo, and the Rust RPC additions are therefore not codegen-derived from our pinned source.

I’m moving this PR to draft for now. Please mark it ready for review once the corresponding runtime change has landed and this PR references that shipped runtime version, with the RPC type changes coming purely from codegen output.

For tracking, I've moved this to draft - please mark as ready to review when appropriate.

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.

3 participants