extract_relevant_lines_str breaks the review block when the extracted lines contain a code fence
extract_relevant_lines_str in pr_agent/algo/utils.py wraps the extracted lines in a hard-coded triple-backtick fence. When those lines contain a fence of their own, the inner one closes the outer one and everything after it, including </details>, falls inside the code block; confirmed through the GitHub and Gitea markdown APIs. The fix is a _get_fence helper that picks a backtick or tilde fence the content cannot close. First fixed by @evandrocoan in #2312. Separately, issue_content is interpolated into the same <details> template with no fence handling and wants its own change.
Reference implementation with tests: carry/2312-fence-escaping (from #2945, evandrocoan's commits preserved). A PR from that branch, or your own fix, is welcome.
Source: The-PR-Agent/pr-agent