Skip to content

feat: eval output, scroll --until, session cleanup, snapshot compact#27

Merged
detrin merged 1 commit into
mainfrom
feat/eval-output-and-scroll-until
May 31, 2026
Merged

feat: eval output, scroll --until, session cleanup, snapshot compact#27
detrin merged 1 commit into
mainfrom
feat/eval-output-and-scroll-until

Conversation

@detrin

@detrin detrin commented May 31, 2026

Copy link
Copy Markdown
Owner

Summary

Four agent-friendliness improvements based on real-world usage bottlenecks:

  1. eval returns output (feat: make eval return output to stdout #23) — dict/list results are JSON-serialized to stdout. Agents no longer need to fall back to MCP playwright for data extraction.

  2. scroll --until <selector> (feat: add scroll --until for infinite scroll patterns #24) — scrolls in increments until an element becomes visible. Fixes the infinite-scroll pattern that fails the benchmark. Usage: brow scroll -s 1 --until "text=Article 35"

  3. session cleanup (fix: auto-cleanup stale sessions on daemon restart #25) — releases all sessions. After agent crashes, a simple brow session cleanup unblocks profile locks without needing to identify individual stale sessions.

  4. Snapshot auto-compact (feat: snapshot --compact mode to reduce token usage on large pages #26) — pages >500 lines auto-truncate to interactive elements + structural landmarks, with a hint to use --search. Prevents accidental 300K+ token dumps. Explicit --compact flag also available.

Closes #23, #24, #25, #26

Test plan

  • brow eval -s 1 "result = {'hello': 'world'}" prints JSON
  • brow scroll -s 1 --until "text=Article 35" on infinite scroll page
  • brow session cleanup releases all sessions
  • Large page snapshot shows truncation header
  • Unit tests pass (pytest brow/tests/test_cli.py test_snapshot.py test_client.py)
  • Lint passes

…compact

1. eval now JSON-serializes dict/list results to stdout (#23)
2. scroll --until <selector> loops scroll+check until element visible (#24)
3. session cleanup command releases all sessions after crashes (#25)
4. snapshot auto-compacts large pages (>500 lines) showing only
   interactive elements with a hint to use --search (#26)

Closes #23, closes #24, closes #25, closes #26
@detrin detrin merged commit b0e3333 into main May 31, 2026
3 checks passed
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.

feat: make eval return output to stdout

1 participant