Skip to content

OpenCUA-7B/32B agents: OSWorld L2 prompt, opencua action_parser, per-family history - #123

Merged
aaronsmulktis merged 7 commits into
aaronsmulktis/fara-7bfrom
aaronsmulktis/opencua
Nov 25, 2026
Merged

aaronsmulktis merged 7 commits into
aaronsmulktis/fara-7bfrom
aaronsmulktis/opencua

Conversation

@aaronsmulktis

Copy link
Copy Markdown
Contributor

Stacked on the Fara-7B PR (uses its click_and_type action and render_system_prompt hook); review the last 7 commits, or after that merges.

Changes

  1. agent=OpenCUA-7B and agent=OpenCUA-32B: XLANG's OpenCUA computer-use models, served by vLLM, with OSWorld's SYSTEM_PROMPT_V1_L2 (Thought, Action, then PyAutoGUI code), without the sudo-password sentence
  2. An opencua action_parser maps its PyAutoGUI and computer.* calls onto ours (table below); anything else is a ParseError and retried. It keeps only the first code block and the first step, so a reply that runs on into imagined steps still parses
  3. ActionParser.render_history: a per-family format for the text history (the default keeps the shared one). OpenCUA writes earlier steps in OSWorld's own template (# Step N: / ## Action:): with the shared format the models copied its headers and ran on into later steps, which cost parse retries and score
  4. New actions: mouse_tripleclick, scroll_at (move, then scroll) and keyboard_press_repeat
  5. Serving notes in the config: the tokenizer revision to load under Transformers v5, and the vLLM processor fix ([Chore] Port more vendored configs and processors to upstream Transformers vllm-project/vllm#60823, in vLLM >= 0.33)
OpenCUA OpenApps
pyautogui.click(x, y) (clicks=2/3, button=), doubleClick, tripleClick, rightClick, middleClick, computer.triple_click mouse_click / mouse_dblclick / mouse_tripleclick / mouse_click(button=...)
moveTo (+ dragTo) mouse_move (mouse_drag_and_drop)
scroll(n) / hscroll(n), moveTo + scroll(n), scroll(n, x, y) scroll(...) / scroll_at(...), 100 px per click
write / typewrite (+ click, + press('enter')) keyboard_type / click_and_type(...)
press(key), hotkey(...), press(key, presses=n) keyboard_press / keyboard_press_repeat
computer.wait noop(wait_ms=3000)
computer.terminate(success) / computer.terminate(failure) send_msg_to_user(...) / report_infeasible(...)

Coordinates follow OpenCUA's convention, absolute pixels on the smart_resized screenshot (1920x1080 is seen as 1932x1092), rescaled to the viewport and clamped; a pair inside [0, 1] is read as relative, as OSWorld does. Measured on synthetic targets served by vLLM, reading them that way cut the mean click error from ~10 to ~6 px at 1920x1080 and from ~15 to ~7 px at 2560x1440 for the 7B, with the same pattern for the 32B.

Testing

  1. tests/test_opencua_action_parser.py (98 tests): reply format, every action, malformed and runaway replies, the history template, and coordinate scaling at desktop and phone sizes, through the parser and the agent
  2. On a cluster with vLLM: 7B 1/2 and 32B 2/2 on the smoke tasks; on 18 episodes across 8 tasks (desktop and phone) 11/18 and 12/18, with clicks landing on their targets and no parse errors

aaronsmulktis user added 7 commits November 17, 2026 13:50
…eat actions

Single-step forms of what PyAutoGUI agents emit: a triple click that selects
a field's text, a wheel scroll over a given point, and one key pressed n times.
…Thought ends the step

A runaway reply can repeat its L2 sections and go on to the next step
without a step header; the last code block was then that imagined step's.
The coordinate notes now give the measured errors per model.
…r the text history

None (the default) keeps the shared History section.
…late

In the shared format OpenCUA copied the history's "### Thoughts:" /
"### Action:" layout into its replies, often without the code, and went on
into imagined steps. Earlier steps are now its Action lines under
"# Step N:", followed by its instruction line, as OSWorld writes the
history it keeps as text.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 17, 2026
@aaronsmulktis
aaronsmulktis changed the base branch from main to aaronsmulktis/fara-7b November 17, 2026 15:28
@aaronsmulktis aaronsmulktis self-assigned this Nov 18, 2026

@marksibrahim marksibrahim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@aaronsmulktis
aaronsmulktis merged commit dbe87b4 into aaronsmulktis/fara-7b Nov 25, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants