Add provider and request headers across SDKs#1094
Merged
stephentoub merged 1 commit intomainfrom Apr 16, 2026
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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
headersto the public provider configuration surface and forward it through create/resume flows. - Add per-turn
requestHeaders/request_headersto message/send options and forward it onsession.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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expose the provider and request headers now available in the runtime.