Skip to content

fix(api): reserve capacity for review page resources - #332

Draft
SamGu-NRX wants to merge 1 commit into
gpt-burst/1022z-bs-284-restfrom
gpt-burst/1023-bs-323-capacity
Draft

SamGu-NRX wants to merge 1 commit into
gpt-burst/1022z-bs-284-restfrom
gpt-burst/1023-bs-323-capacity

Conversation

@SamGu-NRX

Copy link
Copy Markdown
Owner

What changed

With HSS_INGEST_MAX_FILES=1, PR #323's two-request bucket refused a valid review page's third resource. This stacked fix adds a floor for one gallery and ten fixed requests: the module, preview fetch, four verdicts, criteria report, two result JSONs, and preview download.

The fix is in backend/server/api/routes/result.py:250-274. The 2x factor has no traffic evidence. The limiter counts per process: N containers allow N times the budget.

Why

A small ingest file limit must not prevent a valid review page from loading. This PR targets #323 and is stacked on gpt-burst/1022z-bs-284-rest.

Verification

From backend/, env -u NODE_ENV OMP_NUM_THREADS=1 uv run pytest -q server/api/tests/test_review_view.py::test_one_photo_page_loads_all_resources_with_one_file_limit failed on 70ad39ff with a 429 at the third resource. After the fix, its eleven linked requests all returned 200 with the limiter clock frozen.

env -u NODE_ENV OMP_NUM_THREADS=1 uv run pytest -q server/api/tests/test_review_view.py server/api/tests/test_result_boundary.py passed: 35 tests. Ruff check and formatting passed for both changed files.

Risk

The floor counts today's fixed resources. The existing 2x allowance remains unchanged for larger galleries. Neither that factor nor multi-container traffic has been measured.

Checklist

  • The scope is focused; related changes belong together
  • I explained what changed and why
  • N/A for images and video. No visual or motion changes.

Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the size:S 10-29 effective changed lines. label Oct 23, 2026
@SamGu-NRX

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-23T11:41:45.800262Z
We couldn’t complete this review. Comment @codex review to try again.
cf1b3dc 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 effective changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant