Repository navigation
Warn dstack skill about heredocs split across commands items - #4348
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dstack joins
commandsitems into one shell line with&&after stripping each item:dstack/src/dstack/_internal/server/services/jobs/configurators/base.py
Lines 600 to 606 in 0d578c8
So a heredoc that ends an item never sees its terminator: the next item lands on the terminator line, the rest of the script becomes heredoc text, and the run exits 0 without running anything after it. A trailing
# commentin an item silently drops the following items the same way.This hit a preset creation session for Qwen3.8-Flash-Next on 4xH200: the agent split a heredoc writing the nginx config into its own
commandsitem, so the final verification service exited 0 after the model download without starting the engines. The agent took about 10 minutes to notice and relaunch, which delayed the preset by ~10 minutes of idle 4xH200 time plus a second service launch.dstackskill (also bundled into the preset agent) to keep multi-line shell such as heredocs inside onecommandsitem and to avoid trailing comments.The underlying joining in
_join_shell_commandsis unchanged; making it heredoc-safe is a separate fix.