fix(desktop): probe KVM backend once, fail closed on headless host #117

Merged
David merged 1 commit from fix/VA-115-desktop-probe-once-fail-closed into main 2026-07-06 04:13:49 +02:00
Member

run_desktop entered the ~30 fps capture loop unconditionally. On a host with no graphical session every capture_changed_tiles tick returned KvmError::NotAvailable and the loop spun forever at frame rate, so the browser Desktop tab showed a blank canvas and the agent never told the client. VA-112 only throttled the log line; the spin and the silence remained.

Probe the backend once before the select loop, into a throwaway StreamState so a successful probe does not consume the first keyframe the loop must ship. If the probe returns NotAvailable, log one INFO line, close the WebSocket cleanly (the SPA's kvm_displays pre-flight plus DeskStatus render the headless state), and return without entering the loop. A working backend is unaffected: the loop starts after the first successful probe. A transient (non-NotAvailable) first-frame error falls through into the loop, where VA-112's rate-limiter still handles a backend that fails mid-session.

unavailable_reason isolates the fail-closed classification so the boundary (only NotAvailable fails closed) is unit-tested without a live capture backend.

#VA-115

run_desktop entered the ~30 fps capture loop unconditionally. On a host with no graphical session every capture_changed_tiles tick returned KvmError::NotAvailable and the loop spun forever at frame rate, so the browser Desktop tab showed a blank canvas and the agent never told the client. VA-112 only throttled the log line; the spin and the silence remained. Probe the backend once before the select loop, into a throwaway StreamState so a successful probe does not consume the first keyframe the loop must ship. If the probe returns NotAvailable, log one INFO line, close the WebSocket cleanly (the SPA's kvm_displays pre-flight plus DeskStatus render the headless state), and return without entering the loop. A working backend is unaffected: the loop starts after the first successful probe. A transient (non-NotAvailable) first-frame error falls through into the loop, where VA-112's rate-limiter still handles a backend that fails mid-session. unavailable_reason isolates the fail-closed classification so the boundary (only NotAvailable fails closed) is unit-tested without a live capture backend. #VA-115
fix(desktop): probe KVM backend once, fail closed on headless host
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 19m28s
Create release / Create release from merged PR (pull_request) Has been skipped
5fda6aa342
run_desktop entered the ~30 fps capture loop unconditionally. On a host with no graphical session every capture_changed_tiles tick returned KvmError::NotAvailable and the loop spun forever at frame rate, so the browser Desktop tab showed a blank canvas and the agent never told the client. VA-112 only throttled the log line; the spin and the silence remained.

Probe the backend once before the select loop, into a throwaway StreamState so a successful probe does not consume the first keyframe the loop must ship. If the probe returns NotAvailable, log one INFO line, close the WebSocket cleanly (the SPA's kvm_displays pre-flight plus DeskStatus render the headless state), and return without entering the loop. A working backend is unaffected: the loop starts after the first successful probe. A transient (non-NotAvailable) first-frame error falls through into the loop, where VA-112's rate-limiter still handles a backend that fails mid-session.

unavailable_reason isolates the fail-closed classification so the boundary (only NotAvailable fails closed) is unit-tested without a live capture backend.

#VA-115
David scheduled this pull request to auto merge when all checks succeed 2026-07-06 04:04:47 +02:00
David merged commit 07357f087a into main 2026-07-06 04:13:49 +02:00
David deleted branch fix/VA-115-desktop-probe-once-fail-closed 2026-07-06 04:13:49 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/vervain-agent!117
No description provided.