Repository navigation
Add obs-preflight recording checks - #4
Conversation
Checks, against the conditions OBS's StartRecording silently refuses or shows a blocking dialog for: an active recording, an unwritable output directory, low disk space, an encoder the platform lacks, output settings changed since OBS last connected (which OBS ignores until it rebuilds outputs), audible inputs on recorded tracks (warning, or failure with expectSilent), and visible 0x0 sources. Open Settings/error dialogs cannot be detected over WebSocket and are reported as unknown. The fake OBS advertises responder request types, and tests share TOOL_COUNT. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Vjn8uBEa4mJshaQU3pFuqX
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ae1390e4b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return; | ||
| } | ||
| this.identified = true; | ||
| this.outputSettingsPending = false; |
There was a problem hiding this comment.
Preserve pending settings across transient reconnects
When the WebSocket reconnects without OBS restarting—for example after a network interruption or toggling the WebSocket server—this clears outputSettingsPending even though OBS has not rebuilt its outputs. A subsequent obs-preflight therefore omits the output-settings failure and can report ready while the profile change is still unapplied; the flag should only be cleared in response to a confirmed output rebuild or an explicit acknowledgement.
Useful? React with 👍 / 👎.
| async ({ parameterCategory, parameterName, parameterValue }) => { | ||
| try { | ||
| await client.sendRequest("SetProfileParameter", { parameterCategory, parameterName, parameterValue }); | ||
| if (OUTPUT_PARAMETER_CATEGORIES.has(parameterCategory)) client.markOutputSettingsPending(); |
There was a problem hiding this comment.
Track output changes made through the generic request tool
When a caller invokes SetProfileParameter through obs-call-request, src/tools/protocol.ts sends the request directly and bypasses this sole call to markOutputSettingsPending. The generic tool can therefore change Output, SimpleOutput, or AdvOut settings and the next preflight will incorrectly consider them applied; track this mutation in the shared request path or in the generic handler as well.
Useful? React with 👍 / 👎.
| } else { | ||
| checks.push({ id: "encoder", status: "pass", message: `${mode} output mode records with ${encoder}` }); |
There was a problem hiding this comment.
Verify encoder availability before reporting a pass
For every Windows or Linux encoder whose name does not match the Apple regex, this branch reports pass based only on the operating system. A profile imported onto a Windows machine without the required NVIDIA GPU or driver can still contain nvenc, so preflight reports ready even though OBS cannot create the recording encoder; platform compatibility alone should not be treated as proof that the configured encoder is available.
Useful? React with 👍 / 👎.
| if (isObject(transform) && (transform.sourceWidth === 0 || transform.sourceHeight === 0)) { | ||
| blank.push(String(item.sourceName ?? item.sceneItemId)); | ||
| } |
There was a problem hiding this comment.
Check rendered dimensions instead of intrinsic source size
For an enabled item whose transform scales it to zero or crops away its content, sourceWidth and sourceHeight remain the source's intrinsic nonzero dimensions, so this check reports that the item has a size even though it renders at 0×0. Inspect the rendered transform dimensions (width and height, including crop/scale effects) when deciding whether the recording will be blank.
Useful? React with 👍 / 👎.
Stacked on #3.
obs-preflightis a read-only tool. It checks for each condition under which OBS'sStartRecordingsilently does nothing or opens a blocking dialog (seefrontend/widgets/OBSBasic_Recording.cpp), plus the problems we hit while recording the Siftable demo.record-idlerecord-directoryunknownwhen OBS is on another hostdisk-spaceminFreeDiskMb(default 1024)encoderRecEncoder=noneoutput-settingsobs-set-profile-parameterchanged output settings since OBS last connected; OBS ignores them until it rebuilds its outputsaudioexpectSilentscene-itemssettings-dialogunknown: the WebSocket can't report open dialogsA request that fails makes its check
unknown, not the whole tool.Tests: 13 unit tests against a stateful fake OBS, one per failure plus the healthy case. Also a read-only live test, and the live recording test now requires preflight to report ready. Against real OBS 32.2.2 on the Siftable Review profile it reports ready.
npm run checkpasses (58 unit, 8 e2e). The live read-only suite passes (2 passed, 2 skipped by design).🤖 Generated with Claude Code
https://claude.ai/code/session_01Vjn8uBEa4mJshaQU3pFuqX