Preserve provider error classification on streamed failures#38
Conversation
StreamAccumulator::finish mapped ModelStreamItem::ProviderFailed to TinyAgentsError::Model, stringifying away the structured ProviderError. is_retryable treats Model(_) as retryable, so a permanent streamed failure (401 auth, insufficient_quota, model_not_found, 400) was retried and fallback-churned as transient. Keep the ProviderError struct in a new failed_provider slot and return TinyAgentsError::Provider from finish() so the retry layer sees status/code/retryable, matching the unary path. Unstructured Failed(String) still maps to Model.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 21 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. 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 Run ID: 📒 Files selected for processing (5)
Comment |
collapsible_if in StreamAccumulator::push_tool_chunk and a duplicated #[cfg(test)] on the stream test module both fail CI's cargo clippy --all-targets -- -D warnings under rust 1.96. Behavior-neutral.
|
CI guardian: the |
…r wording
This PR changes StreamAccumulator::finish to return the structured
TinyAgentsError::Provider (preserving status/code/retryable) instead of a
flattened Model string. The e2e contract assertion still expected the old
"<provider> provider error (<code>)" wording; update it to the new
ProviderError Display ("<provider> returned HTTP <status> (<code>): <msg>").
|
CI guardian follow-up: with the clippy blocker cleared, CI surfaced a real test failure that was masked behind it — |
On the streaming path,
StreamAccumulator::finishmappedModelStreamItem::ProviderFailedtoTinyAgentsError::Model, stringifying away the structuredProviderError. Sinceis_retryabletreatsModel(_)as retryable, a permanent streamed failure (401 auth,insufficient_quota,model_not_found, 400) was retried and fallback-churned as transient.Keep the
ProviderErrorstruct in a newfailed_providerslot and returnTinyAgentsError::Providerfromfinish()so the retry layer sees status/code/retryable— matching the unary path. UnstructuredFailed(String)still maps toModel. Adds tests for the streamed 401 (non-retryable) and unstructured-failure paths.Closes tinyhumansai/openhuman#4637