Skip to content
Merged
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
6 changes: 6 additions & 0 deletions .github/workflows/openrouter-code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ jobs:
roast_level: professional
status_comments: "true"
max_tool_turns: ${{ steps.pr.outputs.turns }}
# Configure this on the target repository, not organization-wide.
# Keep review budgets modest (e.g. 512 KiB); the action validates
# positive integers.
max_diff_kb: ${{ vars.OPENROUTER_MAX_DIFF_KB || '300' }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 No workflow-side validation of OPENROUTER_MAX_DIFF_KB; any non-positive or non-integer value fails the required check for every PR in the repo (risk)

If a repo admin sets OPENROUTER_MAX_DIFF_KB to something invalid (e.g. "0", "abc", "1.5", "-5", or a whitespace-only string like " 400"), the || '300' fallback only covers unset/empty values, so the invalid value is passed straight to the action's max_diff_kb input and the action's positive-integer validation fails. The consequence is that the required check turns red for every PR in that repo until the variable is fixed — and the failure is opaque, because the Summary step doesn't show the effective budget and nothing in the workflow names the variable as the culprit.

The workflow is the only gate: vars.OPENROUTER_MAX_DIFF_KB is read at line 180 with no validation, and a repo-wide grep finds no other place that checks the value. Note the PR body's claim that the action validates the value is contributor data — the pinned action (FlyOverCoderKY/openrouter-pr-review-action@​4471f596) is external and not verifiable from this checkout, so the exact failure mode (hard fail vs. silent ignore) is a proof gap.

A cheap guard — a grep -E '^[0-9]+$' step before the action, or a warning when the variable is non-empty but non-numeric — would make the failure mode visible and diagnosable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disputed with verified pinned-action and actual repository-configuration evidence: #19 (comment). Existing action input validation remains authoritative; Support Desk override is repository-scoped. Leaving this thread unresolved for visibility.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 max_diff_kb input may not exist on the pinned action commit, silently leaving the default 300 KB budget (risk)

The PR's stated purpose is that a Support Desk full-PR review includes every changed hunk instead of stubs. If max_diff_kb is not a declared input in the pinned action's action.yml (FlyOverCoderKY/openrouter-pr-review-action@​4471f5963751223c26a2e169d78c0f13817165aa), GitHub Actions emits only a warning about unexpected inputs and the review runs at the default 300 KB — meaning the PR's goal silently does nothing until someone notices stubs in a review body again.

The workflow is the only file in this repo that references the action, and a repo-wide grep for max_diff_kb finds only the new line, so there is no in-repo documentation or test pinning the input contract. The PR body's claim that the input is "documented" on the action is contributor data; the action itself is not reachable from this checkout, so the input contract is unverified.

A one-line confirmation that the pinned action's action.yml declares max_diff_kb (and validates it as a positive integer) would close this gap.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disputed with verified pinned-action and actual repository-configuration evidence: #19 (comment). Existing action input validation remains authoritative; Support Desk override is repository-scoped. Leaving this thread unresolved for visibility.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 Org-level variable visibility leaks the Support Desk budget to every repo under the org ruleset (risk)

The comment says the override is "bounded repository overrides" (i.e., per-repo), but vars.OPENROUTER_MAX_DIFF_KB resolves org variables too, and this workflow is the org-required review for every pegma-dev repository. If the Support Desk budget is configured as an org-level variable with "all repositories" visibility, every repo inherits the larger budget — the intended repo-level override is not enforced anywhere in this file.

The concrete cost is a large diff budget (plus token cost) being applied to every repo's reviews when only one repo needs it. Repo-level variables override org variables, so the safe configuration is a repo-level variable on the Support Desk repo, or an org variable scoped to "Selected repositories". Nothing in the workflow or the PR body states that constraint, so an operator can plausibly set the org variable and not notice the blast radius.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disputed with verified pinned-action and actual repository-configuration evidence: #19 (comment). Existing action input validation remains authoritative; Support Desk override is repository-scoped. Leaving this thread unresolved for visibility.

env:
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}

Expand All @@ -189,6 +193,7 @@ jobs:
ACTION: ${{ github.event.action }}
KEY_PRESENT: ${{ steps.key.outputs.present }}
SCOPE: ${{ steps.pr.outputs.scope }}
MAX_DIFF_KB: ${{ vars.OPENROUTER_MAX_DIFF_KB || '300' }}
VERDICT: ${{ steps.review.outputs.verdict }}
ISSUES: ${{ steps.review.outputs.issue_count }}
REVIEW_URL: ${{ steps.review.outputs.review_url }}
Expand All @@ -202,6 +207,7 @@ jobs:
echo "| Eligible | \`${REVIEW_ELIGIBLE}\` |"
echo "| Secret present | \`${KEY_PRESENT:-n/a}\` |"
echo "| Scope | \`${SCOPE:-n/a}\` |"
echo "| Diff budget (KiB) | \`${MAX_DIFF_KB}\` |"
echo "| Models | \`${OR_MODELS}\` |"
echo "| Requested routes | \`${OR_MODEL_ROUTES}\` |"
echo "| Judge | \`${OR_JUDGE}\` |"
Expand Down
Loading