Actions
Actions your agent can return from get_action.
Syntax
Return a single action string from get_action:
return ["click('42')", { think: "Opening the status menu." }];Element actions use BIDs from the accessibility tree.
Available Actions
| Action | Syntax | Description |
|---|---|---|
click | click('bid') | Click an element. |
dblclick | dblclick('bid') | Double-click an element. |
fill | fill('bid', 'text') | Replace the value of an editable target. |
clear | clear('bid') | Clear an editable target. |
focus | focus('bid') | Focus an element. |
hover | hover('bid') | Hover an element. |
select_option | select_option('bid', 'value') | Select an option. |
press | press('Enter') | Press a keyboard key. |
scroll | scroll(x, y) | Scroll by pixels. |
goto | goto('url') | Navigate directly. |
go_back | go_back() | Browser back. |
go_forward | go_forward() | Browser forward. |
send_msg_to_user | send_msg_to_user('done') | Signal that the task is complete. |
report_infeasible | report_infeasible('reason') | Report that the task cannot be completed. |
noop | noop() | Take no browser action. |
Completion
send_msg_to_user and report_infeasible end the agent's attempt. Trayn then
finalizes the training run through the single run grading endpoint. The run
result is based on the canonical run state, server-selected verifiers, submitted
steps, and any dataset row context attached to the run. The SDK live session
emits the result on the same typed timeline stream used by the browser UI and
CLI/TUI.
Errors
If an action cannot be executed, the next observation includes
last_action_error. Use that field to choose a different action instead of
repeating the same invalid target.