Skip to content

fix(operator-adb): await asynchronous device actions - #1958

Open
dvd233 wants to merge 1 commit into
bytedance:mainfrom
dvd233:fix/await-adb-actions
Open

fix(operator-adb): await asynchronous device actions#1958
dvd233 wants to merge 1 commit into
bytedance:mainfrom
dvd233:fix/await-adb-actions

Conversation

@dvd233

@dvd233 dvd233 commented Aug 31, 2026

Copy link
Copy Markdown

Summary

Closes #1952

AdbOperator.execute() awaits each singleActionExecutor() call, but several action branches started asynchronous ADB work without returning that promise through the call chain. This allowed the public API to report success before gestures or typing finished, detached command failures from the request, and let later actions start out of order.

This change awaits every affected path:

  • long_press, swipe, and drag wait for handleSwipe();
  • scroll waits for handleScroll(), which now waits for its inner handleSwipe();
  • type waits for handleType();
  • handleHotkey() waits for the ADB keyevent() promise.

The new tests use controllable ADB promises through the public doExecute() boundary. They cover all six action types, verify that command rejections produce a failed execution result, and verify that a later action does not start until the current device command completes.

Verification

  • pnpm --filter @gui-agent/operator-adb test -- --run: 1 suite, 7 tests pass.
  • pnpm --filter @gui-agent/operator-adb build: ESM, CJS, and declarations build successfully.
  • Standalone strict TypeScript check for test/AdbOperator.test.ts: passes.
  • pnpm exec prettier --check gui-agent/operator-adb/test/AdbOperator.test.ts: passes.
  • Git merge-tree with the current head of fix(security): prevent shell injection in ADB operator #1883 completes without conflicts.

No Android device was available for a hardware smoke test; the regression coverage uses delayed and rejecting ADB method mocks to validate ordering and failure propagation deterministically.

Checklist

  • Added or updated necessary tests (Optional).
  • Updated documentation to align with changes (Optional).
  • Verified no breaking changes, or prepared solutions for any occurring breaking changes (Optional).
  • My change does not involve the above items.

@netlify

netlify Bot commented Aug 31, 2026

Copy link
Copy Markdown

Deploy Preview for agent-tars-docs ready!

Name Link
🔨 Latest commit 8bd2679
🔍 Latest deploy log https://app.netlify.com/projects/agent-tars-docs/deploys/6a957b12a88ed80008920d49
😎 Deploy Preview https://deploy-preview-1958--agent-tars-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 31, 2026

Copy link
Copy Markdown

Deploy Preview for tarko ready!

Name Link
🔨 Latest commit 8bd2679
🔍 Latest deploy log https://app.netlify.com/projects/tarko/deploys/6a957b1210b9ec0008ea5c7d
😎 Deploy Preview https://deploy-preview-1958--tarko.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@CLAassistant

CLAassistant commented Aug 31, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

[Bug Report]: ADB operator reports success before asynchronous actions finish

2 participants