Skip to content

Commit bb5971e

Browse files
ChenhanYuclaude
andcommitted
fix(launcher): address PR #1176 review feedback
core.py: fix SSH user precedence — explicit user arg now wins over slurm_config.user, which wins over getpass.getuser() query.py: - re-raise connection errors so datasets.map() halts the shard instead of silently swallowing them in worker processes - map developer-role messages to system per OpenAI schema conventions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: chenhany <chenhany@nvidia.com>
1 parent ba6ed6a commit bb5971e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

tools/launcher/common/query.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ def generate(self, messages, verbose=False, **chat_template_kwargs):
8181

8282
if "Connection error" in str(e):
8383
early_termination = True
84+
raise # propagate so datasets.map() halts the shard
8485

8586
new_message = None
8687

@@ -159,12 +160,15 @@ def synthesize(data):
159160
current_messages.append(stripped)
160161
else:
161162
current_messages.append(new_message)
163+
elif role == "developer":
164+
# Map developer-role messages to system per OpenAI schema conventions.
165+
current_messages.append({"role": "system", "content": msg["content"]})
162166
elif role == "assistant":
163167
# Original assistant messages are not used — the model generates fresh responses.
164168
pass
165169
else:
166-
# Skip unknown roles (e.g. tool) rather than raising; tool turns are
167-
# part of agentic datasets but are not sent to the generation model.
170+
# Skip unknown roles (e.g. tool) — agentic datasets include tool turns
171+
# that are not sent to the generation model.
168172
pass
169173

170174
# Restore the full reasoning trace for the last generated assistant turn.

tools/launcher/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def build_slurm_executor(
254254

255255
tunnel = run.SSHTunnel(
256256
host=slurm_config.host,
257-
user=getattr(slurm_config, "user", None) or (getpass.getuser() if user is None else user),
257+
user=user or getattr(slurm_config, "user", None) or getpass.getuser(),
258258
port=slurm_config.port,
259259
job_dir=job_dir,
260260
identity=identity,

0 commit comments

Comments
 (0)