Skip to content

browser: give stopped runs a final writer answer - #41

Open
charan-rathore wants to merge 3 commits into
awlevin:mainfrom
charan-rathore:fix/browser-final-answer
Open

charan-rathore wants to merge 3 commits into
awlevin:mainfrom
charan-rathore:fix/browser-final-answer

Conversation

@charan-rathore

Copy link
Copy Markdown
Contributor

Summary

Fixes #17. Builds on merged #23, which gave the browser loop visible page text. The browser loop currently stops on done, none, low confidence, a stall, or the step limit without returning a useful answer. This change gives the stopped run to the writer, with the final page's URL, title, plain visible text, controls, and action history. The writer returns an answer, may ask the user a bounded question, or may give a focus that sends the classifier back to work. The classifier still picks every action.

The answer, achievement flag, and handoff count are saved to run.json. clicker-bench browser prints the answer. A disabled or failed writer ends with a clear "no answer" instead of crashing. Optional screenshot capture only runs when writer vision is enabled.

Why this builds on #23

#23 added visible page text to the browser observation. Its final shape is a list of plain strings, not evidence IDs. This change passes those strings to the writer, so it can answer a question whose evidence is in page copy rather than a clickable control. No clickable target is created from text.

Checks

  • uv run --no-sync ruff check .: passed.
  • uv run --no-sync ruff format --check .: passed.
  • uv run --no-sync pytest -q: 618 passed, 3 skipped, 1 xfailed on Linux.
  • Fake-browser cases cover a final answer saved to the run folder, bounded focus handoff, a user question and reply, disabled or failed writer, and screenshot capture only when enabled. No Chrome, network, or provider key was used.

Caveat

The full macOS CI and a live provider/browser run have not yet been verified, so this PR is a draft. The tests check the handoff with fakes at the browser and writer boundaries.

Instinct assisted.

@charan-rathore
charan-rathore marked this pull request as ready for review September 28, 2026 06:29
@charan-rathore

Copy link
Copy Markdown
Contributor Author

Hi, this is ready for review. The current checks are green. Happy to make any changes you need. Thanks!

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.

Browser backend: hand a stopped run to the writer for a final answer

1 participant