existing-session profiles set cdpUrl to '' (Chrome MCP auto-connect, no
CDP port). Passing an empty cdpUrl to getPageForTargetId would always fail
silently, leaving postRunUrl undefined and falling back to the stale pre-run
tab.url. Explicitly skip the Playwright lookup when cdpUrl is empty and rely
on tab.url, which the relay keeps updated via tabs.onUpdated.
Move CDP getPageForTargetId call inside eligibility check so error/4xx
responses don't incur unnecessary connection latency. Also skip when url
is already set (no enrichment needed).
Note: cross-site navigations that trigger renderer swaps may invalidate
the pre-action targetId; documented as known limitation with tab.url
fallback.
Extracted the URL enrichment logic from withRouteTabContext into a pure,
testable function. Tests cover: enrichment of ok responses, postRunUrl
preference, tab.url fallback, existing field preservation, non-ok/null/
array/primitive rejection, and missing URL handling.
originalJson is const inside the try block and not accessible from the
catch block (tsgo correctly flags this, tsc was lenient). The inner
try/catch around params.run() already restores res.json before
re-throwing, so the outer catch doesn't need the restore.
Fixes tsgo TS2304 in CI.
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.
Remove redundant url: tab.url and targetId: tab.targetId from
individual action/debug route responses. The withRouteTabContext
wrapper already resolves the live Playwright URL and injects both
fields into any response where they're missing. Hardcoding tab.url
in handlers prevented the wrapper from correcting stale relay
metadata — the exact scenario it was designed to fix.
Addresses Codex review on openclaw/openclaw#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>
* build: mirror uuid for msteams
Add uuid to both the msteams bundled extension and the root package so the workspace build can resolve @microsoft/agents-hosting during tsdown while standalone extension installs also have the runtime dependency available.
Regeneration-Prompt: |
pnpm build failed because @microsoft/agents-hosting 1.3.1 requires uuid in its published JS but does not declare it in its package manifest. The msteams extension dynamically imports that package, and the workspace build resolves it from the root dependency graph. Mirror uuid into the root package for workspace builds and keep it in extensions/msteams/package.json so standalone plugin installs also resolve it. Update the lockfile to match the manifest changes.
* build: prune stale plugin dist symlinks
Remove stale dist and dist-runtime plugin node_modules symlinks before tsdown runs. These links point back into extension installs, and tsdown's clean step can traverse them on rebuilds and hollow out the active pnpm dependency tree before plugin-sdk declaration generation runs.
Regeneration-Prompt: |
pnpm build was intermittently failing in the plugin-sdk:dts phase after earlier build steps had already run. The symptom looked like missing root packages such as zod, ajv, commander, and undici even though a fresh install briefly fixed the problem. Investigate the build pipeline step by step rather than patching TypeScript errors. Confirm whether rebuilds mutate node_modules, identify the first step that does it, and preserve existing runtime-postbuild behavior.
The key constraint is that dist and dist-runtime plugin node_modules links are intentional for runtime packaging, so do not remove that feature globally. Instead, make rebuilds safe by deleting only stale symlinks left in generated output before invoking tsdown, so tsdown cleanup cannot recurse back into the live pnpm install tree. Verify with repeated pnpm build runs.
import the config-backed Slack directory helpers into the Slack channel plugin so directory.listPeers and directory.listGroups no longer throw at runtime, and add a regression test covering configured DM peer listing