Skip to content

fix(automation): keep tools and previews in the thread session - #886

Merged
nixuuu merged 1 commit into
devfrom
fix/automation-preview-sessions
Nov 16, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/automation-preview-sessions

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 16, 2026

Copy link
Copy Markdown
Member

Change

Automation could open its own session while thread Preview watched the thread-derived session, leaving the preview disconnected. Desktop batches could override the startup session, and global lifecycle operations could affect other threads.

Use one worker-owned thread scope for browser, desktop and device MCP calls and catalogs, checked before gateway authorization. Preserve each tool's supported argument grammar:

  • Keep Browser headless and reject global close all as well as session and namespace overrides.
  • Bind Desktop batch sessions and session-end IDs. Hide and reject session creation, global session GC and sandbox execution outside the host Preview.
  • Bind Device calls and batch steps. Hide and reject the test runner, which creates per-attempt sessions; scripts can use replay in the thread session.
  • Let default Desktop/Device previews follow the current focused window or thread-session device while explicit selections stay pinned. Resolve the apple alias against iOS/macOS catalog entries.

Update automation documentation and add adapter and MCP bridge regression coverage.

Fixes: #846

Verification

  • 60 targeted local tests passed across MCP policies/bridge, tool and Preview adapters, and real gateway↔worker Preview/activity integration, with temporary-file cleanup.
  • After rebasing onto current dev, reran the affected tool/Preview adapter tests, worker typecheck and scoped lint.
  • Edited TypeScript files formatted with oxfmt; diff checks passed.
  • Installed Browser 0.43.0, Desktop 1.3.1 and Device 0.21.37 passed actual MCP catalog checks and read-only calls, including Desktop batch execution. Native desktop/device UI interaction was not exercised.
  • Full generation checks, repository-wide static checks, test shards and builds remain with CI.

Copy audit (§8): not applicable; no UI copy changed. New guidance and errors belong to the model-facing MCP interface.

Bind browser, desktop and device automation to a shared worker-owned thread scope, reject session escapes and keep default preview targets current.

Fixes: #846
@nixuuu
nixuuu enabled auto-merge (squash) November 16, 2026 20:25
@nixuuu
nixuuu merged commit df8a15f into dev Nov 16, 2026
15 checks passed
@nixuuu
nixuuu deleted the fix/automation-preview-sessions branch November 16, 2026 20:32
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