文件历史

提交图

18 次代码提交

作者 SHA1 备注 提交日期
Gregor Žunič 07e56f7644 Remove branch test churn 2026-06-20 17:21:54 -07:00
Gregor Žunič cc2dbc2500 Clean up browser manager PR edge cases 2026-06-18 18:44:00 -07:00
Gregor Žunič 07ea791529 Tighten harness setup diagnostics 2026-06-18 18:41:22 -07:00
Gregor Žunič 73743edea2 Add local profile targeting and browser cleanup 2026-06-17 23:21:35 -07:00
mathisdittrich 1599ba1951 Revert "Stage file uploads for remote browsers" 2026-05-15 00:17:53 -07:00
shawn pana f226972302 Stage file uploads for remote browsers 2026-05-14 19:14:44 +00:00
Saurav Panda 45b75e62c4 wait_for_network_idle: filter by session_id; set_session: disable old Network
codex flagged a P2 follow-on to the just-added Network.enable: my fix
reliably enables Network on every fresh session, but old sessions
never get Network disabled (helpers.switch_tab attaches without
detaching), and wait_for_network_idle reads from the daemon's global
drain_events stream without filtering by session_id. Net effect: an
agent that visited a polling/SSE tab and switched away would observe
that background tab's traffic in a later wait, either timing out or
waiting on the wrong tab's requests.

Two narrow fixes:

1. helpers.wait_for_network_idle now captures the active session at
   the start of the wait and skips events whose session_id doesn't
   match. That's the consumer-side root-cause fix.

2. daemon set_session now calls Network.disable on the previous
   session before enabling on the new one. Defense in depth — keeps
   the daemon's event buffer from filling with background-tab noise
   in the first place. Best-effort with its own 2s timeout; failure
   doesn't abort the rest of the handler.

Tests added:
- tests/unit/test_helpers.py: events from a background session are
  ignored; the active session can reach idle even when the
  background session is busy.
- tests/unit/test_daemon.py: set_session disables Network on the old
  session; first set_session call (no prior session) does not call
  Network.disable.

Full suite: 63 passed (60 -> 63).
2026-05-04 18:34:18 -07:00
Saurav Panda 12f5973fb1 Merge pull request #258 from wdeveloper16/feat/spa-form-helpers
fix(helpers): add fill_input, wait_for_element, wait_for_network_idle
2026-05-02 15:11:26 -07:00
Saurav Panda 4da0684eb2 fill_input: dispatch select-all without char event so Cmd/Ctrl+A actually fires
press_key emits a Input.dispatchKeyEvent('char', text='a') after every
single-character keyDown. With Cmd/Ctrl held, that char event makes Chrome
treat the input as a printable letter "a" rather than firing the
select-all shortcut, so the field never gets cleared (Backspace would
then delete the literal "a" and leave the original value untouched).

Dispatch the rawKeyDown/keyUp pair directly with the modifier set and no
text/char event. Tightened the test to assert (a) the modifier is on the
'a' event with the platform-correct value and (b) no char event with
text='a' is emitted.
2026-05-02 12:54:43 -07:00
Saurav Panda 41c23013d1 wait_for_element(visible=True): prefer checkVisibility, fall back to computed style
The computed-style check measures the element itself, so an element nested
inside a display:none or visibility:hidden ancestor is reported as visible
(getComputedStyle returns the descendant's own non-none value, not the
inherited "is rendered" state). checkVisibility walks the ancestor chain
and is the right primitive on modern Chrome. Kept the per-element CSS
check as a fallback for older Chrome that lacks checkVisibility.
2026-05-02 12:26:23 -07:00
Alezander9 84da63313d Soften skill-toggle wording; drop redundant =0 test 2026-05-01 20:44:14 -07:00
Alezander9 7e9a7db8c5 feat: gate domain skills behind BH_DOMAIN_SKILLS env (default off)
Domain skills auto-injected by goto_url() are community-contributed and quality varies; defaulting them off avoids polluting the average run while preserving the contribution loop. Set BH_DOMAIN_SKILLS=1 to opt in.
2026-05-01 20:34:01 -07:00
wdeveloper16 878cfa9d59 fix(fill_input): raise on missing element, add timeout param for SPA rendering 2026-04-30 10:49:58 +02:00
wdeveloper16 2229e91eee fix: address copilot review — macOS Cmd+A, fixed visibility check, inflight tracking, stronger test 2026-04-30 00:01:00 +02:00
wdeveloper16 da708c42e3 feat(helpers): add fill_input, wait_for_element, wait_for_network_idle 2026-04-29 23:42:35 +02:00
Sarath S Menon 64dafa2805 refactor(js): proper return-statement parsing, unserializable value decoding, unified eval helpers (#231)
Replace naive `"return " in expression` check with a character-level parser that
ignores strings, line comments, and block comments. Add `_decode_unserializable_js_value`
to handle NaN, ±Infinity, -0, and BigInt. Extract `_runtime_value` and
`_runtime_evaluate` to unify error handling across `js()` and `page_info()`.
Wrap Runtime.evaluate TimeoutErrors in RuntimeError with expression context.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 16:33:28 +05:30
Sarath S Menon fb1a51dd9b refactor: move to src layout, agent-workspace, and fix SKILL.md invocation format (#229)
* refactor(tests): reorganize into tests/unit and tests/integration

Moves all root-level test_*.py files into a structured tests/ directory:
- tests/unit/ — admin, helpers (was test_screenshot), run
- tests/integration/ — js expression tests
- tests/conftest.py — shared fake_png pytest fixture, eliminating duplication

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor: move to src layout, agent-workspace, and fix SKILL.md invocation format

- Move package to src/browser_harness/ and domain-skills/interaction-skills to agent-workspace/
- Fix all browser-harness <<'PY' heredoc examples in SKILL.md and run.py HELP string to use the correct -c '...' flag format (heredoc was never supported by the CLI)
- Update SKILL.md path references from domain-skills/ to agent-workspace/domain-skills/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 15:38:11 +05:30
Sarath S Menon cae52ce916 refactor(tests): reorganize into tests/unit and tests/integration (#228)
Moves all root-level test_*.py files into a structured tests/ directory:
- tests/unit/ — admin, helpers (was test_screenshot), run
- tests/integration/ — js expression tests
- tests/conftest.py — shared fake_png pytest fixture, eliminating duplication

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 14:42:52 +05:30