fix(runtime): register configs_dir in TOP_LEVEL_MODULES + drop alias

Wheel-build smoke gate detected `configs_dir` missing from
scripts/build_runtime_package.py:TOP_LEVEL_MODULES. Without it the
build would ship `import configs_dir` un-rewritten and every
external-runtime install would die on `ModuleNotFoundError` at first
import.

Two callers used `import configs_dir as _configs_dir` to belt-and-
suspenders against an imagined name collision, but the rewriter
rejects `import X as Y` because the rewrite would produce
`import molecule_runtime.X as X as Y` (invalid syntax). No actual
collision exists (only docstring/comment references). Switched to
plain `import configs_dir`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Hongming Wang 2026-05-01 13:13:57 -07:00
parent c636022d2f
commit b8fdbd9fab
3 changed files with 6 additions and 5 deletions

View File

@ -59,6 +59,7 @@ TOP_LEVEL_MODULES = {
"agent",
"agents_md",
"config",
"configs_dir",
"consolidation",
"coordinator",
"events",

View File

@ -55,7 +55,7 @@ from dataclasses import dataclass, field
from pathlib import Path
from typing import Any, Callable
import configs_dir as _configs_dir
import configs_dir
logger = logging.getLogger(__name__)
@ -524,4 +524,4 @@ def default_cursor_path() -> Path:
+ .platform_inbound_secret regardless of whether the runtime is
in-container (/configs) or external (~/.molecule-workspace).
"""
return _configs_dir.resolve() / ".mcp_inbox_cursor"
return configs_dir.resolve() / ".mcp_inbox_cursor"

View File

@ -41,7 +41,7 @@ import threading
import time
from pathlib import Path
import configs_dir as _configs_dir
import configs_dir
logger = logging.getLogger(__name__)
@ -380,7 +380,7 @@ def main() -> None:
# env-fallback). configs_dir.resolve() handles in-container vs
# external-runtime fallback so we don't probe a non-existent
# /configs on a laptop and falsely report no-token-file.
has_token_file = (_configs_dir.resolve() / ".auth_token").is_file()
has_token_file = (configs_dir.resolve() / ".auth_token").is_file()
has_token_env = bool(os.environ.get("MOLECULE_WORKSPACE_TOKEN", "").strip())
if not has_token_file and not has_token_env:
missing.append("MOLECULE_WORKSPACE_TOKEN (or CONFIGS_DIR/.auth_token)")
@ -473,7 +473,7 @@ def _read_token_file() -> str:
to inline a 4-line file read than pull in the whole stack just for
the path).
"""
path = _configs_dir.resolve() / ".auth_token"
path = configs_dir.resolve() / ".auth_token"
if not path.is_file():
return ""
try: