Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions scripts/langchain/issue_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,10 @@ def analyze_issue(issue_body: str, *, use_llm: bool = True) -> IssueOptimization
)
return result
except Exception as openai_error:
err_type = type(openai_error).__name__
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, consider whether extracting err_type here is the best approach. Lines 646 and 838 have similar error handling patterns but use type(e).__name__ inline without extraction. Either all four locations should extract the error type into a variable, or all should use inline extraction. Alternatively, if line length is the only concern, the f-string could be split without introducing the intermediate variable.

Copilot uses AI. Check for mistakes.
print(
f"OpenAI API also failed ({type(openai_error).__name__}: {openai_error}), using fallback",
f"OpenAI API also failed "
f"({err_type}: {openai_error}), using fallback",
file=sys.stderr,
)
else:
Expand Down Expand Up @@ -819,8 +821,10 @@ def apply_suggestions(
"used_llm": True,
}
except Exception as openai_error:
err_type = type(openai_error).__name__
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, consider whether extracting err_type here is the best approach. Lines 646 and 838 have similar error handling patterns but use type(e).__name__ inline without extraction. Either all four locations should extract the error type into a variable, or all should use inline extraction. Alternatively, if line length is the only concern, the f-string could be split without introducing the intermediate variable.

Copilot uses AI. Check for mistakes.
print(
f"OpenAI API also failed ({type(openai_error).__name__}: {openai_error}), using fallback",
f"OpenAI API also failed "
f"({err_type}: {openai_error}), using fallback",
file=sys.stderr,
)
else:
Expand Down
Loading