Skip to content

Run frontier MoE models on hardware you already own — pure C, zero deps, experts streamed from disk. Tiny engine, immense model. 🐦

C

coli chat: a line that starts with a picture's path is a message, not a command

JustVugg761ce17aff04
diff --git a/c/coli b/c/coli
index b707109b..42233024 100755
--- a/c/coli
+++ b/c/coli
@@ -1651,6 +1651,13 @@ def chat_command(message):
e deve poter distinguere "comando sbagliato" da "testo che comincia con /"."""
if not message or message[0] not in "/:":
return None, None
+ # A picture's path is not a command. A file dragged into the terminal pastes
+ # "/home/me/photo.png" at the start of the line, and that line is a question
+ # about the picture; read as a command it got "comando sconosciuto" and the
+ # picture never left the prompt.
+ # The first word decides: "/save /tmp/x.png" is still the /save command.
+ if IMAGE_PATH.fullmatch(message.split()[0]):
+ return None, None
head, _, rest = message[1:].partition(" ")
return head.strip().lower(), rest.strip()
diff --git a/c/tests/test_qwen_image_cli.py b/c/tests/test_qwen_image_cli.py
index e641d595..ad354d18 100644
--- a/c/tests/test_qwen_image_cli.py
+++ b/c/tests/test_qwen_image_cli.py
@@ -130,6 +130,11 @@ class LauncherTest(unittest.TestCase):
self.assertEqual(set(self.cli.IMAGE_CHAT_COMMANDS),
{"size", "steps", "seed", "render", "save", "help", "quit"})
self.assertEqual(self.cli.chat_command("/size 1024x576"), ("size", "1024x576"))
+ # a picture's path at the start of a line is a message, not a command
+ self.assertEqual(self.cli.chat_command("/home/me/foto.png cosa vedi?"), (None, None))
+ self.assertEqual(self.cli.chat_command("~/Desktop/a.JPG"), (None, None))
+ self.assertEqual(self.cli.chat_command("/brio a | b"), ("brio", "a | b"))
+ self.assertEqual(self.cli.chat_command("/save /tmp/x/nome.png"), ("save", "/tmp/x/nome.png"))
def run_coli(args, env, stdin=None, timeout=60):