Bug Description
Quoted relative local image paths are not detected by the CLI file-drop/single-query image attachment path. This means an input like "./rel image.png" describe this is sent as plain text instead of attaching the image.
Affected files/lines
cli.py:1413-1449 — _detect_file_drop() has a starts_like_path prefilter that accepts unquoted ./ / ../, and quoted absolute / tilde / Windows paths, but not quoted "./..." or "../..." paths.
cli.py:1284-1324 — _split_path_input() already supports quoted path tokens and escaped spaces.
cli.py:1327-1362 — _resolve_attachment_path() already resolves relative paths against TERMINAL_CWD / os.getcwd().
tests/cli/test_cli_file_drop.py:133-193 covers escaped spaces, unquoted spaces, file URI, and tilde paths, but not quoted relative paths.
Why this is a bug
The lower-level path parsing/resolution code supports quoted and relative paths, but _detect_file_drop() rejects quoted relative inputs before it reaches that code. Quoting relative paths is a common shell/CLI habit when the filename contains spaces.
Minimal reproduction
From the repo root with the venv active:
source venv/bin/activate
python - <<'PY'
from pathlib import Path
from tempfile import TemporaryDirectory
import os
from cli import _detect_file_drop
with TemporaryDirectory() as td:
p = Path(td) / 'rel image.png'
p.write_bytes(b'fake')
old = os.getcwd()
os.chdir(td)
try:
print(_detect_file_drop('"./rel image.png" describe'))
print(_detect_file_drop(f'"{p}" describe'))
finally:
os.chdir(old)
PY
Actual output observed during review:
None
{'path': PosixPath('.../rel image.png'), 'is_image': True, 'remainder': 'describe'}
Expected behavior
_detect_file_drop('"./rel image.png" describe') should return the same kind of attachment dict as the quoted absolute path case, with remainder == 'describe'.
Suggested investigation direction
Extend the starts_like_path prefilter in _detect_file_drop() to allow quoted relative prefixes ("./, './, "../, '../) and add regression tests in tests/cli/test_cli_file_drop.py. Also consider checking the same path through _collect_query_images() because single-query hermes chat -q '"./rel image.png" ...' depends on this detection path.
Bug Description
Quoted relative local image paths are not detected by the CLI file-drop/single-query image attachment path. This means an input like
"./rel image.png" describe thisis sent as plain text instead of attaching the image.Affected files/lines
cli.py:1413-1449—_detect_file_drop()has astarts_like_pathprefilter that accepts unquoted.//../, and quoted absolute / tilde / Windows paths, but not quoted"./..."or"../..."paths.cli.py:1284-1324—_split_path_input()already supports quoted path tokens and escaped spaces.cli.py:1327-1362—_resolve_attachment_path()already resolves relative paths againstTERMINAL_CWD/os.getcwd().tests/cli/test_cli_file_drop.py:133-193covers escaped spaces, unquoted spaces, file URI, and tilde paths, but not quoted relative paths.Why this is a bug
The lower-level path parsing/resolution code supports quoted and relative paths, but
_detect_file_drop()rejects quoted relative inputs before it reaches that code. Quoting relative paths is a common shell/CLI habit when the filename contains spaces.Minimal reproduction
From the repo root with the venv active:
Actual output observed during review:
Expected behavior
_detect_file_drop('"./rel image.png" describe')should return the same kind of attachment dict as the quoted absolute path case, withremainder == 'describe'.Suggested investigation direction
Extend the
starts_like_pathprefilter in_detect_file_drop()to allow quoted relative prefixes ("./,'./,"../,'../) and add regression tests intests/cli/test_cli_file_drop.py. Also consider checking the same path through_collect_query_images()because single-queryhermes chat -q '"./rel image.png" ...'depends on this detection path.