Skip to content

Report screen recordings that fail to start - #7189

Closed
Literato2 wants to merge 3 commits into
omacom:quattrofrom
Literato2:notify-when-recording-fails-to-start
Closed

Literato2 wants to merge 3 commits into
omacom:quattrofrom
Literato2:notify-when-recording-fails-to-start

Conversation

@Literato2

Copy link
Copy Markdown
Contributor

start_screenrecording already notices when gpu-screen-recorder dies before writing the output file — the wait loop breaks on the dead pid and the kill -0 guard fails — but the failure branch didn't exist. No notification, nothing on screen. A recording that never starts is indistinguishable from a keybinding that does nothing, and the stderr explaining why goes to /dev/null unless OMARCHY_SCREENRECORD_DEBUG=true is already set, which nobody sets before the first failure.

This adds the missing else: notify, and return non-zero, which the caller at the bottom already treats as failure (start_screenrecording || cleanup_webcam).

Verified by forcing a start failure — the notification fires with the message pointing at the debug variable.

Independent of #7184 and of the portal-ordering PR; this one is about surfacing any start failure, whatever the cause.

One thing I left alone: the script's own exit status still comes from that || cleanup_webcam, so omarchy capture screenrecording continues to exit 0 on failure. Happy to change that too if you'd want it.

The startup wait already notices when gpu-screen-recorder dies before it
writes the output file, but the failure branch did nothing: no message,
and the script still exited 0. A recording that never starts looks
exactly like a keybinding that does nothing.

Notify on that path and return non-zero, which the caller already treats
as failure by tearing down the webcam overlay. Point at the existing
debug variable, since the stderr that explains the failure goes to
/dev/null unless it is set.
@686f6c61

Copy link
Copy Markdown

The missing else is the right fix. start_screenrecording already leaves the wait loop when gpu-screen-recorder dies before the output file appears; the kill -0 guard then fails and used to fall through with nothing on screen. A recording that never starts looked like a dead keybinding.

omarchy-notification-send is the helper this file already uses for the other start failures (missing output dir, no webcam, force-kill). Pointing at OMARCHY_SCREENRECORD_DEBUG=true is accurate: LOG_FILE is /dev/null unless that env is set, so stderr is gone unless you already knew to turn it on.

One leftover I'd leave for a follow-up, same as you noted: the caller is still start_screenrecording || cleanup_webcam, so omarchy capture screenrecording exits 0 after this path. Changing that is a separate, caller-visible behavior change from surfacing the failure.

Read against current quattro bin/omarchy-capture-screenrecording. Did not force a start failure on hardware here.

@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Sep 28, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 6b563c3 and reproduced on a worker built from the Omarchy ISO. Nothing found that needs changing.

Reproduction. I made the real gpu-screen-recorder fail at start (--fullscreen --resolution=bogus, which it rejects immediately) and watched the session bus for notifications. On quattro (3faafba) and on this branch with its commit reverted, the recorder exits and nothing is sent: no notification, no indicator, nothing on screen. On this branch, "Screen recording failed to start" arrives as a critical notification. ./test/cli and test/shell.d/screenrecording-test.sh (18 passed) are green on the same worker. The branch is behind quattro but merges cleanly, and the lines it touches are unchanged there.

What else it fixes. Returning 1 means the start_screenrecording || cleanup_webcam caller now runs. Before this change, the empty if returned success, so a failed start with --with-webcam left the webcam overlay on screen. I checked that by reading the code, not on the worker, which has no camera.

Second opinion. Codex at medium effort reviewed the same diff and found no defects. It traced every path into the new branch and pointed out the webcam cleanup above. It may have read this review in progress, so its agreement is not guaranteed to be independent. It also raised two points that don't block this PR:

  • If OMARCHY_SCREENRECORD_DEBUG=true is already set, the notification still tells the user to set it. Pointing at the log file in that case would help more, but this is a wording choice.
  • If the recorder creates its output file and then dies before the final kill -0, the empty or partial file is left in the videos directory. That already happens on quattro, so this change doesn't introduce it.

As you noted, omarchy capture screenrecording still exits 0 when the start fails. Changing that is a separate change that callers would notice.

This is labelled verified and ready. Merging it is the maintainer's decision.

@omarchybot omarchybot added ready Good to merge and removed ready Good to merge labels Sep 28, 2026
@omarchybot omarchybot removed ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review labels Oct 10, 2026
omarchybot and others added 2 commits October 11, 2026 01:08
quattro now tries each installed recorder in turn and returns 1 only once every backend has failed to start, with the picker and cancel paths returning earlier. The notification moves to that final return, so it fires when no recorder started and stays silent when the user cancels.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A recorder that never creates its file is stopped after the ready timeout, which can take two seconds, and the loop moves on without checking for a cancel. When that was the last backend, a cancel arriving meanwhile reached the failure notification.

Co-Authored-By: Codex Medium <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 10, 2026
@greptile-apps

greptile-apps Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] This PR appears safe to merge.

Summary

This PR reports screen recordings that fail after all recorder backends have been tried.

  • Failed recording starts now show a notification and debug hint.

Reviews (1) · Last reviewed commit: "Stay silent when a start is cancelled wh..." · Reviewed by Greptile

@omarchybot omarchybot added the ready Good to merge label Oct 10, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-reviewed after quattro moved under this branch, and brought it back to merging cleanly. It is at 123a4b2 now.

What changed on quattro. start_screenrecording now tries each installed recorder in turn (gpu-screen-recorder, then wf-recorder) and returns 1 only after every one has failed to start. The if kill -0 block this branch added an else to is now inside that loop, so the original change no longer applied. I merged quattro into the branch and moved the notification to the function's last return 1, after the loop. It fires once, when no recorder started, and never between one backend and the next. Same message, same urgency. Cancelling the picker or a toggle while the start is pending returns earlier and stays silent. There was no rebase or force push; your commit is unchanged underneath.

One fix on top. A recorder that never creates its file is stopped after the ready timeout, which can take up to two seconds, and the loop moves on without checking for a cancel. If that was the last backend, a cancel arriving in those two seconds reached the failure notification. A start_cancelled && return 1 before the notification closes that, the same guard the function uses after the picker. Codex found this in its first round.

Reproduction, on a worker built from the Omarchy ISO. I made the real gpu-screen-recorder fail at start (--fullscreen --resolution=bogus) and watched the session bus. On quattro (f2a39c4), and on this head with the notification removed, nothing is sent. On this head, "Screen recording failed to start" arrives. I also ran a stand-in recorder that never writes its file. Left alone, both the merge and this head notify after the timeout. With a cancel during the stop, the merge notifies and this head does not. A picker cancel sends nothing. ./test/cli (117 passed) and the six test/shell.d/screenrecording-*.sh files (61 passed) are green on the same worker, and the Greptile check passed.

Second opinion. Codex at medium effort reviewed both rounds. The first found the cancel edge above. The second, on 123a4b2, found nothing further. Codex may have read this review in progress, so its agreement in the second round is not guaranteed to be independent.

The script's own exit status after a failed start is unchanged, as you noted in the description.

This is labelled verified and ready, and it waits on the maintainer.

omarchybot added a commit to ThePrimeagen/omarchy that referenced this pull request Nov 15, 2026
A cancel that lands while the last recorder is being stopped after its ready timeout reached the failure notification, so cancelling could report a failed start and exit 1. The notification now also points at OMARCHY_SCREENRECORD_DEBUG, since the recorder's stderr goes to /dev/null without it. Both come from omacom#7189.

Co-Authored-By: Literato2 <317679755+Literato2@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Closing in favour of #19094. The maintainer wants a failed start to be actionable on its own: #19094 retries the start once with the debug log on and puts the recorder's actual error in the failure notification, rather than asking the user to turn on debugging and try again. Your notification and cancel handling informed it, and you're credited there. Reviewed by Claude Opus 5.5 with Codex Medium as a second opinion; its independence is not guaranteed.

@omarchybot omarchybot closed this Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants