From b8fdbd9fabc937de540edaf90083aa9fbd7a53fb Mon Sep 17 00:00:00 2001 From: Hongming Wang Date: Fri, 1 May 2026 13:13:57 -0700 Subject: [PATCH] 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) --- scripts/build_runtime_package.py | 1 + workspace/inbox.py | 4 ++-- workspace/mcp_cli.py | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/build_runtime_package.py b/scripts/build_runtime_package.py index e6977e52..e95c5195 100755 --- a/scripts/build_runtime_package.py +++ b/scripts/build_runtime_package.py @@ -59,6 +59,7 @@ TOP_LEVEL_MODULES = { "agent", "agents_md", "config", + "configs_dir", "consolidation", "coordinator", "events", diff --git a/workspace/inbox.py b/workspace/inbox.py index 05e99382..28e1b46e 100644 --- a/workspace/inbox.py +++ b/workspace/inbox.py @@ -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" diff --git a/workspace/mcp_cli.py b/workspace/mcp_cli.py index 070bc661..1acb247a 100644 --- a/workspace/mcp_cli.py +++ b/workspace/mcp_cli.py @@ -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: