Skip to content

Mobile: press requests can deliver input after the action has timed out #1684

Closed

Description

@shamilovtim

A mobile press request can continue resolving or waiting inside agent-device after the adapter has already failed the action. The adapter races the SDK promise against its input budget but does not pass the SDK's existing request cancellation signal.

Reproduction

On the original main baseline d8b694ffa48b04c94d70a11cc280267f1ea9a100 (e2e 0.23.0, @e2e-dev/mobile 0.12.6):

  1. Dismiss a standalone UIKit fixture's overlay, which retains input for a three-second exit animation.
  2. Press the underlying fixture button with a 500 ms action timeout.
  3. Observe the fixture's native event counter after the action fails.

With the implicit native-readiness candidate f2bc18d described in callstack/agent-device#4388, the step fails at 501 ms, but its SDK request continues for 3071 ms and then delivers the input. This native reproduction deliberately uses that candidate to expose a pending pre-input wait; it does not claim the currently published SDK already waits for this overlay.

A deterministic reproduction with the real published SDK client and a controlled transport also shows that the adapter never forwards caller cancellation. No application-specific data or UI is needed.

Expected behavior

  • Forward caller interruption to ordinary SDK press requests.
  • Cancel a still-pending press when the adapter stops waiting for its response.
  • Preserve the existing minimum 250 ms acknowledgement allowance: an input already sent with a 100 ms budget may still return its acknowledgement at 180 ms.
  • Preserve unrelated SDK refusals and nonpress error classifications.
  • Keep the existing daemon session/device serialization and shared recording-finalization behavior.

This is the adapter-side cancellation companion to #1682 and callstack/agent-device#4388. Native readiness belongs inside the SDK; tests should not need a new wait API.

Implementation and verification

PR #1685, current source head d45a6e1551629f0f2dd165b739d6970a059febeb, forwards the SDK request signal for ordinary press calls while preserving the acknowledgement allowance and error classifications. This covers taps, double taps, focus, check/uncheck and the taps used to focus a field or dismiss a keyboard tip. Other input request lifetimes and shared recording finalization are unchanged. The package still pins published agent-device 0.21.36.

The newer matched native comparison uses mobile main baseline d8b694f versus live-tested mobile c282cf9, with separately identified SDK source 965e77b and matching native a55 assets on both sides. Main fails the zero-input assertion after a 502 ms tap timeout because input later reaches the fixture; the fix preserves zero input after the three-second fade and allows exactly one input from the following attempt. Fixture, commands, exact hashes and all five videos. This remains candidate-SDK evidence, not a claim that 0.21.36 already has implicit native-readiness polling.

A separate real-native acceptance probe waits for the native runner's actual COMMAND_ACCEPTED for a double tap, aborts the caller, then immediately starts the next attempt, relaunches the fixture and taps once. Main with recording off, the fix with recording off, and the fix with recording on all preserve the subsequent device ordering. Each fresh process receives exactly its own tap. With recording off, local attempt admission can precede native completion; the SDK fences the subsequent device work. Three videos, native command markers and process-specific event logs.

Head d45a6e15 adds test coverage to the unchanged production source from e15c0585. All 524 mobile tests and the full repository check pass in a separately installed checkout with pinned agent-device 0.21.36. The coverage proof records all eight isolated press-route bypass mutations failing the new assertions, plus the fresh device-fixture budget signal delivering one late input and failing the zero-input oracle; restoring the source passes.

The native cancellation videos above retain their original tested commits and SDK identifiers. Those dedicated probes were not repeated for the structural revision or this test-only follow-up.

All current-head CI checks passed at d45a6e15, including iOS and Android deterministic suites and the five-version Node matrix. The latest automated review reports zero issues; all optional re-review points have dispositions.

The supported cancellation contract is bounded: SDK issue #3383 and merged PR #3385, already present in 0.21.36, hold session/device locks while an accepted native command drains. The original native-command deadline, unavailable status or notAccepted can end draining with work unconfirmed and its charge abandoned. Client-promise rejection is not a universal native-termination guarantee. Arbitrary custom transports that ignore abort bypass the production daemon's locks; the controlled-transport reproduction is not native-device evidence.

All public application sources and media are constructed fixtures. This issue remains open until the implementation is merged.

Activity

  1. okwasniewski commented on Nov 11, 2026

    @okwasniewski
    Member

    Confirmed on main: no press or other input request passes the SDK's per-request signal (packages/mobile/src/surface.ts:1459/1466/1468/1493/1556/1700). InputBudget.send (support.ts:58-73) only races the request, so a press still waiting in the daemon can deliver input after the action failed. agent-device 0.21.36 supports per-request cancellation (client-connection.ts:199). With the published SDK nothing waits before input, so it mostly bites once callstack/agent-device#4391 lands, but worth fixing either way. Review posted on #1685.

    This was an automated triage.

  2. added
    bugSomething isn't working
    mobileMobile engine (@e2e-dev/mobile)
    P2Improvement / follow-up
    on Nov 11, 2026
  3. yunuschoudhurywork-lang commented on Nov 12, 2026

    @yunuschoudhurywork-lang

    @okwasniewski hi, can i work on this?

  4. okwasniewski commented on Nov 12, 2026

    @okwasniewski
    Member

    [claude-opus-5-5] automated triage on behalf of @okwasniewski

    @yunuschoudhurywork-lang thanks, but this one is already covered: #1685 by @shamilovtim implements it, CI is green and it is waiting on maintainer review. Nothing left to pick up here.

    Open issues without a linked PR are a better place to start, for example ones labeled help wanted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Improvement / follow-upbugSomething isn't workingmobileMobile engine (@e2e-dev/mobile)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions