Skip to content

Commit 268dae1

Browse files
Fix Python test failures
- Mode.set() now returns None (void) - remove result assertions - ModelSupports.vision is optional in the schema - default to False Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent ef219e7 commit 268dae1

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

python/copilot/client.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,15 +360,13 @@ def to_dict(self) -> dict:
360360
class ModelSupports:
361361
"""Model support flags"""
362362

363-
vision: bool
363+
vision: bool = False
364364
reasoning_effort: bool = False # Whether this model supports reasoning effort
365365

366366
@staticmethod
367367
def from_dict(obj: Any) -> ModelSupports:
368368
assert isinstance(obj, dict)
369-
vision = obj.get("vision")
370-
if vision is None:
371-
raise ValueError("Missing required field 'vision' in ModelSupports")
369+
vision = obj.get("vision", False)
372370
reasoning_effort = obj.get("reasoningEffort", False)
373371
return ModelSupports(vision=bool(vision), reasoning_effort=bool(reasoning_effort))
374372

python/e2e/test_rpc.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,18 +129,16 @@ async def test_get_and_set_session_mode(self):
129129
assert initial == SessionMode.INTERACTIVE
130130

131131
# Switch to plan mode
132-
plan_result = await session.rpc.mode.set(ModeSetRequest(mode=SessionMode.PLAN))
133-
assert plan_result == SessionMode.PLAN
132+
await session.rpc.mode.set(ModeSetRequest(mode=SessionMode.PLAN))
134133

135134
# Verify mode persisted
136135
after_plan = await session.rpc.mode.get()
137136
assert after_plan == SessionMode.PLAN
138137

139138
# Switch back to interactive
140-
interactive_result = await session.rpc.mode.set(
139+
await session.rpc.mode.set(
141140
ModeSetRequest(mode=SessionMode.INTERACTIVE)
142141
)
143-
assert interactive_result == SessionMode.INTERACTIVE
144142

145143
await session.disconnect()
146144
await client.stop()

0 commit comments

Comments
 (0)