Skip to content

Commit 7152a06

Browse files
author
Your Name
committed
refactor: Check vision support against active model
Co-authored-by: cecli (openai/gemini_cli/gemini-2.5-pro)
1 parent 5eefbfa commit 7152a06

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

cecli/commands/add.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,11 @@ async def execute(cls, io, coder, args, **kwargs):
125125
else:
126126
io.tool_error(f"Cannot add {matched_file} as it's not part of the repository")
127127
else:
128-
if is_image_file(matched_file) and not coder.main_model.info.get("supports_vision"):
128+
active_model = coder.get_active_model()
129+
if is_image_file(matched_file) and not active_model.info.get("supports_vision"):
129130
io.tool_error(
130131
f"Cannot add image file {matched_file} as the"
131-
f" {coder.main_model.name} does not support images."
132+
f" {active_model.name} does not support images."
132133
)
133134
continue
134135
content = io.read_text(abs_file_path)

cecli/commands/read_only.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,11 @@ def _add_read_only_file(
156156
source_mode="read-only",
157157
target_mode="read-only",
158158
):
159-
if is_image_file(original_name) and not coder.main_model.info.get("supports_vision"):
159+
active_model = coder.get_active_model()
160+
if is_image_file(original_name) and not active_model.info.get("supports_vision"):
160161
io.tool_error(
161162
f"Cannot add image file {original_name} as the"
162-
f" {coder.main_model.name} does not support images."
163+
f" {active_model.name} does not support images."
163164
)
164165
return
165166

cecli/commands/read_only_stub.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,11 @@ def _add_read_only_file(
156156
source_mode="read-only",
157157
target_mode="read-only",
158158
):
159-
if is_image_file(original_name) and not coder.main_model.info.get("supports_vision"):
159+
active_model = coder.get_active_model()
160+
if is_image_file(original_name) and not active_model.info.get("supports_vision"):
160161
io.tool_error(
161162
f"Cannot add image file {original_name} as the"
162-
f" {coder.main_model.name} does not support images."
163+
f" {active_model.name} does not support images."
163164
)
164165
return
165166

0 commit comments

Comments
 (0)