[WIP] Node SDK canvas launch admission and retention - #2637
Draft
ulugbekna wants to merge 1 commit into
Draft
Conversation
Attach the connection-owned launch provider before handshake and require an explicit v1 acknowledgement before session creation or resume. Expose global and scoped no-turn retention with canonical null results, and forward initial script-safety configuration before new extension work. Make cancellation teardown safe before registration and under overlapping request/connection cancellation, preserving synchronous resolver errors. Add focused public loopback coverage and document runtime/release limits. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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
WIP Node SDK follow-up for hosts embedding canvas extensions:
extensionLaunchProviderbefore the RPC handshake; require an explicit{ contractVersion: 1 }before create/resume. Unsupported negotiation fails closed, while omitting the option preserves legacy behavior.client.rpc.session.retain({ sessionId })andsession.rpc.retain()with exactnullacknowledgements and thesession.retainedevent. Global retention works while create is pending, without manufacturing a conversation turn.enableScriptSafetyin the initial create/resume request, before newly initialized extension work.Includes generated Node bindings, public exports, focused loopback regressions, and experimental API documentation. No dependency or CLI-pin changes, runtime implementation, release payloads, or private qualification fixtures/logs are included.
Source and release provenance
This is P1, a newly validated source publication candidate, based on
dcfbb93859bea38837234a6dd82b64d545f32624(0.0.0-dev, CLI pin1.0.84-4). During publication preparation, five files changed from the preserved earlier R2 source: the already-qualified B2 initial-safety forwarding, B3 cancellation helper/tests, and matching README clarification. The helper and focused test file exactly match the qualified B3 source. The generated sources and generator were not changed during preparation.This is not the separate
@github/copilot-sdk@1.0.13+ B3 backport adopted by the VS Code integration. That backport starts atf13e4a2cc7e4e220974d2333142234e162a3252e, retains CLI pin1.0.83, and has its own complete-image payload and qualification history. Its frozen bytes and native receipts are unchanged; those receipts are not relabeled as executions of this PR.The checked-in generated changes were produced with the existing Node generator from verified CLI
1.0.84-4schemas plus the reviewed canonical launch-v1/retain contract fragments and retained event. Using the complete older runtime schema would remove unrelated newer SDK APIs, so it was not substituted wholesale.enableScriptSafetyuses the existing canonicalSessionOpenOptionstype.Merge/release prerequisite: the matching runtime contracts must be reviewed/released, followed by an appropriate CLI pin and ordinary regeneration. The current pin does not supply all these additions. Running the standard pinned-release generator today will not reproduce them; the repository's codegen consistency check is expected to remain blocked by that prerequisite. This draft does not bypass the check or assert released SDK/runtime availability.
Validation boundary
Fresh on the actual P1 source/build, macOS arm64 with Node 24.18.0:
vscode-jsonrpc@8.2.1.Prior separately labeled R2 and 1.0.13+B3 evidence includes isolated compatible-runtime counter/SSE, no-turn retention/cold resume/offline domain persistence, and startup-negative cleanup. This publication does not claim a fresh native matrix, all extension sources/platforms/transports, production UI compatibility, or all model-driven resume combinations.
Remaining runtime and policy limits
The required order is source approval, successful retention, then an approved launch recipe. Top-level extension effects can precede
joinSessionor canvas open; create/resume completion is not canvas-registry readiness.The compatible runtime keeps a disconnected launch-provider connection authoritative. A replacement on the same running runtime may be refused; the SDK propagates that refusal rather than bypassing ownership. An SDK-owned runtime restart permits fresh negotiation.
enableScriptSafety: trueenables read-only shell-command classification under runtime/managed policy, not a security-policy override, blanket tool approval, or extension sandbox. It is not retroactive protection for running work. The setting is in-memory: cold omission defaults to classification disabled, while resident omission preserves the current value. Hosts requiring it must explicitly set true before each create/cold resume.