Skip to content

style(miles): move radix os import to module scope#9

Open
TianyeGGBond wants to merge 1 commit into
rlops:zhenyu/m11-mvp-testfrom
TianyeGGBond:zhenyu/radix-top-level-os-import
Open

style(miles): move radix os import to module scope#9
TianyeGGBond wants to merge 1 commit into
rlops:zhenyu/m11-mvp-testfrom
TianyeGGBond:zhenyu/radix-top-level-os-import

Conversation

@TianyeGGBond
Copy link
Copy Markdown

Context

This is a small style cleanup for the RLix guard in RadixTreeMiddleware.

The code had a local import:

import os as _os  # local import ? module top imports must change

That comment is self-contradictory: it says the import belongs at module scope while keeping it local. There is also no practical reason to delay-import os; it is a standard-library module, and the nearby RLix-mode call sites in router.py and multi_turn.py already use top-level import os.

Change

  • Move os to the module import block.
  • Use os.environ directly in the RLix-mode guard.
  • Keep behavior unchanged: RLIX_CONTROL_PLANE=rlix still rejects RadixTreeMiddleware initialization.

Validation

Passed:

python -m compileall miles/router/middleware_hub/radix_tree_middleware.py
git diff --check origin/zhenyu/m11-mvp-test..HEAD

Also ran a focused initialization check with temporary local import stubs for heavy optional dependencies missing in this Windows environment. With RLIX_CONTROL_PLANE=rlix, RadixTreeMiddleware(...) still raises the expected RuntimeError.

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