Repository navigation
fix(computer-use): discover and target exact application windows - #3430
Merged
bobleer merged 2 commits intoOct 16, 2026
Merged
Conversation
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.
Summary
Computer Use can select a windowless launcher or an application's large main window while the requested task lives in a different process or smaller window. Add native window discovery and exact
{pid, window_id}targeting so the agent can identify the task by title and keep observations and input bound to it.Also honor
describe_screen(include_image: true)for vision-capable models and correct recovery guidance that treated a windowless process or sparse accessibility tree as evidence that the task was absent.Update the existing navigation-icon regression to follow the overview components introduced in #3426. The initial CI run exposed its stale inline-icon expectations; the test now verifies the MiniApp logo component is wired into the overview, retains each app's icon, and uses the standard search icon for Skill discovery. No production overview code changes.
Type and Areas
Type: bug fix and capability improvement.
Areas: Computer Use tool contracts/orchestration, macOS and Windows desktop providers, built-in agent prompt, native regression fixture, architecture documentation.
Motivation / Impact
list_windowsdiscovers native titles and owner PIDs without activating or selecting a window. macOS includes off-screen WindowServer entries; Windows lists visible, non-minimized titled top-level windows.window-target-v1. Exact selection validates window ownership, supports switching windows within one process, and preserves the existing capture when a requested replacement cannot be resolved. An exact-window failure cannot return a different window's AX tree as fallback.describe_screenpreserves its text-only default and returns the requested window image plus screenshot identity/geometry when explicitly requested by a vision-capable model.Verification
Passed locally on macOS:
node scripts/test-computer-use-context.mjs— 66 passed, 1 ignored.cargo test --locked -p openbitfun-core --no-default-features --features agent-runtime,git,tools-computer-use --lib computer_use_tool::tests— 57 passed.cargo test --locked -p openbitfun-agent-content --test prompt_catalog_contracts— 9 passed.cargo test --locked -p openbitfun-desktop --features devtools --lib computer_use— 163 passed, 9 opt-in tests ignored.node scripts/test-macos-control-roundtrip.mjs— passed using its documentedOPENBITFUN_TEST_BINARYoption after compiling the native harness. The full production Tool pipeline discovers both fixture windows, first captures the larger default window, selects the smaller window by ID, rejects a wrong-owner ID without losing the existing binding, returns an image fromdescribe_screen, and verifies click delivery, Unicode text, Return, OCR, and unchanged human foreground state. The fixture does not overrideacceptsFirstMouse.node scripts/test-windows-computer-use-native.mjs --check --target x86_64-pc-windows-msvc— native-module cross-compilation passed; this is not Windows execution or a full Windows Desktop build.cargo build --locked -p openbitfun-desktop --features devtools— passed.pnpm run fmt:rsandgit diff --check— passed.pnpm --dir src/web-ui run test:run src/app/components/NavPanel/navigationIconIntegration.test.ts src/app/scenes/personal-overview/OverviewMiniAppLogos.test.tsx src/app/scenes/personal-overview/PersonalOverviewScene.actions.test.tsx— 30 passed after reproducing and correcting the stale navigation-icon assertion from the initial CI run.The original game was not replayed with the new build. Windows native behavior and remote-control/peer/detached scenarios were not exercised locally; existing CI supplies broader platform checks.
Reviewer Notes
AI-assisted. Testing level: fully tested for the listed local macOS scenarios, with platform and end-to-end limits stated above.
The selector field is optional and legacy payload round trips remain covered. Older hosts and Linux reject unsupported exact-window selectors explicitly. Linux retains its AT-SPI/portal contract; remote SSH workspaces retain their explicit unsupported response. No new desktop capture fallback or input permission path is introduced.
Checklist