fix(compat-fallout): repoint 3 live imports of dropped facade names (cli_stream_mixin is_table_divider/looks_like_table_row -> agent.markdown_tables; /bg AIAgent -> run_agent; code_execution_tool _ssh_config_from_config -> terminal_tool_backends); repoint approval-ui test patch target

This commit is contained in:
Teknium
2026-09-03 15:43:04 -07:00
parent 4fcd9ede33
commit 6d39f797e6
4 changed files with 8 additions and 9 deletions
+2 -2
View File
@@ -1900,8 +1900,8 @@ class CLICommandsMixin:
def _handle_background_command(self, cmd: str):
"""Handle /bg <prompt> — run a prompt in a separate background session (its own AIAgent
on a thread); the result prints here without touching the active history."""
from cli import (
AIAgent, set_approval_callback, set_secret_capture_callback, set_sudo_password_callback)
from cli import set_approval_callback, set_secret_capture_callback, set_sudo_password_callback
from run_agent import AIAgent
prompt = _command_arg(cmd)
if not prompt:
return _cp(" Usage: /bg <prompt>", " Example: /bg Summarize the top HN stories today",
+4 -4
View File
@@ -377,9 +377,9 @@ class CLIStreamMixin:
def _emit_stream_text(self, text: str) -> None:
"""Emit filtered text to the streaming display."""
from agent.markdown_tables import is_table_divider, looks_like_table_row
from cli import (
HermesCLI, _ACCENT, _RST, _STREAM_PARTIAL_PREVIEW_LEN, _cprint, _strip_markdown_syntax,
datetime, is_table_divider, looks_like_table_row)
HermesCLI, _ACCENT, _RST, _STREAM_PARTIAL_PREVIEW_LEN, _cprint, _strip_markdown_syntax, datetime)
if not text:
return
# Defer content while the reasoning box renders so reasoning always lands BEFORE it.
@@ -451,8 +451,8 @@ class CLIStreamMixin:
def _flush_stream(self) -> None:
"""Emit any remaining partial line from the stream buffer and close the box."""
from cli import (
_ACCENT, _RST, _cprint, _strip_markdown_syntax, is_table_divider, looks_like_table_row)
from agent.markdown_tables import is_table_divider, looks_like_table_row
from cli import _ACCENT, _RST, _cprint, _strip_markdown_syntax
# Still inside a "reasoning block" at end-of-stream = false positive (the model
# mentioned a tag in prose and never closed it): recover the buffer as regular text.
if getattr(self, "_in_reasoning_block", False) and getattr(self, "_stream_prefilt", ""):
+1 -1
View File
@@ -245,7 +245,7 @@ class TestCliApprovalUi:
"failed": False,
}
with patch.object(cli_module, "AIAgent", FakeAgent), \
with patch("run_agent.AIAgent", FakeAgent), \
patch.object(cli_module, "_cprint"), \
patch.object(cli_module, "ChatConsole") as chat_console:
chat_console.return_value.print = MagicMock()
+1 -2
View File
@@ -404,12 +404,11 @@ _CONTAINER_CONFIG_DEFAULTS = (
def _get_or_create_env(task_id: str):
"""``(env, env_type)`` — the environment the terminal/file tools share for *task_id*, created on
first use (same double-checked per-task lock pattern as file_tools._get_file_ops)."""
from tools.terminal_tool_backends import _create_environment
from tools.terminal_tool_backends import _create_environment, _ssh_config_from_config
from tools.terminal_tool import (
_active_environments, _env_lock, _get_env_config, _last_activity,
_start_cleanup_thread, _creation_locks, _creation_locks_lock, _task_env_overrides,
_resolve_container_task_id, _resolve_task_host_cwd, _is_container_backend, _select_image,
_ssh_config_from_config,
)
effective_task_id = _resolve_container_task_id(task_id)
def _cached():