Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions cecli/commands/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,11 @@ async def execute(cls, io, coder, args, **kwargs):
else:
io.tool_error(f"Cannot add {matched_file} as it's not part of the repository")
else:
if is_image_file(matched_file) and not coder.main_model.info.get("supports_vision"):
active_model = coder.get_active_model()
if is_image_file(matched_file) and not active_model.info.get("supports_vision"):
io.tool_error(
f"Cannot add image file {matched_file} as the"
f" {coder.main_model.name} does not support images."
f" {active_model.name} does not support images."
)
continue
content = io.read_text(abs_file_path)
Expand Down
5 changes: 3 additions & 2 deletions cecli/commands/read_only.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,11 @@ def _add_read_only_file(
source_mode="read-only",
target_mode="read-only",
):
if is_image_file(original_name) and not coder.main_model.info.get("supports_vision"):
active_model = coder.get_active_model()
if is_image_file(original_name) and not active_model.info.get("supports_vision"):
io.tool_error(
f"Cannot add image file {original_name} as the"
f" {coder.main_model.name} does not support images."
f" {active_model.name} does not support images."
)
return

Expand Down
5 changes: 3 additions & 2 deletions cecli/commands/read_only_stub.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,11 @@ def _add_read_only_file(
source_mode="read-only",
target_mode="read-only",
):
if is_image_file(original_name) and not coder.main_model.info.get("supports_vision"):
active_model = coder.get_active_model()
if is_image_file(original_name) and not active_model.info.get("supports_vision"):
io.tool_error(
f"Cannot add image file {original_name} as the"
f" {coder.main_model.name} does not support images."
f" {active_model.name} does not support images."
)
return

Expand Down
Loading