Suggestions, replies and re-reviews
The default-branch settings routes jobs.pr_review, jobs.pr_summary and jobs.pr_reply choose models separately. Omitted roles inherit the top-level route. The optional legacy inference document overrides file routes while supplied. Retries and fallbacks share the applicable cap when one is set.
Repository context
Section titled “Repository context”The review job checks out the exact pull request base commit. It reads Git objects without loading modules or running repository code, then selects unchanged imports, callers, symbol references and related tests. Pull request source still comes from the GitHub API and remains untrusted evidence.
The selection is bounded to 5,000 text files, 50 MiB of scanned source and 128 KiB per file. pr_review.context_tokens and pr_review.context_files apply smaller prompt limits. pr_review.skip_paths and pr_review.context_exclude_paths keep generated or sensitive paths out. Common key files, tracked environment files, binaries and lockfiles are excluded without configuration.
The summary links every unchanged file supplied as context at the base commit. It also states when the checkout is stale, files were excluded, scanning stopped or relevant files did not fit. The selection helps trace cross-file regressions, but it is not a complete repository analysis. More context can improve recall while using more input tokens on every review chunk.
Related repositories
Section titled “Related repositories”pr_review.related_repositories may name up to three repositories under the pull request repository's owner. The setting is read from the trusted base and is empty by default. Add each related repository to the same owner's CodeHawk App installation before enabling it.
With the hosted CodeHawk App, each related repository must allow the calling repository in its own .github/codehawk.json on its default branch:
{ "related_context": { "allow": ["octo-org/widgets", "octo-org/*"] }}The Worker checks consent before issuing a separate contents read token for allowed repositories only. Refused repositories appear as a notice in the run log and as unavailable in the summary. A private repository may use public or private consenting related repositories. A public repository cannot use private related source. The Worker refuses it with private_to_public, regardless of consent, and the review action also checks visibility before reading files.
With your own App key, the key owner's installation decides access and no consent file is read. This self-hosted path still mints a separate contents read token with no pull request or issue permissions. The posting token remains scoped to the current repository. A configured repository outside that owner is reported as unavailable because GitHub App installation tokens do not cross owners.
Code Hawk resolves the configured name through GitHub, so a renamed repository is shown under its canonical name. It pins the default branch to an immutable commit, reads the Git tree and selected blobs through the API, and never checks out or executes related code. A 404 is reported as missing App access rather than treated as an empty repository.
The fixed limit covers three repositories, 40 scanned text files and 2 MiB per repository, 128 KiB per file, six supplied files and 2,000 input tokens across the run. Files are ranked by changed symbols, matching paths, contract paths and tests. The summary names every selected repository, commit and file, plus access failures or omissions. A finding that relies on related source links the exact related file and line. This can expose concrete consumer breaks, but it is a bounded search rather than a complete dependency index.
Repository review memory
Section titled “Repository review memory”GitHub review activity is the decision log. Code Hawk does not copy feedback into a repository file, issue ledger or hosted profile. A thumbs down, or a reply containing by design, won't fix or not a bug, dismisses that finding. A thumbs up, or an explicit accepted finding, confirmed bug, confirmed security fault or valid finding reply, accepts it. The latest trusted decision on a finding is current.
Every decision actor is checked through GitHub's current repository permission API. Only write, maintain or admin permission counts. Bot feedback and feedback from readers, triage users or pull request authors without one of those permissions are ignored. Losing write permission also removes that actor's feedback from memory on the next run.
Dismissed examples can suppress the same fault class on a later pull request, even when its path or wording gives it a new fingerprint. Accepted examples can raise the relevance of a similar concrete fault. Neither changes the evidence bar. Every posted finding still has to name an added line and a provable failing case. The model reports which supplied decision ids changed the result, and Code Hawk accepts only ids and effects that match the bounded prompt.
The pull request summary lists the current decisions supplied to the model, their actors and their original GitHub sources. It has a separate section when a decision actually suppressed or raised something. Remove the source reaction or delete the source reply to remove its decision on the next review.
Retention follows the current GitHub record. Each run reads the newest 10 pages, up to 1,000 pull request review comments and 1,000 issue comments, plus Code Hawk finding issues. It reads up to 300 reactions on a source. The model receives at most the 20 newest current decisions and 2,000 input tokens across the run. Older retained decisions still suppress an exact matching fingerprint, but only the bounded prompt can influence a new fault class.
What Code Hawk posts
Section titled “What Code Hawk posts”- Suggested fixes. When the model offers a small fix for added lines, the line comment ends with a GitHub
suggestionblock, as a range comment when it spans lines. A fix that is long, touches lines the pull request did not add, holds a fence, a hidden comment marker or an at sign before a name is dropped, and the finding is still posted without it. - Replies. Code Hawk answers a reply in one of its own review threads, or an
@mention of the app in a review comment or a pull request conversation comment. Only people GitHub reports withadmin,maintainorwritepermission on the repository are answered (asked live, because a webhook shows a private organization member asCONTRIBUTOR), never bots, never fork pull requests, and never pastpr_review.reply_max_per_pranswers on the pull request. An answer is short, defanged, carries a hidden reply marker and never promises a change. The per pull request limit is not atomic, so comments that arrive at the same moment can overshoot it by a few, each subject tocaps.pr_replywhen set. Replies are uncapped by default. There is no repository-wide reply budget. - Re-reviews. After a complete review the summary comment records the reviewed commit. The next push is compared with it and only lines added since then are sent to the model. A rewritten history, a missing commit, a comparison of 300 or more files or a file without a patch gives a full review, and nothing new since the last review makes no model call.
Reply caller
Section titled “Reply caller”Put this in .github/workflows/pr-reply.yml on the default branch. Give it a separate concurrency group so a comment does not cancel an in-progress review. Enable PR_REVIEW_ENABLED and provision the same credentials as PR review.
name: PR reply
on: issue_comment: # zizmor: ignore[dangerous-triggers] comment jobs check write access and never check out pull request code types: [created] pull_request_review_comment: types: [created]
permissions: contents: read
concurrency: group: pr-reply-${{ github.event.comment.id }} cancel-in-progress: false
jobs: reply: name: Code Hawk reply if: >- vars.PR_REVIEW_ENABLED == 'true' && (github.event_name == 'pull_request_review_comment' || github.event.issue.pull_request) && github.event.comment.user.type != 'Bot' && !endsWith(github.event.comment.user.login, '[bot]') permissions: contents: read pull-requests: read id-token: write uses: bts-io/codehawk/.github/workflows/pr-review.yml@<sha> # codehawk <version> with: inference: ${{ vars.CODEHAWK_INFERENCE }} secrets: CODEHAWK_CREDENTIAL_1: ${{ secrets.CODEHAWK_CREDENTIAL_1 }}To dismiss an existing Code Hawk finding, add a thumbs-down reaction or reply with a clear dismissal such as not a bug, by design, or won't fix. Reviews consult recent feedback on Code Hawk findings in the repository. This can suppress a matching fingerprint on a later PR. It does not teach the model a new review rule.
For your own App, add app_id under with and forward CODEHAWK_PRIVATE_KEY under secrets. See the self-hosted App lines. The hosted App needs neither.