Skip to content

Fix Mobile-Agent-v3 action parsing for Python-style dict output - #272

Merged
junyangwang0410 merged 2 commits into
X-PLUG:mainfrom
vwww-droid:fix/mobile-v3-action-parse
Mar 23, 2026
Merged

Fix Mobile-Agent-v3 action parsing for Python-style dict output#272
junyangwang0410 merged 2 commits into
X-PLUG:mainfrom
vwww-droid:fix/mobile-v3-action-parse

Conversation

@vwww-droid

Copy link
Copy Markdown
Contributor

Summary

  • Add a fallback parser in run_mobileagentv3.py to handle Python-dict style action strings returned by some OpenAI-compatible models.
  • Reuse the parsed action_object throughout the step loop instead of re-decoding raw action text, preventing secondary JSONDecodeError crashes.
  • Keep behavior unchanged for valid JSON action payloads.

Test plan

  • Run python3 -m py_compile Mobile-Agent-v3/mobile_v3/run_mobileagentv3.py.
  • Reproduce local run where action payload uses single quotes and confirm the loop continues past operator/reflection.
  • Validate one end-to-end UI task on-device after merging.

Made with Cursor

Some OpenAI-compatible models emit action objects as Python dict strings with single quotes; this change adds a safe fallback parser and avoids re-decoding raw action text later in the loop, preventing JSONDecodeError crashes.
Quote local save_path in adb pull so instructions with spaces no longer break screenshot capture, and simplify static shell command strings.
@junyangwang0410
junyangwang0410 merged commit 5079dca into X-PLUG:main Mar 23, 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.

2 participants