Skip to content

Add provider and request headers across SDKs#1094

Merged
stephentoub merged 1 commit intomainfrom
stephentoub/add-runtime-option-types
Apr 16, 2026
Merged

Add provider and request headers across SDKs#1094
stephentoub merged 1 commit intomainfrom
stephentoub/add-runtime-option-types

Conversation

@stephentoub
Copy link
Copy Markdown
Collaborator

@stephentoub stephentoub commented Apr 16, 2026

Expose the provider and request headers now available in the runtime.

Expose provider headers and per-message requestHeaders across Node, Python, Go, and .NET, and add focused tests covering create, resume, and send request forwarding.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@stephentoub stephentoub requested a review from a team as a code owner April 16, 2026 19:16
Copilot AI review requested due to automatic review settings April 16, 2026 19:16
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 aligns the four SDKs (Node, Python, Go, .NET) on a minimal header-related surface area by exposing provider-level headers and per-message requestHeaders/request_headers, and ensuring these values are forwarded on the corresponding JSON-RPC calls (session.create, session.resume, session.send) with focused tests verifying the serialized request shapes.

Changes:

  • Add provider headers to the public provider configuration surface and forward it through create/resume flows.
  • Add per-turn requestHeaders/request_headers to message/send options and forward it on session.send.
  • Add targeted serialization/request-shape tests in each SDK to validate the wire payloads.
Show a summary per file
File Description
python/test_client.py Adds pytest coverage asserting provider headers and per-turn request headers are forwarded in create/resume/send RPC payloads.
python/copilot/session.py Adds request_headers to send/send_and_wait and forwards it as requestHeaders in the RPC params.
python/copilot/client.py Extends provider snake_case→wire conversion to include headers.
nodejs/test/client.test.ts Adds vitest coverage asserting provider headers and requestHeaders are present in create/resume/send requests.
nodejs/src/types.ts Extends public TS types to include ProviderConfig.headers and MessageOptions.requestHeaders.
nodejs/src/session.ts Forwards requestHeaders on the session.send request payload.
go/types_test.go Adds JSON marshal/unmarshal tests ensuring headers and requestHeaders serialize under correct JSON property names.
go/types.go Adds ProviderConfig.Headers and MessageOptions.RequestHeaders, and includes requestHeaders in the send request struct.
go/session.go Wires MessageOptions.RequestHeaders into the session.send request.
dotnet/test/SerializationTests.cs Adds serialization tests for ProviderConfig.Headers, MessageOptions.RequestHeaders, and the internal send request payload.
dotnet/src/Types.cs Adds ProviderConfig.Headers and MessageOptions.RequestHeaders (with clone support for the dictionary).
dotnet/src/Session.cs Forwards RequestHeaders into the internal SendMessageRequest and includes it in the record schema.

Copilot's findings

  • Files reviewed: 12/12 changed files
  • Comments generated: 0

@stephentoub stephentoub merged commit c04c8c0 into main Apr 16, 2026
38 of 39 checks passed
@stephentoub stephentoub deleted the stephentoub/add-runtime-option-types branch April 16, 2026 19:31
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.

2 participants