Support experimental schema types in codegen#1267
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the multi-language code generators to treat JSON Schema definitions marked with stability: "experimental" as experimental independently of RPC method stability, ensuring generated types surface appropriate experimental warnings/annotations across SDKs.
Changes:
- Add a shared
isSchemaExperimentalhelper and thread schema-level experimental metadata through TypeScript, C#, Python, Go, and Rust generators. - Emit language-appropriate experimental markers on generated types (JSDoc/attributes/comments/rustdoc warnings).
- Move the C#
Diagnostics.Experimentalconstant out of generated RPC code into the SDK namespace for reuse by generated outputs.
Show a summary per file
| File | Description |
|---|---|
| scripts/codegen/utils.ts | Adds isSchemaExperimental helper for schema-level stability detection. |
| scripts/codegen/typescript.ts | Annotates generated TS types as @experimental when definitions or method shapes are experimental. |
| scripts/codegen/rust.ts | Adds rustdoc experimental warnings for experimental schemas and adjusts generator CLI arg handling. |
| scripts/codegen/python.ts | Adds experimental comments for generated Python enums/classes/unions and RPC type annotation. |
| scripts/codegen/go.ts | Adds experimental comments for generated Go enums/types and session-event surfaces. |
| scripts/codegen/csharp.ts | Propagates schema experimental markers into generated C# attributes and centralizes attribute strings. |
| rust/src/generated/rpc.rs | Regenerated Rust RPC output (import split reflects generator changes). |
| dotnet/src/Types.cs | Introduces Diagnostics.Experimental constant in GitHub.Copilot.SDK namespace. |
| dotnet/src/Generated/Rpc.cs | Removes the generated Diagnostics helper (now sourced from Types.cs). |
Copilot's findings
- Files reviewed: 7/8 changed files
- Comments generated: 1
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2ed69af to
63358c7
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Generated by SDK Consistency Review Agent for issue #1267 · ● 2.1M
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
d64143a to
61abbe6
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Generated by SDK Consistency Review Agent for issue #1267 · ● 925.4K
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Cross-SDK Consistency Review ✅This PR threads experimental schema-level annotations through all five SDK code generators (TypeScript, C#, Python, Go, Rust) consistently. Here's a summary of the cross-language findings: Coverage across generators
One minor observationIn Idiom consistencyLanguage-specific markers are appropriately idiomatic:
The refactoring of the C# Overall this PR maintains strong cross-SDK parity. 👍
|
There was a problem hiding this comment.
Generated by SDK Consistency Review Agent for issue #1267 · ● 1.4M
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Schema definitions can now carry experimental stability independently of RPC methods, but the SDK generators only propagated experimental markers from methods. This adds schema-level experimental handling so generated types surface the same non-stable signal as experimental APIs.
Summary
isSchemaExperimentalhelper for schemastability: "experimental"checks.[Experimental(Diagnostics.Experimental)], TypeScript@experimental, Python/Go comments, and Rust doc warnings.Validation
cd scripts\codegen && npm run generatecd dotnet && dotnet build .\src\GitHub.Copilot.SDK.csproj --no-restore --verbosity quietcd go && go build ./...cd nodejs && npx tsc --noEmitcd python && python -c "import copilot"cd rust && cargo check --features test-support