Commit cd71ba1
Workaround: patch model capabilities in Python models.list deserializer
TODO: Remove once the runtime schema correctly marks limits/supports
and max_context_window_tokens as optional in ModelCapabilities.
The generated Python deserializer (from quicktype) uses strict assert-
based type checks that crash on null/missing fields. Go, C#, and TS
deserializers silently zero-default these. This adds a targeted patch
to models.list that supplies missing defaults before deserialization.
Files to update when removing this workaround:
- scripts/codegen/python.ts (remove _patch_model_capabilities helper
and the string replacement logic)
- python/copilot/generated/rpc.py (will be regenerated automatically)
Co-authored-by: Copilot <[email protected]>1 parent ca0f563 commit cd71ba1
2 files changed
+56
-2
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
403 | 424 | | |
404 | 425 | | |
405 | 426 | | |
| |||
413 | 434 | | |
414 | 435 | | |
415 | 436 | | |
416 | | - | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
417 | 450 | | |
418 | 451 | | |
419 | 452 | | |
| |||
0 commit comments