Skip to content

Commit ec40f4d

Browse files
committed
Fix Python generated enum refs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8ba82ae commit ec40f4d

5 files changed

Lines changed: 145 additions & 114 deletions

File tree

python/copilot/generated/rpc.py

Lines changed: 57 additions & 89 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

python/e2e/test_mode_handlers_e2e.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
from copilot.generated.session_events import (
1010
AutoModeSwitchCompletedData,
1111
AutoModeSwitchRequestedData,
12+
AutoModeSwitchResponse,
13+
ExitPlanModeAction,
1214
ExitPlanModeCompletedData,
1315
ExitPlanModeRequestedData,
1416
SessionIdleData,
@@ -104,7 +106,7 @@ async def on_exit_plan_mode(request, invocation):
104106
lambda event: (
105107
isinstance(event.data, ExitPlanModeCompletedData)
106108
and event.data.approved is True
107-
and event.data.selected_action == "interactive"
109+
and event.data.selected_action == ExitPlanModeAction.INTERACTIVE
108110
),
109111
)
110112
)
@@ -126,7 +128,7 @@ async def on_exit_plan_mode(request, invocation):
126128

127129
completed = await completed_event
128130
assert completed.data.approved is True
129-
assert completed.data.selected_action == "interactive"
131+
assert completed.data.selected_action == ExitPlanModeAction.INTERACTIVE
130132
assert completed.data.feedback == "Approved by the Python E2E test"
131133
assert response is not None
132134
finally:
@@ -164,7 +166,7 @@ async def on_auto_mode_switch(request, invocation):
164166
session,
165167
lambda event: (
166168
isinstance(event.data, AutoModeSwitchCompletedData)
167-
and event.data.response == "yes"
169+
and event.data.response == AutoModeSwitchResponse.YES
168170
),
169171
)
170172
)
@@ -192,7 +194,7 @@ async def on_auto_mode_switch(request, invocation):
192194
assert requested.data.retry_after_seconds == 1
193195

194196
completed = await completed_event
195-
assert completed.data.response == "yes"
197+
assert completed.data.response == AutoModeSwitchResponse.YES
196198

197199
model_change = await model_change_event
198200
assert model_change.data.cause == "rate_limit_auto_switch"

0 commit comments

Comments
 (0)