Description
Follow-up from #396 and PR #397. The regex-based runtime detection has a false-positive when model names contain runtime keywords (e.g., copilot --model gpt-5.3-codex). PR #397 fixes the codex regex, but the same bug class exists in:
is_runtime_cmd() (~line 263): uses runtime_name in cmd bare substring match
_detect_runtime() (~line 412-421): uses runtime in script_content bare substring match
- Copilot regex (~line 362): same
(^|\s) pattern that matches mid-command
- LLM regex (~line 381): same pattern
Expected behavior
All runtime detection should use start-of-string anchored patterns (^runtime\s+) for command matching. The env-var detection path (lines 296-341) already handles prefix cases separately.
Location
src/apm_cli/core/script_runner.py
Related
Description
Follow-up from #396 and PR #397. The regex-based runtime detection has a false-positive when model names contain runtime keywords (e.g.,
copilot --model gpt-5.3-codex). PR #397 fixes the codex regex, but the same bug class exists in:is_runtime_cmd()(~line 263): usesruntime_name in cmdbare substring match_detect_runtime()(~line 412-421): usesruntime in script_contentbare substring match(^|\s)pattern that matches mid-commandExpected behavior
All runtime detection should use start-of-string anchored patterns (
^runtime\s+) for command matching. The env-var detection path (lines 296-341) already handles prefix cases separately.Location
src/apm_cli/core/script_runner.pyRelated