Skip to content

OSS build silently ignores best_practices.md (currently SaaS-only) #2377

@agonzalesipcoop-cmyk

Description

@agonzalesipcoop-cmyk

Feature request / documentation gap

best_practices.md is documented at https://qodo-merge-docs.qodo.ai/tools/improve/#best-practices but only loaded by the Qodo Merge SaaS. The open-source pr-agent package on PyPI does not read the file from the repo, so users who follow the public docs and add a best_practices.md see it silently ignored — none of its content reaches the LLM.

(See closed issue #1288 — same confusion.)

Suggested behavior

One of:

  1. Load it in OSS too — read best_practices.md from the repo root (or a configurable path) at startup and append its contents to pr_reviewer.extra_instructions and pr_code_suggestions.extra_instructions after the normal apply_repo_settings merge.
  2. Or explicitly document in the README and the improve tool docs that best_practices.md is SaaS-only and has no effect in the OSS package, so users do not waste time authoring rules that nothing reads.

Workaround

Wrapping apply_repo_settings and appending the file contents to extra_instructions per call works:

import pr_agent.git_providers.utils as _utils_mod
import pr_agent.agent.pr_agent as _agent_mod
from pathlib import Path
from pr_agent.config_loader import get_settings

original = _utils_mod.apply_repo_settings
appendix = "\n\n" + Path("best_practices.md").read_text()

def _wrapped(pr_url):
    original(pr_url)
    for section in ("pr_reviewer", "pr_code_suggestions"):
        key = f"{section}.extra_instructions"
        current = str(get_settings().get(key, "") or "")
        if appendix not in current:
            get_settings().set(key, current + appendix)

_utils_mod.apply_repo_settings = _wrapped
_agent_mod.apply_repo_settings = _wrapped

Wrapping is required because apply_repo_settings runs per PR and would overwrite a one-shot boot mutation.

Environment

  • pr-agent 0.34.3 (PyPI)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions