Skip to content

Each history line says what came of its action: the page it went to, the popup it opened or closed, or the items that changed - #55

Open
awlevin wants to merge 3 commits into
mainfrom
jev-action-outcome
Open

awlevin wants to merge 3 commits into
mainfrom
jev-action-outcome

Conversation

@awlevin

@awlevin awlevin commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

What

A decision reads the screen now showing and the last eight actions, never the screen before. On chrome/2ad9387a a click meant for Organise only closed Chrome's "Restore pages?" bubble on top of it, and the history said only clicked 'Organise'.

Now the runner compares the capture after each action with the capture the action was taken on. It ends that action's history line with the coarsest change (typesafe_computer_use/outcome.py). The classifier's previous_actions, the writer, and the answer all read the same lines.

change line
new URL (with a new title, where titles are known), app, or window title clicked 'Bookmark manager' → went to chrome://bookmarks
popup opened (role and name; a nameless menu by its first items) clicked 'Organise' → opened: menu ('Sort by name', 'Add new bookmark', …)
popup closed, none opened clicked 'Organise' → closed: alert 'Restore pages?'
items came or went (controls first, no lone glyphs) scrolled down → new: 'Post 3', 'Post 4', …; gone: 'Post 1', …
same screen (the stall count's same_screen): focus moved to a text field / field holds new text / nothing focused 'Name' / 'Name' holds 'Thomas' / no change

It uses only roles, names, URL, title, and labels. With no tree, the item comparison runs on OCR text. When one screen has a tree and the other has none, the line gets no ending. Chrome builds its tree lazily, so a task's first capture can have none.

How

  • ax_walk.walk_actionable: each control inside an on-screen node with a popup role gets AxNode.within (AT-SPI alert, dialog, menu, file-chooser; Mac AXSheet, AXPopover). A popup-role node with no frame on screen does not count. Chrome keeps a closed <select>'s menu in the tree that way.
  • perception.perceive fills Screen.popups (popup → its controls' labels). It does this before judging whether the capture drew them, so a menu the capture has not painted yet is still named by all its items (77676b4).
  • New Desktop.frontmost_window_title in macOS (Quartz, the same window as the bounds), Windows (GetWindowText), and OSWorld (the named frame, not a popup window). The conftest guard refuses it on the host adapters.
  • runner: RunState.acted_on holds a Glance of the screen an action ran on. The next capture (a step's, or the answer's) ends the line. The log shows → … under the step that acted. tried_here and the repeat rule still compare the bare action text.
  • Two rules come from the data:
    • When a dialog closes, a menu that appears with it does not count as opened. A modal dialog hides Chrome settings' role=menu sidebar from the tree.
    • When a popup opened, the line names only what opened.

Replay

This changes what the model sees. The scripts are in the session only; they call only the TypeSafe API.

170 captured steps from runs 20260929-161216, -162330, -163418, -164132, -164952, and 20260928-175203 (pre-#48 2ad9387a). Each step was sent twice as captured (A, A2) and twice with previous_actions rebuilt with outcomes from the step payloads and saved trees (B, B2):

A A2 B B2
mean confidence 0.622 0.624 0.643 0.636
steps under 0.4 33 31 30 32
  • Same pick: A=A2 97.6%, B=B2 92.9%, A vs B 90.4%.
  • Input tokens: +53 a request (5096 → 5149), about $0.000002.
  • Better:
    • 164952 2ad9387a step 9 (… pressed Return → closed: dialog 'Add folder'): done 0.51/0.59 → 0.85/0.82.
    • Steps 11–12: done 0.45 → 0.65.
    • 164132 bb5e4c0d steps 8–9 (activated Google Chrome → went to Google Chrome 'New Tab - Google Chrome'): 0.30 → 0.60, no longer a low-confidence stop.
    • 162330 2ad9387a step 7 (→ opened: menu ('Bookmarks bar', 'All Bookmarks')): 0.60 → 0.84.
  • Worse: 161216 2ae9ba84 step 7. A settings page that was still loading showed its sidebar menu after the bubble's Close (→ opened: menu ('You and Google', …)), and the pick moved from click (0.41/0.38) to Escape (0.41/0.35).
  • Wording: the requested ; opened: nothing after a closed popup lowered confidence in the replay. Over the 24 steps with such a line (two samples each), the mean was 0.743 with it and 0.765/0.757 without. Examples:
    • 161216 2ad9387a step 9: done 0.50 with it, 0.74/0.76 without.
    • 175203 step 7: re-click on Organise 0.42 with it, 0.55/0.59 without.
    • "only closed …" did worse (0.680). So the line ends at the closed popup.

Tests

  • tests/test_outcome.py:
  • test_l58 (run-level): the bubble takes the click, and the next decision's previous_actions and the answer's actions_taken carry clicked 'Organise' → closed: alert 'Restore pages?'.
  • test_l57 and the OSWorld agent test show → opened: menu (…) after the combined close-and-click.
  • Scenario asserts about what the loop did now compare acts(state) (lines without their outcome).
  • uv run ruff check, uv run ruff format --check, and uv run pytest pass (765 passed). The conftest guard gains frontmost_window_title for both host adapters.

Cloud

Main's 2 s wait, --ocr rapidocr. The baseline is T164943Z (a246829): 6 of 6 solved, 6.7 steps, 54.7 s, $0.0030. Rows are committed in this PR.

task T224732Z T230833Z T231716Z baseline T164943Z
2ad9387a 0 · 7 steps · 52.8 s · $0.0028 1 · 11 · 85.4 s · $0.0047 0 · 7 · 54.9 s · $0.0029 1 · 10 · 73.0 s · $0.0038
2ae9ba84 1 · 6 · 48.0 · $0.0038 1 · 7 · 58.7 · $0.0025 1 · 6 · 50.6 · $0.0036 1 · 6 · 51.1 · $0.0037
12086550 1 · 5 · 34.9 · $0.0016 1 · 6 · 53.6 · $0.0024 1 · 5 · 40.8 · $0.0016 1 · 5 · 37.2 · $0.0016
9f935cce (not gated) 0 · 5 · 50.7 · $0.0042 0 · 5 · 42.2 · $0.0038 0 · 5 · 43.6 · $0.0047 1 · 6 · 61.0 · $0.0050
af630914 1 · 6 · 59.2 · $0.0022 1 · 6 · 40.5 · $0.0022 1 · 6 · 57.0 · $0.0021 1 · 6 · 55.2 · $0.0022
bb5e4c0d 1 · 7 · 67.6 · $0.0020 1 · 7 · 47.4 · $0.0020 1 · 7 · 63.3 · $0.0020 1 · 7 · 50.7 · $0.0020

The first three columns are commit 36d2e75. The solo 2ad9387a runs, against T163408Z (9 steps, 42.3 s, $0.0029):

  • T230533Z (36d2e75): solved in 8 steps, 37.4 s, $0.0027.
  • T232953Z (77676b4): solved in 9 steps, 40.2 s, $0.0029.

Over the 18 batch runs:

runs steps s $
solved 13 6.5 54.4 $0.0025
failed 5 5.8 48.8 $0.0037
baseline, solved 6 6.7 54.7 $0.0030

The gate does not hold. 2ad9387a failed in 2 of 3 batches.

2ad9387a

  • Every batch run, and the baseline batch too, got a capture that lagged the tree after "closed 'Restore pages?' then clicked 'Organise'". The tree had the menu's six items; the screenshot, 2 s later, had drawn none, not even the Organise button. The item after the first became off-screen controls, and in a VM nothing can press those. So press_offscreen 'Add new folder' was refused, then clicked 'Bookmarks bar', then a stop at under 0.4.
  • Replayed with and without the outcome lines, the classifier made the same picks at those steps (2 samples each). The lag is not caused by this branch. PR jev's wait sleeps in the VM, a page still loading is not a stall, and a capture that lags the screen gets a second look #54's second look is aimed at it.
  • The two runs split at the answer model's focus:
    • The baseline was told "Click 'Organise'" and solved in 10 steps.
    • Here it said "the three-dot menu" 3 of 3 times, and the classifier took that for Chrome's menu.
  • Replaying that stop 17 times per arm, "the three-dot menu" came back:
    • 15 times with the lines as they were (menu ('Sort by name'), named by the one drawn item);
    • 10 times with no outcomes;
    • 7 times with the menu named by the tree's items.
  • That last wording is 77676b4, now in this PR. Its rerun (T232953Z) solved in 9 steps, but it did not hit the lag, so the fix is confirmed on the replay only, not in a run.

9f935cce: every run stopped at step 1 under 0.4 (0.31 to 0.36, as in most runs on the machine today, the baseline aside). The writer then sent it to site search, which ends on the Civil Division documents page instead of the filtered forms list. Step 1 has no history, so this branch cannot change it.

Per the maintainer, this PR stays open: no merge.

🤖 Generated with Claude Code

awlevin and others added 3 commits September 29, 2026 15:52
…the popup it opened or closed, or the items that changed

A decision reads the screen now showing and the last eight actions, never the screen before, so on chrome/2ad9387a a click meant for Organise that only closed the "Restore pages?" bubble read as "clicked 'Organise'". Now the runner compares the capture after each action with the one it was taken on and ends the line with the coarsest change, in roles, names, URL, title, and labels, with OCR text where there is no tree: "clicked 'Organise' → closed: alert 'Restore pages?'", "→ opened: menu ('Sort by name', 'Add new bookmark', …)", "→ went to chrome://bookmarks", "→ new: …; gone: …", "→ 'Name' holds 'Thomas'", or "→ no change" by the stall count's own same_screen. The lines go to the classifier, the writer, and the answer.

The shared walk marks each control inside an on-screen popup role (AT-SPI alert, dialog, menu; a Mac sheet or popover), and every adapter reports its front window's title (new Desktop.frontmost_window_title, guarded in tests).

Replay of 170 captured requests, each sent twice as captured and twice with the new lines: mean confidence 0.62 -> 0.64, 53 more input tokens a request, same pick 98% within and 90% across.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rawn yet or not

On two of three batch runs of chrome/2ad9387a the capture after Organise's click lagged the tree: the tree had the menu's six items, the capture had drawn one. The line then read "opened: menu ('Sort by name')", and the answer model sent the classifier to Chrome's own three-dot menu in 15 of 17 reviews of that stop, against 10 of 17 with the outcomes left out and 7 of 17 with the menu named by the tree's items. So perception keeps each popup the tree shows with its controls' labels (Screen.popups), before the capture's paint is judged, and the line names it from there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…istory line's outcome

T224732Z, T230833Z, T231716Z (36d2e75, --envs 3, 2 s wait): 2ae9ba84, 12086550, af630914, and bb5e4c0d solved 3 of 3; 2ad9387a 1 of 3, each failure after a capture that lagged the tree by the Organise menu; 9f935cce 0 of 3, each after a first step under 0.4 that the writer sent to site search. Solo 2ad9387a: T230533Z (36d2e75) 8 steps, T232953Z (77676b4) 9 steps, both solved. OBSERVATIONS.md gets three lines from them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant