Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,18 @@ include = [
name = "github_copilot_sdk"

[features]
default = ["bundled-cli"]
default = ["bundled-cli", "rustls"]
runtime = []
# TLS backend for the `CopilotRequestHandler` HTTP/WebSocket forwarding
# transport. Exactly one is normally enabled. `rustls` (default) uses
# reqwest's rustls stack (aws-lc-rs provider, matching the Copilot runtime)
# with no system OpenSSL; `native-tls` opts into the platform-native stack
# (OpenSSL on Linux). These are deliberately opt-in features rather than
# hard-coded dependency features: Cargo unifies features, so a hard-coded
# `reqwest/native-tls` flips `reqwest`'s default TLS backend to native-tls for
# every reqwest client in the consumer's whole dependency graph.
rustls = ["reqwest/rustls", "tokio-tungstenite/rustls-tls-native-roots"]
native-tls = ["reqwest/native-tls", "tokio-tungstenite/native-tls"]
bundled-cli = ["runtime", "dep:tar", "dep:flate2", "dep:zip"]
in-process = ["runtime", "dep:libloading"]
local-runtime = ["in-process"]
Expand Down Expand Up @@ -68,8 +78,8 @@ base64 = "0.23"
bytes = "1"
http = "1"
futures-util = "0.3"
reqwest = { version = "0.13", default-features = false, features = ["stream", "http2", "native-tls"] }
tokio-tungstenite = { version = "0.28.0", default-features = false, features = ["connect", "native-tls"] }
reqwest = { version = "0.13", default-features = false, features = ["stream", "http2"] }
tokio-tungstenite = { version = "0.28.0", default-features = false, features = ["connect"] }

[target.'cfg(windows)'.dependencies]
zip = { version = "7.2.0", default-features = false, features = ["deflate"], optional = true }
Expand Down
2 changes: 2 additions & 0 deletions rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1595,6 +1595,8 @@ and `CARGO_CFG_TARGET_ENV` (cross-compilation works).
| `in-process` | — | Enables `Transport::InProcess` while preserving the selected runtime acquisition policy. |
| `local-runtime` | — | Enables `in-process` and, when `bundled-cli` is disabled, disables SDK-managed runtime download, extraction, and embedding. The application must supply a compatible runtime package through `COPILOT_CLI_PATH`. |
| `bundled-in-process` | — | Enables `in-process`, implies `bundled-cli`, and additionally embeds the platform-native runtime library. |
| `rustls` | ✓ | TLS for the `CopilotRequestHandler` HTTP/WebSocket forwarding transport via rustls (aws-lc-rs provider, OS trust store). No system OpenSSL required, so musl/static targets build. |
| `native-tls` | — | Platform-native TLS (OpenSSL on Linux, Secure Transport on macOS, SChannel on Windows) for the request-handler transport instead of rustls. With `default-features = false`, enable one of `rustls` / `native-tls` if you register a `request_handler` that forwards to HTTPS/WSS upstreams. |
| `derive` | — | `schema_for::<T>()` for generating JSON Schema from Rust types (adds `schemars`). |

```toml
Expand Down