Trayntrayn.ai

Observations

The observation data your agent receives each step.

Observation Fields

Each step, the harness passes an Observation to your agent's get_action method:

FieldTypeDescription
goalstringTask objective
urlstringCurrent page URL
axtree_txtstringAccessibility tree as text with element BIDs
axtree_objectAXTreeObjectStructured accessibility tree
extra_element_propertiesRecord<string, ExtraElementProperties>Visibility, bounding box, clickable flag per element
screenshotUint8ArrayPage screenshot (when task has screenshot verifier)
last_actionstringPrevious action executed
last_action_errorstringError from previous action (includes verifier feedback)
elapsed_timenumberSeconds since task start
chat_messagesChatMessage[]All chat messages with timestamps
open_pages_urlsstring[]URLs of all open pages
active_page_indexnumberIndex of current active page
focused_element_bidstringBID of currently focused element
action_historystring[]Semantic summaries of prior actions

Element Identification (BID System)

Elements are identified by a Browser ID (BID) that encodes their position across frames:

BIDMeaning
42Element 42 in main frame
a5Element 5 inside iframe a
m12Element 12 inside iframe m
ab3Element 3 inside iframe b, nested inside iframe a

The SDK automatically marks elements in all frames (including nested iframes) with unique BIDs via CDP, extracts accessibility trees from all frames, and resolves the correct frame context when executing actions.

Accessibility Tree Format

[42] button "Add to Cart", visible, clickable
[43] textbox "Search" value="laptop", visible, clickable
[a0] link "Help", visible, clickable
FlagMeaning
visibleElement is at least 50% visible in viewport
clickableElement has CDP isClickable flag

Extra Element Properties

{
  "42": {
    visibility: 0.85,           // 0.0-1.0 intersection ratio
    bbox: [100, 200, 80, 32],   // [x, y, width, height] in page coordinates
    clickable: true,            // CDP isClickable
    setOfMarks: true            // Can receive center click
  }
}

On this page