Skip to content

refactor(converter): align PyautoguiActionConvertor with sandbox-platform#16

Merged
gwynbleidd003 merged 3 commits intoagiopen-org:mainfrom
aoshen524:refactor/align-pyautogui-converter
Feb 16, 2026
Merged

refactor(converter): align PyautoguiActionConvertor with sandbox-platform#16
gwynbleidd003 merged 3 commits intoagiopen-org:mainfrom
aoshen524:refactor/align-pyautogui-converter

Conversation

@aoshen524
Copy link
Contributor

Summary

  • Rename converters/oagi.pyconverters/pyautogui_action_converter.py with standalone PyautoguiActionConvertor class matching sandbox-platform task_utils.py exactly
  • TYPE action now uses make_type_command() (PynputController for short ASCII, _smart_paste for Unicode/long/multiline) instead of pyautogui.typewrite()
  • Return type changed to list[tuple[str, bool]] with is_last_of_repeat tracking
  • Move PyautoguiConfig from pyautogui_action_handler.py to handler/utils.py (shared between handler and converter)
  • Remove ConverterConfig, BaseActionConverter now uses PyautoguiConfig
  • Add make_type_command() and _PYNPUT_CHAR_LIMIT to handler/utils.py
  • Full key normalization table (windows/super/meta→win, control→ctrl, cmd→command, media keys)
  • Always-validate coordinates [0, 1000] instead of configurable strict mode
  • OagiActionConverter kept as backward-compat alias

Test plan

  • All 32 converter unit tests pass
  • Backward compat: OagiActionConverter alias works
  • Import check: from oagi.converters import PyautoguiActionConvertor works
  • PyautoguiConfig importable from both oagi.handler.utils and top-level oagi
  • ruff check + format pass on all changed files
  • CI passes

🤖 Generated with Claude Code

aoshen524 and others added 3 commits February 13, 2026 15:07
…form task_utils

Replace OagiActionConverter with standalone PyautoguiActionConvertor that
matches task_utils.py:PyautoguiActionConvertor exactly, enabling sandbox-platform
to import directly from oagi-python.

Key changes:
- Rename converters/oagi.py -> converters/pyautogui_action_converter.py
- TYPE action: use make_type_command() (PynputController/_smart_paste) instead of pyautogui.typewrite()
- Return type: list[tuple[str, bool]] with is_last_of_repeat tracking
- Coordinates: always validate range [0, 1000] instead of configurable strict mode
- Key normalization: full mapping table (windows/super/meta, control, cmd, media keys)
- Move PyautoguiConfig from handler to handler/utils.py (shared by handler and converter)
- Remove ConverterConfig, BaseActionConverter now uses PyautoguiConfig
- Add make_type_command() and _PYNPUT_CHAR_LIMIT to handler/utils.py
- OagiActionConverter kept as backward-compat alias

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…idual params

Replace 6 individual __init__ parameters with a single config: PyautoguiConfig
object. Only override scroll_amount=2 in the default (converter targets remote
sandbox VM, not local platform).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use unicode arrow → in _validate_keys suggestions (matching task_utils)
- Fix self-referencing comment in _normalize_key

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gwynbleidd003 gwynbleidd003 merged commit e478bd6 into agiopen-org:main Feb 16, 2026
3 checks passed
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