Future-proof SDK policy wire types - #2385
Conversation
Use SDK-owned open strings for managed bypass policy values, preserve Java's generated-enum setter compatibility, initialize Rust connect requests from defaults, and activate the Go invalid-model fixture. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Cross-SDK Consistency ReviewThis PR makes SDKs not yet updated
Suggested alignmentTo match the Go/Java approach in the other SDKs:
These aren't blocking concerns for this PR if the
|
There was a problem hiding this comment.
Pull request overview
Future-proofs handwritten SDK code against upcoming policy and generated-type changes.
Changes:
- Opens Go and Java bypass-policy wire values to future strings.
- Builds Rust handshake requests from generated defaults.
- Configures the existing Go invalid-model E2E fixture.
Show a summary per file
| File | Description |
|---|---|
go/types.go |
Defines open policy values and constants. |
go/client_test.go |
Tests future policy serialization. |
go/internal/e2e/rpc_tasks_and_handlers_e2e_test.go |
Configures the invalid-model snapshot. |
java/sdk/src/main/java/com/github/copilot/rpc/ManagedSettingsPermissions.java |
Stores bypass policy as a string. |
java/sdk/src/main/java/com/github/copilot/rpc/DisableBypassPermissionsModes.java |
Adds known string constants. |
java/sdk/src/test/java/com/github/copilot/ManagedSettingsTest.java |
Tests known and future policy values. |
rust/src/lib.rs |
Default-initializes generated connect requests. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 7/7 changed files
- Comments generated: 3
- Review effort level: Balanced
|
|
||
| /** @return the bypass-permissions policy, or {@code null} when unset */ | ||
| public DisableBypassPermissionsMode getDisableBypassPermissionsMode() { | ||
| public String getDisableBypassPermissionsMode() { |
| * bypass-permissions policy | ||
| * @return this policy | ||
| */ | ||
| public ManagedSettingsPermissions setDisableBypassPermissionsMode(String value) { |
| // | ||
| // The runtime may introduce additional fail-closed modes. Values are serialized | ||
| // as strings so callers can use newer modes without waiting for an SDK release. | ||
| type DisableBypassPermissionsMode string |
Summary
Extracts the runtime-independent, SDK-owned prerequisite fixes from #2375:
ConnectRequestfromDefaultso newly generated optional fields do not require handwritten updates@github/copilotremains unchanged. This PR does not update the runtime, generated sources, snapshots, version manifests, or Rust launcher behavior.Validation
cd go && go test . -run '^TestSessionRequests_ManagedSettings$'cd go && go test ./internal/e2e -run 'TestRPCTasksAndHandlersE2E/should report implemented error for invalid task agent model' -count=1cd java && mvn spotless:checkcd java && mvn -pl sdk test -Dtest=ManagedSettingsTestcd rust && cargo +nightly-2026-04-14 fmt --checkcd rust && cargo clippy --all-features --all-targets -- -D warningscd rust && cargo test --all-features