#7589: Tests: accept browser profiles auth option
agents
## Summary
- update browser tool test to accept the new authToken option passed to browserProfiles
## Testing
- pnpm vitest run --config vitest.unit.config.ts src/agents/tools/browser-tool.test.ts
## Notes
- fixes the failing test in #7518 after browser auth changes
AI-assisted: Yes (Codex). Prompts/session logs available on request.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates the browser tool and browser client plumbing to support an `authToken` option when calling into the browser control service (including bridge-server auth enforcement), and adjusts the browser tool unit test to accept the new `browserProfiles(baseUrl, { authToken })` call shape.
Change fits the existing architecture by threading authentication through the same `fetchBrowserJson` path used for other browser calls, while allowing sandbox bridge URLs to require a bearer token.
<h3>Confidence Score: 4/5</h3>
- This PR looks safe to merge with low functional risk.
- The changes primarily thread an auth token through existing browser client APIs and update tests accordingly; the main concern is that the updated test assertion is permissive and may not catch unintended option forwarding.
- src/agents/tools/browser-tool.test.ts
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#14197: fix(security): harden browser API auth, token comparisons, and hook...
by leecarollyn-gif · 2026-02-11
76.0%
#22952: fix(browser): suggest remote profile when local Chrome is not insta...
by dashed · 2026-02-21
75.8%
#19885: test(gateway,browser): isolate tests from ambient OPENCLAW_GATEWAY_...
by NewdlDewdl · 2026-02-18
74.9%
#21119: Security/Browser: fail closed when control server has no auth
by bmendonca3 · 2026-02-19
74.4%
#20207: fix(browser): use profile driver instead of hardcoded name
by mahsumaktas · 2026-02-18
74.2%
#14944: fix(browser): prefer openclaw profile in headless/noSandbox environ...
by BenediktSchackenberg · 2026-02-12
74.1%
#16658: test: isolate env-dependent gateway/auth fixtures
by sauerdaniel · 2026-02-15
73.4%
#11054: fix(security): Add auth token to sandbox browser bridge (#11023)
by shadril238 · 2026-02-07
73.1%
#14734: test(agents): guard against stale allowAgents in existing sessions
by davidahmann · 2026-02-12
73.1%
#14368: fix: skip auth profile cooldown on format errors to prevent provide...
by koatora20 · 2026-02-12
73.0%