19 Commits

Author SHA1 Message Date
zeroaltitude
c3d3732daa
fix(browser): restore res.json before originalJson flush and in catch block
If originalJson(interceptedBody) throws (e.g. BigInt serialization),
the outer catch would hit the intercepted res.json. Now restores
before both the flush and in the catch block as a safety net.

Addresses codex-connector P1 on PR #30323.
2026-03-18 15:00:18 -07:00
zeroaltitude
9dddc5e517
fix(browser): restore res.json before error handling in withRouteTabContext
The intercepted res.json was not restored on exceptions from run(),
causing handleRouteError -> jsonError to hit the buffer interceptor
instead of actually sending the error response. This could leave
HTTP requests hanging on any Playwright failure in tab-targeting routes.

Addresses codex-connector P1 on PR #30323.
2026-03-18 15:00:17 -07:00
zeroaltitude
52f4f9c6b4
fix(browser): resolve URL post-action to avoid stale values; skip redundant preflight lookup; guard relay send
- Move URL enrichment to after handler run() so navigating actions
  (/act, /navigate) report post-action URL, not pre-run snapshot
- Remove pre-run Playwright page lookup that doubled CDP latency
- Wrap sendToRelay in tabs.onUpdated with try/catch for WebSocket flaps

Addresses review feedback from codex-connector on PR #30323.
2026-03-18 15:00:17 -07:00
zeroaltitude
43a670f095
fix(browser): preserve handler-supplied URLs and Chrome tab titles
Address two review findings on the browser URL enrichment:

1. withRouteTabContext now only fills in url when the handler didn't
   already set one (record.url === undefined). This prevents clobbering
   post-navigation URLs returned by /navigate and similar handlers.

2. Chrome extension tabs.onUpdated listener now falls back to
   chrome.tabs.get() for the current title when changeInfo.title is
   undefined (URL-only changes), preventing relay cache title wipes.
2026-03-18 15:00:08 -07:00
zeroaltitude
a66693b025
feat(browser): include current page URL in all tab-targeting responses
Enrich every browser action response with the resolved page URL so
downstream consumers (security plugins, audit loggers) know which page
was targeted without a separate tabs query.

- Add shared withRouteTabContext URL enrichment wrapper (agent.shared.ts)
- Resolve live URL via Playwright, fall back to tab list URL
- Include url field in browser-tool console message results
- Push URL changes from Chrome extension background script

Co-authored-by: Eddie Abrams <eddie@bighatbio.com>
2026-03-18 15:00:01 -07:00
Peter Steinberger
141738f717 refactor: harden browser runtime profile handling 2026-03-09 00:25:43 +00:00
Peter Steinberger
5d98c2ae7e refactor(browser): share playwright route context for debug/storage routes 2026-02-18 21:58:08 +00:00
Peter Steinberger
b8b43175c5 style: align formatting with oxfmt 0.33 2026-02-18 01:34:35 +00:00
Peter Steinberger
31f9be126c style: run oxfmt and fix gate failures 2026-02-18 01:29:02 +00:00
cpojer
d0cb8c19b2
chore: wtf. 2026-02-17 13:36:48 +09:00
Sebastian
ed11e93cf2 chore(format) 2026-02-16 23:20:16 -05:00
cpojer
90ef2d6bdf
chore: Update formatting. 2026-02-17 09:18:40 +09:00
cpojer
f06dd8df06
chore: Enable "experimentalSortImports" in Oxfmt and reformat all imorts. 2026-02-01 10:03:47 +09:00
cpojer
5ceff756e1
chore: Enable "curly" rule to avoid single-statement if confusion/errors. 2026-01-31 16:19:20 +09:00
Peter Steinberger
e7fdccce39 refactor: route browser control via gateway/node 2026-01-27 03:24:54 +00:00
Peter Steinberger
a76cbc43bb
fix(browser): remote profile tab ops follow-up (#1060) (thanks @mukhtharcm)
Landed via follow-up to #1057.

Gate: pnpm lint && pnpm build && pnpm test
2026-01-17 01:28:22 +00:00
Peter Steinberger
028eed5fe8 fix(browser): surface detection details and docs 2026-01-16 06:57:54 +00:00
Peter Steinberger
c379191f80 chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
2026-01-14 15:02:19 +00:00
Peter Steinberger
2b60ee96f2 refactor(browser): split pw tools + agent routes 2026-01-14 05:39:44 +00:00