simplify(compat): terminal/file/environments — drop 42 re-exports/aliases, repoint 20 callers + 41 test files

tools/terminal_tool.py: drop 30 pure re-export names (lifecycle/config/backends/
sudo/guards/result/interrupt/utils/_DockerEnvironment/is_managed_tool_gateway_ready)
and the noqa-F401 comments on the 25 names the facade itself uses. Sibling modules
(terminal_tool_backends/_result/_sudo/_lifecycle, environments/base, process_registry)
that read removed names through the facade now import from the defining module.
tools/environments/base.py: drop 11 re-exports (base_output/base_session_env/
path_utils) and the BaseEnvironment.stop() compat alias (no in-tree caller; the
lifecycle hasattr(env, 'stop') fallback stays for third-party envs).
tools/environments/docker.py: drop 1 re-export + the re-export comment.
Callers/tests repointed to tools.terminal_tool_{lifecycle,backends,sudo,config,
guards,result}, tools.interrupt, tools.environments.{base_output,base_session_env,
path_utils}.
This commit is contained in:
Teknium
2026-09-03 13:29:55 -07:00
parent fcbe4acbef
commit f6938b37f3
75 changed files with 683 additions and 645 deletions
+2 -2
View File
@@ -12151,9 +12151,9 @@ def test_session_info_includes_mcp_servers(monkeypatch):
{"name": "filesystem", "transport": "stdio", "tools": 4, "connected": True},
{"name": "broken", "transport": "stdio", "tools": 0, "connected": False},
]
fake_mod = types.ModuleType("tools.mcp_tool")
fake_mod = types.ModuleType("tools.mcp_tool_discovery")
fake_mod.get_mcp_status = lambda: fake_status
monkeypatch.setitem(sys.modules, "tools.mcp_tool", fake_mod)
monkeypatch.setitem(sys.modules, "tools.mcp_tool_discovery", fake_mod)
info = server._session_info(types.SimpleNamespace(tools=[], model="", provider="openai-codex"))