From 833876ac1ce69e37664519d8eb06f1a243c585d8 Mon Sep 17 00:00:00 2001 From: Mason Daugherty <61371264+mdrxy@users.noreply.github.com> Date: Tue, 7 Jul 2026 21:27:29 +0000 Subject: [PATCH 1/2] fix(code): dedupe update/install log path output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The update and install log messages printed the full log path twice — once as "Update log:/Install log:" and again in the "Tail progress: tail -f " line. Collapse each to a single line showing the path once with a "(tail -f to follow)" hint. Co-authored-by: open-swe[bot] --- libs/code/deepagents_code/main.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libs/code/deepagents_code/main.py b/libs/code/deepagents_code/main.py index 2b293edc84f..216f3f223af 100644 --- a/libs/code/deepagents_code/main.py +++ b/libs/code/deepagents_code/main.py @@ -2973,7 +2973,7 @@ def cli_main() -> None: sys.exit(0) log_path = create_update_log_path() console.print( - f"Update log: {log_path}\nTail progress: tail -f {log_path}", + f"Update log: {log_path} (tail -f to follow)", style="dim", highlight=False, markup=False, @@ -3094,8 +3094,7 @@ def cli_main() -> None: console.print(f"Installing package '{package}'...") pkg_log_path = create_update_log_path() console.print( - f"Install log: {pkg_log_path}\n" - f"Tail progress: tail -f {pkg_log_path}", + f"Install log: {pkg_log_path} (tail -f to follow)", style="dim", highlight=False, markup=False, @@ -3205,7 +3204,7 @@ def cli_main() -> None: console.print(f"Installing extra '{extra}'...") log_path = create_update_log_path() console.print( - f"Install log: {log_path}\nTail progress: tail -f {log_path}", + f"Install log: {log_path} (tail -f to follow)", style="dim", highlight=False, markup=False, From 1d4c45fbe1e461d83ab19f5335a9bb919b8cd7a7 Mon Sep 17 00:00:00 2001 From: Mason Daugherty Date: Wed, 8 Jul 2026 20:19:29 -0400 Subject: [PATCH 2/2] cr --- libs/code/deepagents_code/main.py | 14 ++++++++++---- libs/code/tests/unit_tests/test_main.py | 2 ++ libs/code/tests/unit_tests/test_main_args.py | 2 ++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/libs/code/deepagents_code/main.py b/libs/code/deepagents_code/main.py index 216f3f223af..5c7a3779421 100644 --- a/libs/code/deepagents_code/main.py +++ b/libs/code/deepagents_code/main.py @@ -15,6 +15,7 @@ import json import logging import os +import shlex import shutil import sys import traceback @@ -40,6 +41,11 @@ """Marker stored by `--sandbox` with no value, resolved to `[sandboxes].default`.""" +def _tail_log_command(log_path: Path | str) -> str: + """Return a copy-pasteable command for following a log file.""" + return f"tail -f {shlex.quote(str(log_path))}" + + def build_version_text() -> str: """Build the plain-text output for the `--version` CLI flag. @@ -371,7 +377,7 @@ def _run_startup_auto_update(console: "Console") -> None: return log_path = create_update_log_path() console.print( - f"Progress: tail -f {log_path}", + f"Update log: {_tail_log_command(log_path)}", style="dim", highlight=False, markup=False, @@ -2973,7 +2979,7 @@ def cli_main() -> None: sys.exit(0) log_path = create_update_log_path() console.print( - f"Update log: {log_path} (tail -f to follow)", + f"Update log: {_tail_log_command(log_path)}", style="dim", highlight=False, markup=False, @@ -3094,7 +3100,7 @@ def cli_main() -> None: console.print(f"Installing package '{package}'...") pkg_log_path = create_update_log_path() console.print( - f"Install log: {pkg_log_path} (tail -f to follow)", + f"Install log: {_tail_log_command(pkg_log_path)}", style="dim", highlight=False, markup=False, @@ -3204,7 +3210,7 @@ def cli_main() -> None: console.print(f"Installing extra '{extra}'...") log_path = create_update_log_path() console.print( - f"Install log: {log_path} (tail -f to follow)", + f"Install log: {_tail_log_command(log_path)}", style="dim", highlight=False, markup=False, diff --git a/libs/code/tests/unit_tests/test_main.py b/libs/code/tests/unit_tests/test_main.py index 11674640b7f..7eff59c0d4a 100644 --- a/libs/code/tests/unit_tests/test_main.py +++ b/libs/code/tests/unit_tests/test_main.py @@ -132,6 +132,8 @@ def test_successful_update_restarts_before_launch(self) -> None: _run_startup_auto_update(console) upgrade.assert_awaited_once() + printed = " ".join(str(c.args[0]) for c in console.print.call_args_list) + assert "tail -f /tmp/dcode-update.log" in printed restart.assert_called_once_with() def test_successful_update_skips_restart_when_shadowed(self) -> None: diff --git a/libs/code/tests/unit_tests/test_main_args.py b/libs/code/tests/unit_tests/test_main_args.py index 3adf64aa4ff..d780468fd59 100644 --- a/libs/code/tests/unit_tests/test_main_args.py +++ b/libs/code/tests/unit_tests/test_main_args.py @@ -1937,6 +1937,7 @@ def test_success_renders_installed_message(self) -> None: assert code == 0 text = self._printed_text(console_mock) assert "Installed extra 'quickjs'" in text + assert "tail -f /tmp/deepagents-install.log" in text def test_failure_renders_log_path_and_manual_command(self) -> None: """A failed install surfaces both the log path and manual script command.""" @@ -2106,6 +2107,7 @@ def test_package_with_yes_runs(self) -> None: perform_mock.assert_awaited_once() text = self._printed_text(console_mock) assert "Installed package 'langchain-custom'" in text + assert "tail -f /tmp/deepagents-install.log" in text def test_package_non_interactive_without_yes_refuses(self) -> None: """Non-TTY stdin + no --yes must exit 2 without installing."""