Removed unneeded code
This commit is contained in:
parent
15fa6cef49
commit
5d28388bc3
|
@ -346,7 +346,7 @@ class AiderCodeSolver(CodeSolverStrategy):
|
|||
aider_command = self._create_aider_command(issue_content)
|
||||
aider_did_not_crash = run_cmd(
|
||||
aider_command,
|
||||
repository_path,
|
||||
cwd=repository_path,
|
||||
check=False,
|
||||
)
|
||||
if not aider_did_not_crash:
|
||||
|
@ -381,13 +381,6 @@ class ClaudeCodeSolver(CodeSolverStrategy):
|
|||
|
||||
def solve_issue_round(self, repository_path: Path, issue_content: str) -> bool:
|
||||
"""Solve an issue using Claude Code."""
|
||||
import json
|
||||
import os
|
||||
|
||||
# Set Anthropic API key environment variable
|
||||
env = os.environ.copy()
|
||||
env['ANTHROPIC_API_KEY'] = secrets.anthropic_api_key()
|
||||
|
||||
# Prepare the issue prompt for Claude Code
|
||||
enhanced_issue = CLAUDE_CODE_MESSAGE_FORMAT.format(
|
||||
issue=issue_content,
|
||||
|
@ -399,31 +392,12 @@ class ClaudeCodeSolver(CodeSolverStrategy):
|
|||
claude_command = self._create_claude_command(enhanced_issue)
|
||||
|
||||
# Run Claude Code
|
||||
result = subprocess.run(
|
||||
run_cmd(
|
||||
claude_command,
|
||||
cwd=repository_path,
|
||||
env=env,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
check=False,
|
||||
)
|
||||
|
||||
if result.returncode != 0:
|
||||
logger.error('Claude Code failed with return code %d', result.returncode)
|
||||
logger.error('stderr: %s', result.stderr)
|
||||
return False
|
||||
|
||||
# Parse response if it's JSON
|
||||
try:
|
||||
if result.stdout.strip():
|
||||
response_data = json.loads(result.stdout)
|
||||
logger.info(
|
||||
'Claude Code response: %s',
|
||||
response_data.get('text', 'No text field'),
|
||||
)
|
||||
except json.JSONDecodeError:
|
||||
logger.info('Claude Code response (non-JSON): %s', result.stdout[:500])
|
||||
|
||||
# Run post-solver cleanup
|
||||
run_post_solver_cleanup(repository_path, 'Claude Code')
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user