Add custom agent handoff metadata to Rust SDK - #2476
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
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.
|
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. |
Status
Blocked on github/copilot-agent-runtime#18485 landing and shipping in a Copilot CLI release. This PR will remain draft until SDK
mainpins that release and the Rust RPC changes regenerate from its schema.Summary
CustomAgentHandoffwith requiredlabelandagent, plus optionalprompt,send, andmodelfields.handoffson generatedAgentInfo, coveringagents.discoverand session agent RPC results.CustomAgentConfig.handoffssupport and awith_handoffsbuilder that reuse the generated handoff type.Schema and compatibility
The proposed contract matches the schema in github/copilot-agent-runtime#18485. Once that schema ships, this branch will rebase onto the corresponding SDK CLI-version update and regenerate
rust/src/generated/api_types.rsthrough the repository codegen workflow.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. ExistingAgentInfopayloads withouthandoffscontinue to deserialize.Testing
cargo +nightly-2026-04-14 fmt --checkCOPILOT_SKIP_CLI_DOWNLOAD=1 cargo clippy --all-features --all-targets -- -D warningsCOPILOT_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)