-
Notifications
You must be signed in to change notification settings - Fork 49
fix: script runner misidentifies 'codex' in model names as the codex runtime binary #397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -114,7 +114,15 @@ def test_transform_runtime_command_copilot_removes_p_flag(self): | |
| original, "hello-world.prompt.md", self.compiled_content, self.compiled_path | ||
| ) | ||
| assert result == "copilot --log-level all" | ||
|
|
||
|
|
||
| def test_transform_runtime_command_copilot_with_codex_in_model_name(self): | ||
| """Test copilot command with --model flag containing 'codex' substring is not misidentified.""" | ||
| original = "copilot --allow-all-tools --model gpt-5.3-codex -p hello-world.prompt.md" | ||
| result = self.script_runner._transform_runtime_command( | ||
| original, "hello-world.prompt.md", self.compiled_content, self.compiled_path | ||
| ) | ||
| assert result == "copilot --allow-all-tools --model gpt-5.3-codex" | ||
|
Comment on lines
+118
to
+124
|
||
|
|
||
| def test_detect_runtime_copilot(self): | ||
| """Test runtime detection for copilot commands.""" | ||
| assert self.script_runner._detect_runtime("copilot --log-level all") == "copilot" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The updated codex detection still matches
codexanywhere in the command (as long as it’s preceded by whitespace). That means a copilot command likecopilot --model codex -p hello-world.prompt.mdwould still hit thiscodexbranch and be rewritten tocodex exec ..., becausecodex -p hello-world.prompt.mdsatisfies the regex. Since this section is explicitly for commands without env-var prefixes, the codex transform should only trigger whencodexis the leading command token (optionally after leading whitespace), and the extraction regex should be aligned to that same anchored shape.