Skip to content

Fix command prefix bug#18

Open
cynthia-d-lo wants to merge 3 commits into
mainfrom
clo/fix-command-prefix-bug
Open

Fix command prefix bug#18
cynthia-d-lo wants to merge 3 commits into
mainfrom
clo/fix-command-prefix-bug

Conversation

@cynthia-d-lo

Copy link
Copy Markdown
Contributor

Currently, if a user specifies a custom command prefix and the project directory does not match the source directory, we append --project <project dir> to the command prefix regardless of whether command-prefix is a uv command.

This pr ensures that the --project flag is only appended to uv commands.

@cynthia-d-lo cynthia-d-lo requested a review from fepegar June 22, 2026 15:57
@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown

@fepegar fepegar requested a review from Copilot June 22, 2026 16:06
@cynthia-d-lo cynthia-d-lo changed the title Clo/fix command prefix bug Fix command prefix bug Jun 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts how submit_to_aml() constructs the runtime command so that --project <dir> is only appended when the user’s command_prefix is a uv command, avoiding incorrect flag injection for non-uv prefixes when project_dir != source_dir.

Changes:

  • Gate the --project <relative dir> append behind a command_prefix uv-prefix check.
  • Keep existing behavior of computing the project path relative to source_dir for the job’s runtime command.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/submit_aml/aml.py Outdated
Comment on lines 490 to 492
if command_prefix.startswith("uv") and project_dir != source_dir:
relative_project_dir = project_dir.relative_to(source_dir)
command_prefix += f" --project {relative_project_dir}"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following

if command_prefix.startswith("uv run"):
logger.info('Adding debugpy to uv run command using "--with"')
command_prefix += " --with debugpy"
, I decided to narrow the check to .startswith("uv run")` in 675e038

I contemplated adding a use_uv flag instead, but I decided against it because it created a confusing user experience (users would always have to remember to unset use_uv when using a non-uv command_prefix).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants