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.
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.
- 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.
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.
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>