Repository navigation
Add native notification APIs for extension providers and hosts - #2833
Closed
fletchto99 wants to merge 3 commits into
Closed
fletchto99 wants to merge 3 commits into
fletchto99 wants to merge 3 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: af21271a-79e1-48f0-8cd2-7d40531a0e76
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: af21271a-79e1-48f0-8cd2-7d40531a0e76
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: af21271a-79e1-48f0-8cd2-7d40531a0e76
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.
Summary
Add the SDK slice of the coordinated native desktop notification feature:
joinSession({ requestNotifications: true })and usesession.notifications.getCapabilities(),requestPermission(), andshow()from their provider process, including while canvas HTML is hidden.{ signal?: AbortSignal }options and forward actual JSON-RPC cancellation. Only capability discovery maps method-not-found tounsupported; delivery is never retried or silently switched to another adapter.NotificationHandlercallbacks,ClientOptions::with_notification_handler, explicit host registration status, cancellation-aware dispatch, and unregister-on-stop. Callbacks remain disabled until registration is acknowledged.Integration status
Draft: this is not a released, end-to-end feature. Dependent changes in
github/copilot-agent-runtimeandgithub/github-appare still in progress. Cross-repository validation and native OS delivery/activation validation are pending. These SDK tests use synthetic JSON-RPC peers; they do not send real notifications or modify real preferences.The app must use its supported one-way SDK vendoring workflow. The handwritten SDK changes have been reconciled into the in-progress runtime repository's authoritative
src/sdktree; both changes must be included before release export. The runtime enforces trusted stdio-root host nomination and extension authorization; this PR does not grant those permissions itself.Validation
Passed against the final coordinated runtime schemas:
npm --prefix nodejs test -- test/extension.test.ts test/notifications.test.ts test/client-global-api.test.ts test/rust-codegen.test.ts— 96 tests passed, rerun after the final schema update.npm --prefix nodejs run typecheck— source and test typechecks passed.npm --prefix nodejs run build— ESM, CJS, and declaration builds passed.any-mock warnings inextension.test.ts.cargo +1.98.1 test --manifest-path rust/Cargo.toml --no-default-features --features test-support --lib notification— 19 selected tests passed, 310 library tests compiled; two existing dead-code warnings under this minimal feature selection. Rerun after the final schema update.cargo +1.98.1 check --manifest-path rust/Cargo.toml --no-default-features --features local-runtime— passed.cargo +1.98.1 clippy --manifest-path rust/Cargo.toml --no-default-features --features local-runtime --lib -- -D warnings— passed, including a rerun after the final schema update. The build emits the expected note that the app supplies the local runtime.rustfmt +nightly-2026-04-14 --config-path rust/.rustfmt.nightly.toml --config skip_children=true --checkon the six changed handwritten Rust files — passed.git diff --cached --check— passed before each commit.The full-schema test uses
COPILOT_RUNTIME_SOURCE=checkoutandCOPILOT_CLI_SCHEMA_DIR=<runtime-checkout>/generated. Validation was executed across coordinated sessions; final Rust tests and clippy were rerun in this SDK session. Rust toolchains were isolated to session artifacts; no installed app was replaced.The follow-up commit
30dc82e4regenerates the final schema-lint metadata. Its only file change is 294 added documentation lines inrust/src/generated/api_types.rs, marking notification variants experimental. No wire fields, values, or handwritten implementation changed.Schema provenance
Node and Rust projections were generated, not hand-edited, from the coordinated runtime checkout:
github/copilot-agent-runtimeatefd3a3f4e9955825a384e9e568433c74a565461c, plus the in-progress notification contract changes.0a2fdb0f5923e1d9da71563c77333aa7a272130bc6c33219ce8fd7784074bc77.api.schema.jsonSHA-256:f92d2f8f322ebc18fe60b901fa9a800389d5e2c4d27961481fa51af38b8cddc0.session-events.schema.jsonSHA-256:3d4d826b3a748b902d626ceb82046fff70db2b3bb6449f4c977a38094e275e35.The runtime reports all 28 schema-lint tests passing for this final schema. The event projection differences are two existing managed-settings documentation updates from the runtime baseline; no notification event or event field was introduced. Published CLI pins and protocol-version constants are unchanged.