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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and the versioning follows [Semantic Versioning](https://semver.org/).

- Binary files in the diff (images, office documents, PDFs, …) now show their Git LFS status — a "Git LFS · <size>" tag for LFS-managed files, or a "⚠ Not LFS" tag for files stored inline in git.
- Comments can now be anchored to a whole file (not only a single line) where the platform supports it (Bitbucket / GitHub): a "comment on file" entry in the diff, and existing file-level comments now display correctly instead of being shown as generic PR comments.
- Reviews now pick up the reviewed repository's own guidance file (`AGENTS.md`) as project context, so the review, description, and suggestions follow the project's stated conventions.

## [0.11.0] - 2026-07-07

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

- diff 中的二进制文件(图片、Office 文档、PDF 等)现会显示其 Git LFS 状态——受 LFS 管理的文件显示「Git LFS · <大小>」标记,直接内联存入 git 的文件显示「⚠ 非 LFS」标记。
- 现可对整个文件(而不仅是某一行)添加评论(平台支持时,Bitbucket / GitHub):diff 中新增「对文件评论」入口,且已存在的文件级评论现能正确归属显示,不再被当作 PR 通用评论。
- 评审现会读取被审仓库自身的规范文件(`AGENTS.md`)作为项目上下文,使评审、描述与建议遵循该项目既定的约定。

## [0.11.0] - 2026-07-07

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""LocalGitProvider patch (version-guarded): binary-safe get_diff_files + get_line_link anchor."""
"""LocalGitProvider patch (version-guarded): binary-safe get_diff_files + get_line_link anchor + repo-context file fetch."""
from ..runtime import _EXPECTED_PRAGENT_VERSION, _pragent_version, _warn


Expand Down Expand Up @@ -122,3 +122,29 @@ def get_pr_labels(self, update=False):
return []

module.LocalGitProvider.get_pr_labels = get_pr_labels

# get_repo_file_content: pr-agent 0.39.0's configuration.toml ships a new default
# `repo_context_files = ["AGENTS.md"]` — build_repo_context() fetches those files from the reviewed
# repo and injects them as <instruction_files> so /review /describe /improve follow the project's own
# conventions. The base class returns "" (no-op), so LocalGitProvider is judged "does not support
# repository file fetching" and logs a WARNING each run while silently skipping the feature. Implement it
# by reading the blob straight from the base branch's tree object (not the working tree): the review's diff
# is head.commit vs merge-base(target_branch_name), and target_branch_name is the branch the PR merges
# into — the trusted "default/base branch" content the feature wants (repo_context_from_default_branch=true).
# Reading the tree object (never the working tree) also keeps this independent of _prepare_repo's working-tree
# sanitizing of agent instruction files (that guards the /ask CLI subprocess; repo_context serves the other
# tools). A missing file / any git error degrades to "" (no context) rather than raising, so
# build_repo_context treats it as "no context" and never caches a fetch error.
def get_repo_file_content(self, file_path, from_default_branch=False):
rel = (file_path or "").lstrip("/")
if not rel:
return ""
try:
# For a local provider there is no remote "default branch" distinct from the PR base, so both the
# default-branch and target-branch cases collapse to target_branch_name (guaranteed to exist by
# _prepare_repo). `git show <ref>:<path>` returns the file text, or errors if the path is absent.
return self.repo.git.show(f"{self.target_branch_name}:{rel}")
except Exception:
return ""

module.LocalGitProvider.get_repo_file_content = get_repo_file_content
1 change: 1 addition & 0 deletions docs/arch/02-agent/05-pragent-runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Current patches:
letting `/review`'s key_issues render with a structured file:line.
- **Anthropic drops temperature**: new Claude models deprecate temperature, so all `anthropic/*` are put into the "don't send temperature" set.
- **load_yaml tolerance**: an anchor marker taking a whole line breaks YAML → on parse failure, strip the marker and retry, avoiding a whole review crash.
- **repo-context file fetch**: pr-agent 0.39.0 defaults `repo_context_files = ["AGENTS.md"]`, but `LocalGitProvider` inherits the base no-op `get_repo_file_content` → the feature is skipped with a per-run WARNING. Implement it by reading the blob from the base branch's tree (`git show <target_branch>:<path>`, never the working tree), so `/review /describe /improve` inject the reviewed repo's `AGENTS.md`/etc. as `<instruction_files>`; a missing file degrades to `""`.
- **Local CLI provider**: when `MEEBOX_CLI_MODE` is set, replace `chat_completion` wholesale with the "call the local CLI" version (see below).
- **token usage collection**: see below.

Expand Down
Loading