Skip to content

Add obs-preflight recording checks - #4

Merged
Tom-R-Main merged 1 commit into
mainfrom
improve/preflight
Sep 24, 2026
Merged

Tom-R-Main merged 1 commit into
mainfrom
improve/preflight

Conversation

@Tom-R-Main

Copy link
Copy Markdown
Owner

Stacked on #3.

obs-preflight is a read-only tool. It checks for each condition under which OBS's StartRecording silently does nothing or opens a blocking dialog (see frontend/widgets/OBSBasic_Recording.cpp), plus the problems we hit while recording the Siftable demo.

Check Fails / warns when
record-idle Recording is already active
record-directory The path is missing or not writable. Skipped as unknown when OBS is on another host
disk-space Free space is under minFreeDiskMb (default 1024)
encoder The recording encoder doesn't exist on this platform, e.g. NVENC on macOS. Follows the stream encoder for Simple "Stream" quality and Advanced RecEncoder=none
output-settings obs-set-profile-parameter changed output settings since OBS last connected; OBS ignores them until it rebuilds its outputs
audio An unmuted input feeds a recorded track. A warning, or a failure with expectSilent
scene-items A visible item in the program scene renders at 0×0
settings-dialog Always unknown: the WebSocket can't report open dialogs

A 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 check passes (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

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
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-22T21:51:21.709570Z 8ae1390 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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".

Comment thread src/client.ts
return;
}
this.identified = true;
this.outputSettingsPending = false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment thread src/tools/config.ts
async ({ parameterCategory, parameterName, parameterValue }) => {
try {
await client.sendRequest("SetProfileParameter", { parameterCategory, parameterName, parameterValue });
if (OUTPUT_PARAMETER_CATEGORIES.has(parameterCategory)) client.markOutputSettingsPending();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment thread src/tools/preflight.ts
Comment on lines +145 to +146
} else {
checks.push({ id: "encoder", status: "pass", message: `${mode} output mode records with ${encoder}` });

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment thread src/tools/preflight.ts
Comment on lines +221 to +223
if (isObject(transform) && (transform.sourceWidth === 0 || transform.sourceHeight === 0)) {
blank.push(String(item.sourceName ?? item.sceneItemId));
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@Tom-R-Main
Tom-R-Main deleted the branch main September 24, 2026 05:09
@Tom-R-Main Tom-R-Main closed this Sep 24, 2026
@Tom-R-Main Tom-R-Main reopened this Sep 24, 2026
@Tom-R-Main
Tom-R-Main changed the base branch from improve/quick-fixes to main September 24, 2026 05:10
@Tom-R-Main
Tom-R-Main merged commit c82026d into main Sep 24, 2026
8 checks passed
@Tom-R-Main
Tom-R-Main deleted the improve/preflight branch September 24, 2026 05:13
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