Commit 7ca801f
Fix Python codegen so ReasoningSummary import is not shadowed
The 1.0.60 schema introduces OptionsUpdateReasoningSummary and
SessionOpenOptionsReasoningSummary, structurally identical to the shared
ReasoningSummary enum. quicktype's enum-merging path (independent of
combineClasses) collapsed them into a single locally-defined
`class ReasoningSummary(Enum)` that shadowed the import from
session_events at the top of rpc.py. ModelSwitchToRequest.to_dict()
then called `to_enum(ReasoningSummary, x)` against the local class
while session.py constructed values via the imported one, so the
isinstance check inside to_enum failed and the unit test
TestSessionConfigForwarding.test_set_model_sends_correct_rpc broke.
Add a small post-processing step that strips locally-emitted enum
classes whose name and value set exactly match a name imported from
.session_events. The existing aliases at the end of rpc.py
(OptionsUpdateReasoningSummary = ReasoningSummary etc.) now resolve to
the imported enum, restoring isinstance equality across the SDK.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 367277d commit 7ca801f
2 files changed
Lines changed: 59 additions & 11 deletions
Some 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 | |
|---|---|---|---|
| |||
1177 | 1177 | | |
1178 | 1178 | | |
1179 | 1179 | | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
1180 | 1234 | | |
1181 | 1235 | | |
1182 | 1236 | | |
| |||
2896 | 2950 | | |
2897 | 2951 | | |
2898 | 2952 | | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
2899 | 2958 | | |
2900 | 2959 | | |
2901 | 2960 | | |
| |||
0 commit comments