Skip to content

fix(computer-use): stop macOS capture after resize failure - #3842

Merged
bobleer merged 1 commit into
openBitFun:mainfrom
bobleer:bob/fix-macos-capture-resize-leak
Nov 9, 2026
Merged

bobleer merged 1 commit into
openBitFun:mainfrom
bobleer:bob/fix-macos-capture-resize-leak

Conversation

@bobleer

@bobleer bobleer commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

When ScreenCaptureKit rejects a window resize, revoke the matching Computer Use session through the existing generation- and target-scoped stop path. This releases the native capture stream and preserves the first terminal error. The macOS capture fixture now distinguishes an unavailable surface from a successful frame and injects a resize rejection on a real stream.

Type and Areas

Bug fix in the macOS Computer Use provider, shared by Desktop and graphical CLI. Includes a native regression fixture.

Motivation / Impact

In a real macOS Desktop session, an injected ScreenCaptureKit resize error caused screenshot requests to fail while control remained active. The system kept the capture stream until an explicit Stop. With this change, the session stops on failure, replayd confirms the stream was released, and a new sharing session can capture normally.

Verification

  • node scripts/test-macos-control-capture.mjs passed, including the injected resize error.
  • cargo test --locked -p openbitfun-computer-use --lib control_session::tests:: passed all five tests.
  • cargo build --locked -p openbitfun-desktop passed.
  • Compared unpatched and patched Desktop builds on macOS 15.8.2 using a disposable window and an injected native resize failure. Confirmed automatic stream shutdown in replayd and verified sharing could restart.
  • node scripts/test-windows-computer-use-native.mjs --check --target x86_64-pc-windows-msvc passed as a cross-target type check. An Ubuntu Wayland 1.0.8 idle startup check recorded no ScreenCast or RemoteDesktop portal method calls.
  • Verification exercised local desktop flows. Remote workspace, remote control, Peer Device Mode, and Detached Dispatch were not exercised.

Reviewer Notes

AI-assisted. Tested on the native macOS Desktop path and with focused provider tests. The Windows and Linux provider code is unchanged.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

@bobleer
bobleer merged commit be56bf7 into openBitFun:main Nov 9, 2026
12 checks passed
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