Coverage for core/langgraph/_builtins_pr.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.16.0, created at 2026-09-28 00:19 +0000

1"""_builtins_pr.py — PR-review builtins (lazy-loaded, needs httpx).""" 

2 

3from __future__ import annotations 

4 

5from typing import Any 

6 

7# The findings-formatting helper lives in the per-tool module 

8# tools/github_pr_comment.py (single source). Re-exported because existing 

9# importers (tests) resolve it from this module. 

10try: 

11 from tools.github_pr_comment import _format_findings_as_markdown 

12except ImportError: # pragma: no cover — main.py run (qualified imports) 

13 from langgraph.tools.github_pr_comment import _format_findings_as_markdown 

14 

15 

16def builtin_github_pr_comment(step: dict, state: dict) -> dict: 

17 try: 

18 from tools.github_pr_comment import github_pr_comment as _exec 

19 except ImportError: # pragma: no cover — main.py run (qualified imports) 

20 from langgraph.tools.github_pr_comment import github_pr_comment as _exec 

21 return _exec(step, state) 

22 

23 

24def register_all(executor: Any) -> None: 

25 executor.register("github-pr-comment", builtin_github_pr_comment)