From cc5c2b14a8ae655d042c0c8e66481372b310ee6c Mon Sep 17 00:00:00 2001 From: Jeena Date: Thu, 24 Sep 2026 06:54:11 +0900 Subject: [PATCH] container: Report tool installer failures without a traceback A failing official installer aborted with a raw CalledProcessError traceback, burying the actual problem the installer had already printed to the terminal. Exit with a short message pointing at that output instead. --- agent-container.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/agent-container.py b/agent-container.py index ba76ea3..4bc8eb4 100755 --- a/agent-container.py +++ b/agent-container.py @@ -243,13 +243,20 @@ class AgentContainer: f"Installing {tool} into the container home " "(official installer, no sudo)..." ) - subprocess.run( - [ - "docker", "exec", self.container_name, "bash", "-lc", - spec["install"], - ], - check=True, - ) + try: + subprocess.run( + [ + "docker", "exec", self.container_name, "bash", "-lc", + spec["install"], + ], + check=True, + ) + except subprocess.CalledProcessError as e: + logger.error( + f"Installing {tool} failed with exit status " + f"{e.returncode}; see the installer output above." + ) + sys.exit(1) paths = spec["path"] if isinstance(spec["path"], list) else [spec["path"]] for path_expr in paths: self._ensure_path_entry(path_expr)