Skip to content

Make OBS startup and connection more robust - #13

Open
Broyojo wants to merge 2 commits into
mainfrom
feat/obs-connection-robustness
Open

Make OBS startup and connection more robust#13
Broyojo wants to merge 2 commits into
mainfrom
feat/obs-connection-robustness

Conversation

@Broyojo

@Broyojo Broyojo commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

What

Hardens the OBS integration against the most common failure modes, especially on macOS:

  • Websocket connection retry with readiness probeOBSClient previously called obs.ReqClient() once and crashed if OBS was still starting up (which it usually is, since DuckTrack launches it). Now retries up to 5 times, verifying with get_version().
  • macOS launch via open -a OBS — launching the binary directly bypasses the normal app launch path, which breaks Screen Recording permission prompts. Correspondingly, close_obs now quits OBS via AppleScript on macOS (terminating the open process did nothing) with a killall fallback.
  • Profile fallback — if the computer_tracker profile can't be created or switched to, continue with the current profile and warn, instead of crashing. Profile restore on stop is now guarded the same way.
  • One-time macOS permissions notice — explains the Screen Recording / Accessibility / Input Monitoring requirements on first launch (relevant to Sluggish Movement on MacOS Sometimes #8 and DuckTrack does NOT opening in OSX - M1 Mac Ventura 13.6.6 #10, where recordings silently come out empty without them).

Notes

Builds on #12 (its commit is included here) — merge that first.

Credit

Adapted from the huyouare/DuckTrack fork by @huyouare, which debugged these failure modes on modern macOS. This PR takes the connection/launch/profile robustness ideas from that fork, reimplemented to match the existing code style (the fork's fallback input monitor and logging overhaul are intentionally not included, since the sentinel events it injects would break the events.jsonl schema that downstream consumers rely on).

🤖 Generated with Claude Code

ruiqurm and others added 2 commits July 21, 2026 23:02
- Retry the OBS websocket connection with a readiness probe, since OBS
  may still be starting up when DuckTrack launches it
- Launch OBS via `open -a` on macOS so permission prompts work, and quit
  it gracefully via AppleScript (terminating the `open` process does nothing)
- Continue with the current OBS profile instead of crashing when the
  computer_tracker profile can't be created or switched to
- Show a one-time notice on macOS explaining the required permissions

Adapted from the huyouare/DuckTrack fork.

Co-authored-by: Jesse Hu <3528340+huyouare@users.noreply.github.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants