Skip to content

Add remote_session field to all SDK SessionConfig types#1295

Merged
stephentoub merged 1 commit into
mainfrom
devm33/add-remote-session-to-config
May 14, 2026
Merged

Add remote_session field to all SDK SessionConfig types#1295
stephentoub merged 1 commit into
mainfrom
devm33/add-remote-session-to-config

Conversation

@devm33
Copy link
Copy Markdown
Member

@devm33 devm33 commented May 14, 2026

Overview

What

Adds a remoteSession / remote_session / RemoteSession field to both SessionConfig and ResumeSessionConfig across all SDK languages (Rust, Go, Node.js, Python, .NET), giving SDK clients explicit per-session control over remote behavior.

Why

The runtime added support for a remoteSession parameter on session.create and session.resume in copilot-agent-runtime#7673, but the SDK hand-written types were never updated to expose it. The RemoteSessionMode type already exists in each SDK's generated types, so this wires it into the session config structs and create/resume payloads.

Changes

  • Rust (rust/src/types.rs) — Added remote_session: Option<RemoteSessionMode> field, Debug output, Default value, and with_remote_session() builder method to both SessionConfig and ResumeSessionConfig.
  • Go (go/types.go, go/client.go) — Added RemoteSession field to SessionConfig, ResumeSessionConfig, and wire request structs; wired into create/resume payloads.
  • Node.js (nodejs/src/types.ts, nodejs/src/client.ts, nodejs/src/index.ts) — Added remoteSession?: RemoteSessionMode to SessionConfig interface (picked into ResumeSessionConfig); wired into both payloads; exported the type.
  • Python (python/copilot/client.py) — Added remote_session: RemoteSessionMode | None parameter to create_session and resume_session; wired into payloads using .value for wire serialization.
  • .NET (dotnet/src/Types.cs, dotnet/src/Client.cs) — Added RemoteSession property to both config classes and clone constructors; added to wire records; wired into create/resume calls.

Usage

// Rust
let config = SessionConfig::new(session_id)
    .with_remote_session(RemoteSessionMode::Export);
// Go
config := copilot.SessionConfig{
    RemoteSession: rpc.RemoteSessionModeExport,
}
// Node.js
const session = await client.createSession({
    remoteSession: "export",
});
# Python
from copilot.generated.rpc import RemoteSessionMode
session = await client.create_session(
    remote_session=RemoteSessionMode.EXPORT,
)
// .NET
var config = new SessionConfig { RemoteSession = RemoteSessionMode.Export };

Downstream

This unblocks github/github-app#4914 which needs to set remoteSession: "export" for all sessions.

Copilot AI review requested due to automatic review settings May 14, 2026 19:08
@devm33 devm33 requested a review from a team as a code owner May 14, 2026 19:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Rust SDK’s hand-authored session configuration types to expose the runtime’s new remoteSession control for session.create and session.resume, using the already-generated RemoteSessionMode enum.

Changes:

  • Added remote_session: Option<RemoteSessionMode> to SessionConfig and ResumeSessionConfig (serde camelCase on-wire via existing rename_all = "camelCase").
  • Updated Debug and initialization defaults to include the new field.
  • Added with_remote_session() builder methods for both config types.
Show a summary per file
File Description
rust/src/types.rs Wires RemoteSessionMode into SessionConfig / ResumeSessionConfig via a new optional remote_session field plus builders/defaults/debug output.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 2

Comment thread rust/src/types.rs
Comment thread rust/src/types.rs
@devm33 devm33 force-pushed the devm33/add-remote-session-to-config branch 2 times, most recently from cba339a to f52379a Compare May 14, 2026 19:51
@github-actions

This comment has been minimized.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Generated by SDK Consistency Review Agent for issue #1295 · ● 1.8M

Comment thread rust/src/types.rs
@devm33 devm33 force-pushed the devm33/add-remote-session-to-config branch 2 times, most recently from 10f2dc7 to 94cf020 Compare May 14, 2026 20:12
@github-actions

This comment has been minimized.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Generated by SDK Consistency Review Agent for issue #1295 · ● 577.5K

Comment thread python/copilot/client.py Outdated
Comment thread python/copilot/client.py Outdated
@devm33 devm33 changed the title Add remote_session field to SessionConfig and ResumeSessionConfig Add remote_session field to all SDK SessionConfig types May 14, 2026
@devm33 devm33 force-pushed the devm33/add-remote-session-to-config branch from 94cf020 to 0d58c34 Compare May 14, 2026 20:31
@github-actions

This comment has been minimized.

@devm33 devm33 force-pushed the devm33/add-remote-session-to-config branch from 0d58c34 to 70db81d Compare May 14, 2026 20:38
@github-actions

This comment has been minimized.

Comment thread dotnet/src/Types.cs Outdated
Comment thread python/copilot/client.py
@devm33 devm33 force-pushed the devm33/add-remote-session-to-config branch from 70db81d to eb3dc6d Compare May 14, 2026 21:02
@github-actions

This comment has been minimized.

Add per-session remote behavior control (Off/Export/On) to
SessionConfig and ResumeSessionConfig across all SDK languages
(Rust, Go, Node.js, Python, .NET). Each SDK wires the field into
the JSON-RPC create/resume payloads using the existing generated
RemoteSessionMode type.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@devm33 devm33 force-pushed the devm33/add-remote-session-to-config branch from eb3dc6d to 9ecade7 Compare May 14, 2026 21:25
@github-actions
Copy link
Copy Markdown
Contributor

Cross-SDK Consistency Review ✅

This PR maintains excellent cross-SDK consistency. The remoteSession / remote_session / RemoteSession field is added to all five SDK implementations with parallel changes:

SDK SessionConfig ResumeSessionConfig Wire key Optionality
Rust remote_session: Option<RemoteSessionMode> "remoteSession" Option<T> + skip_serializing_if
Go RemoteSession rpc.RemoteSessionMode "remoteSession" zero value + omitempty
Node.js remoteSession?: RemoteSessionMode ✅ (via Pick) "remoteSession" optional property
Python remote_session: RemoteSessionMode | None = None "remoteSession" None guard
.NET RemoteSessionMode? RemoteSession "remoteSession" nullable

Notable design points

  • Language-idiomatic optionality: Go uses the zero-value + omitempty pattern on the wire struct (consistent with GitHubToken string elsewhere in SessionConfig), while other languages use explicit nullable/optional types. Both approaches correctly omit the field when not set.
  • Rust builder methods: with_remote_session() is added to both config types — this is Rust-specific and consistent with the existing builder pattern in that SDK.
  • Type export: RemoteSessionMode is properly re-exported from Node.js (index.ts) and Python (__init__.py) public APIs.
  • Tests: Rust adds serialization/deserialization tests for the new field in both config types.

No consistency gaps found.

Generated by SDK Consistency Review Agent for issue #1295 · ● 425.5K ·

@stephentoub stephentoub added this pull request to the merge queue May 14, 2026
Merged via the queue into main with commit 0159731 May 14, 2026
43 checks passed
@stephentoub stephentoub deleted the devm33/add-remote-session-to-config branch May 14, 2026 21:40
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.

4 participants