Skip to content

refactor(rlix): use shared is_rlix_mode() in multi_turn generate#29

Open
TianyeGGBond wants to merge 1 commit into
rlops:zhenyu/m11-mvp-testfrom
TianyeGGBond:tianye/f11-multi-turn-shared-is-rlix-mode
Open

refactor(rlix): use shared is_rlix_mode() in multi_turn generate#29
TianyeGGBond wants to merge 1 commit into
rlops:zhenyu/m11-mvp-testfrom
TianyeGGBond:tianye/f11-multi-turn-shared-is-rlix-mode

Conversation

@TianyeGGBond

Copy link
Copy Markdown

Context

miles/rollout/generate_hub/multi_turn.py defined a private
_is_rlix_mode() that hand-copied the
os.environ.get("RLIX_CONTROL_PLANE") == "rlix" check already owned by
the canonical is_rlix_mode() in miles/utils/rlix_validation.py.

The duplicate's docstring justified itself as avoiding an import
dependency ("multi_turn must remain importable even when the
rlix_validation module is absent in legacy installations"). That
rationale does not hold: rlix_validation imports only the stdlib
(os / shutil / logging / typing), so importing it is free and
cannot break importability. The result was a second, drifting copy of
the env-flag contract.

Change points

  • Import is_rlix_mode from miles.utils.rlix_validation
  • Delete the duplicate _is_rlix_mode() function
  • Update the one call site (rlix_mode = _is_rlix_mode()is_rlix_mode())
  • Drop the now-unused import os

No behavior change. Diff: 2 insertions / 9 deletions in 1 file.

🤖 Generated with Claude Code

multi_turn defined a private _is_rlix_mode() that hand-copied the
`os.environ.get("RLIX_CONTROL_PLANE") == "rlix"` check, duplicating the
canonical helper in miles/utils/rlix_validation.py. Its stated reason was
to avoid importing rlix_validation, but that module only depends on the
stdlib (os/shutil/logging/typing), so importing it is free and cannot
break importability.

Import is_rlix_mode() directly, drop the duplicate function and the now
unused `import os`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant