Fix: suppress idle timeout countdown in provider-wait footer (#3189)#3375
Fix: suppress idle timeout countdown in provider-wait footer (#3189)#3375idling11 wants to merge 2 commits into
Conversation
…bown#3189) Default provider-wait status now shows only 'waiting for model' without the noisy '{idle}s/{budget}s idle timeout' countdown on every render. Thresholds: - idle < 60s: 'waiting for model' (no countdown) - idle >= 60s: 'waiting for model · {idle}s' (significant wait) - idle >= 75% budget: 'waiting for model · {idle}s/{budget}s idle timeout' (near timeout) Structured incident logs keep full detail. Provider/model identity stays in the header bar. Added 4 tests: fresh wait, thresholded wait, near-timeout, dispatch-pending.
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
There was a problem hiding this comment.
Code Review
This pull request refines the footer UI's model-waiting status by introducing a threshold of 60 seconds before displaying elapsed idle time, and surfacing a detailed timeout warning when the idle time reaches 75% of the stream-idle budget. Unit tests were also added to cover these scenarios. The review feedback points out a potential issue where a configured timeout budget of less than 60 seconds would prevent the near-timeout warning from displaying, and suggests checking the near-timeout condition first to resolve this.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| // Normal wait — no countdown noise. | ||
| if idle < PROVIDER_WAIT_IDLE_SHOW_SECS { | ||
| return "waiting for model".to_string(); | ||
| } | ||
|
|
||
| // Significant idle — surface the elapsed seconds so the user can judge | ||
| // whether the stream is making progress. | ||
| let near_timeout = budget > 0 && idle >= budget.saturating_mul(3) / 4; // ≥ 75% | ||
| if near_timeout { | ||
| format!("waiting for model · {idle}s/{budget}s idle timeout") | ||
| } else { | ||
| format!("waiting for model · {idle}s") | ||
| } |
There was a problem hiding this comment.
If a user configures a small stream_chunk_timeout_secs (e.g., less than 60 seconds, such as 30 seconds), the early return if idle < PROVIDER_WAIT_IDLE_SHOW_SECS will prevent the near_timeout warning from ever being displayed, even when the stream is extremely close to timing out (e.g., at 25 seconds of idle time).
Checking near_timeout first ensures that the timeout warning is always surfaced when the stream is at risk, regardless of whether the idle time has crossed the 60-second threshold.
let near_timeout = budget > 0 && idle >= budget.saturating_mul(3) / 4; // ≥ 75%
if near_timeout {
return format!("waiting for model · {idle}s/{budget}s idle timeout");
}
// Normal wait — no countdown noise.
if idle < PROVIDER_WAIT_IDLE_SHOW_SECS {
return "waiting for model".to_string();
}
format!("waiting for model · {idle}s")The test expected idle seconds at 40s, but the new threshold suppresses the counter below 60s. Bumped idle to 65s and added budget assertion.
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Follow up on PR #3375 by @idling11 so a short configured stream-idle budget still surfaces the full idle-timeout warning even when the elapsed idle time is below the normal 60s display threshold. Verification: - cargo test -p codewhale-tui --bin codewhale-tui --locked provider_wait_reason -- --nocapture - cargo test -p codewhale-tui --bin codewhale-tui --locked stall_reason_provider_wait -- --nocapture - cargo fmt --all -- --check - git diff --check Co-authored-by: idling11 <8055620+idling11@users.noreply.github.com>
|
Thanks @idling11 — I carried this into the v0.8.64 integration branch with your original commits preserved:
I also added a small review follow-up as Verified on the integration branch with:
I am keeping this PR open until the integration branch lands and #3189 can be closed against the public mainline. |
Behaviour changes
waiting for model · 3swaiting for modelwaiting for model · 60swaiting for model · 60swaiting for model · 225swaiting for model · 225s/300s idle timeoutFanout / dispatch-pending labels are unchanged and take precedence.
Design decisions
Ns/Ms idle timeoutonly surfaces when the stream is at real risk of timing out.maybe_log_provider_wait_incidentkeeps full idle/budget detail regardless of footer copy.Tests (4 passed)
provider_wait_reason_fresh_show_only_labelprovider_wait_reason_thresholded_show_idle_secondsprovider_wait_reason_near_timeout_show_full_idle_budgetprovider_wait_reason_dispatch_pendingClose #3189.
Summary
Testing
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-featurescargo test --workspace --all-featuresChecklist