Repository navigation
feat(computer-use): cross-platform AppProvider replacing macOS-only FocusManager - #1078
Merged
Merged
Conversation
…ocusManager Replace the macOS-only FocusManager interface with a cross-platform AppProvider that enumerates running applications, activates by stable ID/name, and reports the focused application - implemented for macOS, X11, and Wayland (stub). Breaking changes: ActivateApp now takes app_id or name instead of bundle_id. GetFocusedApp returns structured Application data. FocusManager interface removed; replaced by AppProvider. macOS: added PID-based activation for unbundled/dev processes. X11: implemented via _NET_CLIENT_LIST, _NET_WM_PID, _NET_ACTIVE_WINDOW. Wayland: stub returning ErrAppUnsupported. Errors distinguish 'application not running' (ErrAppNotFound) from OS refusal. Resolves #1076
- app_darwin.go could not compile: cgo names are per-file, so the standalone provider referencing C functions from client_darwin.go's preamble failed; it is now a thin provider delegating to package functions in client_darwin.go (also removes the duplicated implementation on MacOSClient/Controller) - remove leftover GetTerminalApp/SwitchToTerminal calling the deleted getTerminalApp C function, and the unused GetFrontmostApp - strdup ObjC UTF8String returns: freeing autoreleased interior pointers corrupted the heap, and listRunningApps returned a pointer that died with its autorelease pool - drop Close from AppProvider: tools were closing the shared registered singleton, killing the X11 connection after the first call; the X11 provider is now stateless and opens one short-lived connection per call - fix _NET_ACTIVE_WINDOW client message: the target window belongs in the event's window field (was root), use proper SubstructureRedirect|Notify mask (was 0x00FFFFFF), and build it with xproto.ClientMessageEvent instead of hand-rolled byte helpers - delete the Wayland stub: it was only registered when it would always be skipped by DetectAppProvider, which no longer probes - stop advertising a nonexistent ListRunning tool in prompts and schema descriptions - only warn in storeFocusedApp on a real error, not on headless nil
This was referenced Aug 19, 2026
edenreich
added a commit
that referenced
this pull request
Aug 19, 2026
Resolves #1077 ## Summary Removes the macOS-only Swift floating window outright (no deprecation cycle). The desktop app's computer-use monitor, screen overlay, and approval surface (inference-gateway/desktop#135) are the visualization layer, consuming the headless control surface from #1074/#1075. ## Changes - **Deleted**: `internal/display/macos/ComputerUse/` (Swift app), the `//go:embed` + `FloatingWindowManager` lifecycle (`manager.go`, `manager_stub.go`, `types.go`), and the cmd wiring (`floating_window_darwin.go`, `floating_window_stub.go`) - **Config**: `floating_window` section removed from `computer_use.yaml` schema, defaults, and `INFER_COMPUTER_USE_FLOATING_WINDOW_*` env overrides. Existing config files with the old keys still load (yaml unmarshal is lenient; covered by a test fixture that keeps the removed keys) - **Chat**: control-event forwarding to Bubble Tea now gates on an EventBridge being present instead of the floating window; EventBridge itself stays (extension bridge / control surface use it) - **Release workflow**: Swift build step removed - **CI**: new `build-macos` job (`macos-latest`, plain `go build`) so darwin cgo code compiles in CI — the previous ubuntu-only matrix masked darwin breakage (see #1078). Now trivial since the Swift embed is gone - **README**: points at the desktop app for visualization ## Acceptance criteria - [x] `ComputerUse/` and `cmd/chat.go` wiring removed - [x] `floating_window` dropped; unknown keys don't break config load (test-covered) - [x] `infer chat` computer-use session verified against the mock gateway (model select, prompt, reply; 42 tools registered, no floating-window errors) - [x] README no longer references the Swift window ## Impacted repos - **docs**: inference-gateway/docs#578 - **desktop**: no action required — tool names unchanged; schema change (`bundle_id` → `app_id`/`name`) noted on desktop#70 separately ## Docs Filed: inference-gateway/docs#578
Contributor
|
🎉 This PR is included in version 0.176.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #1076
Summary
Replace the macOS-only FocusManager interface with a cross-platform AppProvider abstraction for the computer-use tool surface. ActivateApp now targets running applications by stable ID or name (not installed-bundle lookup), and GetFocusedApp returns structured application data on all three platforms. Errors distinguish "not running" from "OS refused".
Changes
Applicationstruct (ID, Name, PlatformID) - a cross-platform model for running appsdisplay.AppProviderreplacingdisplay.FocusManager- methods:ListRunning,Activate,GetFocused,CloseErrAppNotFoundandErrAppUnsupportedfor clear error distinctionmacosAppProviderregistered viainit(), uses NSWorkspace to enumerate all running apps, activate by bundle ID or PID (unbundled/dev processes now work)x11AppProviderusing_NET_CLIENT_LIST,_NET_WM_PID,_NET_ACTIVE_WINDOWatoms + fallback toSetInputFocusErrAppUnsupportedwith documented limitationbundle_id(macOS-only) toapp_id(stable ID) orname(substring match)bundle_idargument removed