Skip to content

[BUG] Generated scripts break when REMOTE_ROOT contains spaces #667

Description

@njzjz-bot

Summary

Generated scheduler scripts expand $REMOTE_ROOT without shell quoting. Any LocalContext or SSH configuration whose remote root contains whitespace is split into multiple arguments, so cd, source, marker-file writes, and failure diagnostics target the wrong path and the job is reported as failed after retries.

Reproduction

A minimal Shell + LocalContext submission with remote_root set to a path such as /tmp/dpdispatcher/remote root and a task such as echo hello fails on current master. The generated script contains commands like:

cd $REMOTE_ROOT
echo 0 > $REMOTE_ROOT/<job>_flag_if_job_task_fail

The shell treats the expanded path as multiple words; the task never reaches its intended working directory. The same unquoted expansion is used by source $REMOTE_ROOT/<job>.sub.run, the task script, and the PEP 723 script path appended in dpdispatcher/run.py.

This is consistent with the path-with-spaces failure reported in the older #648 discussion, but the current master code still emits the unquoted expansions.

Expected behavior

Remote roots containing spaces should either execute correctly or be rejected explicitly. Since path values are already accepted and quoted when REMOTE_ROOT is initialized, generated uses should preserve the path as one shell word.

Suggested fix

Use quoted variable expansions such as "$REMOTE_ROOT/..." (or ${REMOTE_ROOT} inside double quotes) at every generated-script use, including the PEP 723 script argument. Add a local execution regression test with a remote root containing spaces.

Coding agent: Codex
Codex version: codex-cli 0.151.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions