Skip to content

Allow repository-specific OpenRouter diff budgets - #19

Merged
FlyOverCoderKY merged 2 commits into
mainfrom
codex/sd-03-review-budget
Nov 8, 2026
Merged

FlyOverCoderKY merged 2 commits into
mainfrom
codex/sd-03-review-budget

Conversation

@FlyOverCoderKY

@FlyOverCoderKY FlyOverCoderKY commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Large Support Desk PRs exceed the review action's default 300 KiB embedded diff budget, leaving changed files represented only by stubs. The required workflow now forwards OPENROUTER_MAX_DIFF_KB to the documented max_diff_kb input for both full and incremental reviews, retaining 300 when unset. Its run summary shows the effective budget.

Configure the variable on the target repository and keep budgets modest; Support Desk's repository-only value is set and read back as 512. No organization variable was created. Existing action validation rejects invalid values before model execution; this change adds no new hard upper-limit policy.

The branch is rebased onto PR #18's current main and preserves Sol, Azure US routing, the action pin, permissions, scope selection, ledger handling, tool turns, failure behavior, and authentication. The actual pinned action declares max_diff_kb.

Validation: inspected the exact six-line diff, pinned input/parser contract, and repository-variable readback. Whitespace and control-byte checks passed. No application tests apply to this workflow wiring. Current-head review and required checks remain required before merge. Support Desk PR #39 stays a draft and will receive a new complete full-PR review after this caller lands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-11-08T03:41:53.268736Z f2ce0d9 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

OpenRouter review posted (clean). #19 (review)

@FlyOverCoderKY

Copy link
Copy Markdown
Contributor Author

@codex security review

@github-actions github-actions Bot left a comment

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.

OpenRouter pull-request review

Verdict: issues
Scope: full-pr (full-pr)
Mode: initial
Commit: bf7ed285cd233088746acb14017a6d7dd2bc49d4
Judge: openai/gpt-5.6-luna (repaired(canonical+6): source coverage preserved before publication cap)
Cost: $0.0354 (lanes $0.0328 + judge $0.0026)

Lanes

  • openai/gpt-6.1-sol: ok (0 finding(s), 14.5s, 20522+467 tokens (12492 cached), 3 tool round(s), via Azure, $0.0286)
  • z-ai/glm-5.3-flash: ok (6 finding(s), 161.6s, 41877+10426 tokens (24895 cached), 6 tool round(s), via OpenInference, $0.0042)

Findings

🟠 Issue 1 — 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

.github/workflows/openrouter-code-review.yml:180 · risk · identified by z-ai/glm-5.3-flash

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.

🟠 Issue 2 — max_diff_kb input may not exist on the pinned action commit, silently leaving the default 300 KB budget

.github/workflows/openrouter-code-review.yml:180 · risk · identified by z-ai/glm-5.3-flash

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.

🟠 Issue 3 — Org-level variable visibility leaks the Support Desk budget to every repo under the org ruleset

.github/workflows/openrouter-code-review.yml:180 · risk · identified by z-ai/glm-5.3-flash

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.

🟠 Issue 4 — No upper bound on the override; a very large budget can blow the 30-minute job timeout and OpenRouter cost

.github/workflows/openrouter-code-review.yml:179 · risk · identified by z-ai/glm-5.3-flash

The word "bounded" in the new comment only refers to the action's positive-integer validation — there is no upper bound in the workflow. A repo admin who sets OPENROUTER_MAX_DIFF_KB to, say, 100000 embeds up to ~100 MB of diff into the review, and the review can exceed timeout-minutes: 30, turning the required check red for exactly the large PRs the override was meant to fix (the header's list of accepted red modes includes the job timeout, but that's a failure mode here, not a review outcome).

The workflow header already documents that the job timeout is one of the few ways the check can turn red, so the cost of an unbounded variable is real and silent. An upper clamp (or at least a note in the comment stating the variable must be set at repo level and kept modest) would prevent the failure scenario.

🔵 Issue 5 — Summary step does not surface the effective max_diff_kb budget

.github/workflows/openrouter-code-review.yml:186 · nit · identified by z-ai/glm-5.3-flash

The Summary table lists Models, Judge, Scope, Verdict, and Issues but not the budget actually used. When a reviewer or operator is debugging a misconfigured OPENROUTER_MAX_DIFF_KB (or a silent fallback to 300 because the variable is unset/empty), the run summary gives no signal — the only visible symptom is a review with stubbed large files or a failed validation, with no way to tell which knob is wrong.

Adding max_diff_kb to the summary table (e.g. \${{ vars.OPENROUTER_MAX_DIFF_KB || '300' }}` as a row) would make both the override and the fallback visible in the run UI.

🔵 Issue 6 — Comment overclaims: the override applies to every run, not only full-PR reviews

.github/workflows/openrouter-code-review.yml:179 · nit · identified by z-ai/glm-5.3-flash

The new comment says "Allow bounded repository overrides for large full-PR reviews", but the input is set on the single action step used for both scopes — latest-commit runs (incremental reviews after a ledger exists) inherit the same larger budget. The behavior is harmless (latest-commit diffs are small), but the comment overclaims the scope, which matters for future readers reasoning about which lane a variable affects.

A repo-wide grep confirms the only other place the override is mentioned is the PR body, which also frames it as a full-PR fix. Rewording the comment to "for large reviews" (or noting it applies to both scopes) would match the actual behavior.

Workflow run

status_comments: "true"
max_tool_turns: ${{ steps.pr.outputs.turns }}
# Allow bounded repository overrides for large full-PR reviews.
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.

status_comments: "true"
max_tool_turns: ${{ steps.pr.outputs.turns }}
# Allow bounded repository overrides for large full-PR reviews.
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.

🟠 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.

status_comments: "true"
max_tool_turns: ${{ steps.pr.outputs.turns }}
# Allow bounded repository overrides for large full-PR reviews.
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.

🟠 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: bf7ed285cd

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@FlyOverCoderKY

Copy link
Copy Markdown
Contributor Author

R1 triage before the fix push:

  • r1-1 is disputed: invalid administrator configuration is intentionally rejected before model execution. The pinned action already parses MAX_DIFF_KB, strips surrounding whitespace, checks positivity, and names the input in its error. A workflow-side copy of that parser is unnecessary; silently ignoring invalid configuration would hide a required-review setup failure. The cited leading-space example is accepted by the action's actual parser. Pinned parser.
  • r1-2 is disputed: max_diff_kb exists under both the original 4471f596 pin and PR Roll the primary review lane to GPT-6.1 Sol on Azure US ZDR #18's current 0d6a05e4 pin. The current action declares the input, exports it as MAX_DIFF_KB, parses it as a positive integer, and uses the value times 1024 for collection. It is neither an unknown input nor silently ignored. Declared input, original pin.
  • r1-3 is disputed as a code defect: normal GitHub variable precedence is intentional. This change creates no organization variable; the organization-variable readback is empty. The actual Support Desk override has now been set and read back as the REPOSITORY variable OPENROUTER_MAX_DIFF_KB=512. A later administrator explicitly configuring an organization-wide value would be a separate configuration decision. The patch will add target-repository guidance so operators can see the intended setup. GitHub variable precedence.

The patch will address r1-4's wording/operational guidance, r1-5's effective-budget summary, and r1-6's scope wording. No new hard upper-limit policy or model/security redesign is needed for the specific 512 KiB repository override. Invalid values continue to fail closed through the existing action validation.

The branch has been locally rebased onto PR #18's d3b814c main, preserving its Sol lane, US route, and action pin. Disputed threads remain unresolved for visibility. Fresh current-head checks/reviews will run after the fix push, and Support Desk's full-coverage review will be checked after this caller lands.

@FlyOverCoderKY
FlyOverCoderKY force-pushed the codex/sd-03-review-budget branch from bf7ed28 to f2ce0d9 Compare November 8, 2026 03:37
@FlyOverCoderKY

Copy link
Copy Markdown
Contributor Author

@codex security review

@github-actions github-actions Bot left a comment

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.

OpenRouter pull-request review

Verdict: clean
Scope: rebase (full-pr)
Mode: verify
Commit: f2ce0d94a1c43424841fdbf1ae059195c88c9aa4
Judge: openai/gpt-5.6-luna
Cost: $0.0591 (lanes $0.0589 + judge $0.0001)

Lanes

  • openai/gpt-6.1-sol: ok (0 finding(s), 25.1s, 42810+1147 tokens (28961 cached), 3 tool round(s), via Azure, $0.0539)
  • z-ai/glm-5.3-flash: ok (0 finding(s), 44.7s, 47080+6330 tokens (28672 cached), 3 tool round(s), via InferenceNet, $0.0051)

Round 2 resolution

  • 🤝 r1-1 disputed — 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: The technical rebuttal establishes intentional fail-fast validation in the pinned action, including whitespace stripping and an input-specific error. Duplicating that parser in the workflow is unnecessary. The current workflow also surfaces OPENROUTER_MAX_DIFF_KB in its always-running summary. No current repository evidence invalidates the rebuttal.
  • 🤝 r1-2 disputed — max_diff_kb input may not exist on the pinned action commit, silently leaving the default 300 KB budget: The current action pin is 0d6a05e41616281368c1f6bb7fb5a47ddf41375d, matching the rebuttal's specific input-declaration, environment-export, parser, and collection references. No local evidence contradicts that contract. The external action is unavailable in this inert checkout, so it could not be independently reread; that limitation is not new evidence that the input is unsupported.
  • 🤝 r1-3 disputed — Org-level variable visibility leaks the Support Desk budget to every repo under the org ruleset: Normal GitHub organization/repository variable precedence is intentional, not a newly introduced configuration leak. The supplied configuration readback identifies a repository-scoped Support Desk override, and the current comment explicitly directs operators to configure the target repository rather than the organization. No current evidence shows an organization-wide override.
  • ✅ r1-4 fixed correctly — No upper bound on the override; a very large budget can blow the 30-minute job timeout and OpenRouter cost: The original finding explicitly accepted modest-budget operational guidance as an alternative to a hard clamp. The current comment removes the misleading 'bounded' claim, directs configuration to the target repository, and recommends modest budgets with a concrete 512 KiB example. This implements that accepted repair; it does not claim to enforce an upper limit.
  • ✅ r1-5 fixed correctly — Summary step does not surface the effective max_diff_kb budget: The Summary step now receives MAX_DIFF_KB using the same variable expression and 300 fallback as the action input, and prints a 'Diff budget (KiB)' row. Its existing always() condition also exposes the configured value after an action failure.
  • ✅ r1-6 fixed correctly — Comment overclaims: the override applies to every run, not only full-PR reviews: The replacement comment refers to review budgets without restricting the override to full-PR reviews. It accurately describes the input shared by full-pr and latest-commit runs.
  • Open findings after this round: 0 (0 bug-severity).

No structured findings from the successful lane(s).

Workflow run

@FlyOverCoderKY

Copy link
Copy Markdown
Contributor Author

Fixed body-only r1-5 in f2ce0d9: the summary receives and safely prints the effective diff budget from the same default-300 expression used by the action. Current-head security and review are requested again; the three disputed findings retain concrete primary-source/configuration evidence and remain visible.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: f2ce0d94a1

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@FlyOverCoderKY

Copy link
Copy Markdown
Contributor Author

The bounded Copilot review window has expired. Review was requested around 03:27 UTC and again for current head f2ce0d9. At 04:04 UTC, the reviews, conversation comments, and requested-reviewer readbacks still show no observable Copilot review activity. This is an unavailable-reviewer fallback, not a passing Copilot review, and no quota or authentication cause is inferred.

Current-head completed evidence is clean: OpenRouter review 5816460670 has both actual lanes successful, a decoded ledger with 0 OPEN findings, and the complete one-file full-PR diff embedded without truncation or stubs; standalone security receipt 6716832244 reports no issues. The required check is successful and the PR is mergeable. The six-line patch was inspected against PR #18 main and preserves its model route, action pin, permissions, and ledger behavior. Proceeding under the existing bounded fallback while keeping disputed threads visible.

@FlyOverCoderKY
FlyOverCoderKY merged commit a9a5d77 into main Nov 8, 2026
1 check passed
@FlyOverCoderKY
FlyOverCoderKY deleted the codex/sd-03-review-budget branch November 8, 2026 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant