Fix some argument validation in C##1322
Conversation
Also clean up usings
There was a problem hiding this comment.
Pull request overview
This PR tightens .NET SDK argument validation and cleans up unused/reordered using directives across source and test files.
Changes:
- Adds null argument checks to selected
CopilotClient,CopilotSession, andSessionFsProvidermethods. - Removes unused usings and normalizes using ordering across .NET tests and source files.
Show a summary per file
| File | Description |
|---|---|
| dotnet/src/Client.cs | Adds null validation for public client/session lifecycle APIs and cleans usings. |
| dotnet/src/Session.cs | Adds null validation for message, handler, model, and log APIs. |
| dotnet/src/SessionFsProvider.cs | Adds null validation for session filesystem request handlers. |
| dotnet/src/Types.cs | Reorders usings. |
| dotnet/src/JsonRpc.cs | Removes unused using and reorders usings. |
| dotnet/src/Polyfills/Utf8.cs | Removes unused using. |
| dotnet/src/Polyfills/DownlevelExtensions.cs | Removes unused usings. |
| dotnet/test/ConnectionTokenTests.cs | Removes unused using. |
| dotnet/test/Harness/E2ETestBase.cs | Reorders usings. |
| dotnet/test/Harness/E2ETestContext.cs | Reorders usings. |
| dotnet/test/Unit/CloneTests.cs | Removes unused using. |
| dotnet/test/Unit/JsonRpcTests.cs | Removes unused using. |
| dotnet/test/Unit/SerializationTests.cs | Removes unused using. |
| dotnet/test/Unit/SessionEventSerializationTests.cs | Removes unused using. |
| dotnet/test/E2E/AbortE2ETests.cs | Removes/reorders usings. |
| dotnet/test/E2E/BuiltinToolsE2ETests.cs | Removes unused using. |
| dotnet/test/E2E/ClientOptionsE2ETests.cs | Removes unused using. |
| dotnet/test/E2E/CommandsE2ETests.cs | Removes unused using. |
| dotnet/test/E2E/ElicitationE2ETests.cs | Removes unused using. |
| dotnet/test/E2E/ErrorResilienceE2ETests.cs | Removes unused using. |
| dotnet/test/E2E/HookLifecycleAndOutputE2ETests.cs | Removes unused using. |
| dotnet/test/E2E/MultiClientE2ETests.cs | Removes/reorders usings. |
| dotnet/test/E2E/MultiTurnE2ETests.cs | Removes unused using. |
| dotnet/test/E2E/PendingWorkResumeE2ETests.cs | Reorders usings. |
| dotnet/test/E2E/RpcEventSideEffectsE2ETests.cs | Reorders usings. |
| dotnet/test/E2E/RpcMcpConfigE2ETests.cs | Reorders usings. |
| dotnet/test/E2E/RpcServerE2ETests.cs | Removes unused using. |
| dotnet/test/E2E/RpcSessionStateE2ETests.cs | Reorders usings. |
| dotnet/test/E2E/RpcShellAndFleetE2ETests.cs | Removes unused using. |
| dotnet/test/E2E/SessionConfigE2ETests.cs | Removes/reorders usings. |
| dotnet/test/E2E/SessionE2ETests.cs | Reorders usings. |
| dotnet/test/E2E/StreamingFidelityE2ETests.cs | Removes unused using. |
| dotnet/test/E2E/SuspendE2ETests.cs | Removes/reorders usings. |
| dotnet/test/E2E/ToolsE2ETests.cs | Removes unused using. |
Copilot's findings
- Files reviewed: 34/34 changed files
- Comments generated: 0
Cross-SDK Consistency Review ✅This PR adds null argument validation ( Cross-language parity check:
Summary: The null checks added here are appropriate and .NET-idiomatic. The other SDKs achieve equivalent protection through their own language mechanisms (Go value types for strings, Python required keyword arguments, TypeScript's type system). No cross-SDK parity gaps were identified. The
|
Also clean up usings