Harden TUI API connection state - #326
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 47 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: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughTuiApiRuntime gains a ChangesCritical resource recovery logic
Documentation updates
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant TuiApiRuntime
participant ResourceState
Caller->>TuiApiRuntime: refresh(resource)
TuiApiRuntime->>ResourceState: perform request
ResourceState-->>TuiApiRuntime: failure
TuiApiRuntime->>TuiApiRuntime: shouldRecoverFromResourceFailure(resource, error, generation)
alt resource is critical
TuiApiRuntime->>TuiApiRuntime: set state degraded
else non-critical and generation stale
TuiApiRuntime->>TuiApiRuntime: set state degraded
end
ResourceState-->>TuiApiRuntime: later success
TuiApiRuntime->>TuiApiRuntime: markRequestSuccess(generation)
TuiApiRuntime->>TuiApiRuntime: hasCriticalResourceFailure()
alt no critical failure remaining
TuiApiRuntime->>Caller: state connected
else critical failure remains
TuiApiRuntime->>Caller: state stays degraded
end
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@src/multiplexer/tui-api-runtime.ts`:
- Around line 243-255: Update the recovery flow in tui-api-runtime so a
successful request can clear the degraded desktop-state; right now
refreshRuntimeGuard() only probes guards and markRequestSuccess() still sees
hasCriticalResourceFailure() as true because desktop-state.error is never reset.
Adjust the recovery path around markRequestSuccess(), refreshRuntimeGuard(), and
the desktop-state resource handling so a successful refresh explicitly
re-fetches or clears desktop-state before setConnectionState("connected") is
allowed.
🪄 Autofix (Beta)
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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 4bafb998-5d0e-4f04-9f56-0d898a8ab8e3
📒 Files selected for processing (4)
AGENTS.mddocs/core-sidecar-north-star.mdsrc/multiplexer/tui-api-runtime.test.tssrc/multiplexer/tui-api-runtime.ts
Summary
Verification
Summary by CodeRabbit
New Features
Bug Fixes