Conversation
…ror for a time budget Motivation: On Linux Wayland while the session is locked or monitors are off (observed on niri), the compositor sends frame callbacks to invisible windows only every ~1-2 s. capturePage rejects immediately with UnknownVizError until the guest presents a frame, and capturePageWithRetry gave up after three attempts 120 ms apart (~240 ms), so some preview_snapshot calls failed. Unlocked sessions are unaffected. Approach: UnknownVizError is now retried every 120 ms for a 2.5 s budget instead of a fixed three attempts. Other capture failures keep the existing three attempts, and the 1 s per-attempt timeout is unchanged, so a guest that never paints still fails (worst case roughly 3.5 s, inside the snapshot timeout). The error text surfaced to the agent is not changed here. Validation: in apps/desktop, `vp test run src/preview/Manager.test.ts` passes (92 tests). The new case (10 consecutive UnknownVizError rejections, then success) fails without the change (only 3 attempts) and passes with it. `vp run typecheck` is clean and `vp lint` reports only a pre-existing warning. I could not run a real locked Wayland session here, so the compositor behavior rests on the issue's analysis, not on my own reproduction. Report: pingdotgg#13997 Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com> Assisted-by: claude-sonnet-5-5 (via Claude Code)
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a localized desktop reliability fix that extends retries only for the specific transient UnknownVizError condition, while preserving existing behavior for other failures. The production change is small, bounded, and accompanied by regression coverage. Notes:
You can add or adjust custom eligibility rules. Learn more. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: pingdotgg/t3code/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughPreview screenshot capture now retries ChangesPreview capture retry policy
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Low Suggested reviewers: Merge Risk: ⚪ Minimal · up to The preview capture retry change is mergeable after normal checks; the reported loss of ordinary retries does not occur. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change adds no new access path and keeps the checks that prevent a capture from accepting a replaced preview guest. The 2.5-second retry budget is not a deadline for the whole capture, so automation control may be held longer than that figure suggests. Retained concerns
Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Dismissing prior approval to re-evaluate 36eb273
What Changed
capturePageWithRetry(apps/desktop/src/preview/Manager.ts) now retriesUnknownVizErrorevery 120 ms for a 2.5 s budget instead of three fixed attempts. Other capture failures keep the three-attempt retry, and the 1 s per-attempt timeout is unchanged. Added a test with ten consecutiveUnknownVizErrorrejections followed by success.Why
While a Linux Wayland session is locked or monitors are off, the compositor (niri) sends frame callbacks to hidden windows only every ~1-2 s, so a guest rejects
capturePagewithUnknownVizErroruntil then. The old retry gave up after ~240 ms, so somepreview_snapshotcalls failed. A time budget above the worst-case interval fixes that, while a guest that never paints still fails.Validation:
vp test run src/preview/Manager.test.tspasses (92 tests); the new case fails without the change and passes with it. Typecheck is clean. I could not reproduce a locked Wayland session here, so the compositor behavior relies on the issue's analysis. The tool error text is not changed.Report: #13997
UI Changes
None. This change does not alter any UI; it only changes retry behavior for preview snapshot captures in the desktop app.
Checklist
Fixes #13997
Summary by CodeRabbit