Repository navigation
Fixes from the live run: audio-only 0×0 warnings, snapshots saved to disk - #17
Conversation
Microphones, desktop audio, and media sources playing an audio file are always 0x0, but obs-preflight, obs-apply-scene, and the read-back after an input change warned about them, and the read-back waited a second for them to get a size. A shared rendersNoVideo check now skips them. Snapshots lived in the server's memory, so obs-restore could not undo a change once that server exited, which is what happened in the live test. They are now saved to the state directory (OBS_MCP_STATE_DIR, or the platform's app data folder), owner-readable only, the last 20, and listed per OBS instance. Unit tests get a fresh state directory each. 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: b37e4a51b3
ℹ️ 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".
| } catch (error) { | ||
| logger.error(`Could not save snapshots to ${path}: ${error instanceof Error ? error.message : String(error)}`); |
There was a problem hiding this comment.
Propagate snapshot persistence failures
When the state directory is unwritable, the disk is full, or renameSync otherwise fails, this catch only logs the error and lets takeSnapshot return normally. Consequently obs-snapshot, obs-apply-scene, and obs-capture-window report that a restorable snapshot was saved and may proceed with changes, but that snapshot cannot be restored. Propagate the failure so callers do not promise an undo point that does not exist.
Useful? React with 👍 / 👎.
| const list = snapshots(client); | ||
| list.push(snapshot); | ||
| if (list.length > MAX_SNAPSHOTS) list.shift(); | ||
| saveAll([...loadAll(), snapshot]); |
There was a problem hiding this comment.
Serialize cross-process snapshot updates
When two stdio server processes take snapshots concurrently, each can read the same snapshots.json, append only its own snapshot, and then atomically rename its stale list over the other process's update; one successfully reported snapshot is therefore lost. This is directly possible in the newly supported cross-agent workflow, and atomic rename prevents torn writes but not this read-modify-write race, so updates need cross-process serialization or independent per-snapshot files.
Useful? React with 👍 / 👎.
Stacked on #16.
Found live (OBS 32.2.2, after recovering OBS from the parallel-batch deadlock):
obs-apply-sceneplan-only against "Demo": it reported "already matches", and forfit: "canvas"it planned only the 3 transform fields that differ.obs-apply-sceneadded a muted synthetic 440 Hz tone (a media source playing a WAV, not system audio) behind the background.obs-take-start {expectSilent: true}, tone unmuted for 4 s, thenobs-take-stop.Fixed here
obs-apply-scenewarned "MCP Test Tone renders at 0×0", and preflight did the same. Any scene with a microphone got a false warning, and the read-back after changing a mic waited a second for a size that never comes.rendersNoVideo(kind, settings): audio-capture kinds on every platform, plusffmpeg_source/vlc_sourceplaying an audio file.obs-apply-sceneand the read-back after an input change.OBS_MCP_STATE_DIR(default: the platform's app-data folder, e.g.~/Library/Application Support/obs-mcp).Tests:
npm run checkpasses (210 unit, 14 e2e); live suite 6 passed, 2 skipped. New tests: the audio-only kinds; preflight with a mic;obs-apply-scenewith an audio file; a mic settings change (no wait, no warning); a snapshot restored by a new server on the same OBS address (file mode 0600); per-instance listing; state-directory paths.🤖 Generated with Claude Code
https://claude.ai/code/session_01Vjn8uBEa4mJshaQU3pFuqX