Skip to content

feat(desktop): warn when the recording's microphone or camera disconnects - #4263

Open
richiemcilroy wants to merge 10 commits into
feat/gpui-recording-settings-menufrom
feat/gpui-device-disconnect-warnings
Open

richiemcilroy wants to merge 10 commits into
feat/gpui-recording-settings-menufrom
feat/gpui-device-disconnect-warnings

Conversation

@richiemcilroy

@richiemcilroy richiemcilroy commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Stacked on #4262.

When the microphone or camera disappears mid-recording, the GPUI app said nothing: the bar's issue card only covered errors, sleep pause and low storage (controls_window.rs), and the camera bubble had no "Camera disconnected" overlay (camera_window.rs listed it as a known gap). The Tauri app warned in both places (in-progress-recording.tsx:199-208, camera.tsx:66,162) and reopened the device when it came back. This brings that back.

sequenceDiagram
    participant W as Input watch (1 s poll)
    participant S as RecordingSession
    participant F as Feed the recording reads
    participant UI as Bar + bubble
    W->>S: selected mic / camera missing from the device list
    S->>UI: "Microphone disconnected. Silence will be used until it reconnects."
    Note over F: recording continues: mic source fills silence, camera track gets no frames
    W->>S: same device listed again
    S->>F: SetInput(same device) on the locked feed
    F-->>S: ready
    S->>UI: warning clears
Loading
  • Detection (session/input_watch.rs): while a recording is live (running or paused), poll the microphone names and camera device ids once a second, as Tauri's spawn_microphone_watcher / spawn_camera_watcher did. Only the inputs the recording uses are watched: an input switched to "None", or one with a switch in flight, is never reported missing.
  • Keeps recording: nothing stops. The microphone source already fabricates keepalive silence for a dead device; the camera track simply has no new frames until it returns.
  • Reconnect: when the same device is listed again it is reopened on the feed the recording reads from. A locked feed accepts the same device back without a new lock (LockedInputReconnected), so Studio and Instant both resume on it. After an Instant mic switch (feat(desktop): recording settings menu with mid-recording microphone and camera switching #4262) that is the switched-to feed. The warning clears only once the reopen succeeds; a failed reopen retries on the next poll.
  • Bar: the issue card shows the Tauri wording for each lost input; the mic indicator turns to the red mic-off icon with no level while disconnected.
  • Bubble: the existing issue overlay shows "Camera disconnected / The selected camera stopped sending video." while the camera is gone.

Edge cases

Case Behaviour
Unplug while paused Detected (the watch runs while paused); reopened on return
Unplug, then stop Stop is unaffected; the watch ends with the recording
Device switched to "None" Not watched, never warns
Device returns but fails to open Warning stays, retried every second
Next recording State resets when a recording starts

Tests

  • session::input_watch::tests: a missing device warns and its return asks for a reopen while the warning stays until the reopen succeeds; an input the recording stopped using never warns.
  • i18n surface pairs for the four new strings in every locale.

Proof

The warning in the real app

macOS 15 runner (Blacksmith), real app, Studio recording on "Cap Test Mic B" (a CoreAudio aggregate device over BlackHole). The device is destroyed 6 s in and created again 4 s later:

23:29:35.144  recording started
23:29:41.591  recording microphone disconnected; recording continues with silence
23:29:45.902  recording microphone reconnected
23:30:14.460  recording finished

The warning shows within a second of the unplug (the watch polls once a second), and the microphone is reopened within a second of the device returning.

Light Dark
Unplugged
Plugged back in

A/V sync across an unplug

Flash and click stimulus recorded on the same runner by this branch's cap-recording and main's, side by side (runs 43982721209 and 43985132765). The microphone is unplugged at 20 s and plugged back in at 30 s. The table shows how far av-sync-check's mean offset (video minus audio) moved between the 10 flashes before the unplug and the 19 to 20 after the reconnect.

Recording Run 1 change (ms) Run 2 change (ms)
Instant, this PR / main +2.8 / +2.4 +4.8 / +0.7
Studio, this PR / main -0.6 / +0.4 +2.6 / +0.6

Not proven

  • The camera warning was not captured: the hosted macOS runners have no camera. The bubble overlay reuses the existing issue overlay, covered by the input watch tests.
  • The A/V probe drives cap-recording directly, so its reconnect is the microphone source's own retry, not the app's reopen on the locked feed. The app's reopen is shown working in the log above; its sync was not measured separately.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge, with no outstanding actionable findings.

Summary

Adds microphone and camera disconnect warnings during recording, then reopens the selected device when it returns.

  • GPUI recordings now spot lost inputs and reopen them when they return.
  • The controls bar and camera bubble now explain when recording inputs disappear.

Reviews (8) · Last reviewed commit: "fix(desktop): keep the camera's identity..." · Reviewed by Greptile

@vercel

vercel Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
cap-status Skipped Skipped Nov 17, 2026 1:39am UTC

@vercel
vercel Bot temporarily deployed to Preview – cap-status November 14, 2026 07:05 Inactive
@sandchest-com

sandchest-com Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Sandchest

Sandchest reviewed 5e5669a: nothing exploitable found in this change.

Sandchest reviews every change for vulnerabilities an attacker could use · 2 credits · Review details

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found 2 potential issues (2 medium).

View 1 other finding in Capy.

Open in Capy

Comment thread apps/desktop-gpui/src/camera_window.rs Resolved
Comment thread apps/desktop-gpui/src/recording.rs Resolved
@richiemcilroy
richiemcilroy force-pushed the feat/gpui-device-disconnect-warnings branch from 6b34355 to a5e4cbb Compare November 14, 2026 15:28
@vercel
vercel Bot temporarily deployed to Preview – cap-status November 14, 2026 15:28 Inactive

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

Open in Capy

@richiemcilroy
richiemcilroy force-pushed the feat/gpui-device-disconnect-warnings branch from a5e4cbb to ee52390 Compare November 14, 2026 17:39
@vercel
vercel Bot temporarily deployed to Preview – cap-status November 14, 2026 17:39 Inactive
@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

View 1 other finding in Capy.

Open in Capy

@richiemcilroy
richiemcilroy force-pushed the feat/gpui-device-disconnect-warnings branch from ee52390 to c491b43 Compare November 14, 2026 20:30
@vercel
vercel Bot temporarily deployed to Preview – cap-status November 14, 2026 20:30 Inactive

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

View 1 other finding in Capy.

Open in Capy

@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@richiemcilroy
richiemcilroy force-pushed the feat/gpui-device-disconnect-warnings branch from c491b43 to 3be7375 Compare November 15, 2026 04:38
@vercel
vercel Bot temporarily deployed to Preview – cap-status November 15, 2026 04:38 Inactive

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

View 1 other finding in Capy.

Open in Capy

@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@vercel
vercel Bot temporarily deployed to Preview – cap-status November 17, 2026 00:10 Inactive
@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

View 1 other finding in Capy.

Open in Capy

@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@vercel
vercel Bot temporarily deployed to Preview – cap-status November 17, 2026 00:58 Inactive

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

Open in Capy

Comment thread apps/desktop-gpui/src/feeds.rs Resolved
@vercel
vercel Bot temporarily deployed to Preview – cap-status November 17, 2026 01:39 Inactive
@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

View 1 other finding in Capy.

Open in Capy

This branch was successfully deployed

1 active (outdated) and 1 inactive deployments
Preview – cap-status — 5e5669a4 Deployed Nov 17, 2026 by vercel[bot]
Preview – cap-web — 74a1100b Deployed Nov 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant