diff --git a/apps/backend/runners/github/gh_client.py b/apps/backend/runners/github/gh_client.py index 84fa7b2b..c4476926 100644 --- a/apps/backend/runners/github/gh_client.py +++ b/apps/backend/runners/github/gh_client.py @@ -665,8 +665,9 @@ class GHClient: - issue_comments: General PR discussion comments """ # Fetch inline review comments - review_endpoint = f"repos/{{owner}}/{{repo}}/pulls/{pr_number}/comments" - review_args = ["api", review_endpoint, "-f", f"since={since_timestamp}"] + # Use query string syntax - the -f flag sends POST body fields, not query params + review_endpoint = f"repos/{{owner}}/{{repo}}/pulls/{pr_number}/comments?since={since_timestamp}" + review_args = ["api", review_endpoint] review_result = await self.run(review_args, raise_on_error=False) review_comments = [] @@ -677,8 +678,9 @@ class GHClient: logger.warning(f"Failed to parse review comments for PR #{pr_number}") # Fetch general issue comments - issue_endpoint = f"repos/{{owner}}/{{repo}}/issues/{pr_number}/comments" - issue_args = ["api", issue_endpoint, "-f", f"since={since_timestamp}"] + # Use query string syntax - the -f flag sends POST body fields, not query params + issue_endpoint = f"repos/{{owner}}/{{repo}}/issues/{pr_number}/comments?since={since_timestamp}" + issue_args = ["api", issue_endpoint] issue_result = await self.run(issue_args, raise_on_error=False) issue_comments = [] diff --git a/apps/backend/runners/github/services/followup_reviewer.py b/apps/backend/runners/github/services/followup_reviewer.py index 69799eeb..61a6ad79 100644 --- a/apps/backend/runners/github/services/followup_reviewer.py +++ b/apps/backend/runners/github/services/followup_reviewer.py @@ -543,10 +543,9 @@ class FollowupReviewer: Returns parsed AI response with finding resolutions and new findings, or None if AI review fails. """ - try: - from ...core.client import create_client - except ImportError: - from core.client import create_client + # Use raw Anthropic client for simple message API calls + # (ClaudeSDKClient is for agent sessions, not direct message calls) + import anthropic self._report_progress( "analyzing", 65, "Running AI-powered review...", context.pr_number @@ -624,16 +623,13 @@ Please analyze this follow-up review context and provide your response in the JS """ try: - # Create client and run the review - client = create_client( - project_dir=self.project_dir, - spec_dir=self.github_dir, - model=self.config.model or "claude-sonnet-4-5-20250929", - agent_type="qa_reviewer", - ) + # Create Anthropic client for simple message API call + # Note: For agent sessions with tools, use ClaudeSDKClient instead + client = anthropic.AsyncAnthropic() + model = self.config.model or "claude-sonnet-4-5-20250929" response = await client.messages.create( - model=self.config.model or "claude-sonnet-4-5-20250929", + model=model, max_tokens=4096, messages=[{"role": "user", "content": user_message}], )