Skip to content

Commit 487299a

Browse files
committed
Merge remote-tracking branch 'origin/main' into inline-data-attachments
# Conflicts: # python/README.md
2 parents 85185fd + 485ea5e commit 487299a

68 files changed

Lines changed: 558 additions & 955 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"name": "Python 3",
55
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "mcr.microsoft.com/devcontainers/python:2-3.14-trixie",
6+
"image": "mcr.microsoft.com/devcontainers/python:3-3.14-trixie",
77
"features": {
88
"ghcr.io/devcontainers/features/copilot-cli:1": {},
99
"ghcr.io/devcontainers/features/github-cli:1": {},

CONTRIBUTING.md

Lines changed: 33 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,71 @@
1-
## Contributing
1+
# Contributing
22

3-
[fork]: https://github.com/github/copilot-sdk/fork
4-
[pr]: https://github.com/github/copilot-sdk/compare
3+
Thanks for your interest in contributing!
54

6-
Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great.
5+
This repository contains the Copilot SDK, a set of multi-language SDKs (Node/TypeScript, Python, Go, .NET) for building applications with the GitHub Copilot agent, maintained by the GitHub Copilot team.
76

87
Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [project's open source license](LICENSE).
98

109
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
1110

12-
## What kinds of contributions we're looking for
11+
## Before You Submit a PR
1312

14-
We'd love your help with:
13+
**Please discuss any feature work with us before writing code.**
1514

16-
* Fixing any bugs in the existing feature set
17-
* Making the SDKs more idiomatic and nice to use for each supported language
18-
* Improving documentation
15+
The team already has a committed product roadmap, and features must be maintained in sync across all supported languages. Pull requests that introduce features not previously aligned with the team are unlikely to be accepted, regardless of their quality or scope.
1916

20-
If you have ideas for entirely new features, please post an issue or start a discussion. We're very open to new features but need to make sure they align with the direction of the underlying Copilot CLI and can be maintained in sync across all our supported languages.
17+
If you submit a PR, **be sure to link to an associated issue describing the bug or agreed feature**. No PRs without context :)
2118

22-
Currently **we are not looking to add SDKs for other languages**. If you want to create a Copilot SDK for another language, we'd love to hear from you, and we may offer to link to your SDK from our repo. However we do not plan to add further language-specific SDKs to this repo in the short term, since we need to retain our maintenance capacity for moving forwards quickly with the existing language set. So, for any other languages, please consider running your own external project.
19+
## What We're Looking For
2320

24-
## Prerequisites for running and testing code
21+
We welcome:
22+
23+
- Bug fixes with clear reproduction steps
24+
- Improvements to documentation
25+
- Making the SDKs more idiomatic and nice to use for each supported language
26+
- Bug reports and feature suggestions on [our issue tracker](https://github.com/github/copilot-sdk/issues) — especially for bugs with repro steps
27+
28+
We are generally **not** looking for:
29+
30+
- New features, capabilities, or UX changes that haven't been discussed and agreed with the team
31+
- Refactors or architectural changes
32+
- Integrations with external tools or services
33+
- Additional documentation
34+
- **SDKs for other languages** — if you want to create a Copilot SDK for another language, we'd love to hear from you and may offer to link to your SDK from our repo. However we do not plan to add further language-specific SDKs to this repo in the short term, since we need to retain our maintenance capacity for moving forwards quickly with the existing language set. For other languages, please consider running your own external project.
35+
36+
## Prerequisites for Running and Testing Code
2537

2638
This is a multi-language SDK repository. Install the tools for the SDK(s) you plan to work on:
2739

2840
### All SDKs
29-
1. (Optional) Install [just](https://github.com/casey/just) command runner for convenience
41+
42+
1. The end-to-end tests across all languages use a shared test harness written in Node.js. Before running tests in any language, `cd test/harness && npm ci`.
3043

3144
### Node.js/TypeScript SDK
45+
3246
1. Install [Node.js](https://nodejs.org/) (v18+)
3347
1. Install dependencies: `cd nodejs && npm ci`
3448

3549
### Python SDK
50+
3651
1. Install [Python 3.8+](https://www.python.org/downloads/)
3752
1. Install [uv](https://github.com/astral-sh/uv)
3853
1. Install dependencies: `cd python && uv pip install -e ".[dev]"`
3954

4055
### Go SDK
56+
4157
1. Install [Go 1.24+](https://go.dev/doc/install)
4258
1. Install [golangci-lint](https://golangci-lint.run/welcome/install/#local-installation)
4359
1. Install dependencies: `cd go && go mod download`
4460

4561
### .NET SDK
62+
4663
1. Install [.NET 8.0+](https://dotnet.microsoft.com/download)
47-
1. Install [Node.js](https://nodejs.org/) (v18+) (the .NET tests depend on a TypeScript-based test harness)
48-
1. Install npm dependencies (from the repository root):
49-
```bash
50-
cd nodejs && npm ci
51-
cd test/harness && npm ci
52-
```
5364
1. Install .NET dependencies: `cd dotnet && dotnet restore`
5465

55-
## Submitting a pull request
66+
## Submitting a Pull Request
5667

57-
1. [Fork][fork] and clone the repository
68+
1. Fork and clone the repository
5869
1. Install dependencies for the SDK(s) you're modifying (see above)
5970
1. Make sure the tests pass on your machine (see commands below)
6071
1. Make sure linter passes on your machine (see commands below)
@@ -63,29 +74,7 @@ This is a multi-language SDK repository. Install the tools for the SDK(s) you pl
6374
1. Push to your fork and [submit a pull request][pr]
6475
1. Pat yourself on the back and wait for your pull request to be reviewed and merged.
6576

66-
### Running tests and linters
67-
68-
If you installed `just`, you can use it to run tests and linters across all SDKs or for specific languages:
69-
70-
```bash
71-
# All SDKs
72-
just test # Run all tests
73-
just lint # Run all linters
74-
just format # Format all code
75-
76-
# Individual SDKs
77-
just test-nodejs # Node.js tests
78-
just test-python # Python tests
79-
just test-go # Go tests
80-
just test-dotnet # .NET tests
81-
82-
just lint-nodejs # Node.js linting
83-
just lint-python # Python linting
84-
just lint-go # Go linting
85-
just lint-dotnet # .NET linting
86-
```
87-
88-
Or run commands directly in each SDK directory:
77+
### Running Tests and Linters
8978

9079
```bash
9180
# Node.js

docs/features/image-input.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ session = await client.create_session({
7979
"on_permission_request": lambda req, inv: PermissionRequestResult(kind="approved"),
8080
})
8181

82-
await session.send({
83-
"prompt": "Describe what you see in this image",
84-
"attachments": [
82+
await session.send(
83+
"Describe what you see in this image",
84+
attachments=[
8585
{
8686
"type": "file",
8787
"path": "/absolute/path/to/screenshot.png",
8888
},
8989
],
90-
})
90+
)
9191
```
9292

9393
</details>
@@ -269,17 +269,17 @@ session = await client.create_session({
269269
})
270270

271271
base64_image_data = "..." # your base64-encoded image
272-
await session.send({
273-
"prompt": "Describe what you see in this image",
274-
"attachments": [
272+
await session.send(
273+
"Describe what you see in this image",
274+
attachments=[
275275
{
276276
"type": "blob",
277277
"data": base64_image_data,
278278
"mimeType": "image/png",
279279
"displayName": "screenshot.png",
280280
},
281281
],
282-
})
282+
)
283283
```
284284

285285
</details>

docs/getting-started.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,18 @@ Create `main.py`:
129129

130130
```python
131131
import asyncio
132-
from copilot import CopilotClient
132+
from copilot import CopilotClient, PermissionHandler
133133

134134
async def main():
135135
client = CopilotClient()
136136
await client.start()
137137

138-
session = await client.create_session({"model": "gpt-4.1"})
139-
response = await session.send_and_wait({"prompt": "What is 2 + 2?"})
138+
session = await client.create_session({
139+
"model": "gpt-4.1",
140+
"on_permission_request": PermissionHandler.approve_all,
141+
})
140142

143+
response = await session.send_and_wait({"prompt": "What is 2 + 2?"})
141144
print(response.data.content)
142145

143146
await client.stop()
@@ -274,7 +277,7 @@ Update `main.py`:
274277
```python
275278
import asyncio
276279
import sys
277-
from copilot import CopilotClient
280+
from copilot import CopilotClient, PermissionHandler
278281
from copilot.generated.session_events import SessionEventType
279282

280283
async def main():
@@ -283,6 +286,7 @@ async def main():
283286

284287
session = await client.create_session({
285288
"model": "gpt-4.1",
289+
"on_permission_request": PermissionHandler.approve_all,
286290
"streaming": True,
287291
})
288292

@@ -653,7 +657,7 @@ Update `main.py`:
653657
import asyncio
654658
import random
655659
import sys
656-
from copilot import CopilotClient
660+
from copilot import CopilotClient, PermissionHandler
657661
from copilot.tools import define_tool
658662
from copilot.generated.session_events import SessionEventType
659663
from pydantic import BaseModel, Field
@@ -678,6 +682,7 @@ async def main():
678682

679683
session = await client.create_session({
680684
"model": "gpt-4.1",
685+
"on_permission_request": PermissionHandler.approve_all,
681686
"streaming": True,
682687
"tools": [get_weather],
683688
})
@@ -925,7 +930,7 @@ Create `weather_assistant.py`:
925930
import asyncio
926931
import random
927932
import sys
928-
from copilot import CopilotClient
933+
from copilot import CopilotClient, PermissionHandler
929934
from copilot.tools import define_tool
930935
from copilot.generated.session_events import SessionEventType
931936
from pydantic import BaseModel, Field
@@ -947,6 +952,7 @@ async def main():
947952

948953
session = await client.create_session({
949954
"model": "gpt-4.1",
955+
"on_permission_request": PermissionHandler.approve_all,
950956
"streaming": True,
951957
"tools": [get_weather],
952958
})
@@ -1504,7 +1510,7 @@ Trace context is propagated automatically — no manual instrumentation is neede
15041510
- **SDK → CLI**: `traceparent` and `tracestate` headers from the current span/activity are included in `session.create`, `session.resume`, and `session.send` RPC calls.
15051511
- **CLI → SDK**: When the CLI invokes tool handlers, the trace context from the CLI's span is propagated so your tool code runs under the correct parent span.
15061512

1507-
📖 **[OpenTelemetry Instrumentation Guide →](./observability/opentelemetry.md)**detailed GenAI semantic conventions, event-to-attribute mapping, and complete examples.
1513+
📖 **[OpenTelemetry Instrumentation Guide →](./observability/opentelemetry.md)**TelemetryConfig options, trace context propagation, and per-language dependencies.
15081514

15091515
---
15101516

@@ -1519,7 +1525,7 @@ Trace context is propagated automatically — no manual instrumentation is neede
15191525
- [Using MCP Servers](./features/mcp.md) - Integrate external tools via Model Context Protocol
15201526
- [GitHub MCP Server Documentation](https://github.com/github/github-mcp-server)
15211527
- [MCP Servers Directory](https://github.com/modelcontextprotocol/servers) - Explore more MCP servers
1522-
- [OpenTelemetry Instrumentation](./observability/opentelemetry.md) - Add tracing to your SDK usage
1528+
- [OpenTelemetry Instrumentation](./observability/opentelemetry.md) - TelemetryConfig, trace context propagation, and per-language dependencies
15231529

15241530
---
15251531

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Detailed API reference for each session hook.
6767

6868
### [Observability](./observability/opentelemetry.md)
6969

70-
- [OpenTelemetry Instrumentation](./observability/opentelemetry.md) — built-in TelemetryConfig, trace context propagation, and application-level tracing
70+
- [OpenTelemetry Instrumentation](./observability/opentelemetry.md) — built-in TelemetryConfig and trace context propagation
7171

7272
### [Integrations](./integrations/microsoft-agent-framework.md)
7373

0 commit comments

Comments
 (0)