Commit 02f2604
Add experimental GitHub telemetry redirection across all SDKs (#1835)
* codegen: add notification flag to RpcMethod metadata
Adds an optional
otification marker to the shared RpcMethod interface so
the per-language generators can emit notification-style dispatch (no JSON-RPC
reply) for void clientGlobal methods such as gitHubTelemetry.event.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* nodejs: add GitHub telemetry redirection support
Regenerates the TypeScript RPC types for the experimental gitHubTelemetry.event
clientGlobal notification and wires an onGitHubTelemetry callback on the client.
Registering a handler opts created/resumed sessions into telemetry redirection.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* dotnet: add GitHub telemetry redirection support
Regenerates the C# RPC types for the experimental gitHubTelemetry.event
clientGlobal notification and adds an OnGitHubTelemetry callback. Registering a
handler opts created/resumed sessions into telemetry redirection. The option is
marked [Experimental] and [EditorBrowsable(Never)] to keep it unadvertised.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* python: add GitHub telemetry redirection support
Regenerates the Python RPC types for the experimental gitHubTelemetry.event
clientGlobal notification and adds an on_github_telemetry callback. Registering a
handler opts created/resumed sessions into telemetry redirection.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* go: add GitHub telemetry redirection support
Regenerates the Go RPC types for the experimental gitHubTelemetry.event
clientGlobal notification and adds an OnGitHubTelemetry callback. Registering a
handler opts created/resumed sessions into telemetry redirection.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* rust: add GitHub telemetry redirection support
Regenerates the Rust RPC types for the experimental gitHubTelemetry.event
clientGlobal notification and adds an on_github_telemetry callback. Registering a
handler opts created/resumed sessions into telemetry redirection. The telemetry
module is #[doc(hidden)] to keep it unadvertised.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* java: add GitHub telemetry redirection support
Adds the experimental gitHubTelemetry.event notification adapter and an
onGitHubTelemetry client option. Registering a handler opts created/resumed
sessions into telemetry redirection.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix telemetry codegen after schema bump
Keep experimental GitHub telemetry schema additions available to codegen until they ship in the packaged Copilot schema, and apply formatter output required by CI.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Rename telemetry redirection to forwarding across SDKs
The runtime renamed the per-session opt-in capability from
"redirection" to "forwarding" (wire field enableGitHubTelemetryForwarding)
and updated the GitHubTelemetry schema description strings. This mirrors
that rename across every SDK plus the codegen schema overlay so the
hand-written opt-in flag matches the runtime contract.
Also folds in two PR review fixes:
- dotnet: document the expected-teardown catch in GitHubTelemetryTests
DisposeAsync (was an empty catch).
- python: re-export GitHubTelemetryNotification/Event/ClientInfo from
copilot/__init__.py for parity with the nodejs public surface.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* nodejs: align GitHub telemetry forwarding with cross-SDK contract
Address PR review feedback on the Node telemetry surface:
- Omit enableGitHubTelemetryForwarding from session.create/resume unless a
handler is registered, matching Go/Python/Rust/dotnet/Java (which all
omit the field when off) instead of always sending false.
- Isolate consumer callback failures: await the handler inside try/catch so
async callbacks or thrown errors cannot leak into the JSON-RPC dispatch
path (mirrors the panic isolation in the other SDKs).
- Widen onGitHubTelemetry to return void | Promise<void> so consumers can
supply async callbacks.
- Update the no-handler test to assert the field is absent rather than false.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* python: address telemetry review nits
- Use asyncio.create_task instead of the legacy asyncio.ensure_future when
scheduling awaitable notification handlers on the event loop thread.
- Drop the redundant local `import asyncio` in the telemetry transport test
(asyncio is already imported at module scope), clearing CodeQL
py/repeated-import.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* dotnet: observe expected exception in telemetry test teardown
The DisposeAsync teardown catch swallows expected listener/socket shutdown
exceptions. Observe the caught exception so the block is no longer empty,
clearing CodeQL cs/empty-catch-block.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* go: format telemetry forwarding fields
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* codegen: remove temporary GitHub telemetry schema overlay
The telemetry types ship natively in @github/copilot 1.0.67, so the
hand-maintained schema overlay that injected GitHubTelemetryNotification,
GitHubTelemetryEvent, GitHubTelemetryClientInfo, and the
gitHubTelemetry.event clientGlobal method is no longer needed. Remove the
api-additions overlay and its application plumbing in utils.ts, and revert
rust.ts to read the schema directly. The generic notification-flag codegen
handling is retained, since the published schema marks gitHubTelemetry.event
as a notification.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Reconcile Node/Python/Go telemetry glue with main's generated dispatch
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
* Repoint Java telemetry glue at generated types; finish Rust/.NET reconcile
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
* codegen: restore notification dispatch for gitHubTelemetry.event
The clientGlobal method gitHubTelemetry.event is a JSON-RPC notification (schema notification: true, void result). Restore the codegen notification-flag machinery so TypeScript/Python/Go emit notification registration (onNotification / notification-handler table / nil-result SetRequestHandler) instead of request-style onRequest dispatch, and regenerate the affected bindings. Also restore the Python _jsonrpc notification registry and fix the Go adapter to return only an error.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* test: guard gitHubTelemetry.event notification-style dispatch
Send an id-less JSON-RPC notification (not a request) through the real wire in the Node and Python unit tests so a regression back to onRequest dispatch is caught. Add a Node E2E that creates a forwarding-enabled session against a live CLI and asserts a gitHubTelemetry.event notification is delivered to the onGitHubTelemetry handler.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* test: clarify telemetry forwarding comment in e2e
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* test: use shared waitForCondition helper in telemetry e2e
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* test: add live gitHubTelemetry forwarding E2E for all languages
Adds a live-CLI E2E in Go, Python, .NET, Rust, and Java that registers an
onGitHubTelemetry callback, creates a session, and asserts at least one
gitHubTelemetry.event notification is forwarded with a well-typed payload.
This brings the other SDKs to parity with the existing nodejs E2E.
Session creation emits an early session.start hydro event, so no model
round-trip (and no recorded CAPI exchange) is needed; the tests are
snapshot-free.
The Rust change also refactors the E2E harness to run a native
COPILOT_CLI_PATH binary directly (non-.js), leaving the node_modules
index.js path unchanged for CI.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* fix: guard gitHubTelemetry callbacks in Python and .NET adapters
Wrap the user-provided on_github_telemetry / OnGitHubTelemetry callback
invocation in exception handling so a throwing handler cannot propagate
into the JSON-RPC dispatch machinery. Mirrors the existing guards in the
Node, Go, Java, and Rust adapters. Errors are logged (Python module
logger; .NET ILogger, falling back to NullLogger.Instance) rather than
silently swallowed, matching the Java (SEVERE) and Rust (warn) behavior.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* test: normalize telemetry E2E line endings
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* fix(java): log gitHubTelemetry callback errors at WARNING not SEVERE
A user-supplied onGitHubTelemetry callback throwing is a routine,
recoverable condition, not a serious system failure. Level.WARNING
matches the Java SDK''s own convention (CopilotSession "Error in event
handler") and the .NET (LogWarning) and Rust (warn) adapters.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* fix(python): log gitHubTelemetry callback errors at WARNING not ERROR
A user-supplied on_github_telemetry callback throwing is a routine,
recoverable condition, not an error. Use logger.warning(..., exc_info=True)
instead of logger.exception (which logs at ERROR), matching the .NET, Java,
and Rust adapters and client.py''s own convention (exc_info=True elsewhere,
never logger.exception).
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* Make GitHub telemetry callback async in nodejs, .NET, Java, and Python
The runtime-forwarded gitHubTelemetry.event callback now returns an
awaitable so consumers can perform async I/O in their telemetry sink,
addressing PR feedback. Signatures:
- nodejs: (n) => void | Promise<void>
- .NET: Func<GitHubTelemetryNotification, Task>
- Java: Function<GitHubTelemetryNotification, CompletableFuture<Void>>
- Python: Callable[[GitHubTelemetryNotification], None | Awaitable[None]]
Each adapter awaits the result and logs handler failures at WARNING.
Go and Rust are intentionally left synchronous; neither SDK has an
async-callback idiom. Unit and E2E call sites updated accordingly.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>1 parent 32fb841 commit 02f2604
42 files changed
Lines changed: 2581 additions & 69 deletions
File tree
- dotnet
- src
- test
- E2E
- Unit
- go
- internal/e2e
- rpc
- java/src
- main/java/com/github/copilot
- rpc
- test/java/com/github/copilot
- nodejs
- src
- generated
- test
- e2e
- python
- copilot
- generated
- e2e
- rust
- src
- tests
- e2e
- scripts/codegen
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
1037 | 1038 | | |
1038 | 1039 | | |
1039 | 1040 | | |
1040 | | - | |
| 1041 | + | |
| 1042 | + | |
1041 | 1043 | | |
1042 | 1044 | | |
1043 | 1045 | | |
| |||
1246 | 1248 | | |
1247 | 1249 | | |
1248 | 1250 | | |
1249 | | - | |
| 1251 | + | |
| 1252 | + | |
1250 | 1253 | | |
1251 | 1254 | | |
1252 | 1255 | | |
| |||
1724 | 1727 | | |
1725 | 1728 | | |
1726 | 1729 | | |
1727 | | - | |
1728 | | - | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
1729 | 1733 | | |
1730 | 1734 | | |
1731 | 1735 | | |
1732 | 1736 | | |
1733 | 1737 | | |
1734 | | - | |
| 1738 | + | |
| 1739 | + | |
1735 | 1740 | | |
1736 | 1741 | | |
1737 | 1742 | | |
1738 | 1743 | | |
1739 | 1744 | | |
1740 | 1745 | | |
1741 | | - | |
| 1746 | + | |
| 1747 | + | |
1742 | 1748 | | |
1743 | 1749 | | |
1744 | 1750 | | |
| |||
2495 | 2501 | | |
2496 | 2502 | | |
2497 | 2503 | | |
2498 | | - | |
| 2504 | + | |
| 2505 | + | |
2499 | 2506 | | |
2500 | 2507 | | |
2501 | 2508 | | |
| |||
2594 | 2601 | | |
2595 | 2602 | | |
2596 | 2603 | | |
2597 | | - | |
| 2604 | + | |
| 2605 | + | |
2598 | 2606 | | |
2599 | 2607 | | |
2600 | 2608 | | |
| |||
2713 | 2721 | | |
2714 | 2722 | | |
2715 | 2723 | | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
| 2731 | + | |
| 2732 | + | |
| 2733 | + | |
| 2734 | + | |
| 2735 | + | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
| 2747 | + | |
| 2748 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| 284 | + | |
284 | 285 | | |
285 | 286 | | |
286 | 287 | | |
| |||
378 | 379 | | |
379 | 380 | | |
380 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
381 | 391 | | |
382 | 392 | | |
383 | 393 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
0 commit comments