Ccopilot-cli-release-app[bot]Update SDK snapshot for Copilot CLI 1.0.89-3
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Add lsp config for dotnet. (#234) * Add lsp config for dotnet. * fix: add rootPath for C# LSP in subdirectory * fix: remove explicit rollForward to allow patch version updates * Add support for golang lsp. * Update to simplified config. * Update to new format. | 7 个月前 | |
C# API review fixes (#1343) | 4 个月前 | |
Update SDK snapshot for Copilot CLI 1.0.89-3 | 2 天前 | |
Update SDK snapshot for Copilot CLI 1.0.89-3 | 2 天前 | |
Replace StreamJsonRpc with a custom JSON-RPC implementation in the .NET SDK (#1170) * Replace StreamJsonRpc with a custom JSON-RPC implementation in the .NET SDK StreamJsonRpc was the only JSON-RPC client the .NET SDK used, but it dragged in 10 transitive runtime dependencies including Newtonsoft.Json, MessagePack, Nerdbank.Streams, and Microsoft.VisualStudio.Threading - none of which the SDK actually exercised. It also made every wire interaction go through a serialization stack we did not control, complicating AOT/trim work. This PR drops StreamJsonRpc and replaces it with a focused, internal JsonRpc class (~720 lines) that implements only what the SDK uses to talk to the Copilot CLI: LSP-style header-delimited framing (Content-Length: N\r\n\r\n + body), JSON-RPC 2.0 requests/responses/notifications, and reflection-based dispatch for the small set of methods the SDK registers. The wire format is the same one the Go and Python SDKs implement against the same CLI. Notable points: - Public API surface is unchanged for SDK consumers. - No StreamJsonRpc types leak through the public surface (they were already PrivateAssets=compile). - Codegen for the generated RPC handlers (scripts/codegen/csharp.ts) was updated to emit calls against the new JsonRpc class. - Cuts deployment footprint by ~3.24 MB / 10 assemblies in a published net8.0 app (10.14 MB -> 6.90 MB; Newtonsoft.Json, MessagePack, Nerdbank.MessagePack, Nerdbank.Streams, MessagePack.Annotations, Microsoft.VisualStudio.Threading, Microsoft.VisualStudio.Validation, PolyType, Microsoft.NET.StringTools all gone). - All existing unit tests pass; the read loop and framing parser were reviewed for correctness across header/body edge cases. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix JsonRpc serialization of args and formatting SerializeArgs was calling GetTypeInfo(typeof(object?[])), which is not provided by any of the source-generated JsonSerializerContexts and therefore threw NotSupportedException at runtime on macOS/Ubuntu (Windows happened to skip these code paths in earlier failures). Build the params JSON array manually, looking up TypeInfo by each argument's runtime type, which is what the merged source-gen resolver actually contains. Also insert the missing space before ':' in the PendingRequest primary-constructor base list to satisfy 'dotnet format --verify-no-changes'. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Combine nested Content-Length validation if-statements Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Send single-arg RPC params as object, not positional array The Copilot CLI uses vscode-jsonrpc-style request handlers which expect `params` to be the request object directly. The other SDKs (Node/Python/Go) all send single-object params, but the .NET InvokeAsync was wrapping the single arg in a positional JSON array, so the CLI couldn't deserialize it and never responded — every round-trip RPC test timed out. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Filter SendCancelNotificationAsync catch to expected lifecycle exceptions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Always emit `result` on JSON-RPC responses, even when null vscode-jsonrpc (used by the Copilot CLI) rejects responses that lack both `result` and `error` with 'The received response has neither a result nor an error property'. Our `JsonRpcResponse` inherited the context-level `DefaultIgnoreCondition = WhenWritingNull`, so void/ nullable-returning handlers (e.g. session.plan.update, every sessionFs handler that returns SessionFsError?) emitted `{jsonrpc, id}` with no `result` field, hanging the CLI and timing out tests. Override the policy on the Result property with [JsonInclude] + [JsonIgnore(Condition = Never)] so we always serialize `result: null`. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Retrigger CI after Windows-only PermissionTests timeout flake Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix race in GetFinalAssistantMessageAsync that could miss early events If AssistantMessageEvent and SessionIdleEvent both arrived between SendAsync returning and the subscription being installed, AND GetMessagesAsync returned only the assistant message before SessionIdleEvent had arrived, the helper would hang. The subscription would later receive SessionIdleEvent but skip it because the local finalAssistantMessage variable was still null (the AssistantMessageEvent had been delivered before subscription). Now CheckExistingMessages backfills finalAssistantMessage from already-delivered events under a lock, so the SessionIdleEvent handler can complete the wait. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Remove redundant [JsonInclude] from JsonRpcResponse.Result [JsonInclude] is for opting in non-public members; the property is already public with a public getter/setter. The override of the context-level WhenWritingNull policy is purely from [JsonIgnore(Condition = Never)]. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix remaining race in GetFinalAssistantMessageAsync helper Previous fix backfilled the assistant message but still missed cases where SessionIdleEvent arrived via the subscription before backfill completed (subscription saw finalAssistantMessage==null and skipped) and the GetMessagesAsync snapshot was taken before SessionIdleEvent arrived (existingIdle==false). Both paths now feed a shared (finalAssistantMessage, sawIdle) state and call a single TryComplete that fires when both have been observed regardless of which path saw which. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Bump TestHelper default timeout from 60s to 120s Single-test 60s timeouts have been intermittently failing CI on different tests across runs (Should_Create_Session_With_Custom_Config_Dir on macOS, Should_Create_A_Session_With_Appended_SystemMessage_Config on Windows). The race in GetFinalAssistantMessageAsync is fixed; remaining failures appear to be CI runner slowness on snapshot replay. 120s gives loaded runners more room without affecting healthy runs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Don't honor user cancellation between header and body in JSON-RPC writes SendMessageAsync was passing the user's cancellation token to all three write/flush calls. If the token fired between writing the header and the body (or mid-body), the peer was left waiting for N body bytes that never arrived, desynchronizing the LSP-style stream for every subsequent message on the connection. Because our E2E test fixture shares a single CopilotClient (and underlying CLI process) across all tests in a class, one cancelled write could corrupt the wire and cause every subsequent test to hang in GetFinalAssistantMessageAsync. Cancellation now only applies to *waiting* for the write lock. Once we hold the lock and start writing a framed message we commit the whole thing. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> | 4 个月前 | |
Strong-name sign .NET SDK (#1778) Use the canonical .NET Open.snk key to strong-name sign the GitHub.Copilot.SDK assembly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> | 3 个月前 | |
Update SDK snapshot for Copilot CLI 1.0.88-2 | 4 天前 | |
Make tool callbacks optional across SDKs (#1308) * Make tool callbacks optional across SDKs Allow SDK consumers to provide declaration-only tools and manually resolve permission and tool requests when callbacks are omitted. Preserve automatic SDK handling when callbacks are supplied, and add manual resume samples across languages. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix Python tool overload stubs Use explicit pass bodies for define_tool overload declarations so code-quality checks do not flag no-op ellipsis statements. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update Python E2E optional permission tests Assert create and resume sessions work without permission callbacks now that those callbacks are optional. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> | 4 个月前 | |
Strong-name sign .NET SDK (#1778) Use the canonical .NET Open.snk key to strong-name sign the GitHub.Copilot.SDK assembly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> | 3 个月前 | |
Update SDK snapshot for Copilot CLI 1.0.89-3 | 2 天前 | |
Improve .NET SDK build infrastructure and documentation (#643) * Improve .NET SDK build infrastructure and documentation - Add Central Package Management (Directory.Packages.props) with all package versions centralized - Add Directory.Build.props with shared properties (TargetFramework, ImplicitUsings, Nullable, TreatWarningsAsErrors) - Add nuget.config with single nuget.org source and package source mapping (required by CPM) - Add global.json specifying .NET 10 SDK (the library is still built with a net8.0 TFM) - Update all CI workflows from .NET 8.0.x to .NET 10.0.x - Enable XML documentation file generation (GenerateDocumentationFile) - Add XML doc comments to all non-generated public types and members - Add valid-value lists in XML docs for string properties with known values (e.g. PermissionRequest.Kind, ToolResultObject.ResultType) - Add #pragma warning disable CS1591 to generated files (SessionEvents.cs, Rpc.cs) and codegen scripts - Enable EmbedUntrackedSources, IncludeSymbols, SymbolPackageFormat - Enable ContinuousIntegrationBuild conditional on CI/TF_BUILD environment variables - Add PackageProjectUrl to package metadata - Add [EditorBrowsable(Never)] to obsolete GithubToken property - Upgrade analysis level and fix some diagnostics * Exclude nodejs/scripts/ from Node.js SDK test triggers Changes to development utility scripts (codegen, protocol version updates) should not trigger the Node.js test suite, as they don't affect SDK runtime code and the workflow fails on fork PRs that lack the COPILOT_HMAC_KEY secret. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Mock sendRequest in session.resume unit tests These tests verify that the correct parameters are forwarded to the RPC call, not that the CLI handles them. Mock sendRequest (like the setModel test already does) so the tests don't depend on CLI authentication, which is unavailable on fork PRs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix PermissionRequestResultKind type in custom-agents docs Use PermissionRequestResultKind.Approved instead of string literal "approved" to match the strongly-typed struct in the .NET SDK. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> | 6 个月前 | |
Improve .NET SDK build infrastructure and documentation (#643) * Improve .NET SDK build infrastructure and documentation - Add Central Package Management (Directory.Packages.props) with all package versions centralized - Add Directory.Build.props with shared properties (TargetFramework, ImplicitUsings, Nullable, TreatWarningsAsErrors) - Add nuget.config with single nuget.org source and package source mapping (required by CPM) - Add global.json specifying .NET 10 SDK (the library is still built with a net8.0 TFM) - Update all CI workflows from .NET 8.0.x to .NET 10.0.x - Enable XML documentation file generation (GenerateDocumentationFile) - Add XML doc comments to all non-generated public types and members - Add valid-value lists in XML docs for string properties with known values (e.g. PermissionRequest.Kind, ToolResultObject.ResultType) - Add #pragma warning disable CS1591 to generated files (SessionEvents.cs, Rpc.cs) and codegen scripts - Enable EmbedUntrackedSources, IncludeSymbols, SymbolPackageFormat - Enable ContinuousIntegrationBuild conditional on CI/TF_BUILD environment variables - Add PackageProjectUrl to package metadata - Add [EditorBrowsable(Never)] to obsolete GithubToken property - Upgrade analysis level and fix some diagnostics * Exclude nodejs/scripts/ from Node.js SDK test triggers Changes to development utility scripts (codegen, protocol version updates) should not trigger the Node.js test suite, as they don't affect SDK runtime code and the workflow fails on fork PRs that lack the COPILOT_HMAC_KEY secret. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Mock sendRequest in session.resume unit tests These tests verify that the correct parameters are forwarded to the RPC call, not that the CLI handles them. Mock sendRequest (like the setModel test already does) so the tests don't depend on CLI authentication, which is unavailable on fork PRs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix PermissionRequestResultKind type in custom-agents docs Use PermissionRequestResultKind.Approved instead of string literal "approved" to match the strongly-typed struct in the .NET SDK. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> | 6 个月前 |