Skip to content
Merged
Show file tree
Hide file tree
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
16 changes: 11 additions & 5 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
# This file was autogenerated by uv via the following command:
# uv pip compile pyproject.toml --extra dev -o requirements-dev.lock
coverage==7.13.0
# via pytest-cov
# uv pip compile pyproject.toml --extra dev --universal --output-file requirements-dev.lock
colorama==0.4.6 ; sys_platform == 'win32'
# via pytest
black==24.10.0
# via my-project (pyproject.toml)
coverage==7.13.4
# via pytest-cov
iniconfig==2.3.0
# via pytest
mypy==1.18.2
mypy==1.19.1
# via my-project (pyproject.toml)
mypy-extensions==1.1.0
# via mypy
openpyxl==3.1.5
# via my-project (pyproject.toml)
packaging==25.0
# via pytest
pandas==2.2.3
# via my-project (pyproject.toml)
pathspec==0.12.1
# via mypy
pydantic==2.7.4
Expand All @@ -32,7 +38,7 @@ pytest==9.0.2
# pytest-cov
pytest-cov==7.0.0
# via my-project (pyproject.toml)
ruff==0.15.0
ruff==0.15.1
# via my-project (pyproject.toml)
tomlkit==0.13.3
# via my-project (pyproject.toml)
Expand Down
4 changes: 2 additions & 2 deletions scripts/langchain/followup_issue_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -988,11 +988,11 @@ def _invoke_llm(
) -> str:
"""Invoke LLM and return response text."""
try:
from langchain_core import messages as langchain_messages
import langchain_core.messages as lc_messages
except ModuleNotFoundError:
human_message_cls = None
else:
human_message_cls = getattr(langchain_messages, "HumanMessage", None)
human_message_cls = lc_messages.HumanMessage
Copy link

Copilot AI Feb 15, 2026

Choose a reason for hiding this comment

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

This refactoring changes the error handling behavior. The original code used getattr with a default of None, which would gracefully handle the case where HumanMessage doesn't exist in the module. The new code directly accesses lc_messages.HumanMessage, which will raise an AttributeError (not caught by the ModuleNotFoundError handler) if HumanMessage doesn't exist. While unlikely in practice since HumanMessage is a core class, this represents a functional change in error handling that deviates from the defensive programming pattern used in the original code.

Suggested change
human_message_cls = lc_messages.HumanMessage
human_message_cls = getattr(lc_messages, "HumanMessage", None)

Copilot uses AI. Check for mistakes.

config = _build_llm_config(
operation=operation,
Expand Down
3 changes: 1 addition & 2 deletions tests/test_validate_release_workflow_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ def _write_workflow(path: Path, *, extra: str = "") -> None:
name: release-${{ env.RELEASE_VERSION }}
path: release/${{ env.RELEASE_VERSION }}/
retention-days: 7
"""
+ extra,
""" + extra,
encoding="utf-8",
)

Expand Down
Loading