From 00582a487c44e790c85aba39290b5afda87a25a6 Mon Sep 17 00:00:00 2001 From: Graham Neubig Date: Wed, 23 Jul 2025 10:35:48 -0400 Subject: [PATCH] Refactor get_microagents_from_org_or_user error handling (#9865) Co-authored-by: openhands --- openhands/runtime/base.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/openhands/runtime/base.py b/openhands/runtime/base.py index 084ec208cb..1423092579 100644 --- a/openhands/runtime/base.py +++ b/openhands/runtime/base.py @@ -49,6 +49,7 @@ from openhands.integrations.provider import ( ProviderHandler, ProviderType, ) +from openhands.integrations.service_types import AuthenticationError from openhands.microagent import ( BaseMicroagent, load_microagents_from_dir, @@ -701,12 +702,18 @@ fi GENERAL_TIMEOUT, org_openhands_repo, ) + except AuthenticationError as e: + self.log( + 'debug', + f'org-level microagent directory {org_openhands_repo} not found: {str(e)}', + ) + raise except Exception as e: self.log( - 'error', + 'debug', f'Failed to get authenticated URL for {org_openhands_repo}: {str(e)}', ) - raise Exception(str(e)) + raise clone_cmd = ( f'GIT_TERMINAL_PROMPT=0 git clone --depth 1 {remote_url} {org_repo_dir}' @@ -762,6 +769,11 @@ fi f'Clone command output: {clone_error_msg}', ) + except AuthenticationError as e: + self.log( + 'debug', + f'org-level microagent directory {org_openhands_repo} not found: {str(e)}', + ) except Exception as e: self.log( 'debug',