The Codegen Check workflow (.github/workflows/codegen-check.yml) regenerates schema-driven types via cd scripts/codegen && npm run generate and fails if the working tree is dirty. It does not run cd nodejs && npm run update:protocol-version, which is the script that regenerates the per-language SDK protocol version constants:
nodejs/src/sdkProtocolVersion.ts
dotnet/src/SdkProtocolVersion.cs
python/copilot/_sdk_protocol_version.py
go/sdk_protocol_version.go
rust/src/sdk_protocol_version.rs
Source of truth: sdk-protocol-version.json. If someone edits sdk-protocol-version.json (or hand-edits one of the generated files) without running the script, CI won't catch it. Each SDK can drift independently.
Proposal
Extend codegen-check.yml:
- Add an
npm run update:protocol-version step after npm run generate.
- Extend the
paths: trigger to include all the generated outputs and the script itself, so the workflow runs on PRs that touch any of them:
- 'sdk-protocol-version.json'
- 'nodejs/scripts/update-protocol-version.ts'
- 'nodejs/src/sdkProtocolVersion.ts'
- 'dotnet/src/SdkProtocolVersion.cs'
- 'python/copilot/_sdk_protocol_version.py'
- 'go/sdk_protocol_version.go'
- 'rust/src/sdk_protocol_version.rs'
- Update the failure message to mention both regen commands.
Context
I noticed this while working on #1164 (Rust SDK technical preview). I'd originally bundled this fix into that PR but reverted it to keep the Rust port surgical. Tracking it here as a follow-up.
Generated via Copilot (Claude Opus 4.7) on behalf of @tclem
The
Codegen Checkworkflow (.github/workflows/codegen-check.yml) regenerates schema-driven types viacd scripts/codegen && npm run generateand fails if the working tree is dirty. It does not runcd nodejs && npm run update:protocol-version, which is the script that regenerates the per-language SDK protocol version constants:nodejs/src/sdkProtocolVersion.tsdotnet/src/SdkProtocolVersion.cspython/copilot/_sdk_protocol_version.pygo/sdk_protocol_version.gorust/src/sdk_protocol_version.rsSource of truth:
sdk-protocol-version.json. If someone editssdk-protocol-version.json(or hand-edits one of the generated files) without running the script, CI won't catch it. Each SDK can drift independently.Proposal
Extend
codegen-check.yml:npm run update:protocol-versionstep afternpm run generate.paths:trigger to include all the generated outputs and the script itself, so the workflow runs on PRs that touch any of them:Context
I noticed this while working on #1164 (Rust SDK technical preview). I'd originally bundled this fix into that PR but reverted it to keep the Rust port surgical. Tracking it here as a follow-up.