Conversation
Expose the runtime's cached-model validation input without adding model discovery or refresh behavior to the SDK. Preserve absent, empty, and explicit false values, and keep the field exclusive to session.create. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused changes are tested and have no unresolved blocking issues.
Review tier: Lite (auto)
Findings: None
Note
Copilot is running an experiment and ran this review at Lite.
What changed in this PR
Adds Rust SDK support for forwarding cached model metadata during session.create.
Changes:
- Adds
CachedModelandSessionConfig.cached_models. - Preserves omission, empty-list, and camelCase serialization semantics.
- Adds focused wire-format tests while leaving
session.resumeunchanged.
| File | Description |
|---|---|
rust/src/wire.rs |
Adds cachedModels to session creation payloads. |
rust/src/types.rs |
Defines the cached-model API, builder, conversion, and tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Chuxel
marked this pull request as draft
September 15, 2026 01:30
Chuxel
marked this pull request as ready for review
September 15, 2026 20:06
Resolve adjacent Rust SessionConfig and SessionCreateWire additions by retaining both cached_models and allowed_models, including their defaults, debug fields, builders, and wire mappings. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The runtime already accepts a cached model catalog during
session.create, but the Rust SDK does not expose or forward it. This leaves hosts unable to avoid the duplicate model-catalog fetch through the supported SDK API.Related issue: https://github.com/github/copilot-agent-runtime/issues/17913
Runtime support (merged): https://github.com/github/copilot-agent-runtime/pull/18113
Changes
CachedModel { id: String, supports_reasoning_effort: bool }andSessionConfig.cached_models: Option<Vec<CachedModel>>, plus the normalwith_cached_modelsbuilder.idand requiredsupportsReasoningEffortin camelCasecachedModelsentries.Noneomits the field, an empty list is authoritative and stays[], andfalseis preserved.session.create;session.resumeis unchanged. The SDK performs no new fetch, validation, or refresh. The runtime retains ownership of the asynchronous post-create refresh, and the consumer retains account/catalog policy.Only
rust/src/types.rsandrust/src/wire.rschange. This PR targets latest upstreammain; no release-prep targeting requirement was found. No consumer vendoring, dependency pins, runtime edits, or feature flags are included. The App must receive this API through normal canonical sync after SDK merge.Validation
The new tests first failed to compile because the public API was missing. After implementation:
cargo +nightly-2026-04-14 fmt --all -- --config-path .rustfmt.nightly.toml --check.cargo clippy --all-features --all-targets -- -D warningspassed.cargo test --all-features --lib types::testspassed all 70 tests, including the four new contract tests.cargo test --all-features --no-runcompiled the Rust unit and integration test targets.Cargo validation used
COPILOT_SKIP_CLI_DOWNLOAD=1because these checks exercise SDK serialization and compilation, not runtime behavior. Runtime-backed E2E tests were not run.