Skip to content

fix: validate launcher service env before PTY launch#44

Open
haosenwang1018 wants to merge 2 commits intomodelscope:mainfrom
haosenwang1018:fix/validate-service-env-before-launch
Open

fix: validate launcher service env before PTY launch#44
haosenwang1018 wants to merge 2 commits intomodelscope:mainfrom
haosenwang1018:fix/validate-service-env-before-launch

Conversation

@haosenwang1018
Copy link
Copy Markdown

@haosenwang1018 haosenwang1018 commented Apr 10, 2026

Summary

  • fail fast with a clear launcher error when *_PATH or *_SCRIPT env vars are missing for PTY-managed services
  • validate that configured service paths exist before invoking LaunchCommandWhenAbsent
  • add focused launcher tests for missing-env rejection and successful PTY launch wiring

Testing

  • python -m pytest tests/test_launcher.py -q

Closes #9

The LlmDedupSamplingExploreStrategy class was using EnvWorkerWithPrompt
which doesn't exist. Based on issue modelscope#31 and comparison with the similar
LlmRandomSamplingExploreStrategy, this should use EnvWorker instead.

Changes:
- Import EnvWorker and TrajExpConfig
- Replace EnvWorkerWithPrompt instantiation with EnvWorker using correct
  interface (task, config, thread_index, tokenizer)
- Update execute() call to include required parameters (traj_exp_config,
  tmux, stop) matching the pattern used in random strategy

Fixes modelscope#31
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the LlmDedupExploreStrategy to use EnvWorker instead of EnvWorkerWithPrompt, updating the execution parameters to include trajectory configuration and execution controls. It also introduces a robust environment variable validation helper in launcher.py along with new unit tests. A regression was identified in the deduplication strategy where the environment service URL is no longer explicitly passed to the worker, which may ignore custom configuration overrides provided during initialization.

Comment on lines +58 to 63
env_worker = EnvWorker(
task=task,
config=self._config,
thread_index=0,
tokenizer=self._tokenizer,
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The transition from EnvWorkerWithPrompt to EnvWorker ignores self._env_service_url. Previously, this URL was explicitly passed to the worker (line 60 on the LEFT side). Now, EnvWorker relies on self._config.env_service.env_url internally, which means any custom environment URL provided during the strategy's initialization (via kwargs) is ignored. This is a regression in functionality that prevents overriding the environment service URL for this specific strategy.

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.

Launcher crashes when REME_PATH/REME_SCRIPT are unset

1 participant