Rust: Add Scoped Main-Turn Interruption#2015
Conversation
Generate the typed session.interruptMainTurn RPC surface, expose Session::interrupt_main_turn with explicit options and result, and track SessionCapabilities.interrupt_main_turn across create and capabilities.changed snapshots. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2704b44e-61a0-4b2f-952b-befba7f5c813
|
Deduplication note: #2014 is the canonical SDK integration PR and owns ongoing review/maintenance. This draft is temporarily frozen as the final-runtime-head codegen reference. Its generated |
|
Canonical SDK lane. Please preserve this PR’s final-head generated event schema and |
Transfer the stronger wire, error, capability, typed-event, and queue-semantics coverage from superseded PR github#2014 while preserving the final-runtime-head generated schema and conventional high-level API. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 52417727-d5b4-482e-8391-0011d0984a5d
|
Initial canonical parity transfer is complete at Evidence:
The runtime gate is still closed: github/copilot-agent-runtime#12968 remains open at required head Maintainer action requested after the publication gate opens: the author account has repository |
Summary
Canonical Rust SDK consumer lane for github/copilot-agent-runtime#12968 and github/github-app#8664:
InterruptMainTurnOptions { flush_queued: bool }with builder APIsession.interruptMainTurnRPC andInterruptMainTurnRequest/InterruptMainTurnResultSessionCapabilities::interrupt_main_turn: Option<bool>on create/resume snapshotsCapabilitiesChangedData::interrupt_main_turn: Option<bool>event payloadcapabilities.changedsnapshots replace the capability cache wholesale by final runtime contractSession::abort; unsupported or old runtimes surface JSON-RPC MethodNotFoundParity coverage
Transferred the valuable docs/tests from superseded #2014 while preserving this PR's final-head generated files:
flushQueuedomission throughsession.rpc().interrupt_main_turn(InterruptMainTurnRequest::default())flushQueued: false; builder serializestrueinterrupted: trueandfalse-32601propagation with proof that nosession.abortfollowstrue, resume/unsupportedfalse, old omissionNoneevent.typed_data::<CapabilitiesChangedData>()Runtime dependency
Generated from the schemas at final runtime head
9391d2e781b23fc1ebcbd5b4605f848afa40b7d0in github/copilot-agent-runtime#12968. CLI 1.0.71 and current published@github/copilotpins do not contain this protocol. Keep this PR draft until the first published CLI package containing that exact runtime head exists; then update package/version/hash pins through repository conventions and run canonical full codegen. The generated-files freshness check is expected to remain red until that publication gate opens.Validation
cargo +nightly-2026-04-14 fmt --checkcargo clippy --all-features --all-targets -- -D warningscargo test --all-features --test session_test(119 passed)GITHUB_ACTIONS=true cargo test --all-featuresRUSTDOCFLAGS='-D warnings' cargo doc --no-deps --all-features