chore: add option for server timeout and set default to 5m - #90
Conversation
|
Warning Review limit reached
Next review available in: 39 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
WalkthroughChangesRender timeout control
Sequence Diagram(s)sequenceDiagram
participant Client
participant RequestParsers
participant handleRender
participant Renderer
Client->>RequestParsers: Send render request with optional timeout
RequestParsers->>RequestParsers: Validate and normalize timeoutMs
RequestParsers->>handleRender: Pass parsed render request
handleRender->>Renderer: Render with timeoutMs or config.renderTimeout
Renderer-->>Client: Return render result or timeout error
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
✨ Simplify code
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cli/src/server/config.ts`:
- Around line 56-59: Update cli/src/server/config.ts lines 56-59 in intOption
and line 73 so timeout values accept only integer numbers within 1..2147483647,
rejecting fractional, boolean/coerced, zero, negative, and oversized values
while preserving fallback behavior; update cli/src/server/request.ts lines 90-96
to enforce the same bound for request timeouts. Extend coverage in
cli/src/server/config.test.ts lines 53-73 and cli/src/server/request.test.ts
lines 50-55 for these invalid values. Add maximum: 2147483647 to both timeout
OpenAPI schemas in openapi.yaml lines 104-109 and 283-288.
In `@cli/src/server/routes.ts`:
- Around line 89-90: Update the timeout handling around timeoutPromise and
Promise.race so the setTimeout handle is retained and cleared in a finally block
after the race settles, regardless of whether renderPromise succeeds, fails, or
times out. Keep the existing timeout error behavior unchanged.
- Around line 87-90: Update handleRender and handleRenderStream in
cli/src/server/routes.ts (anchor lines 87-90 and sibling lines 137-141) to
create and pass an abort signal through doRender and doRenderStreamed, aborting
it when the per-request timeout fires. Propagate cancellation through SSR
rendering, PDF worker work, S3 uploads, and cache writes so timed-out requests
cannot continue or persist late results.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 376b1ee3-8986-4c82-b697-5813d202caa0
📒 Files selected for processing (9)
README.mdchart/values.yamlcli/src/cli.tscli/src/server/config.test.tscli/src/server/config.tscli/src/server/request.test.tscli/src/server/request.tscli/src/server/routes.tsopenapi.yaml
Summary by CodeRabbit
New Features
Bug Fixes