From 04011230081cfb54cd3b652d709273b8de837d9f Mon Sep 17 00:00:00 2001 From: Aaron Yordanyan Date: Sat, 14 Jun 2025 10:19:12 +0400 Subject: [PATCH] Refine Docker configuration handling and documentation - Updated exception handling in `agent.py` for better error specificity (catching `FileNotFoundError`). - Added contextual comment for `CONFIG_FILE_DOCKER` in `agent.py`. - Updated `DOCKER.md` to reflect the new GitHub repository link. --- DOCKER.md | 2 +- src/serena/agent.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DOCKER.md b/DOCKER.md index 04f8ca6e..45e0f5c8 100644 --- a/DOCKER.md +++ b/DOCKER.md @@ -158,4 +158,4 @@ We're working on: - Dynamic port allocation - Windows line-ending handling -For updates and issues, please check the [GitHub repository](https://github.com/AbanteAI/serena). \ No newline at end of file +For updates and issues, please check the [GitHub repository](https://github.com/diazoxide/serena). diff --git a/src/serena/agent.py b/src/serena/agent.py index c6021a13..512a8fe2 100644 --- a/src/serena/agent.py +++ b/src/serena/agent.py @@ -111,7 +111,7 @@ def is_running_in_docker() -> bool: try: with open('/proc/self/cgroup', 'r') as f: return 'docker' in f.read() - except: + except FileNotFoundError: return False @@ -328,7 +328,7 @@ class SerenaConfig(SerenaConfigBase): loaded_commented_yaml: CommentedMap CONFIG_FILE = "serena_config.yml" - CONFIG_FILE_DOCKER = "serena_config.docker.yml" + CONFIG_FILE_DOCKER = "serena_config.docker.yml" # Docker-specific config file; auto-generated if missing, mounted via docker-compose for user customization @classmethod def autogenerate(cls) -> None: