You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A negative TimeSpan such as TimeSpan.FromTicks(-1) rounded up to 0 ms, passed the check, and scheduled an immediate timeout. It now throws ArgumentOutOfRangeException, like a negative TotalMs. The conversion is .NET-only (upstream takes milliseconds), so the regression tests carry no upstream link. This follows the review comment that arrived on #704 after it merged.
Limit details: You’ve used all 10 included reviews currently available.
📝 Walkthrough
The TimeSpan conversion now treats Timeout.InfiniteTimeSpan as unlimited, rejects other negative values, and retains upward rounding for nonnegative durations. Tests cover these behaviors.
Changes: Timeout conversion
Layer / File(s)
Summary
Timeout conversion and validation src/Vercel.AI/Prompt/TimeoutConfiguration.cs, tests/Vercel.AI.Tests/TimeoutConfigurationTests.cs
The conversion handles infinite timeouts before validation and throws ArgumentOutOfRangeException for other negative durations. Oversized nonnegative durations remain unlimited. Tests cover negative and infinite values, and upward rounding of a positive sub-millisecond duration.
Issue 697 in hardkoded/vercel-ai-sdk-dotnet — Its description concerns timeout configuration for generateText and streamText. This change updates TimeSpan timeout behavior.
Merge Risk:⚪ Minimal · up to 173f4
The timeout change appears mergeable after normal checks; no outstanding behavior issue is identified.
Security architecture risk:⚪ Minimal · up to 173f4
The change rejects invalid negative durations before timeout setup. Existing unlimited-timeout behavior is preserved, with no identified expansion of access or authority.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
inferred — The demonstrated exposure is limited to callers supplying TimeSpan timeout values. The scoped comparison adds no production entrypoint or privilege transition; public declarations in the new test file are test code, not additional service endpoints.
Trust Boundaries and Controls
observed — The conversion checks the infinite sentinel first, rejects other negative inputs, and then returns a newly constructed configuration. Rejected values do not reach timer creation through this conversion, and the changed code introduces no shared-state mutation or partial transition requiring cleanup.
Pre-merge checks: 5
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely describes the main change: rejecting negative TimeSpan timeout values.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Upstream Parity
The PR description names only port-repository pull requests (#708 and #704) and states that the conversion is .NET-only because upstream accepts milliseconds. It does not name a vercel/ai commit, upst…
Full details: Upstream Parity
Explanation
The PR description names only port-repository pull requests (#708 and #704) and states that the conversion is .NET-only because upstream accepts milliseconds. It does not name a vercel/ai commit, upstream pull request, or upstream file. Under the applicability rule, the Upstream parity check does not apply.
✨ Finishing Touches
📝 Generate docstrings
Commit to this branch
Create a new PR
🧪 Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.
Comment @coderabbitai help to get the list of available commands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A negative
TimeSpansuch asTimeSpan.FromTicks(-1)rounded up to 0 ms, passed the check, and scheduled an immediate timeout. It now throwsArgumentOutOfRangeException, like a negativeTotalMs. The conversion is .NET-only (upstream takes milliseconds), so the regression tests carry no upstream link. This follows the review comment that arrived on #704 after it merged.🤖 Generated with Claude Code
https://claude.ai/code/session_01TQmtUKfZTs497KkiGSfYk9
Summary by CodeRabbit