@@ -64,9 +64,10 @@ def __init__(
6464
6565 def _run_phase (self , repo_dir : Path , prompt : str , model : str , phase_name : str ) -> Tuple [bool , Dict [str , Any ], str ]:
6666 raw_result = None
67- if hasattr (self .claude_runner , "run_prompt" ):
67+ supports_run_prompt = callable (getattr (type (self .claude_runner ), "run_prompt" , None ))
68+ if supports_run_prompt :
6869 raw_result = self .claude_runner .run_prompt (repo_dir , prompt , model = model )
69- if not ( isinstance ( raw_result , tuple ) and len ( raw_result ) == 3 ) and hasattr (self .claude_runner , "run_code_review" ):
70+ elif hasattr (self .claude_runner , "run_code_review" ):
7071 try :
7172 raw_result = self .claude_runner .run_code_review (repo_dir , prompt , model = model )
7273 except TypeError :
@@ -87,6 +88,13 @@ def _run_phase(self, repo_dir: Path, prompt: str, model: str, phase_name: str) -
8788 return False , {}, f"Failed to parse { phase_name } output"
8889 return True , parsed , ""
8990
91+ def _is_excluded (self , filepath : str ) -> bool :
92+ checker = getattr (self .github_client , "is_excluded" , None )
93+ if callable (checker ):
94+ return bool (checker (filepath ))
95+ # Fallback for current client/tests that still expose private method.
96+ return bool (self .github_client ._is_excluded (filepath ))
97+
9098 def _collect_phase_findings (self , phase_result : Dict [str , Any ], source_agent : str ) -> List [Dict [str , Any ]]:
9199 findings : List [Dict [str , Any ]] = []
92100 for finding in phase_result .get ("findings" , []):
@@ -125,7 +133,7 @@ def run(
125133 original_count = len ([f for f in triage_result .get ("findings" , []) if isinstance (f , dict )])
126134 legacy_findings = []
127135 for finding in triage_result .get ("findings" , []):
128- if isinstance (finding , dict ) and not self .github_client . _is_excluded (finding .get ("file" , "" )):
136+ if isinstance (finding , dict ) and not self ._is_excluded (finding .get ("file" , "" )):
129137 legacy_findings .append (self ._ensure_review_type (finding ))
130138 pr_context = {
131139 "repo_name" : pr_data .get ("head" , {}).get ("repo" , {}).get ("full_name" , "unknown" ),
@@ -255,7 +263,7 @@ def run(
255263 "description" : pr_data .get ("body" , "" ),
256264 }
257265 kept_findings = validated
258- original_count = len (validated )
266+ original_count = len (all_candidates )
259267 filter_response = self .findings_filter .filter_findings (validated , pr_context )
260268 if isinstance (filter_response , tuple ) and len (filter_response ) == 3 :
261269 filter_success , filter_results , _ = filter_response
@@ -266,7 +274,7 @@ def run(
266274 for finding in kept_findings :
267275 if not isinstance (finding , dict ):
268276 continue
269- if self .github_client . _is_excluded (finding .get ("file" , "" )):
277+ if self ._is_excluded (finding .get ("file" , "" )):
270278 continue
271279 final_findings .append (self ._ensure_review_type (finding ))
272280
0 commit comments