Skip to content

Verify text input before reporting success - #387

Closed
RasulOs wants to merge 1 commit into
mainfrom
fix/atomic-text-input
Closed

Verify text input before reporting success#387
RasulOs wants to merge 1 commit into
mainfrom
fix/atomic-text-input

Conversation

@RasulOs

@RasulOs RasulOs commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add one shared postcondition for type_text and type_text_direct
  • refresh UI state after transport acceptance and verify exact replacement or append containment
  • treat hint-only fields as empty and ignore only U+200B/U+FEFF sentinels
  • fail observable mismatches and skip the input macro
  • preserve password/unreadable compatibility while reporting verification as unavailable

Reproduction matrix

Path Before After
Generic Android replacement Clear and commit were separate and transport acceptance could be reported as success A single selection replacement is verified from fresh state
Gemma agent on Android 16 Settings search No agent-side postcondition Tool returned Text typed and verified; fresh state was exactly MRTEST7319
Physical WhatsApp search Reporter observed an empty field despite a success response Not rerun in this pass because the Samsung device was not connected

No search result was selected and no message was sent.

Tests

  • PASS: .venv/bin/pytest -q (226 tests)
  • PASS: Ruff on changed Python files
  • PASS: Black check on changed Python files
  • PASS on Android 16 emulator-5554 with Ollama gemma4:latest: the agent replaced Settings search with MRTEST7319, returned Text typed and verified, and fresh Portal state contained the exact value.
  • Test text was cleared and Gboard was restored afterward.
  • The physical Samsung/WhatsApp matrix was not rerun because R5CW41WF6WD was not connected.

Companion PRs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

馃挕 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 43a0ae845d

鈩癸笍 About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 馃憤.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

normalized_expected = _normalize_input_text(text)
if clear:
return normalized_actual == normalized_expected
return normalized_expected in normalized_actual

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Verify that append input changed the field

When clear=False and the field already contains the requested substring, an unchanged post-state passes this check鈥攆or example, typing "foo" into an existing "foo" field can be reported as verified even if the transport silently made no edit. This preserves the false-success case the new postcondition is intended to catch and contradicts the documented append behavior in mobilerun/agent/utils/signatures.py:184-186; compare against the pre-input value or otherwise verify the append actually occurred.

Useful? React with 馃憤聽/ 馃憥.

@RasulOs RasulOs closed this Jul 21, 2026
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