Skip to content

fix: restore oz review invocation cap#436

Merged
captainsafia merged 2 commits intomainfrom
safia/fix-invocation-ratelimit
May 6, 2026
Merged

fix: restore oz review invocation cap#436
captainsafia merged 2 commits intomainfrom
safia/fix-invocation-ratelimit

Conversation

@captainsafia
Copy link
Copy Markdown
Collaborator

Summary

  • Restore the 3-per-PR cap for explicit /oz-review and @oz-agent /review requests in the webhook dispatch path.
  • Count persisted non-bot explicit review invocations across PR conversation comments and inline review comments before building review context.
  • Keep automatic PR review triggers unaffected and fail open if the GitHub lookup for invocation counting fails.

Validation

  • python3 -m unittest tests.test_routing tests.test_builders tests.test_webhook_dispatch
  • python3 -m py_compile core/routing.py core/workflows/__init__.py tests/test_routing.py tests/test_builders.py
  • git --no-pager diff --check

Artifacts

Co-Authored-By: Oz oz-agent@warp.dev

Restore the 3-per-PR cap for explicit /oz-review requests in the webhook dispatch path.

Count persisted non-bot explicit review invocations across PR conversation and inline review comments before building review context, while failing open on lookup errors.

Co-Authored-By: Oz <oz-agent@warp.dev>
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 6, 2026

@captainsafia

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR restores explicit review invocation throttling in webhook dispatch and updates routing/tests for /oz-review and @oz-agent /review.

Concerns

  • The command regex still matches hyphenated prefixes such as /oz-review-this, so non-command text can trigger review runs and count against the cap.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread core/routing.py Outdated
Co-authored-by: oz-for-oss[bot] <277970191+oz-for-oss[bot]@users.noreply.github.com>
@captainsafia
Copy link
Copy Markdown
Collaborator Author

@peicodes @vkodithala Requesting your review on this. I observed in a PR that a user was able to keep going past the 3 /oz-review invocation limit and triggered the review agent about a dozen times on the same PR.

Turns out the code to rate-limit didn't come over when I rewrote everything last week so bringing it back here.

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 6, 2026

@captainsafia

I'm re-reviewing this pull request in response to a review request.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR restores explicit review invocation throttling in the webhook dispatch path, tightens review command detection, and adds coverage for the cap across PR conversation and inline review comments.

Concerns

  • No blocking correctness or security concerns found in the changed lines.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@captainsafia captainsafia merged commit 75321dc into main May 6, 2026
4 checks passed
@captainsafia captainsafia deleted the safia/fix-invocation-ratelimit branch May 6, 2026 22:06
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.

2 participants