Skip to content

fix(cli): only treat delimited run/executor/plugins prefixes as overwrites - #605

Open
ManoharPaturi wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
ManoharPaturi:fix/cli-prefixed-args-word-boundary
Open

fix(cli): only treat delimited run/executor/plugins prefixes as overwrites#605
ManoharPaturi wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
ManoharPaturi:fix/cli-prefixed-args-word-boundary

Conversation

@ManoharPaturi

Copy link
Copy Markdown

Fixes #604.

_parse_prefixed_args matched reserved prefixes with a bare startswith, so task parameters like runtime=, run_id=, executors=, plugins_dir= were rejected with "Run overwrites must start with 'run.'" before the task parser ever saw them.

Now an argument only belongs to the prefixed namespace when the prefix is directly followed by =, . or [. Keyword args fall through to the task parser; a bare token starting with the prefix still raises (the existing test for that case still passes).

Also fixed in the same function, found while testing:

  • prefix stripping used str.replace on every occurrence, so run.a.run.b=1 became a.b=1 (wrong parameter) — now only the first occurrence is stripped
  • values containing = were truncated at the first one (executor=k=vk) — now split("=", 1)

Tests: 4 new (word boundary, nested key not corrupted, value with =, end-to-end cli_execute with a runtime param). All fail on main, pass here. Rest of test/cli/ unchanged (only pre-existing py312 lazy-CLI failure).

Copilot AI lite review requested due to automatic review settings September 7, 2026 06:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

…_prefixed_args

The prefix detection in _parse_prefixed_args used startswith(prefix),
so any task argument whose parameter name merely starts with a reserved
prefix was rejected with a misleading error, e.g.:

  ValueError: Run overwrites must start with 'run.'. Got runtime=3600

Task parameters named runtime, run_id, executors, plugins_dir, etc.
crashed every CLI invocation. Prefixed args are now only matched when
directly followed by a delimiter ('=', '.', '['); keyword arguments for
task parameters are passed through untouched. Bare tokens starting with
the prefix still raise the original error.

Additionally, only the leading prefix occurrence is stripped (previously
run.a.run.b=1 was mangled to ab=1, silently targeting the wrong
parameter) and values containing '=' are no longer truncated
(executor=k=v previously yielded value 'k').

Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
@ManoharPaturi
ManoharPaturi force-pushed the fix/cli-prefixed-args-word-boundary branch from 84d2763 to c25b36c Compare September 7, 2026 16:36
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.

CLI crashes for task parameters starting with run/executor/plugins (e.g. runtime=…): "Run overwrites must start with 'run.'"

2 participants