Skip to content

Forward selfFetchManagedSettings in session.create (all SDKs)#1925

Open
devm33 wants to merge 1 commit into
mainfrom
agents/managed-settings-forward-flag-all-langs
Open

Forward selfFetchManagedSettings in session.create (all SDKs)#1925
devm33 wants to merge 1 commit into
mainfrom
agents/managed-settings-forward-flag-all-langs

Conversation

@devm33

@devm33 devm33 commented Jul 6, 2026

Copy link
Copy Markdown
Member

Extends #1846 to all language SDKs.

Forward selfFetchManagedSettings in session.create

Threads an optional selfFetchManagedSettings flag from the SDK session config through the session.create / resumeSession wire calls, so consumers can opt the runtime into self-fetching enterprise managed settings (bypass-permissions policy) at session bootstrap using the session's gitHubToken.

Per language:

  • nodejsselfFetchManagedSettings?: boolean on SessionConfigBase; forwarded in create/resume payloads. (mirrors Forward selfFetchManagedSettings in session.create #1846)
  • pythonself_fetch_managed_settings kwarg on create_session/resume_session, sent on the wire as selfFetchManagedSettings.
  • goSelfFetchManagedSettings *bool on SessionConfig/ResumeSessionConfig and the create/resume wire structs; forwarded in client.go.
  • dotnetSelfFetchManagedSettings on SessionConfigBase (incl. clone) and both wire records.
  • rustself_fetch_managed_settings: Option<bool> with with_self_fetch_managed_settings builders on both configs and the wire structs.
  • javaselfFetchManagedSettings on SessionConfig/ResumeSessionConfig (getter/setter + clone), the request classes, and SessionRequestBuilder.

Purely additive and opt-in; unset behaves exactly as before. Requires the session gitHubToken; the runtime is expected to reject session creation when omitted (fail-closed). Runtime enforcement lives in the runtime PR.

Verification

  • Go: go build, go vet, test compile ✓
  • Python: syntax parse ✓
  • .NET: SDK build + CloneTests/SerializationTests (76 passed) ✓
  • Rust: cargo build + session_config lib tests (26 passed) ✓
  • Java: compile + ConfigCloneTest/SessionRequestBuilderTest (116 passed), Spotless applied ✓
  • Node: tsc --noEmit

Related PRs

Threads an optional `selfFetchManagedSettings` flag from the SDK session
config through the `session.create` / `resumeSession` wire calls, so
consumers can opt the runtime into self-fetching enterprise managed
settings (bypass-permissions policy) at session bootstrap.

Extends the Node.js change from #1846 to every language SDK:

- nodejs: `selfFetchManagedSettings?: boolean` on `SessionConfigBase`,
  forwarded in create/resume payloads.
- python: `self_fetch_managed_settings` kwarg on create/resume, forwarded
  as `selfFetchManagedSettings`.
- go: `SelfFetchManagedSettings *bool` on `SessionConfig` /
  `ResumeSessionConfig` and wire structs.
- dotnet: `SelfFetchManagedSettings` on `SessionConfigBase` (+ clone) and
  wire records.
- rust: `self_fetch_managed_settings: Option<bool>` with builders and wire
  structs.
- java: `selfFetchManagedSettings` on config, request classes, and builder.

Purely additive and opt-in; unset behaves exactly as before. Requires the
session `gitHubToken`; the runtime is expected to reject session creation
when omitted (fail-closed). Runtime enforcement lives in the runtime PR.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 6, 2026 23:28
@devm33 devm33 requested a review from a team as a code owner July 6, 2026 23:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Threads an opt-in selfFetchManagedSettings flag through each language SDK’s session config and into the session.create / session.resume JSON-RPC payloads, enabling the runtime to self-fetch enterprise managed settings at session bootstrap using the session GitHub token.

Changes:

  • Added selfFetchManagedSettings (language-idiomatic naming/types) to session create + resume configuration surfaces across SDKs.
  • Forwarded the flag into the corresponding create/resume wire/request payloads so it’s emitted as selfFetchManagedSettings when set.
  • Updated supporting builders/clone paths/debug output where applicable to preserve config behavior and observability.
Show a summary per file
File Description
rust/src/wire.rs Adds self_fetch_managed_settings to create/resume wire structs (camelCase on the wire via serde).
rust/src/types.rs Adds config fields + builder methods and forwards into wire conversion + defaults/debug.
python/copilot/client.py Adds self_fetch_managed_settings kwargs to create/resume and forwards into payload as selfFetchManagedSettings.
nodejs/src/types.ts Adds selfFetchManagedSettings?: boolean to SessionConfigBase.
nodejs/src/client.ts Forwards selfFetchManagedSettings in session.create and session.resume request payloads.
java/src/main/java/com/github/copilot/SessionRequestBuilder.java Forwards optional flag from config into create/resume request objects.
java/src/main/java/com/github/copilot/rpc/SessionConfig.java Adds optional flag to session config, accessor, setter, and clone copy.
java/src/main/java/com/github/copilot/rpc/CreateSessionRequest.java Adds nullable selfFetchManagedSettings JSON property with getter/setter/clear.
java/src/main/java/com/github/copilot/rpc/ResumeSessionRequest.java Adds nullable selfFetchManagedSettings JSON property with getter/setter/clear.
java/src/main/java/com/github/copilot/rpc/ResumeSessionConfig.java Adds optional flag to resume config, accessor, setter, and clone copy.
go/types.go Adds SelfFetchManagedSettings *bool to session + resume configs and to create/resume request structs.
go/client.go Forwards SelfFetchManagedSettings from configs into create/resume requests.
dotnet/src/Types.cs Adds SelfFetchManagedSettings to SessionConfigBase and includes it in cloning.
dotnet/src/Client.cs Forwards SelfFetchManagedSettings into create/resume request records (JSON name selfFetchManagedSettings).

Review details

  • Files reviewed: 14/14 changed files
  • Comments generated: 0
  • Review effort level: Low

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Cross-SDK Consistency Review ✅

All six SDK implementations are covered and consistent. Here's a summary of what was verified:

Coverage (all SDKs ✅)

SDK Config field Wire field Both create & resume
Node.js/TS selfFetchManagedSettings?: boolean on SessionConfigBase selfFetchManagedSettings
Python self_fetch_managed_settings: bool | None param selfFetchManagedSettings
Go SelfFetchManagedSettings *bool on both config structs json:"selfFetchManagedSettings,omitempty"
.NET bool? SelfFetchManagedSettings on SessionConfigBase (incl. clone) [JsonPropertyName("selfFetchManagedSettings")]
Java Optional<Boolean> getSelfFetchManagedSettings() + fluent setter (incl. clone) @JsonProperty("selfFetchManagedSettings")
Rust self_fetch_managed_settings: Option<bool> + with_self_fetch_managed_settings builder rename_all = "camelCase"selfFetchManagedSettings

API Design Consistency

  • Naming: All follow language conventions (camelCase for TS/Java, snake_case for Python/Rust, PascalCase for Go/.NET)
  • Wire key: Uniformly selfFetchManagedSettings across all six SDKs
  • Optional/nullable: Each language uses its idiomatic nullable type; absent means "not set, default behavior"
  • Resume path: All SDKs correctly forward the flag on resumeSession / ResumeSession as well, with appropriate docs noting the flag should be re-supplied after CLI restart

No cross-SDK inconsistencies found. This PR successfully extends the feature from Node.js (#1846) to all five remaining SDKs.

Generated by SDK Consistency Review Agent for issue #1925 · sonnet46 1.3M ·

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants